CN115061676A - Automatic generation method and system for satellite-borne protocol package codes - Google Patents

Automatic generation method and system for satellite-borne protocol package codes Download PDF

Info

Publication number
CN115061676A
CN115061676A CN202210554603.0A CN202210554603A CN115061676A CN 115061676 A CN115061676 A CN 115061676A CN 202210554603 A CN202210554603 A CN 202210554603A CN 115061676 A CN115061676 A CN 115061676A
Authority
CN
China
Prior art keywords
protocol
type
satellite
mapping
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210554603.0A
Other languages
Chinese (zh)
Inventor
蔡雨辰
李晓锋
曹志威
齐天翼
柴志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Institute of Control Engineering
Original Assignee
Beijing Institute of Control Engineering
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Institute of Control Engineering filed Critical Beijing Institute of Control Engineering
Priority to CN202210554603.0A priority Critical patent/CN115061676A/en
Publication of CN115061676A publication Critical patent/CN115061676A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Radio Relay Systems (AREA)
  • Communication Control (AREA)

Abstract

A method for automatically generating a satellite-borne protocol suite code comprises the following steps: establishing a mapping information table of the telemetry protocol parameters and the software variables; any satellite-borne protocol parameter in the mapping information table is extracted, and code automatic generation is carried out, wherein the method comprises the following steps: performing parameter protocol analysis and star-end data extraction; judging the value mapping attribute in the coding information of the software variable: if the value mapping attribute is not null, carrying out star-end data mapping; otherwise, the mapping of the star-end data is not executed; judging the transformation attribute in the encoding information of the satellite-borne protocol parameters: if the conversion attribute is not null, performing protocol parameter conversion; otherwise, the protocol parameter transformation is not executed; comparing the source type with the target type, and if the source type is inconsistent with the target type, performing data type conversion; otherwise, the data type conversion is not executed; carrying out assignment on the byte stream; and returning and extracting the next satellite-borne protocol parameter in the mapping information table. The invention effectively reduces the code failure caused by human errors.

Description

Automatic generation method and system for satellite-borne protocol package codes
Technical Field
The invention relates to a method and a system for automatically generating a satellite-borne protocol package code.
Background
Telemetry is the only channel for the surface to acquire the on-orbit state of spacecraft software. Due to the characteristics of various telemetry protocols, continuous change, large volume and the like, software problems related to telemetry are difficult to avoid. With the continuous promotion of the standardization process of satellite development in China, software algorithms, interfaces and functions are developed towards universalization and configuration, telemetry package codes occupy a great proportion in the codes which need to be modified aiming at different business logics of each satellite, and the problem of software telemetry becomes one of main risk points.
In addition, the telemetry protocol is very frequent to change, the time cost occupied in the development process is very high, especially, the universal satellite basic algorithm basically realizes the generalization, but the telemetry contents are different, and the efficiency of the universal micro code development is also restricted.
At present, the processing for the satellite-borne telemetry protocol still only stays in a protocol layer, namely, a format frame of the satellite-borne telemetry protocol is fixed by defining a standardized protocol, and then a development tool improves the efficiency of the satellite-borne protocol in writing and maintaining. The existing code generation method or system aims at a relatively limited protocol sample or scene, and the protocol description capability of the existing code generation method or system cannot meet all requirements of a satellite-borne software telemetry protocol. Therefore, at present, the development of the code of the satellite-borne software telemetry package still needs encoding personnel to manually develop the code according to the protocol document, or develop a generalized module, and then manually configure the encoding parameters according to the protocol document. However, in either way, software code needs to be developed and maintained manually, which not only consumes a lot of time and cost, but also is very prone to human error.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the invention overcomes the defects of the prior art, provides a method and a system for automatically generating a satellite borne protocol package code, provides a method for automatically converting a normalized satellite borne telemetry protocol into a telemetry package code, effectively reduces the risks of code failure and system breakdown even under extreme conditions caused by human errors easily introduced in the traditional manual coding process, ensures the quality of the telemetry package code, and greatly improves the development and maintenance efficiency of the code.
The technical scheme adopted by the invention is as follows: a method for automatically generating a code of a satellite-borne protocol package comprises the following steps:
establishing a mapping information table of the telemetry protocol parameters and the software variables; the mapping information table includes: encoding information of the satellite borne protocol parameters and the software variables respectively, and mapping relation between the satellite borne protocol parameters and the software variables;
any satellite-borne protocol parameter in the mapping information table is extracted, and codes are automatically generated; the code automatic generation comprises:
performing parameter protocol analysis and star-end data extraction;
judging the value mapping attribute in the coding information of the software variable: if the value mapping attribute is not null, carrying out star-end data mapping; if the value mapping attribute is null, the star-end data mapping is not executed;
judging the transformation attribute in the encoding information of the satellite-borne protocol parameters: if the conversion attribute is not null, carrying out protocol parameter conversion; if the conversion attribute is null, the protocol parameter conversion is not executed;
comparing the source type with the target type, and if the source type is inconsistent with the target type, performing data type conversion; if the source type is consistent with the target type, the data type conversion is not executed;
carrying out assignment on the byte stream;
and returning and extracting the next satellite borne protocol parameter in the mapping information table, and automatically generating the code.
Further, the encoding information of the satellite borne protocol parameters is contained in a telemetry protocol document and can be directly read, and the encoding information of the satellite borne protocol parameters comprises: code, name, type, location and transformation;
the satellite-borne protocol parameters correspond to the software variables one by one, and the coding information of the software variables comprises: name, type, bit offset, bit length, value mapping and transformation.
Further, the parameter protocol analysis, the star-end data extraction, the star-end data mapping, the protocol parameter transformation, the data type conversion and the byte stream assignment are carried out, and a universal data interface is adopted between every two steps to realize information transmission;
the definition of the universal data interface is as follows: { variable expression, data type };
the variable expression is a software code segment and 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.
Further, the parameter protocol analysis includes:
carrying out protocol configuration correctness check and risk analysis on the mapping information table, wherein the check content comprises protocol integrity and protocol matching;
wherein, the protocol integrity checks whether the necessary attribute information in the mapping information table is complete; checking whether the matching relation between the attributes in the mapping information table is reasonable or not according to the protocol matching performance;
and after the protocol integrity and the protocol matching are checked according to the application requirements, if an error exists, a prompt is sent before the code is generated, and a mapping information table is perfected.
Further, the star-end data extraction includes:
according to the specific satellite-borne protocol package condition, primary data transformation is carried out on original data stored by software variables, and corresponding processing is carried out when the following conditions are met:
when the bit length of the software variable cannot be divided by 8 or the bit offset is a non-0 value, generating a code for extracting effective bits and assigning the codes to temporary variables, wherein the extraction of the effective bits is completed by using the ' shift ' and ' bit operation of a target language; updating a universal data interface, wherein the variable expression is a 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, a macro or an expression, generating a code for assigning the calculation result of the function, the macro or the expression to a temporary variable, and identifying the function, the macro or the expression by adopting a regular expression matching method; updating a universal data interface, wherein the variable expression is a temporary variable name, and the data type is the type of the software variable;
when the conversion of the software variable is not empty, generating a calculation expression of the software variable according to the conversion key words and the configuration parameters, and assigning the calculation result of the expression to a code of a temporary variable; updating a universal data interface, wherein a variable expression is a temporary variable name, and the data type is determined by specific transformation; the transformation is defined according to specific application requirements;
and if the conditions are not the above conditions, directly generating a universal data interface, wherein the variable expression is the name of the software variable, and the data type is the type of the software variable.
Further, the satellite-side data mapping includes:
if the value mapping attribute is not null, generating a code for assigning different mapping numerical values to temporary variables according to the mapping rule; and updating the universal data interface, wherein the variable expression is a temporary variable name, the data type is determined according to the mapping value, if the mapping value is a floating point number, the data type is a floating point type, and otherwise, the data type is an integer type.
Further, the protocol parameter transformation includes:
if the transformation attribute is not null, generating a reverse calculation expression of the software variable according to the transformation key words and the configuration parameters, and assigning the calculation result of the reverse calculation expression to a code of the temporary variable; updating a universal data interface, wherein a variable expression is a temporary variable name, and the data type is determined by specific transformation; the transformations are defined according to the specific application requirements.
Further, the data type conversion includes:
the source type is the data type of the current universal data interface, and the target type is the type of the satellite-borne protocol parameters;
and if the source type is inconsistent with the target type, adding a data type conversion code of the target language to the variable expression of the current universal data interface, then updating the variable expression of the universal data interface by using the code, and updating the type of the universal data interface to be the target type.
Further, the assigning of the byte stream includes:
and assigning the variable expression in the current universal data interface to a temporary variable, extracting the variable value byte by byte, and sequentially writing the variable value into the target byte position specified by the satellite borne protocol parameters.
A system of a satellite-borne protocol package code automatic generation method comprises a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter transformation module, a data type conversion module and a byte stream assignment module;
any satellite-borne protocol parameter in the mapping information table is extracted, and the satellite-borne protocol parameter sequentially enters a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter conversion module, a data type conversion module and a byte stream assignment module;
the parameter protocol analysis module carries out parameter protocol analysis on the mapping information table;
the satellite-side data extraction module is used for extracting satellite-side data of the satellite-borne protocol parameters;
the star-end data mapping module judges the value mapping attribute in the coding information of the software variable: if the value mapping attribute is not null, carrying out star-end data mapping; if the value mapping attribute is null, the star-end data mapping is not executed;
the protocol parameter conversion module is used for judging the conversion attribute in the encoding information of the satellite-borne protocol parameters: if the conversion attribute is not null, carrying out protocol parameter conversion; if the conversion attribute is null, the protocol parameter conversion is not executed;
the data type conversion module is used for comparing the source type with the target type and carrying out data type conversion if the source type is inconsistent with the target type; if the source type is consistent with the target type, the data type conversion is not executed;
the byte stream assignment module is used for carrying out byte stream assignment on the variable expression in the current universal data interface;
the system comprises a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter conversion module, a data type conversion module and a byte stream assignment module, wherein a universal data interface is adopted between every two modules to realize information transmission.
Compared with the prior art, the invention has the advantages that:
(1) the invention has strong universality. The method is suitable for all types of currently known satellite-borne telemetry protocols;
(2) the invention has high reliability. The method can carry out logical reasoning detection on the correctness of the telemetry protocol and generate high-reliability codes meeting the requirement of the reliability and the safety of the satellite-borne software, thereby ensuring the reliability of the telemetry package codes;
(3) the invention has easy use. The method can automatically complete the whole process of code generation without manual intervention by only establishing mapping between the minimum amount of necessary code information and the telemetering protocol by encoding personnel;
(4) the invention has high efficiency. The method can greatly improve the coding efficiency, the traditional telemetering package code of 2000 lines needs 4 persons/day on average by manual development, and the method only needs 2 persons/hour.
Drawings
FIG. 1 is a flow chart of automatic generation of a protocol suite code on board a satellite.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
As shown in fig. 1, an automatic generation method of a satellite borne protocol package code includes the following steps:
and establishing a mapping information table of the telemetry protocol parameters and the software variables, wherein the mapping information table comprises the respective coding information of the satellite borne protocol parameters and the software variables and the mapping relation between the satellite borne protocol parameters and the software variables. The encoding information of the satellite-borne protocol parameters is contained in a telemetry protocol document and can be directly read, and the specific contents comprise: code number, name, type, location, and transformation. The data source corresponding to each satellite borne protocol parameter is a certain software variable, namely the satellite borne protocol parameters correspond to the software variables one by one, and the coding information of the software variables comprises: name, type, bit offset, bit length, value mapping and transformation.
Any satellite-borne protocol parameter in the mapping information table is read, a code automatic generation process is entered, the code automatic generation process is abstracted into 6 independent steps, and a universal data interface is adopted between every two steps to realize information transmission. Depending on the specific coding information of the on-board protocol parameters and software variables, certain steps may be skipped. The 6 steps are sequentially as follows: parameter protocol analysis, star-end data extraction, star-end data mapping, protocol parameter transformation, data type conversion and byte stream assignment.
The definition of the universal data interface is as follows: { variable expression, data type };
the variable expression is a software code segment and represents an expression of a data source in the current step, and the data type is a data type of a calculation result of the variable expression, such as symbolic four-byte integer, unsigned two-byte integer, double-precision floating point number and the like. Since the data interaction format between each step is through a universal data interface, the omission of individual steps does not affect the transfer of information.
And after the 6 steps are sequentially executed, extracting the next satellite-borne protocol parameter in the mapping information table, and repeatedly executing the 6 steps to finish the automatic generation of the telemetry protocol package code. The whole flow is shown in figure 1.
Specific technical schemes are introduced for 6 independent steps as follows:
analyzing a parameter protocol:
the parameter protocol analysis is to perform protocol configuration correctness check and risk analysis aiming at the mapping information table. The inspection content includes two main aspects: the integrity and the matching of the protocol can be expanded according to the specific application requirements. Checking whether the information of necessary attributes (name, type and position of protocol parameters, name, type, bit offset, bit length and the like of software variables) in the mapping information table is complete or not by the protocol integrity; the protocol matching checks whether the matching relation between the attributes is reasonable, for example, if the type of the protocol parameter is a floating point type, the data length of the position description should not be lower than 9 bits. And after the protocol integrity and the protocol matching are checked according to the application requirements, if an error exists, the user is indicated to perfect the mapping information table before the code is generated.
Extracting star-end data:
and the star-end data extraction carries out primary data transformation on the original data stored by the software variables according to the specific package condition. The corresponding processing is mainly carried out when the following situations are met:
1) a software variable's bit length cannot be divided by 8, or a bit offset is a value other than 0. And generating a code for extracting the effective bit and assigning the effective bit to the temporary variable. The extraction of the valid bits is done using the "shift" and "bit operations of the target language. Then, updating a universal data interface, wherein the variable expression is a temporary variable name, and the data type is the type of the software variable;
2) the name of a software variable is identified as a function, macro, or expression. Code is generated that assigns the result of the computation of the function, macro, or expression to a temporary variable. And identifying the function, the macro or the expression by adopting a standard regular expression matching method. Then, updating a universal data interface, wherein the variable expression is a temporary variable name, and the data type is the type of the software variable;
3) the transformation of the software variables is not space-time. And generating a calculation expression of the software variable according to the transformation key words and the configuration parameters, and assigning the calculation result of the expression to a code of the temporary variable. Then, the universal data interface is updated, wherein the variable expression is the temporary variable name, and the data type is determined by the specific transformation. The transformation is defined according to specific application requirements, for example, a transformation keyword is defined as 'ADD', the configuration parameter is 10, a code is generated for assigning a result to a temporary variable after a software variable is added with 10, and the data type of the universal data interface follows the type of the software variable.
4) If not. And directly generating a universal data interface, wherein the variable expression is the name of the software variable, and the data type is the type of the software variable.
Mapping the star-end data:
the star-side data mapping depends on the value mapping attributes in the software variable information. If the value mapping attribute is null, skipping the star-end data mapping; otherwise, generating codes for assigning different mapping numerical values to temporary variables according to the mapping rules. And then updating the universal data interface, wherein the variable expression is a temporary variable name, the data type is determined according to the mapping value, if the mapping value is a floating point number, the data type is a floating point type, and otherwise, the data type is an integer type.
Protocol parameter transformation:
the protocol parameter transformation depends on the transformation properties in the on-board protocol parameters. If the conversion attribute is null, skipping the protocol parameter conversion; otherwise, generating a reverse calculation expression of the software variable according to the transformation key words and the configuration parameters, and assigning the calculation result of the reverse calculation expression to the code of the temporary variable. Then, the universal data interface is updated, wherein the variable expression is the temporary variable name, and the data type is determined by the specific transformation. The transformation is defined according to specific application requirements, for example, a transformation keyword is defined as 'ADD', the configuration parameter is 10, a reverse calculation code is generated for assigning a result to a temporary variable after a software variable is subtracted by 10, and the data type of the universal data interface follows the type of the software variable.
Data type conversion:
the data type conversion depends on the data type of the current universal data interface and the type of the on-board protocol parameters. And recording the data type of the current universal data interface as a source type and the type of the satellite-borne protocol parameter as a target type. If the source type is consistent with the target type, skipping data type conversion; otherwise, adding a data type conversion code of the target language for the variable expression of the current universal data interface, then updating the variable expression of the universal data interface by using the code, and updating the type of the universal data interface into the target type. For example, the target language is c language, and the variable expression of the current universal data interface is: x + y, type int; if the type of the satellite-borne protocol parameter is float, the variable expression of the universal data interface is as follows after data type conversion: float (x + y), type float. Wherein int represents signed integer, float represents single precision floating point number, and float (x + y) is a code statement for converting int type to float type in c language.
Assigning a byte stream:
and assigning the byte stream to generate a code written into the target position of the satellite borne protocol parameter, wherein the written content is intermediate data formed by the steps, namely a variable expression in the current universal data interface. The method is that the variable expression in the current universal data interface is assigned to a temporary variable, then the variable value is extracted byte by byte, and the variable value is sequentially written into the target byte position specified by the satellite borne protocol parameters.
A system of a satellite-borne protocol package code automatic generation method comprises a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter transformation module, a data type conversion module and a byte stream assignment module;
any satellite-borne protocol parameter in the mapping information table is extracted, and the satellite-borne protocol parameter sequentially enters a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter conversion module, a data type conversion module and a byte stream assignment module;
the parameter protocol analysis module carries out parameter protocol analysis on the mapping information table;
the satellite-side data extraction module is used for extracting satellite-side data of the satellite-borne protocol parameters;
the star-end data mapping module judges the value mapping attribute in the coding information of the software variable: if the value mapping attribute is not null, carrying out star-end data mapping; if the value mapping attribute is null, the star-end data mapping is not executed;
the protocol parameter conversion module is used for judging the conversion attribute in the encoding information of the satellite-borne protocol parameters: if the conversion attribute is not null, carrying out protocol parameter conversion; if the conversion attribute is null, the protocol parameter conversion is not executed;
the data type conversion module is used for comparing the source type with the target type and carrying out data type conversion if the source type is inconsistent with the target type; if the source type is consistent with the target type, the data type conversion is not executed;
the byte stream assignment module is used for carrying out byte stream assignment on the variable expression in the current universal data interface;
the system comprises a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter conversion module, a data type conversion module and a byte stream assignment module, wherein a universal data interface is adopted between every two modules to realize information transmission.
Example (b):
supposing that space flight control system software is provided, the mapping relation table of the telemetering protocol is as follows:
Figure BDA0003651861040000091
Figure BDA0003651861040000101
then, according to the method for automatically generating the package code of the satellite borne protocol, the corresponding package code is automatically generated as follows:
1. analyzing a parameter protocol, and checking that no missing information exists in a mapping relation table;
2. and extracting star end data, judging based on a regular expression, and taking the software variable name angle as a variable. The bit offset of the software variable is 0, the bit length 64 can be divided by 8, but the conversion is not null, so the current situation is in accordance with the situation 3 in the step 4.2), and a code for performing radian angle conversion on the angle is generated, namely the angle is multiplied by 57.3 and then assigned to a temporary variable a, the variable expression for updating the universal data interface is a, and the type is a double-precision floating point type;
3. mapping star-end data, judging that the value mapping of the software variable in the mapping relation table has no content, and skipping the current step;
4. and protocol parameter transformation, namely judging the transformation of the satellite-borne protocol parameters in the mapping relation table into multiplication (factor 0.0001), and generating corresponding reverse calculation expression codes, namely dividing the variable expression of the current universal data interface by 0.0001 and then assigning the codes to temporary variables a. Updating a general data interface, wherein a variable expression is a, and the type is a double-precision floating point type;
5. converting the data type, wherein the data type in the current universal data interface is a double-precision floating point type, and the type of the satellite-borne protocol parameter in the mapping relation table is an unsigned integer, so that a type conversion code is generated, namely a variable expression of the current universal data interface is converted into a code expression of the unsigned integer, the variable expression of the universal data interface is updated by using the expression, and the data type of the universal data interface is the unsigned integer;
6. and (3) assigning a byte stream, writing the data subjected to the steps into 3 rd to 6 th bytes of a satellite borne protocol data packet according to the position information (3-6) of the satellite borne protocol parameters, and generating a corresponding write-in code by using a target language, namely completing automatic code generation of the current satellite borne protocol.
The present invention has not been described in detail, partly as is known to the person skilled in the art.

Claims (10)

1. A method for automatically generating a code of a satellite-borne protocol package is characterized by comprising the following steps:
establishing a mapping information table of the telemetry protocol parameters and the software variables; the mapping information table includes: encoding information of the satellite borne protocol parameters and the software variables respectively, and mapping relation between the satellite borne protocol parameters and the software variables;
any satellite-borne protocol parameter in the mapping information table is extracted, and codes are automatically generated; the code automatic generation comprises:
performing parameter protocol analysis and star-end data extraction;
judging the value mapping attribute in the coding information of the software variable: if the value mapping attribute is not null, carrying out star-end data mapping; if the value mapping attribute is null, the star-end data mapping is not executed;
judging the transformation attribute in the encoding information of the satellite-borne protocol parameters: if the conversion attribute is not null, performing protocol parameter conversion; if the conversion attribute is null, the protocol parameter conversion is not executed;
comparing the source type with the target type, and if the source type is inconsistent with the target type, performing data type conversion; if the source type is consistent with the target type, the data type conversion is not executed;
carrying out assignment on the byte stream;
and returning and extracting the next satellite borne protocol parameter in the mapping information table, and automatically generating the code.
2. The method according to claim 1, wherein the encoded information of the on-board protocol package is contained in a telemetry protocol document and can be directly read, and the encoded information of the on-board protocol package comprises: code, name, type, location and transformation;
the satellite-borne protocol parameters correspond to the software variables one by one, and the coding information of the software variables comprises: name, type, bit offset, bit length, value mapping and transformation.
3. The method for automatically generating the satellite-borne protocol package code according to claim 2, wherein the parameter protocol analysis, the satellite-side data extraction, the satellite-side data mapping, the protocol parameter transformation, the data type conversion and the byte stream assignment are performed, and a universal data interface is adopted between every two steps to realize information transmission;
the definition of the universal data interface is: { variable expression, data type };
the variable expression is a software code segment and 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.
4. The method of claim 3, wherein the parametric protocol analysis comprises:
carrying out protocol configuration correctness check and risk analysis on the mapping information table, wherein the check content comprises protocol integrity and protocol matching;
wherein, the protocol integrity checks whether the necessary attribute information in the mapping information table is complete; checking whether the matching relation between the attributes in the mapping information table is reasonable or not according to the protocol matching performance;
and after the protocol integrity and the protocol matching are checked according to the application requirements, if an error exists, a prompt is sent before the code is generated, and a mapping information table is perfected.
5. The method of claim 3, wherein the extracting of the satellite-side data comprises:
according to the specific satellite-borne protocol package condition, primary data transformation is carried out on original data stored in software variables, and corresponding processing is carried out when the following conditions are met:
when the bit length of the software variable cannot be divided by 8 or the bit offset is a non-0 value, generating a code for extracting effective bits and assigning the codes to temporary variables, wherein the extraction of the effective bits is completed by using the ' shift ' and ' bit operation of a target language; updating a universal data interface, wherein the variable expression is a 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, a macro or an expression, generating a code for assigning the calculation result of the function, the macro or the expression to a temporary variable, and identifying the function, the macro or the expression by adopting a regular expression matching method; updating a universal data interface, wherein a variable expression is a temporary variable name, and a data type is a type of a software variable;
when the conversion of the software variable is not empty, generating a calculation expression of the software variable according to the conversion key words and the configuration parameters, and assigning the calculation result of the expression to a code of a temporary variable; updating a universal data interface, wherein a variable expression is a temporary variable name, and the data type is determined by specific transformation; the transformation is defined according to specific application requirements;
and if the conditions are not the above conditions, directly generating a universal data interface, wherein the variable expression is the name of the software variable, and the data type is the type of the software variable.
6. The method according to claim 3, wherein the satellite-side data mapping comprises:
if the value mapping attribute is not null, generating a code for assigning different mapping numerical values to the temporary variable according to the mapping rule; and updating the universal data interface, wherein the variable expression is a temporary variable name, the data type is determined according to the mapping value, if the mapping value is a floating point number, the data type is a floating point type, and otherwise, the data type is an integer type.
7. The method of claim 3, wherein the protocol parameter transformation comprises:
if the transformation attribute is not null, generating a reverse calculation expression of the software variable according to the transformation key words and the configuration parameters, and assigning the calculation result of the reverse calculation expression to a code of the temporary variable; updating a universal data interface, wherein a variable expression is a temporary variable name, and the data type is determined by specific transformation; the transformations are defined according to the specific application requirements.
8. The method of claim 3, wherein the data type conversion comprises:
the source type is the data type of the current universal data interface, and the target type is the type of the satellite-borne protocol parameters;
and if the source type is inconsistent with the target type, adding a data type conversion code of the target language to the variable expression of the current universal data interface, then updating the variable expression of the universal data interface by using the code, and updating the type of the universal data interface to be the target type.
9. The method according to claim 3, wherein the assigning of the byte stream comprises:
and assigning the variable expression in the current universal data interface to a temporary variable, extracting the variable value byte by byte, and sequentially writing the variable value into the target byte position specified by the satellite borne protocol parameters.
10. The system for the automatic generation method of the satellite-borne protocol package code according to any one of claims 1 to 9, comprising a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter transformation module, a data type conversion module and a byte stream assignment module;
any satellite-borne protocol parameter in the mapping information table is extracted, and the satellite-borne protocol parameter sequentially enters a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter conversion module, a data type conversion module and a byte stream assignment module;
the parameter protocol analysis module carries out parameter protocol analysis on the mapping information table;
the satellite-side data extraction module is used for extracting satellite-side data of the satellite-borne protocol parameters;
the star-end data mapping module judges the value mapping attribute in the coding information of the software variable: if the value mapping attribute is not null, carrying out star-end data mapping; if the value mapping attribute is null, the star-end data mapping is not executed;
the protocol parameter conversion module is used for judging the conversion attribute in the encoding information of the satellite-borne protocol parameters: if the conversion attribute is not null, carrying out protocol parameter conversion; if the conversion attribute is null, the protocol parameter conversion is not executed;
the data type conversion module is used for comparing the source type with the target type and converting the data type if the source type is inconsistent with the target type; if the source type is consistent with the target type, the data type conversion is not executed;
the byte stream assignment module is used for carrying out byte stream assignment on the variable expression in the current universal data interface;
the system comprises a parameter protocol analysis module, a satellite-side data extraction module, a satellite-side data mapping module, a protocol parameter conversion module, a data type conversion module and a byte stream assignment module, wherein a universal data interface is adopted between every two modules to realize information transmission.
CN202210554603.0A 2022-05-19 2022-05-19 Automatic generation method and system for satellite-borne protocol package codes Pending CN115061676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210554603.0A CN115061676A (en) 2022-05-19 2022-05-19 Automatic generation method and system for satellite-borne protocol package codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210554603.0A CN115061676A (en) 2022-05-19 2022-05-19 Automatic generation method and system for satellite-borne protocol package codes

Publications (1)

Publication Number Publication Date
CN115061676A true CN115061676A (en) 2022-09-16

Family

ID=83198257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210554603.0A Pending CN115061676A (en) 2022-05-19 2022-05-19 Automatic generation method and system for satellite-borne protocol package codes

Country Status (1)

Country Link
CN (1) CN115061676A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117289915A (en) * 2023-11-24 2023-12-26 北京控制工程研究所 Configuration table-based satellite-borne software code generation method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117289915A (en) * 2023-11-24 2023-12-26 北京控制工程研究所 Configuration table-based satellite-borne software code generation method and device
CN117289915B (en) * 2023-11-24 2024-02-02 北京控制工程研究所 Configuration table-based satellite-borne software code generation method and device

Similar Documents

Publication Publication Date Title
US9390084B2 (en) Natural language parsers to normalize addresses for geocoding
JP3368883B2 (en) Data compression device, database system, data communication system, data compression method, storage medium, and program transmission device
CN110109896B (en) UAV flight parameter intelligent reduction method
CN112036162B (en) Text error correction adaptation method and device, electronic equipment and storage medium
CN110191021B (en) Protocol testing method and device, electronic equipment and storage medium
CN111814962A (en) Method and device for acquiring parameters of recognition model, electronic equipment and storage medium
CN115061676A (en) Automatic generation method and system for satellite-borne protocol package codes
CN109408050B (en) Code generation method and device for equipment application program interface of railway vehicle
CN109165209B (en) Data verification method, device, equipment and medium for object types in database
CN113778449A (en) Avionics interface data adaptation conversion system
CN111708673A (en) Log data compression method, device, equipment and storage medium
CN111881164B (en) Data processing method based on edge computing and path analysis and big data cloud platform
CN115359799A (en) Speech recognition method, training method, device, electronic equipment and storage medium
CN111724110A (en) Address information processing method and device, computer equipment and storage medium
CN108876963A (en) A kind of storage method, device, microprocessor and the storage medium of automobile log
CN115328753A (en) Fault prediction method and device, electronic equipment and storage medium
CN114861666A (en) Entity classification model training method and device and computer readable storage medium
CN112784838A (en) Hamming OCR recognition method based on locality sensitive hashing network
CN112416354A (en) Code readability assessment method based on multi-dimensional features and hybrid neural network
JP4101712B2 (en) Electronic drawing storage method, electronic drawing storage system, and drawing data providing system
CN112488200A (en) Logistics address feature extraction method, system, equipment and storage medium
CN111831288A (en) Method and system for automatically generating Thrift IDL data structure and automatic transfer function
US6675373B1 (en) Automatic generation of balancing logic for data conversion
CN114638558B (en) Data set classification method for operation accident analysis of comprehensive energy system
CN116110056B (en) Information extraction method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination