A method and system for automatically generating onboard protocol package code

By automatically mapping information tables of telemetry protocol parameters and software variables, telemetry group package codes are generated, which solves the problems of low efficiency in developing satellite telemetry protocol codes and high risk of human errors, and achieves efficient and reliable code generation and maintenance.

CN115061676BActive Publication Date: 2024-11-05BEIJING INST OF CONTROL ENG
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210554603.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2024-11-05
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

The existing technology cannot effectively solve the problems of low code development and maintenance of satellite-on-board telemetry protocols and high risk of human errors, resulting in software telemetry problems becoming the main risk point.

Method used

By establishing a mapping information table for telemetry protocol parameters and software variables, parameter protocol analysis, star-end data extraction, data mapping, protocol parameter transformation, data type conversion and byte stream assignment are automatically performed to generate telemetry packet codes to reduce manual intervention and Risk of error.

Benefits of technology

It realizes efficient and reliable telemetry package code generation, reduces the error risk in the traditional manual coding process, improves code development and maintenance efficiency, and is suitable for all types of satellite-on-board telemetry protocols.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115061676B_ABST
    Figure CN115061676B_ABST
Patent Text Reader

Abstract

A method for automatically generating code for satellite protocol package assembly includes: establishing a mapping information table of telemetry protocol parameters and software variables; extracting any satellite protocol parameter in the mapping information table, and automatically generating code, including: performing parameter protocol analysis and satellite-end data extraction; judging the value mapping attribute in the coding information of the software variable: if the value mapping attribute is not empty, then performing satellite-end data mapping; otherwise, not performing satellite-end data mapping; judging the transformation attribute in the coding information of the satellite protocol parameter: if the transformation attribute is not empty, then performing protocol parameter transformation; otherwise, not performing protocol parameter transformation; comparing the source type and the target type, and if the source type and the target type are inconsistent, then performing data type conversion; otherwise, not performing data type conversion; performing byte stream assignment; and returning the next satellite protocol parameter extracted from the mapping information table. The present invention effectively reduces the code failure caused by human errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and system for automatically generating on-board protocol package codes. Background Art

[0002] Telemetry is the only channel for the ground to obtain the on-orbit status of spacecraft software. Due to the characteristics of telemetry protocols such as diversity, continuous changes, and large volume, telemetry-related software problems are difficult to eliminate. With the continuous advancement of the standardization process of satellite development in my country, software algorithms, interfaces, and functions are all developing towards universalization and configuration. Among the codes that need to be modified for the different business logics of each satellite, telemetry package codes will account for a large proportion, and software telemetry problems will become one of the main risk points.

[0003] In addition, telemetry protocols change very frequently, which takes up a lot of time in the development process. In particular, the basic algorithms of general satellites have basically been universalized, but the telemetry contents are different, which also restricts the efficiency of general micro-code development.

[0004] At present, the processing of satellite telemetry protocols still remains at the protocol layer, that is, by defining standardized protocols to fix the format framework of satellite telemetry protocols, and then developing tools to improve the efficiency of satellite protocol writing and maintenance. The current code generation methods or systems are all aimed at relatively limited protocol samples or scenarios, and their protocol description capabilities cannot meet all the requirements of satellite software telemetry protocols. Therefore, the current development of satellite software telemetry package code still requires coders to manually develop in accordance with protocol documents, or develop universal modules, and then manually configure coding parameters in accordance with protocol documents. However, no matter which method is used, it is necessary to manually develop and maintain software code, which not only consumes a lot of time and cost, but also easily introduces human errors. Summary of the invention

[0005] The technical problem to be solved by the present invention is: to overcome the shortcomings of the prior art, the present invention provides a method and system for automatically generating satellite-borne protocol packaging codes, and provides a method for automatically converting standardized satellite-borne telemetry protocols into telemetry packaging codes, which effectively reduces the risk of human errors easily introduced in the traditional manual coding process, causing code failure, and even causing system crashes in extreme cases, thereby ensuring the quality of the telemetry packaging code and greatly improving the efficiency of code development and maintenance.

[0006] The technical solution adopted by the present invention is: a method for automatically generating on-board protocol package code, which comprises:

[0007] Establishing a mapping information table of telemetry protocol parameters and software variables; the mapping information table includes: encoding information of the satellite-borne protocol parameters and software variables, and a mapping relationship between the satellite-borne protocol parameters and the software variables;

[0008] Extract any satellite protocol parameter in the mapping information table and automatically generate code; the automatic code generation includes:

[0009] Perform parameter protocol analysis and satellite-side data extraction;

[0010] The value mapping attribute in the encoding information of the software variable is judged: if the value mapping attribute is not empty, the star-end data mapping is performed; if the value mapping attribute is empty, the star-end data mapping is not performed;

[0011] The transformation attribute in the encoding information of the onboard protocol parameter is judged: if the transformation attribute is not empty, the protocol parameter transformation is performed; if the transformation attribute is empty, the protocol parameter transformation is not performed;

[0012] Compare the source type and the target type. If the source type and the target type are inconsistent, data type conversion is performed; if the source type and the target type are consistent, data type conversion is not performed.

[0013] Assign byte stream;

[0014] Returns the next satellite protocol parameter extracted from the mapping information table and automatically generates code.

[0015] Further, the coding information of the satellite-borne protocol parameters is contained in the telemetry protocol document and can be directly read, and the coding information of the satellite-borne protocol parameters includes: code, name, type, position and transformation;

[0016] The onboard protocol parameters correspond one-to-one to the software variables, and the encoding information of the software variables includes: name, type, bit offset, bit length, value mapping and transformation.

[0017] Furthermore, the parameter protocol analysis, star-end data extraction, star-end data mapping, protocol parameter transformation, data type conversion, and byte stream assignment use a universal data interface to achieve information transmission between each two steps;

[0018] The definition of the general data interface is: {variable expression, data type};

[0019] The variable expression is a software code snippet that represents the expression of the data source in the current step; the data type is the data type of the result of the variable expression calculation.

[0020] Furthermore, the parameter protocol analysis includes:

[0021] Perform protocol configuration correctness check and risk analysis on the mapping information table, including protocol integrity and protocol matching;

[0022] Among them, the protocol integrity checks whether the required attribute information in the mapping information table is complete; the protocol matching checks whether the matching relationship between the attributes in the mapping information table is reasonable;

[0023] After checking the protocol integrity and protocol matching according to the application requirements, if there are errors, prompts will be issued before code generation and the mapping information table will be improved.

[0024] Furthermore, the satellite end data extraction includes:

[0025] According to the specific onboard protocol package situation, the original data stored in the software variables is initially transformed, and corresponding processing is performed when encountering the following situations:

[0026] When the bit length of the software variable is not divisible by 8 or the bit offset is a non-zero value, generate code to extract valid bits and assign them to temporary variables. The extraction of valid bits is completed using the "shift" and "and" bit operations of the target language; update the general data interface, where the variable expression is the temporary variable name and the data type is the type of the software variable;

[0027] When the name of the software variable is identified as a function, macro or expression, a code is generated to assign the calculation result of the function, macro or expression to the temporary variable, and a regular expression matching method is used to identify the function, macro or expression; the general data interface is updated, in which the variable expression is the temporary variable name and the data type is the type of the software variable;

[0028] When the transformation of the software variable is not empty, the calculation expression of the software variable is generated according to the transformation keyword and configuration parameters, and the calculation result of the expression is assigned to the code of the temporary variable; the general data interface is updated, in which the variable expression is the temporary variable name, and the data type is determined by the specific transformation; the transformation is defined according to the specific application requirements;

[0029] If it is not the case above, a general data interface is directly generated, in which the variable expression is the name of the software variable and the data type is the type of the software variable.

[0030] Furthermore, the satellite-end data mapping includes:

[0031] If the value mapping attribute is not empty, the code for assigning different mapping values ​​to temporary variables is generated according to the mapping rules; the general data interface is updated, where the variable expression is the temporary variable name, and the data type is determined according to the mapping value. If the mapping value is a floating point number, it is a floating point type, otherwise it is an integer type.

[0032] Furthermore, the protocol parameter transformation includes:

[0033] If the transformation attribute is not empty, the reverse calculation expression of the software variable is generated according to the transformation keyword and configuration parameters, and the calculation result of the reverse calculation expression is assigned to the code of the temporary variable; the general data interface is updated, in which the variable expression is the temporary variable name, and the data type is determined by the specific transformation; the transformation is defined according to the specific application requirements.

[0034] Furthermore, the data type conversion includes:

[0035] The source type is the data type of the current universal data interface, and the target type is the type of the onboard protocol parameter as the target type;

[0036] If the source type is inconsistent with the target type, add the data type conversion code of the target language to the variable expression of the current universal data interface, and then use the code to update the variable expression of the universal data interface, and the type of the universal data interface is updated to the target type.

[0037] Furthermore, the byte stream assignment includes:

[0038] Assign the variable expression in the current general data interface to the temporary variable, then extract the variable value byte by byte and write it into the target byte position specified by the onboard protocol parameters in sequence.

[0039] A system for automatically generating a satellite-borne protocol package code comprises a parameter protocol analysis module, a satellite-end data extraction module, a satellite-end data mapping module, a protocol parameter conversion module, a data type conversion module, and a byte stream assignment module;

[0040] Extract any satellite protocol parameter in the mapping information table, and enter the parameter protocol analysis module, satellite data extraction module, satellite data mapping module, protocol parameter conversion module, data type conversion module, and byte stream assignment module in sequence;

[0041] The parameter protocol analysis module performs parameter protocol analysis on the mapping information table;

[0042] Satellite data extraction module, which extracts satellite data of satellite protocol parameters;

[0043] The star-end data mapping module judges the value mapping attribute in the encoding information of the software variable: if the value mapping attribute is not empty, the star-end data mapping is performed; if the value mapping attribute is empty, the star-end data mapping is not performed;

[0044] The protocol parameter transformation module judges the transformation attribute in the encoding information of the onboard protocol parameters: if the transformation attribute is not empty, the protocol parameter transformation is performed; if the transformation attribute is empty, the protocol parameter transformation is not performed;

[0045] The data type conversion module compares the source type and the target type. If the source type and the target type are inconsistent, the data type conversion is performed; if the source type and the target type are consistent, the data type conversion is not performed;

[0046] The byte stream assignment module performs byte stream assignment on the variable expressions in the current general data interface;

[0047] The parameter protocol analysis module, the star-end data extraction module, the star-end data mapping module, the protocol parameter transformation module, the data type conversion module, and the byte stream assignment module use a universal data interface to achieve information transmission between any two modules.

[0048] The advantages of the present invention compared with the prior art are:

[0049] (1) The present invention has strong versatility. The method of the present invention is applicable to all types of currently known satellite telemetry protocols;

[0050] (2) The reliability of the present invention is high. The method of the present invention can perform logical reasoning detection on the correctness of the telemetry protocol and generate highly reliable codes that meet the reliability and security requirements of the onboard software, thereby ensuring the reliability of the telemetry package code;

[0051] (3) The present invention is easy to use. The method of the present invention only requires the coder to map the minimum and necessary code information with the telemetry protocol, and the entire process of code generation can be automatically completed without manual intervention;

[0052] (4) The present invention is highly efficient. The method of the present invention can greatly improve coding efficiency. Traditionally, it takes an average of 4 people / day to manually develop a 2,000-line telemetry package code, while the method of the present invention only requires 2 people / hour. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 Automatically generate flow charts for onboard protocol assembly code. DETAILED DESCRIPTION

[0054] The present invention will be further described below in conjunction with the accompanying drawings.

[0055] like Figure 1 As shown, a method for automatically generating onboard protocol package code includes the following steps:

[0056] A mapping information table of telemetry protocol parameters and software variables is established. The mapping information table contains the encoding information of the satellite protocol parameters and software variables, as well as the mapping relationship between the satellite protocol parameters and software variables. The encoding information of the satellite protocol parameters is contained in the telemetry protocol document and can be read directly. The specific contents include: code, name, type, position and transformation. The data source corresponding to each satellite protocol parameter is a software variable, that is, the satellite protocol parameters correspond to the software variables one by one. The encoding information of the software variables includes: name, type, bit offset, bit length, value mapping and transformation.

[0057] Read any satellite protocol parameter in the mapping information table and enter the code automatic generation process. The code automatic generation process is abstracted into 6 independent steps. A universal data interface is used between every two steps to realize information transmission. Some steps may be skipped according to the specific encoding information of the satellite protocol parameters and software variables. The 6 steps are: parameter protocol analysis, satellite data extraction, satellite data mapping, protocol parameter transformation, data type conversion, and byte stream assignment.

[0058] The definition of the general data interface is: {variable expression, data type};

[0059] Among them, the variable expression is a software code snippet, which represents the expression of the data source in the current step, and the data type is the data type of the variable expression calculation result, such as signed four-byte integer, unsigned two-byte integer, double-precision floating point, etc. Since the data exchange format between each step is through the general data interface, the omission of individual steps does not affect the transmission of information.

[0060] After the above 6 steps are executed in sequence, the next satellite protocol parameter in the mapping information table is extracted, and the above 6 steps are repeated to complete the automatic generation of the telemetry protocol package code. Figure 1 shown.

[0061] The following introduces specific technical solutions for 6 independent steps:

[0062] Parameter protocol analysis:

[0063] Parameter protocol analysis is to check the correctness of protocol configuration and conduct risk analysis on the mapping information table. The inspection content includes two main aspects: protocol integrity and protocol matching, which can also be expanded according to specific application requirements. Protocol integrity checks whether the necessary attributes (name, type, position of protocol parameters, name, type, bit offset, bit length, etc. of software variables) in the mapping information table are complete; protocol matching checks whether the matching relationship between attributes is reasonable. For example, if the type of the protocol parameter is a floating point type, the data length of its position description should not be less than 9 bits. After checking the protocol integrity and protocol matching according to application requirements, if there are errors, the user will be prompted to complete the mapping information table before code generation.

[0064] Star-end data extraction:

[0065] Star-end data extraction performs preliminary data transformation on the original data stored in the software variables according to the specific package situation. It mainly performs corresponding processing when encountering the following types of situations:

[0066] 1) When the bit length of the software variable is not divisible by 8 or the bit offset is a non-zero value, generate code to extract the valid bits and assign them to temporary variables. The extraction of valid bits is completed using the "shift" and "and" bit operations of the target language. Then, update the general data interface, where the variable expression is the temporary variable name and the data type is the type of the software variable;

[0067] 2) When the name of the software variable is identified as a function, macro or expression, a code is generated to assign the calculation result of the function, macro or expression to a temporary variable. The standard regular expression matching method is used to identify the function, macro or expression. Then, the general data interface is updated, where the variable expression is the temporary variable name and the data type is the type of the software variable;

[0068] 3) When the transformation of the software variable is not empty. Generate the calculation expression of the software variable according to the transformation keyword and configuration parameters, and assign the calculation result of the expression to the code of the temporary variable. Then, update the general data interface, where the variable expression is the temporary variable name, and the data type is determined by the specific transformation. The transformation is defined according to the specific application requirements. For example, if the transformation keyword is defined as "ADD" and the configuration parameter is 10, the code is generated to add 10 to the software variable and assign the result to the temporary variable. The data type of the general data interface follows the type of the software variable.

[0069] 4) If it is not the case above, directly generate a general data interface, where the variable expression is the name of the software variable and the data type is the type of the software variable.

[0070] Star-end data mapping:

[0071] The star-end data mapping depends on the value mapping attribute in the software variable information. If the value mapping attribute is empty, the star-end data mapping is skipped; otherwise, according to the mapping rules, the code for assigning different mapping values ​​to temporary variables is generated. Then, the general data interface is updated, where the variable expression is the temporary variable name, and the data type is determined according to the mapping value. If the mapping value is a floating point number, it is a floating point type, otherwise it is an integer type.

[0072] Protocol parameter transformation:

[0073] The protocol parameter transformation depends on the transformation attribute in the onboard protocol parameters. If the transformation attribute is empty, the protocol parameter transformation is skipped; otherwise, the reverse calculation expression of the software variable is generated according to the transformation keyword and configuration parameters, and the calculation result of the reverse calculation expression is assigned to the code of the temporary variable. Then, the general data interface is updated, where the variable expression is the temporary variable name and the data type is determined by the specific transformation. The transformation is defined according to the specific application requirements. For example, if the transformation keyword is defined as "ADD" and the configuration parameter is 10, the reverse calculation code is generated to subtract 10 from the software variable and assign the result to the temporary variable. The data type of the general data interface follows the type of the software variable.

[0074] Data type conversion:

[0075] The data type conversion depends on the data type of the current universal data interface and the type of the onboard protocol parameter. The data type of the current universal data interface is the source type, and the type of the onboard protocol parameter is the target type. If the source type is consistent with the target type, the data type conversion is skipped; otherwise, the data type conversion code of the target language is added to the variable expression of the current universal data interface, and then the variable expression of the universal data interface is updated with the code, and the type of the universal data interface is updated to the target type. For example, the target language is C language, the variable expression of the current universal data interface is: x+y, the type is int; the type of the onboard protocol parameter is float, then after the data type conversion, the variable expression of the universal data interface is: float(x+y), the type is float. Among them, int represents a signed integer, float represents a single-precision floating point number, and float(x+y) is a code statement in C language to convert int type to float type.

[0076] Byte stream assignment:

[0077] The byte stream assignment generates the code written into the target position of the satellite protocol parameter. The content written is the intermediate data formed after the above steps, that is, the variable expression in the current general data interface. The method is to assign the variable expression in the current general data interface to a temporary variable, then extract the variable value byte by byte, and write it into the target byte position specified by the satellite protocol parameter in sequence.

[0078] A system for automatically generating a satellite-borne protocol package code comprises a parameter protocol analysis module, a satellite-end data extraction module, a satellite-end data mapping module, a protocol parameter conversion module, a data type conversion module, and a byte stream assignment module;

[0079] Extract any satellite protocol parameter in the mapping information table, and enter the parameter protocol analysis module, satellite data extraction module, satellite data mapping module, protocol parameter conversion module, data type conversion module, and byte stream assignment module in sequence;

[0080] The parameter protocol analysis module performs parameter protocol analysis on the mapping information table;

[0081] Satellite data extraction module, which extracts satellite data of satellite protocol parameters;

[0082] The star-end data mapping module judges the value mapping attribute in the encoding information of the software variable: if the value mapping attribute is not empty, the star-end data mapping is performed; if the value mapping attribute is empty, the star-end data mapping is not performed;

[0083] The protocol parameter transformation module judges the transformation attribute in the encoding information of the onboard protocol parameters: if the transformation attribute is not empty, the protocol parameter transformation is performed; if the transformation attribute is empty, the protocol parameter transformation is not performed;

[0084] The data type conversion module compares the source type and the target type. If the source type and the target type are inconsistent, the data type conversion is performed; if the source type and the target type are consistent, the data type conversion is not performed;

[0085] The byte stream assignment module performs byte stream assignment on the variable expressions in the current general data interface;

[0086] The parameter protocol analysis module, the star-end data extraction module, the star-end data mapping module, the protocol parameter transformation module, the data type conversion module, and the byte stream assignment module use a universal data interface to achieve information transmission between any two modules.

[0087] Example:

[0088] Assume that there is a space control system software, and the mapping table of its telemetry protocol is as follows:

[0089]

[0090]

[0091] According to a method for automatically generating a satellite-borne protocol package assembly code of the present invention, the corresponding automatic package assembly code generation process is as follows:

[0092] 1. Analyze the parameter protocol and check if there is any missing information in the mapping table;

[0093] 2. Star-end data extraction, based on regular expression judgment, the software variable name angle is a variable. The bit offset of the software variable is 0, and the bit length 64 is divisible by 8, but the conversion to "radian to angle" is not empty. Therefore, the current situation meets the situation 3) in step 4.2, so the code for "radian to angle" conversion is generated, that is, angle is multiplied by 57.3 and assigned to the temporary variable a, and the variable expression of the general data interface is updated to a, and the type is double-precision floating point;

[0094] 3. Star-end data mapping: determine that there is no content in the value mapping of the software variable in the mapping relationship table, and skip the current step;

[0095] 4. Protocol parameter transformation: determine that the transformation of the satellite protocol parameters in the mapping table is multiplication (factor 0.0001), so generate the corresponding reverse calculation expression code, that is, divide the variable expression of the current general data interface by 0.0001 and assign it to the temporary variable a. Update the general data interface, whose variable expression is a, and the type is double precision floating point;

[0096] 5. Data type conversion. The data type in the current universal data interface is double-precision floating point type, and the type of the satellite protocol parameter in the mapping relationship table is unsigned integer type. Therefore, a type conversion code is generated, that is, the variable expression of the current universal data interface is converted into an unsigned integer code expression, and the expression is used to update the variable expression of the universal data interface. The data type of the universal data interface is unsigned integer type.

[0097] 6. Assign byte stream values. According to the location information (3-6) of the satellite protocol parameters, write the data after the above steps into the 3rd to 6th bytes of the satellite protocol data packet. Generate the corresponding write code using the target language to complete the automatic code generation for the current satellite protocol.

[0098] Parts of the present invention that are not described in detail belong to the well-known technologies of those skilled in the art.

Claims

1. A method for automatically generating on-board protocol package code, characterized in that: include: Establish a mapping information table between telemetry protocol parameters and software variables; The mapping information table includes: encoding information of the onboard protocol parameters and software variables, and a mapping relationship between the onboard protocol parameters and the software variables; Extract any satellite protocol parameter in the mapping information table and automatically generate code; the automatic code generation includes: Perform parameter protocol analysis and satellite-side data extraction; The value mapping attribute in the encoding information of the software variable is judged: if the value mapping attribute is not empty, the star-end data mapping is performed; if the value mapping attribute is empty, the star-end data mapping is not performed; The transformation attribute in the encoding information of the onboard protocol parameter is judged: if the transformation attribute is not empty, the protocol parameter transformation is performed; if the transformation attribute is empty, the protocol parameter transformation is not performed; Compare the source type and the target type. If the source type and the target type are inconsistent, data type conversion is performed; if the source type and the target type are consistent, data type conversion is not performed. Assign byte stream; Return to extract the next satellite protocol parameter in the mapping information table and automatically generate code; The source type is the data type of the current universal data interface, and the target type is the type of the onboard protocol parameter as the target type; The coding information of the satellite-borne protocol parameters is contained in the telemetry protocol document and can be directly read. The coding information of the satellite-borne protocol parameters includes: code, name, type, position and transformation; The onboard protocol parameters correspond one-to-one to the software variables, and the encoding information of the software variables includes: name, type, bit offset, bit length, value mapping and transformation; The parameter protocol analysis, star-end data extraction, star-end data mapping, protocol parameter transformation, data type conversion, and byte stream assignment use a universal data interface to achieve information transmission between each two steps; The definition of the general data interface is: {variable expression, data type}; The variable expression is a software code snippet that represents the expression of the data source in the current step; the data type is the data type of the result of the variable expression calculation; The parameter protocol analysis includes: Perform protocol configuration correctness check and risk analysis on the mapping information table, including protocol integrity and protocol matching; Among them, the protocol integrity checks whether the required attribute information in the mapping information table is complete; the protocol matching checks whether the matching relationship between the attributes in the mapping information table is reasonable; After checking the protocol integrity and protocol matching according to the application requirements, if there are errors, prompts will be issued before code generation and the mapping information table will be improved; The star-end data extraction includes: According to the specific onboard protocol package situation, the original data stored in the software variables is initially transformed, and corresponding processing is performed when encountering the following situations: When the bit length of the software variable is not divisible by 8 or the bit offset is a non-zero value, the code is generated to extract the valid bits and assign them to the temporary variable. The extraction of the valid bits is completed using the "shift" and "and" bit operations of the target language; the general data interface is updated, where the variable expression is the temporary variable name and the data type is the type of the software variable; When the name of the software variable is identified as a function, macro or expression, a code is generated to assign the calculation result of the function, macro or expression to the temporary variable, and a regular expression matching method is used to identify the function, macro or expression; the general data interface is updated, in which the variable expression is the temporary variable name and the data type is the type of the software variable; When the transformation of the software variable is not empty, the calculation expression of the software variable is generated according to the transformation keyword and configuration parameters, and the calculation result of the expression is assigned to the code of the temporary variable; the general data interface is updated, in which the variable expression is the temporary variable name, and the data type is determined by the specific transformation; the transformation is defined according to the specific application requirements; If it is not one of the above cases, a general data interface is directly generated, where the variable expression is the name of the software variable and the data type is the type of the software variable; The byte stream assignment includes: assigning the variable expression in the current universal data interface to the temporary variable, then extracting the variable value byte by byte, and writing it into the target byte position specified by the satellite protocol parameters in sequence.

2. The method for automatically generating on-board protocol package code according to claim 1, characterized in that: The star-end data mapping includes: If the value mapping attribute is not empty, the code for assigning different mapping values ​​to temporary variables is generated according to the mapping rules; the general data interface is updated, where the variable expression is the temporary variable name, and the data type is determined according to the mapping value. If the mapping value is a floating point number, it is a floating point type, otherwise it is an integer type.

3. The method for automatically generating on-board protocol package code according to claim 1, characterized in that: The protocol parameter transformation includes: If the transformation attribute is not empty, the reverse calculation expression of the software variable is generated according to the transformation keyword and configuration parameters, and the calculation result of the reverse calculation expression is assigned to the code of the temporary variable; the general data interface is updated, in which the variable expression is the temporary variable name, and the data type is determined by the specific transformation; the transformation is defined according to the specific application requirements.

4. The method for automatically generating on-board protocol package code according to claim 1, characterized in that: The data type conversion includes: If the source type is inconsistent with the target type, add the data type conversion code of the target language to the variable expression of the current universal data interface, and then use the code to update the variable expression of the universal data interface, and the type of the universal data interface is updated to the target type.

5. A system for automatically generating a satellite-borne protocol package code according to any one of claims 1 to 4, comprising a parameter protocol analysis module, a satellite-end data extraction module, a satellite-end data mapping module, a protocol parameter conversion module, a data type conversion module, and a byte stream assignment module; Extract any satellite protocol parameter in the mapping information table, and enter the parameter protocol analysis module, satellite data extraction module, satellite data mapping module, protocol parameter conversion module, data type conversion module, and byte stream assignment module in sequence; The parameter protocol analysis module performs parameter protocol analysis on the mapping information table; Satellite data extraction module, which extracts satellite data of satellite protocol parameters; The star-end data mapping module determines the value mapping attribute in the encoding information of the software variable: if the value mapping attribute is not empty, the star-end data mapping is performed; If the value mapping property is empty, star-side data mapping is not performed; The protocol parameter transformation module determines the transformation attribute in the encoding information of the onboard protocol parameters: if the transformation attribute is not empty, the protocol parameter transformation is performed; If the transform attribute is empty, no protocol parameter transformation is performed; The data type conversion module compares the source type and the target type. If the source type and the target type are inconsistent, the data type conversion is performed; if the source type and the target type are consistent, the data type conversion is not performed; The byte stream assignment module performs byte stream assignment on the variable expressions in the current general data interface; The parameter protocol analysis module, the star-end data extraction module, the star-end data mapping module, the protocol parameter transformation module, the data type conversion module, and the byte stream assignment module use a universal data interface to achieve information transmission between any two modules.

Citation Information

Patent Citations

  • Generation of a device application

    CN108431765A

  • Satellite AOS protocol remote control source program artificial intelligence writing method

    CN109086035A