A Method for Bidirectional Association between Graphical Engineering and Code of a Spacecraft Control System
By filtering and encapsulating the source code of the simulation verification program of the spacecraft control system, generating XML files, extracting key information and associated with graphic design projects, the problem of low iteration efficiency caused by manual modification in the existing technology is solved, automated updates are achieved, and design verification efficiency is improved.
Patent Information
- Application Number
- CN202210725330.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-06-23
AI Technical Summary
In the prior art, the simulation verification program of the spacecraft control system and the update process of the graphic design engineering need to be manually modified, resulting in low iteration efficiency of the design verification process.
The Doxygen tool is used to filter and encapsulate the source code of the simulation verification program, generate XML files, extract global functions, structures, classes and other information, and associate it with the graphical design project to realize automated updates of the graphical design project.
The two-way correlation between the graphic engineering of the spacecraft control system and the code is realized, the iterative efficiency of the design verification process is improved, repeated modifications are avoided, and the degree of automation of design verification is improved.
Smart Images

Figure CN115270412B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spacecraft control system design, and particularly to a method for bidirectional association between a graphical engineering of a spacecraft control system and code. Background Art
[0002] During the design process of a spacecraft control system, designers write the user requirements of the spacecraft control system application software, and conduct test verification through a simulation verification software, and then provide it to the application software development department for software development. In the prior art, "A Method for Automatically Generating User Requirements of Application Software Based on C Code" proposes a method for designing the user requirements of spacecraft control system application software and generating simulation verification software on a graphical interface. The design completed on the graphical interface in this method is the graphical design project, which generally consists of a variable table, an instruction table, a mode, a condition function table, an internal algorithm, a normalization algorithm, and a common function. Among them, the variable table is a module for managing variables in the control system, the instruction table is a module for managing variable modification functions, the mode is a module for managing the working modes of the control system, the condition function table is a module for managing the conversion of working modes, the internal algorithm is a module for managing the algorithms defined in the control system, and the normalization algorithm and common function are modules for managing basic algorithms. After the simulation verification software is debugged and modified, it needs to be fed back to the graphical design project for updating. If this update process needs to be completed manually, it restricts the design verification process from quickly completing iterations. Summary of the Invention
[0003] The technical problem solved by the present invention is to propose a method for bidirectional association between a graphical engineering of a spacecraft control system and code, which can import the modified simulation verification code based on the existing graphical design project of the spacecraft control system, scan and parse it, and compare the old and new codes, and achieve automatic update of the graphical design project to the greatest extent, avoiding repeated modification of the simulation verification program and the graphical design project, and significantly improving the iteration efficiency of the design verification process.
[0004] The technical solution of the present invention is: A method for bidirectional association between a graphical engineering of a spacecraft control system and code, including:
[0005] 1) Screening and encapsulating the source code of the simulation verification program, and storing the extracted information;
[0006] 2) Associating the extracted information with the graphical design project, identifying the changed items, including addition, deletion, and modification, and automatically updating the graphical design project.
[0007] [[ID=Z5]]Screening and encapsulating the source code of the simulation verification program based on the Doxygen tool to achieve a full scan of the VC project code.
[0008] The extracted information includes global functions, structures, and classes.
[0009] The extracted global functions are used to associate with the common functions in the graphical design project, including function declarations and function implementations.
[0010] The extracted structures are used to associate with the variable table in the graphical design project, including: structure names and member variable information of the structures; the member variable information of the structures includes comments of the member variables; the comments of the member variables include assignments of the member variables, initialization attributes of the member variables, and telemetry attributes of the member variables.
[0011] The extracted classes are used to associate with the instruction list, mode, conditional function table, internal algorithm, and normalization algorithm in the graphical design project, including: class names, comments of the classes, member variables of the classes, and member functions of the classes;
[0012] The comments of the classes include instruction list information;
[0013] The member functions of the classes include mode entry functions, mode exit functions, mode control functions, mode management functions, conditional functions, internal functions, and normalization functions.
[0014] The content for automatically updating the graphical design project includes: variable table, instruction list, mode, conditional function table, internal algorithm, normalization algorithm, and common functions.
[0015] Updating the variable table includes adding variables, deleting variables, modifying variable initial values, and updating the initialization and telemetry attributes;
[0016] For adding or deleting variables, it means matching the member variable information of the extracted structure in the variable table of the graphical design project. If the variable does not exist in the variable table, the variable is added; if the variable exists in the variable table but does not exist in the extracted member variable information, the variable is deleted;
[0017] For modifying the variable initial value, it means separately parsing the assignment in the comments of the member variables of the extracted structure to obtain the corresponding variable name and variable initial value, and performing the assignment in the variable table;
[0018] For changing the initialization and telemetry attributes, it means that if there are initialization attributes or telemetry attributes in the comments of some member variables of the extracted structure, the corresponding initialization attributes and telemetry attributes are generated in the variable table.
[0019] Updating the instruction list means matching the instruction list information in the comments of the extracted class in the instruction list of the graphical design project, and if they are inconsistent, updating the extracted instruction list information to the instruction list of the graphical design project.
[0020] Update the pattern, including adding, deleting, and modifying the pattern; among them, adding and deleting the pattern involve the four functions of pattern entry, pattern exit, pattern control, and pattern management in the member functions of the extracted class; if it is detected that these four functions are added or deleted simultaneously, add or delete the pattern in the graphical design project, otherwise only modify the corresponding part of the pattern.
[0021] Update the conditional function table, including adding, deleting, and modifying the pattern switching conditional functions; it means matching the conditional functions in the member functions of the extracted class in the conditional function table of the graphical design project, and finding the corresponding items in the conditional function table for adding, deleting, and modifying.
[0022] Update the internal algorithm, including adding, deleting, and modifying the code of the internal algorithm functions; it means matching the internal algorithms in the member functions of the extracted class in the internal algorithms of the graphical design project, and finding the corresponding items in the internal algorithm list for adding, deleting, and modifying.
[0023] Update the normalization algorithm and common functions, which means matching the normalization functions in the member functions of the extracted class and the extracted global functions in the normalization algorithm and common functions of the graphical design project respectively. Whether there is a match or not, the normalization algorithm and common functions are not updated.
[0024] The advantages of the present invention compared with the prior art are as follows:
[0025] (1) By scanning the VC code generated by the graphical project of the spacecraft control system, the present invention generates an information file, thereby establishing a two-way association between the graphical project and the code, and solving the problem that the traditional method can only perform one-way code generation.
[0026] (2) Based on the key design elements in the design of the spacecraft control system, the present invention extracts information. The three types of information, namely the extracted global functions, structures, and classes, can completely cover the design elements such as the variable table, instruction table, pattern, conditional function table, internal algorithm, normalization algorithm, and common functions, ensuring the integrity and credibility of the establishment of the two-way association.
[0027] (3) The present invention imports the modified code into the graphical project, identifies the change items such as adding, deleting, and modifying through information comparison, and realizes the automatic update of the graphical design project to the greatest extent, avoiding repeated modification of the simulation verification program and the graphical design project, and greatly improving the iteration efficiency of the design verification process. Brief Description of the Drawings
[0028] Figure 1 It is a flow block diagram of the two-way association between the graphical project of the spacecraft control system and the code of the present invention. Detailed implementation mode
[0029] As Figure 1 shown, the present invention proposes a method for two-way association between graphical engineering and code of a spacecraft control system, including:
[0030] 1) Screen and package the source code of the simulation verification program, and store the extracted information in the form of an XML file;
[0031] 2) According to the information in the XML file obtained in step 1), associate it with the graphical design project and automatically update the graphical design project.
[0032] Based on the Doxygen tool, screen and package the source code of the simulation verification program to achieve a full scan of the VC project code.
[0033] The information extracted after scanning the VC project includes global functions, structures, classes, etc., and is stored in a file in XML format for association with the graphical design project in step 2).
[0034] The extracted global function part is used to associate with the common functions in the graphical design project, including information:
[0035] ● Function declaration
[0036] Function name
[0037] Function return value
[0038] File name of the function declaration
[0039] Function comment
[0040] Start line number of the function declaration comment
[0041] Line number where the function declaration is located
[0042] Function formal parameter list
[0043] ● Function implementation
[0044] File name of the function implementation
[0045] Start line number of the function implementation
[0046] End line number of the function implementation
[0047] The starting line number of the function body
[0048] The source code of the function body.
[0049] The extracted structure part, used to associate with the variable table in the graphical design project, including:
[0050] ● Structure name
[0051] ● The file where the structure is declared
[0052] ● Structure comment
[0053] ● The starting line number of the structure comment
[0054] ● The starting line number of the structure declaration
[0055] ● The ending line number of the structure declaration
[0056] ● Member variables of the structure
[0057] Comments of member variables (including assignment, initialization attributes, telemetry attributes, etc.)
[0058] Line numbers of comments of member variables
[0059] Member variable name
[0060] Member variable type
[0061] Array size of member variables
[0062] Line numbers of member variables
[0063] The extracted class part, used to associate with the instruction list, mode, conditional function table, internal algorithm, normalization algorithm, etc. in the graphical design project, including:
[0064] ● Class name
[0065] ● The file name corresponding to the class
[0066] ● The starting line number of the class declaration
[0067] ● The ending line number of the class declaration
[0068] ● Class comment
[0069] Instruction list
[0070] Model comment
[0071] ● Starting line number of class comment
[0072] ● Member variables of the class
[0073] Member variable name
[0074] Comment of member variable
[0075] Line number of comment of member variable
[0076] Member variable type
[0077] Size of member variable array
[0078] Line number of member variable
[0079] ● Member functions of the class, different types of functions are distinguished by function comments, including mode entry functions, mode exit functions, mode control functions, mode management functions, conditional functions, internal functions, normalization functions, etc.
[0080] Member function declaration:
[0081] ◆ Function name
[0082] ◆ Function return value
[0083] ◆ File name of function declaration
[0084] ◆ Function comment
[0085] ◆ Starting line number of function declaration comment
[0086] ◆ Line number where function declaration is located
[0087] ◆ Function parameter list
[0088] Member function implementation:
[0089] ◆ File name of function implementation
[0090] ◆ Starting line number of function implementation
[0091] ◆ Ending line number of function implementation
[0092] ◆ Starting line number of function body
[0093] ◆ Source code of function body
[0094] Associate with the graphical design project by storing information in an XML - formatted file, and update the graphical design project through information comparison. The comparison content includes: variable table, instruction table, mode, conditional function table, internal algorithm, normalization algorithm, and common functions, etc.
[0095] Update the variable table, including adding variables, deleting variables, modifying the initial values of variables, changing initialization and telemetry attributes;
[0096] For adding or deleting variables, it means matching the member variable information of the extracted structure in the variable table of the graphical design project. If the variable does not exist in the variable table, the variable needs to be added; if the variable exists in the variable table but does not exist in the extracted variable information, the variable will be deleted.
[0097] For modifying the initial value of a variable, it means separately parsing the assignment in the comment of the member variable of the extracted structure to obtain the corresponding variable name and variable initial value, and then performing the assignment in the variable table.
[0098] For changing initialization and telemetry attributes, it means that if there are initialization attributes or telemetry attributes in the comments of some member variables of the extracted structure, corresponding initialization attributes and telemetry attributes will be generated in the variable table.
[0099] Update the instruction table, which means matching the instruction table information in the comment of the extracted class in the instruction table of the graphical design project, and if they are inconsistent, updating the extracted instruction table information to the instruction table of the graphical design project.
[0100] Update the mode, including adding, deleting, and modifying the mode. Among them, adding and deleting the mode involves four functions: mode entry, mode exit, mode control, and mode management in the member functions of the extracted class.
[0101] If it is detected that these four functions are added or deleted simultaneously, add or delete the mode in the graphical design project; otherwise, only modify the corresponding part of the mode.
[0102] Update the conditional function table, including adding, deleting, and modifying the mode - switching conditional functions. It means matching the conditional function information in the member functions of the extracted class in the conditional function table of the graphical design project, and finding the corresponding item in the conditional function table for adding, deleting, or modifying.
[0103] Update the internal algorithm, including adding, deleting, and modifying the code of the internal algorithm functions. It means matching the internal algorithm information in the member functions of the extracted class in the internal algorithm of the graphical design project, and finding the corresponding item in the internal algorithm list for adding, deleting, or modifying.
[0104] Identify the normalization algorithms and common functions. This means matching the normalization algorithm information in the member functions of the extracted classes and the extracted global function information with the normalization algorithms and common functions in the graphical design project. Whether there is a match or not, the normalization algorithms and common functions are not updated.
Claims
1. A graphical engineering and code two-way association method for a spacecraft control system, characterized in that Including: Screen and package the source code of the simulation verification program, and store the extracted information; The extracted information includes global functions, structures, and classes; Associate the extracted information with the graphical design project and automatically update the graphical design project; the graphical design project refers to the design completed in the graphical interface; The extracted global functions are used to associate with the common functions in the graphical design project, including function declarations and function implementations; The extracted structures are used to associate with the variable table in the graphical design project, including: structure names and member variable information of the structures; the member variable information of the structures includes comments of the member variables; the comments of the member variables include assignments of the member variables, initialization attributes of the member variables, and telemetry attributes of the member variables; The extracted classes are used to associate with the instruction table, mode, conditional function table, internal algorithm, and normalization algorithm in the graphical design project, including: class names, comments of the classes, member variables of the classes, and member functions of the classes; The comments of the classes include instruction table information; The member functions of the classes include mode entry functions, mode exit functions, mode control functions, mode management functions, conditional functions, internal functions, and normalization functions; The content for automatically updating the graphical design project includes: variable table, instruction table, mode, conditional function table, internal algorithm, normalization algorithm, and common functions; The variable table is a module for managing variables in the control system, the instruction table is a module for managing variable modification functions, the mode is a module for managing the working modes of the control system, the conditional function table is a module for managing the conversion of working modes, the internal algorithm is a module for managing the algorithms defined in the control system, and the normalization algorithm and common functions are modules for managing basic algorithms.
2. The method for bidirectional association between graphical engineering and code of a spacecraft control system according to claim 1, wherein Based on the Doxygen tool, screen and package the source code of the simulation verification program to achieve a full scan of the VC project code.
3. A method for bidirectional association between graphical engineering and code of a spacecraft control system according to claim 1, characterized in that, Update the variable table, including adding variables, deleting variables, modifying the initial values of variables, and updating the initialization and telemetry attributes; For adding or deleting variables, it means matching the member variable information of the extracted structure in the variable table of the graphical design project. If the variable does not exist in the variable table, add the variable; if the variable exists in the variable table but does not exist in the extracted member variable information, delete the variable; For modifying the initial value of a variable, it means separately parsing the assignment in the comment of the member variable of the extracted structure to obtain the corresponding variable name and variable initial value, and perform the assignment in the variable table; For changing the initialization and telemetry attributes, it means that if there are initialization attributes or telemetry attributes in the comments of some member variables of the extracted structure, generate the corresponding initialization attributes and telemetry attributes in the variable table.
4. A method for bidirectional association between graphical engineering and code of a spacecraft control system according to claim 1, characterized in that, Update the instruction table, which means matching the instruction table information in the comment of the extracted class in the instruction table of the graphical design project, and if they are inconsistent, update the extracted instruction table information to the instruction table of the graphical design project.
5. A method for bidirectional association between graphical engineering and code of a spacecraft control system according to claim 1, characterized in that Update the pattern, including adding, deleting, and modifying the pattern. Among them, adding and deleting the pattern involve the four functions of pattern entry, pattern exit, pattern control, and pattern management in the member functions of the extracted class. If the simultaneous addition or deletion of these four functions is detected, add or delete the pattern in the graphical design project; otherwise, only modify the corresponding part of the pattern.
6. A method for bidirectional association between graphical engineering and code of a spacecraft control system according to claim 1, characterized in that, Update the conditional function table, including adding, deleting, and modifying the pattern switching conditional functions. It means matching the conditional functions in the member functions of the extracted class in the conditional function table of the graphical design project, and finding the corresponding items in the conditional function table for addition, deletion, and modification.
7. A method for bidirectional association between graphical engineering and code of a spacecraft control system according to claim 1, characterized in that, Update the internal algorithm, including adding, deleting, and modifying the code of the internal algorithm functions. It means matching the internal algorithms in the member functions of the extracted class in the internal algorithms of the graphical design project, and finding the corresponding items in the internal algorithm list for addition, deletion, and modification.
8. A method for bidirectional association between graphical engineering and code of a spacecraft control system according to claim 1, characterized in that Update the normalization algorithm and common functions, which means matching the normalization functions in the member functions of the extracted class and the extracted global functions in the normalization algorithm and common functions of the graphical design project respectively. Whether there is a match or not, the normalization algorithm and common functions will not be updated.
Citation Information
Patent Citations
Method for quickly developing software, computer equipment and storage medium
CN113590086A
Application program processing method and device, electronic equipment and storage medium
CN114237614A