A method and device for automatically generating transmission service code for a flight control system

By automatically generating flight control system transmission service code, utilizing preset XSD files and the StringTemplate template engine, combined with DOM4j methods and a visual interface, the problem of repetitive work and high costs in flight control system source code development is solved, achieving efficient and low-cost code generation and system upgrades.

CN115686489BActive Publication Date: 2025-10-28XIAN FLIGHT SELF CONTROL INST OF AVIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211410776.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-11
Publication Date
2025-10-28
Estimated Expiration
2042-11-11

AI Technical Summary

Technical Problem

The development of the flight control system's source code involves a lot of repetitive work, resulting in long software development cycles and high costs. Existing automatic code generation technology lacks framework model support and business logic implementation based on the FACE standard, which leads to the need for manual addition of configuration data, resulting in low efficiency.

Method used

This paper provides an automatic generation method for transmission service code in flight control systems. By receiving transmission service attributes input by the user, and using a preset XSD file and StringTemplate template engine, combined with DOM4j methods and a visual interface, the transmission service code is automatically generated, reducing manual intervention.

Benefits of technology

It improves the efficiency of flight control system software development, reduces development costs and time, enhances system portability and reliability, and reduces coupling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686489B_ABST
    Figure CN115686489B_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for automatically generating transmission service code for a flight control system. The method includes: automatically generating an XML configuration file by selecting TS service parameters from a preset XSD file, thereby achieving fully automatic generation of complete code for the transmission service interface, reducing a lot of repetitive work, eliminating errors introduced by manual operation, thereby reducing the development cost of transmission service software and improving the development quality of transmission service software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of software engineering technology, and specifically relates to a method and apparatus for automatically generating transmission service codes for a flight control system. Background Technology

[0002] To address the increasing complexity of flight control electronic systems, poor system reusability, high coupling between airborne software and hardware, and difficulties in system upgrades and expansion, the Open Group released the FACE (Future Airborne Capability Environment) architecture standard in 2014. The FACE approach enhances software portability by defining a reference architecture and adopting design principles, thereby overcoming obstacles related to modularity, portability, and interoperability.

[0003] The development of source code for flight control computer systems based on the FACE standard has been a research project for many institutions in China. However, current source code development largely involves manual coding, which includes a large amount of repetitive work, resulting in long software development cycles and high costs. Currently, many domestic and international companies and research institutions are focusing on research into automatic code generation technology and the development of corresponding tools.

[0004] Current automatic code generation technologies mainly include model-based automatic code generation and template-based automatic code generation. Both technologies only require modification of the template and model when the generated code needs to be changed, making them easy to maintain. However, template-based automatic code generation lacks framework model support and specific business logic implementation, limiting its applicability. Model-based automatic code generation remains challenging in terms of modeling and exhibits significant code redundancy. Both methods can directly achieve automatic code generation based on the FACE standard, but their inherent limitations still exist.

[0005] In the implementation of code generation methods for the configuration of transport services (hereinafter referred to as TS), most of the configuration data still needs to be manually added to the code framework, which involves a lot of repetitive work, long software development cycles, and high software development costs. Summary of the Invention

[0006] This invention provides a method and apparatus for automatically generating transmission service codes for flight control systems, thereby reducing the research and development costs of fly-by-wire flight control system software.

[0007] This invention provides a method for automatically generating transmission service codes for a flight control system, the method comprising the following steps:

[0008] Step 1: Receive user input of at least one transmission service and its attributes used in the flight control system. The transmission service attributes include: transmission interface, transmission mechanism, and transmission element.

[0009] Step 2: For each transmission service, based on the transmission interface of each transmission service, select the candidate complexType node corresponding to the transmission interface from the preset XSD file as the candidate set; the preset XSD file contains at least one candidate complexType node, one candidate complexType node corresponds to one transmission interface, and each candidate complexType node includes multiple simpleType child nodes. The simpleType child nodes are the transmission mechanism and transmission element rules adapted to the transmission interface; the transmission element rules include: the enumeration type and / or text type of the transmission element;

[0010] Step 3: For each transport service, receive the new transport service selected by the user from the candidate set, and generate an XML file by treating each new transport service as an XSDNode node in the XML file.

[0011] Step 4: Construct an XPath path expression based on the node information in the XML file, and use the DOM4j method to parse the XML file based on the XPath path expression to obtain the parsed file;

[0012] Step 5: Convert the attributes of each transmission service in the parsed file into preset data types to obtain template elements;

[0013] Step 6: Assign the template elements to the code template of the preset transmission service;

[0014] The code template for the preset transmission service is generated using the StringTemplate template engine.

[0015] Optionally, converting the attributes of each transmission service in the parsed file into a preset data type includes:

[0016] Select transmission service nodes with different attributes from the parsed file, and convert the attributes of each transmission service node with different attributes into a preset data type.

[0017] Optionally, the transmission service includes: a transmission implementation service and a preset version of the transmission interface service; the preset version of the transmission interface service is the transmission interface service corresponding to the transmission interface of the transmission service input by the user.

[0018] The code template for the preset transmission service is obtained by editing the transmission implementation service and the preset version of the transmission interface service in the StringTemplate template to form a general code template.

[0019] Optionally, the method further includes:

[0020] For any transport service, if there is no candidate complexType node corresponding to the transport interface of any transport service in the preset XSD file;

[0021] In the preset XSD file, create a candidate complexType node corresponding to the transmission interface of any of the transmission services;

[0022] Add a simpleType child node to the selected complexType node.

[0023] Optionally, after selecting candidate complexType nodes corresponding to the transmission interface from a preset XSD file for each transmission service, as a candidate set, the method further includes:

[0024] Generate a visual interface based on the candidate set;

[0025] Correspondingly, the receiving user selects a new transport service from the candidate set, including:

[0026] Receive new transport service attributes selected by the user from a set of candidates through a visual interface.

[0027] Another aspect of the present invention provides an automatic generation device for transmission service codes of a flight control system, comprising:

[0028] The receiving module is used to receive user input of at least one transmission service and the attributes of the transmission service used in the flight control system. The transmission service attributes include: transmission interface, transmission mechanism and transmission element.

[0029] The selection module is used to select, for each transmission service, a candidate complexType node corresponding to the transmission interface from a preset XSD file, as a candidate set, based on the transmission interface of each transmission service. The preset XSD file contains at least one candidate complexType node, each candidate complexType node corresponds to a transmission interface, and each candidate complexType node includes multiple simpleType child nodes. The simpleType child nodes represent the transmission mechanism and transmission element rules adapted to the transmission interface. The transmission element rules include: the enumeration type and / or text type of the transmission element.

[0030] The generation module is used to receive new transport services selected by the user from the candidate set for each transport service, and generate an XML file by using each new transport service as an XSDNode node in the XML file.

[0031] The parsing module is used to construct XPath path expressions based on the node information in the XML file, and then use DOM4j methods to parse the XML file based on the XPath path expressions to obtain the parsed file.

[0032] The conversion module is used to convert the attributes of each transmission service in the parsed file into preset data types to obtain template elements;

[0033] The assignment module is used to assign template elements to the code template of the preset transmission service;

[0034] The code template for the preset transmission service is generated using the StringTemplate template engine.

[0035] Optionally, the conversion module is specifically used to filter transmission service nodes with different attributes from the parsed file, and convert the attributes of each transmission service node with different attributes into a preset data type.

[0036] Optionally, the transmission service includes: a transmission implementation service and a preset version of the transmission interface service; the preset version of the transmission interface service is the transmission interface service corresponding to the transmission interface of the transmission service input by the user.

[0037] The code template for the preset transmission service is obtained by editing the transmission implementation service and the preset version of the transmission interface service in the StringTemplate template to form a general code template.

[0038] Optional features include: creating modules;

[0039] The creation module is used when, for any transport service, there is no candidate complexType node corresponding to the transport interface of any transport service in the preset XSD file;

[0040] In the preset XSD file, create a candidate complexType node corresponding to the transmission interface of any of the transmission services;

[0041] Add a simpleType child node to the selected complexType node.

[0042] Optional features also include: a visualization module;

[0043] Generate a visual interface based on the candidate set;

[0044] Correspondingly, the generation module is specifically used to receive new transmission service attributes selected by the user from the candidate set through a visual interface.

[0045] This invention provides a method and apparatus for automatically generating transmission service codes (TS) for flight control systems, aiming to reduce the development cost of fly-by-wire flight control system software. It achieves automatic generation of TS code through visual editing of configuration files and a parsing mechanism using code templates. With this invention, users can configure TS service parameters via a visual interface, ultimately achieving automatic generation of XML configuration files. Because the visual interface is not only simple and easy to understand to operate, but also ensures the accuracy of configuration data and facilitates data updates, users can focus solely on configuring TS service parameters, eliminating the need to manually add TS service configuration items to the code framework. The system only needs to parse the configuration file to obtain the TS service configuration item data and automatically generate the TS service interface code. This invention can significantly improve system development efficiency and reduce development time and costs. In the field of flight control embedded systems, the use of the FACE open architecture TS configuration file and automatic code generation method helps improve software portability and reliability, and reduces the coupling between software components. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating the implementation of the automatic generation method for transmission service codes of the flight control system provided by the present invention. Detailed Implementation

[0047] The automatic generation technology of flight control system transmission service code provided by the present invention will be explained in detail below with reference to the accompanying drawings.

[0048] The technical solution of this invention is: an automatic generation technology for transmission service configuration files and code based on an embedded open architecture for flight control. Referring to the concept of Transport Services Segment (TSS) in the FACE architecture, two attributes are abstracted for communication services between software components: transmission mechanism and data access. TSS-compliant units (Units of Conformance (UoC)) are established to handle data allocation between portable component segments and / or platform-specific service segment consistency units. Service code with distribution, configuration, and other optional capabilities is then created. The specific steps are as follows: Analyze the transmission service interface and transmission mechanism; design an XML Schema Definition (XSD) file based on the analysis results; then visualize the configuration parameters required for each TS service mechanism by parsing the XSD file, thereby automatically generating the TS configuration file; next, use a stringtemplate template engine to design the code template for the transmission mechanism; parse the generated configuration file and select the appropriate stringtemplate template based on the parsing results; instantiate the template to achieve automatic code generation.

[0049] The following explanation uses Java as an example to illustrate the automatic generation method of flight control system transmission service code provided by this invention. Figure 1 This is a flowchart illustrating the implementation of the automatic generation method for transmission service codes of the flight control system provided by the present invention. Figure 1 The specific steps are as follows:

[0050] Step 1: Based on the W3C recommended standards and the flight controller embedded open architecture, design the XSD file that must be followed to store the TS configuration XML file.

[0051] First, define the first-level complexType node (also known as the top-level node) and assign a value to its name attribute. This node is the outer complex type node. Its child nodes are 6 element elements, which represent 6 types of TS services. The name attribute value of each element element is the name of the transport service mechanism. For example, name="TCPSocket" indicates that the service mechanism is TCPSocket. The type attribute will reference the name of other complexTypes. For example, "xs:TCPSocket_Type" indicates that the referenced complex node name is TCPSocket_Type.

[0052] Next, we define the second-level `complexType` nodes (also called candidate nodes). These nodes are referenced by the first-level `type` attribute, resulting in six referenced `complexType` nodes, each corresponding to one of the six transport mechanisms' `type` attributes in the first level. The child nodes of each referenced `complexType` node are configuration items in its corresponding TS service. For example, TCPSocket has 21 configuration items, so under the `complexType` corresponding to TCPSocket, 11 `element` elements are defined. The `name` attribute value of each `element` element is the configuration item name; for example, `name="ConnectionName"` indicates the connection name attribute. The `type` attribute represents the data type of the configuration item. If it's a common data type like string, int, or double, it can be defined directly, for example, `type="string"`. If the element's content needs to be defined with several optional values, an enumeration constraint is used, also employing the `type` reference node method, for example, `type="xs:ConnectionType_Type"`, making the structure clearer.

[0053] Finally, define a `simpleType` node with enumeration constraints, where its child nodes are the corresponding enumeration items. The name of each referenced node must correspond one-to-one with the `type` attribute value of the configuration item element that references this node in the second level; otherwise, it cannot be referenced. For example... <simpletype name="ConnectionType_Type">This indicates that the enumeration attribute name is a connection type, and the corresponding type attribute when referenced in the second-level complexType node should also be ConnectionType_Type.

[0054] Step Two: Parse the TS configuration XSD file to obtain the required configuration parameter information and complete the subsequent bus abstraction preparation. Declare static variable classes and node object classes, and complete the parsing method classes. The specific parsing process is as follows:

[0055] (1) Read XSD data using SAXReader and return a Document format object;

[0056] (2) After obtaining the Document object, use the getRootElement() method to get the root element, which also returns an Element object;

[0057] (3) Construct an XPath expression based on the node information. The XPath expression points to a node or set of nodes that meet the conditions. For example, the XPath expression for the complexType node referenced by a certain TS service is " / / " + complexType + "[@name=\"" + Configuration_Type + "\"]";

[0058] (4) Use DOM4j methods to obtain nodes or node sets based on the constructed XPath path expression. If the XPath path points to a single node, use the function "selectSingleNode" to obtain the node; if the XPath path points to a node set, use the function "selectNodes" to obtain the node set; for example, List <node>`elementNodes = firstComplexTypeElements.selectNodes(basePath+" / / element");` means retrieving all element elements under the first-level `complexType` node, and storing the results in a List.

[0059] (5) After obtaining the node, get the value of the node attribute name through attributeValue("name"), get the value of the node attribute type through attributeValue("type"), and get the value of the node attribute value through attributeValue("value"). Encapsulate the obtained information into the node object.

[0060] (6) Based on the type attribute value obtained in (5), obtain the second-level complexType node. The path is " / / "+complexType+"[@name=\"" + type + "\"]"; where type is the type value obtained in (5). Then, obtain the attribute node set of the second-level complex node through DOM4j methods, such as List. <node>elementNodes = firstComplexTypeElements.selectNodes(basePath+" / /

[0061] The expression "element" means to retrieve all element elements under the second-level complex node, and the results are stored in a List.

[0062] (7) After obtaining the node, get the value of the node attribute name through attributeValue("name"), get the value of the node attribute type through attributeValue("type"), and get the value of the node attribute value through attributeValue("value"). Encapsulate the obtained information into the node object.

[0063] (8) Based on the type attribute value obtained in (7), obtain the third-level simpleType node. The path is " / / "+complexType+"[@name=\"" + type + "\"]", then obtain the enumeration type value under the simpleType node, such as List. <node>elementNodes = firstComplexTypeElements.selectNodes(basePath+" / / enumeration").

[0064] (9) Get the value of an enumeration type attribute by using attributeValue("value").

[0065] 4) Use DOM4j methods to obtain nodes or node sets based on the constructed XPath path expression. If the XPath path points to a single node, use the function "selectSingleNode" to obtain the node; if the XPath path points to a node set, use the function "selectNodes" to obtain the node set.

[0066] After obtaining the node, retrieve the value of the node's "name" attribute using `attributeValue("name")`, the value of the node's "type" attribute using `attributeValue("type")`, and the value of the node's "value" attribute using `attributeValue("value")`. Then, encapsulate the retrieved information into a node object.

[0067] Step 3: Visualizing Configuration Parameters: Each TS service has its own TS attributes, therefore each TS service has different configuration parameters. Based on the parsing results from Step 2, an operation interface is provided for each TS service. Enumerated configuration items are displayed in this interface for users to select. As we know from the previous steps, different parameters will parse the corresponding node information. Therefore, only a common operation interface needs to be provided, and the configuration items displayed on the interface will differ depending on the input parameters. The specific implementation process is as follows:

[0068] 1) Call the XSD parsing method and pass in the TSType parameter to obtain the collection of all configuration item node objects in the TS service;

[0069] 2) Using the passed-in TSType, the attributes under it are found by parsing the XSD. The node objects in the collection are traversed, and the configuration item names are obtained using the getName() method and used as the interface tag names in sequence. The data type of the configuration item is obtained using the getType() method.

[0070] 3) Determine the data type of the attribute configuration item. If the type of a configuration item is a custom type, call the XSD parsing method and pass in the parameter type to get the selectable values ​​of the configuration item.

[0071] 4) If the configuration item type is a reference to the simpleType type, create a new combo dropdown and add the enumeration value obtained under simpleType to the dropdown options. For other common data types such as int, string, double, etc., create a new Text text box.

[0072] After configuring the parameter visualization interface, restrictions are placed on the input of enumeration type and text type attributes to ensure that the input attribute information is reasonable. The specific implementation process is as follows:

[0073] (1) Add a text input listener event addModifyListener, then use getText() to determine if the input of the enumeration type property is empty. If it is empty, use updateStatus() to update the prompt information, and use getButton(OK).setEnabled(false) to gray out the "OK" button.

[0074] (2) To restrict the input of text type attributes, first, perform null checks as with enumeration types. Then, use the equals() method to process the text attributes separately, with different attributes requiring different restrictions. Next, use the getText() method to retrieve the attribute's input information and perform restriction checks. If the input does not meet the restrictions, gray out the "OK" button. For example, Integer.valueOf(text.getText())>65536 means that the value of the text attribute is greater than 65536.

[0075] At this point, all six TS transmission mechanisms can display their respective configuration items in the operation interface for users to configure themselves.

[0076] Step 4: Generate TS Configuration File: After configuring the parameters in the TS service, an XML file storing the TS configuration data is finally generated. After filling in the configuration items that meet the restrictions in the configuration parameter visualization interface, saving the file generates the TS configuration file, which stores the configuration data for each TS service. The specific implementation process is as follows:

[0077] After filling in the configuration items that meet the restrictions in the configuration parameter visualization interface, saving the settings generates a TS configuration file, which stores the configuration data for each TS service. The specific implementation process is as follows:

[0078] 1) Add an atomic element (atom) to the configuration data of each TS service in the configuration file. Add the attributes id and kind to each atomic element using the addAttribute() method. The attribute id value is generated by UUID (Universally Unique Identifier) ​​so that each atomic element can be uniquely identified. Assign the attribute kind value with the TS service name.

[0079] 2) Add child elements `attribute` to atomic elements using the `addElement("attribute")` method. Each child element represents a configuration item of the TS service. Add an attribute `kind` to each configuration item element using the `addAttribute()` method, and assign a value to the `kind` attribute using the configuration item name. For example, `put("kind", xsdNode.getName())`.

[0080] 3) Use the addElement("value") method to add a child element value to each attribute element. Each value element stores the enumeration type data of its configuration items.

[0081] 4) By obtaining the configuration data of the user in the operation interface, the content of each configuration item value element in the TS configuration file is set using the setText() method.

[0082] The above steps complete the configuration of each TS service's configuration items and save the results in the TS configuration file.

[0083] Step 5: When you open the operation interface after configuring the parameters in the previous step, the configuration data from the generated configuration file will be displayed in the operation interface. Perform operations on the data that needs to be changed, and then save again to complete the update operation of the TS configuration file. When the configuration parameters of certain TS services need to be changed, you do not need to manually modify the TS configuration file; you only need to modify the data in the visual operation interface for TS service parameter configuration and save it. The specific implementation process is as follows:

[0084] 1) Reopen the TS service operation interface with the configured parameters and find the corresponding atomic element in the TS configuration file by ID;

[0085] 2) Obtain the configuration data for each configuration item, and find the attribute element whose name matches the attribute kind value in the TS configuration file; use the setText() method to update the content of the value element under the attribute element with the reconfigured parameter data.

[0086] Step Six: Use the StringTemplate template engine to complete the template design for the TS service interface code structure. The following details the specific design scheme for each part of the TS service interface code template:

[0087] 1) TS_adapter code template. This template group is mainly used for the automatic generation of the declaration part of the TS service management interface. First, the namespace FACE is defined, and then the TS namespace is defined in the FACE namespace. The TS namespace mainly contains initialization functions; connection creation functions; message sending functions; message receiving functions; and connection destruction functions that can be declared based on the connection ID.

[0088] 2) MTF_TS Code Templates. This template group is mainly used for the specific implementation of the previous template function. First, the namespace MTF is defined, and then the TS namespace is defined within the MTF namespace. This template contains code templates for the TCPSocket, UDPSocket, SharedMemory, MessageQueue, QueuingPort, and SamplingPort transport services. Different transport methods populate the templates according to their corresponding attribute configurations, ultimately completing the implementation of all declared functions in 1).

[0089] Step Seven: Obtain the parameter configuration data for each TS service based on the XML file generated in Step Four, and complete the TS configuration file parsing. This development uses the Java language. In Java, compared to other methods of parsing XML files, DOM4j is a convenient, flexible, and open-source library with outstanding performance, powerful functionality, and ease of use. Therefore, DOM4j was chosen for parsing XML files. DOM4j parses XML files through an XML file tree structure; therefore, this paper chooses to use XPath when obtaining node path information, as XPath makes the program structure more concise. The specific process of parsing the XML file is as follows:

[0090] 1) Select and read the XML files for each TS service, and obtain the Document object; for example: Document cop = new SAXReader().read(new File("templates / cop_gncV5.xml")), which means reading the XML file under the templates folder.

[0091] 2) Construct an XPath expression based on node information. The XPath expression points to the node or set of nodes that meet the conditions. For example, the XPath expression " / / atom[@kind = 'TCPSocket']" means to get the paths of all TCPSockets in the XML file.

[0092] 3) Use DOM4j methods to retrieve nodes or node sets based on the constructed XPath path expression. If the XPath path points to a single node, use the function "selectSingleNode" to retrieve the node; if the XPath path points to a node set, use the function "selectNodes" to retrieve the node set. For example, selectNodes(xpath_TCPSocketProcess) retrieves the set of all attribute nodes of a TCPSocket.

[0093] 4) Loop through the set of attribute nodes, use elementText to get the text attribute value under the root node, use attributeValue to get the attribute value configured in the leaf node, and store the obtained information in the corresponding data structure.

[0094] Step 8: Select and read the corresponding StringTemplate based on the node information. For each template element, assign values ​​to the attributes of its corresponding TS service template file to instantiate the template. Using the StringTemplate code template designed in Step 6, generate the TS service interface code according to Step 7. The specific process is as follows:

[0095] 1) Read the StringTemplate template file of FACE_TS, pass in the parameters required by the code of each transmission mechanism, and the code of the management interface can be generated;

[0096] 2) Read the StringTemplate template file of MTF_TS and obtain the TSGroup object;

[0097] Match the data results parsed in step seven to the corresponding parts in the template file. For example, select the tcp template part for the TCPSocket service element and obtain its corresponding object.

[0098] 3) Then, based on the configuration parameters parsed from the TS service, assign values ​​to the attributes in the selected template; for example, the TCPSocket service includes attribute information such as source address and maximum number of bytes. After assigning values ​​to the template, the transport service code block is generated.

[0099] 4) Finally, convert the assigned TS object into a string for easy output and storage to a specified path.

[0100] This allows users to automatically configure the transmission service and generate code simply by entering the required parameter values ​​into the visual interface.< / node> < / node> < / node> < / simpletype>

Claims

1. A method for automatically generating transmission service codes for a flight control system, characterized in that, The method includes the following steps: Step 1: Receive user input of at least one transmission service and its attributes used in the flight control system. The transmission service attributes include: transmission interface, transmission mechanism, and transmission element. Step 2: For each transmission service, based on the transmission interface of each transmission service, select the candidate complexType node corresponding to the transmission interface from the preset XSD file as the candidate set; the preset XSD file contains at least one candidate complexType node, one candidate complexType node corresponds to one transmission interface, and each candidate complexType node includes multiple simpleType child nodes. The simpleType child nodes are the transmission mechanism and transmission element rules adapted to the transmission interface; the transmission element rules include: the enumeration type and / or text type of the transmission element; Step 3: For each transport service, receive the new transport service selected by the user from the candidate set, and generate an XML file by treating each new transport service as an XSDNode node in the XML file. Step 4: Construct an XPath path expression based on the node information in the XML file, and use the DOM4j method to parse the XML file based on the XPath path expression to obtain the parsed file; Step 5: Convert the attributes of each transmission service in the parsed file into preset data types to obtain template elements; Step 6: Assign the template elements to the code template of the preset transmission service; The code template for the default transmission service is generated using the StringTemplate template engine. The transmission service includes: a transmission implementation service and a preset version of the transmission interface service; the preset version of the transmission interface service is the transmission interface service corresponding to the transmission interface of the transmission service input by the user. The code template for the preset transmission service is obtained by editing the transmission implementation service and the preset version of the transmission interface service in the StringTemplate template to form a general code template.

2. The method according to claim 1, characterized in that, The step of converting the attributes of each transmission service in the parsed file into a preset data type includes: Select transmission service nodes with different attributes from the parsed file, and convert the attributes of each transmission service node with different attributes into a preset data type.

3. The method according to claim 1, characterized in that, The method further includes: For any transport service, if there is no candidate complexType node corresponding to the transport interface of any transport service in the preset XSD file; In the preset XSD file, create a candidate complexType node corresponding to the transmission interface of any of the transmission services; Add a simpleType child node to the selected complexType node.

4. The method according to claim 1, characterized in that, For each transmission service, after selecting the candidate complexType node corresponding to the transmission interface from a preset XSD file as the candidate set, the method further includes: Generate a visual interface based on the candidate set; Correspondingly, the receiving user selects a new transport service from the candidate set, including: Receive new transport service attributes selected by the user from a set of candidates through a visual interface.

5. An automatic generation device for transmission service codes of a flight control system, characterized in that, include: The receiving module is used to receive user input of at least one transmission service and the attributes of the transmission service used in the flight control system. The transmission service attributes include: transmission interface, transmission mechanism and transmission element. The selection module is used to select, for each transmission service, a candidate complexType node corresponding to the transmission interface from a preset XSD file, as a candidate set, based on the transmission interface of each transmission service. The preset XSD file contains at least one candidate complexType node, each candidate complexType node corresponds to a transmission interface, and each candidate complexType node includes multiple simpleType child nodes. The simpleType child nodes represent the transmission mechanism and transmission element rules adapted to the transmission interface. The transmission element rules include: the enumeration type and / or text type of the transmission element. The generation module is used to receive new transport services selected by the user from the candidate set for each transport service, and generate an XML file by using each new transport service as an XSDNode node in the XML file. The parsing module is used to construct XPath path expressions based on the node information in the XML file, and then use DOM4j methods to parse the XML file based on the XPath path expressions to obtain the parsed file. The conversion module is used to convert the attributes of each transmission service in the parsed file into preset data types to obtain template elements; The assignment module is used to assign template elements to the code template of the preset transmission service; The code template for the default transmission service is generated using the StringTemplate template engine. The transmission service includes: a transmission implementation service and a preset version of the transmission interface service; the preset version of the transmission interface service is the transmission interface service corresponding to the transmission interface of the transmission service input by the user. The code template for the preset transmission service is obtained by editing the transmission implementation service and the preset version of the transmission interface service in the StringTemplate template to form a general code template.

6. The apparatus according to claim 5, characterized in that, The conversion module is specifically used to filter transmission service nodes with different attributes from the parsed file and convert the attributes of each transmission service node with different attributes into a preset data type.

7. The apparatus according to claim 5, characterized in that, Also includes: Create a module; The creation module is used when, for any transport service, there is no candidate complexType node corresponding to the transport interface of any transport service in the preset XSD file; In the preset XSD file, create a candidate complexType node corresponding to the transmission interface of any of the transmission services; Add a simpleType child node to the selected complexType node.

8. The apparatus according to claim 5, characterized in that, Also includes: Visualization module; Generate a visual interface based on the candidate set; Correspondingly, the generation module is specifically used to receive new transmission service attributes selected by the user from the candidate set through a visual interface.

Citation Information

Patent Citations

  • Proxy service generating device and proxy service generating method

    CN103530135A

  • Transplantable unit code automatic generation method based on aviation embedded open system architecture

    CN111782194A