| With the continuous development of urban IT, safety-critical systems are being used in more and more fields, such as aerospace, medical treatment, rail transportation and etc. Safety-critical systems used in these fields are feature-intensive and have complex logic. Their design and development are of great difficult, though having a long lifecycle but with a high cost. Therefore, this paper focuses on a method based on the CBTC (Communications Based Train Control) system in rail transportation area. The notion of application data is introduced and the configurable automatic code generation technique based on models is studied. With this, the defects and deficiencies of the conventional methods will be solved, human errors reduced and safety of the software improved.Firstly, the application data for the CBTC system are introduced, including static application data which defines the personal character and functional logic description which defines the general character. Then taking the ATP (Automat Train Protection) system as an example, the application data models are designed and built to describe the application data. Static application data models consist of interface models, signal models and general parameter models; functional logic description models consist of structure models, algorithm models and logic models. Secondly, a configuration framework for the application data is designed to manage and configure data automatically. A configurable and model-based code automatic generation method is provided, with the XSLT-based format conversion technology combined and integrated in it. This method first converts the configured application data models into the XML format documents, and after processed by the XSLT processor, obtains software source codes, a format file defined by the template XSL documents. Finally, the framework of the automatic generation platform is designed and developed to configure ATP application data and generate codes automatically based on the models.In this paper, we achieve the semi-formalization of the software requirements for the safety-critical system, having the requirements clearly and accurately described and making it possible to tested and validated in the design phase. Meanwhile the automations of the data configurations and code generations avoid human errors to the maximum level and significantly improve work efficiency. Besides, by configuring different application data, the system features can be changed rapidly and efficiently, thus obtaining high applicability and reusability of the system. |