A method and device for improving the efficiency of spacecraft flight status recognition

By converting the spacecraft flight status criterion mode to C/C++ language and generating a dynamic link library, the problem of low spacecraft flight status recognition efficiency is solved, and efficient and flexible flight status recognition is achieved, suitable for large constellation management.

CN118885179BActive Publication Date: 2024-12-20NINGBO TIANXUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411354618.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-20
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

In existing spacecraft measurement and control missions, the flight status recognition efficiency is low, making it difficult to meet the needs of real-time interpretation of high-frequency telemetry data and real-time identification of high-throughput data, resulting in increased CPU load and low frequent call efficiency.

Method used

By analyzing the flight status criterion pattern of the spacecraft, creating description rules, establishing an associated relationship flight status criterion table and criterion rule function description table, converting it into header files and source programs written in C/C++ language, compiling links to generate dynamic Link library files for state recognition software to call.

Benefits of technology

It significantly improves processing efficiency, reduces hardware resource requirements, improves identification speed and efficiency, and is suitable for large constellation management to automatically identify spacecraft flight status, with flexibility, reliability and maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885179B_ABST
    Figure CN118885179B_ABST
Patent Text Reader

Abstract

The invention belongs to the field of spacecraft measurement and control data processing, and relates to a method and device for improving the efficiency of spacecraft flight state recognition. The method comprises: analyzing a flight state criterion mode of a spacecraft, creating a flight state description rule, and establishing a flight state criterion table and a criterion rule function description table with associated relationships according to the description rule; the flight state criterion table comprises a main table, a subtable and a sub-subtable; entering or importing the criterion of the flight state into the flight state criterion table, the criterion condition is written according to the requirements of C / C++ language, supporting logic, arithmetic and relational expressions, and the criterion rule and function body of complex logic processing are written into the criterion rule function description table; reading the information of the flight state criterion table and the criterion rule function description table, and converting them into a header file and a source program written in C / C++ language; after syntax verification, compiling and linking to generate a dynamic link library file; and releasing the dynamic link library file after being tested correctly by an automated testing tool.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of spacecraft measurement and control data processing, and in particular relates to a method and a device for improving the efficiency of spacecraft flight status recognition. Background Art

[0002] In the existing spacecraft measurement and control tasks, the judgment of the flight status of the spacecraft is very critical. There are two common practices. One is to use the flight status criterion as a configuration file. During recognition, the criterion expression string is parsed to parse out the parameter code, bracket level, various arithmetic or logical or judgment symbols, criterion value, etc., and then the parameter code is used as the keyword to find the result value in the data structure corresponding to the parameter code through Hash or other methods. The current value of each parameter is passed into the criterion expression, and the expression is judged to be true according to the bracket level and arithmetic operations, logical operations, conditional judgments, expected criterion values, etc. If it is true, it is considered that the flight state corresponding to the current criterion occurs. Another method is to define the criterion expression and recognition logic through a scripting language. During real-time processing, the script is executed by calling the script interpreter each time to judge whether each criterion expression is satisfied. Among them, the efficiency of directly parsing the criterion expression will be higher than that of using a scripting language, but both methods have the problem of increasing CPU load and low efficiency due to frequent calls. It is difficult to meet the needs of real-time interpretation of high-frequency telemetry data, especially the needs of real-time identification of spacecraft flight conditions through high-throughput data. Summary of the invention

[0003] The purpose of the present invention is to overcome the defects of the prior art and propose a method for improving the efficiency of spacecraft flight status recognition. The present invention also discloses a device for improving the efficiency of spacecraft flight status recognition.

[0004] In order to achieve the above object, the present invention proposes a method for improving the efficiency of spacecraft flight status recognition, comprising:

[0005] Analyze the flight state criterion mode of the spacecraft, create a flight state description rule, and establish a flight state criterion table and a criterion rule function description table with an associated relationship according to the description rule; the flight state criterion table includes a main table, a sub-table and a sub-sub-table;

[0006] The flight status criteria are entered or imported into the flight status criteria table. The criteria conditions are written in accordance with the C / C++ language requirements, supporting various logical expressions, arithmetic expressions and relational expressions, and the criteria rules and function bodies of complex logical processing are written into the criteria rule function description table;

[0007] Read the information of the flight status criterion table and the criterion rule function description table, and convert them into header files and source programs written in C / C++ language;

[0008] After passing the syntax verification, compile and link to generate a dynamic link library file;

[0009] After being tested correctly by the automated testing tool, the dynamic link library file is released.

[0010] Preferably, the description rules include:

[0011] Define a namespace to store the value information of each parameter, including storing the corresponding value information for each parameter and storing multiple trend change judgment data for the same parameter;

[0012] A criterion rule function is defined, including a function name, a passed parameter, and a return type; the criterion rule function supports a variety of judgment parameter change trends, including increasing, decreasing, periodic changes, and regular changes triggered by conditions within a required time period.

[0013] Preferably, the corresponding value information is stored for each parameter, including: storing parameter serial number, parameter code, type of result value, over-limit flag, source code valid flag, length of result value, storing result value according to the type of result value, and data time.

[0014] Preferably, the flight status criterion mode of the spacecraft includes: one or more of real-time result criterion, historical result criterion and conditional result criterion; wherein,

[0015] For the real-time result criterion, it is determined whether the real-time parameters meet the requirement that the criterion rule expression is true within the required duration or number of consecutive frames. The real-time parameters include: telemetry parameters, command code in the remote control command sending information, flight phase identification in the global shared information, feature point time and flight relative time;

[0016] For historical result judgment, determine whether the change characteristics of telemetry parameters meet the flight status change characteristics within the required historical time period;

[0017] For the conditional result criterion, determine whether the triggering condition will trigger the telemetry parameter value to be updated to a predetermined value or value range.

[0018] Preferably, the code of the telemetry parameter is consistent with the parameter code in the telemetry parameter outline; the name of the flight state, remote control command code, flight phase identification, characteristic point time and flight relative time are consistent with the documents related to the aerospace measurement and control application software system.

[0019] Preferably, the main table of the flight status criterion table is used to describe brief information of the flight status, including: spacecraft identification, flight status identification, spacecraft name, flight status name, normal or abnormal identification, abnormal treatment plan, real-time / delay ratio identification mark, data source used by the flight status criterion, flight status related subsystems and importance of the flight status; wherein the flight status identification is a positive integer that increases from 1;

[0020] Subtable, used to describe the relationship between each set of criteria that can independently determine the flight state. Each flight state includes one or more sets of criteria, and each set of criteria is assigned a criterion group number. The subtable field information includes: spacecraft identification, flight state identification, criterion group number, expressions between criteria, disposal plan when abnormal state occurs, script for correcting state occurrence time, preconditions for flight state judgment, postconditions after state judgment, and data source;

[0021] Sub-sub-table, used to describe the detailed criterion information of each criterion group of the flight state; the sub-sub-table field information includes: spacecraft ID, flight state ID, criterion group serial number, specific criterion ID, specific criterion expression, data source, parameter historical change trend and parameter current change trend;

[0022] Each flight status of each spacecraft is identified by a unique joint primary key of the spacecraft ID and the flight status ID. The sub-subtable is associated with the sub-table through the spacecraft ID, flight status ID and criterion group number, and the sub-table is associated with the main table through the spacecraft ID and flight status ID.

[0023] Preferably, the criterion rule function description table is used to describe a general or special function criterion, and the table field information includes: general identification, spacecraft identification, function name, function declaration, function description, function body, flight status identification, criterion group serial number and specific criterion identification;

[0024] If it is a multi-task general function, the spacecraft ID, flight status ID, criterion group number and specific criterion ID are empty;

[0025] If it is a single-task general function, the flight status identifier, criterion group number and specific criterion identifier are empty.

[0026] Preferably, the flight status criterion table is read and converted into a header file and a source program written in C / C++ language; including:

[0027] Step S0) reading the main table, sub-table and sub-sub-table of the flight status criterion table, converting the flight status criterion information into various expressions expressed in C / C++ language, and generating a header file;

[0028] Step S1) reading the telemetry parameter attribute information of the selected spacecraft identification, as well as the mission sharing information and the remote control command sending information interface from the configuration information management database, storing them in corresponding data structures respectively, and establishing a storage index relationship of the parameter code;

[0029] Step S2) According to C / C++ language rules, the first line adds the included header file;

[0030] Step S3) Read the flight status criterion information of the designated spacecraft ID from the database in ascending order of the flight status ID:

[0031] Create an index information IndexID for each criterion group under each flight status identification:

[0032] ;

[0033] in, Indicates the flight status indicator. Indicates the maximum number of criterion groups for flight status, Indicates the criterion group number;

[0034] Match the parameter codes, flight phase identifiers, and characteristic point moment identifiers in all criterion expressions under each set of criteria with the parameter codes in the parameter attribute information, and the flight phase identifiers and characteristic point moment identifiers in the task sharing information. If they are completely matched, replace them with member variables in the corresponding data structure, and keep other characters or function names in the criterion expressions;

[0035] Step S4) in a switch manner, the index information IndexID of each set of criteria group numbers under each flight status identification is used as the condition value of the case branch, the expression converted in step S3) is used as the statement to be executed to meet the case branch condition, and a "break" statement is added;

[0036] Step S5) When the flight status criterion information conversion is completed, go to step S6), otherwise, go to step S3);

[0037] Step S6) After adding the "default" statement, the compound statement is aligned and indented according to the C / C++ language programming style, thereby generating a source program file and closing it.

[0038] Preferably, the information of the criterion rule function description table is read and converted into a header file and a source program written in C / C++ language; including:

[0039] Step T0) reading the criterion rule function description table, writing the information of the function declaration field recorded in the criterion rule function description table line by line until the writing is completed, and generating a header file;

[0040] Step T1) According to the C / C++ language rules, add the included header file in the first line;

[0041] Step T2) reads the judgment rule function description table, writes the contents of the function name, function declaration, function description, and function body fields in sequence, and generates a source program.

[0042] On the other hand, the present invention also discloses a device for improving the efficiency of identifying the flight status of a spacecraft, comprising:

[0043] A rule establishment module is used to analyze the flight state criterion mode of the spacecraft, create a flight state description rule, and establish a flight state criterion table and a criterion rule function description table with an associated relationship according to the description rule; the flight state criterion table includes a main table, a sub-table and a sub-sub-table;

[0044] The input module is used to input or import the flight status criteria into the flight status criteria table. The criteria conditions are written in accordance with the C / C++ language requirements, supporting various logical expressions, arithmetic expressions and relational expressions, and writing the criteria rules and function bodies of complex logical processing into the criteria rule function description table;

[0045] A code conversion module is used to read the information of the flight status criterion table and the criterion rule function description table and convert them into header files and source programs written in C / C++ language;

[0046] Compile and generate module, used to compile and link to generate dynamic link library files after passing syntax verification;

[0047] The publishing module is used to publish the dynamic link library file after the automated testing tool has tested it correctly. The compiling and generating module is used to compile and link the dynamic link library file after the syntax verification has passed.

[0048] The release module is used to release the dynamic link library file after it has been tested correctly by the automated testing tool.

[0049] Compared with the prior art, the advantages of the present invention are:

[0050] 1. Significantly improve processing efficiency: By converting the flight status criterion expression into C / C++ statements, and designing the expressions with complex logical processing into function expressions, compiling and linking to generate dynamic libraries for the state recognition software to call, data processing efficiency can be significantly improved. Tests show that the processing efficiency is improved by an order of magnitude. Under the same processing requirements, the demand for hardware resources is reduced, which is especially suitable for automatic identification of spacecraft flight status in large constellation management.

[0051] 2. Flexibility and scalability: It supports various logical expressions, relational expressions, arithmetic expressions, assignment operations and other symbols in C / C++ language. The complex processing logic of analyzing various historical results and conditional results can be flexibly converted into function expressions. The judgment criteria of various flight states can be flexibly expanded through configuration information. This method can be applied to the identification of various normal flight states of spacecraft and the diagnosis of fault states.

[0052] 3. Reliability and accuracy: The standardized C / C++ language description and compilation process can detect human errors in expressions in advance, improving the accuracy and consistency of flight status recognition.

[0053] 4. Maintainability and operability: The dynamic library is easy to manage, which simplifies system maintenance. It is easy to operate and easy to integrate into the existing measurement and control application software system. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a flow chart of a method for improving the efficiency of identifying the flight status of a spacecraft according to the present invention;

[0055] Figure 2 It is the name of a commonly used criterion rule function;

[0056] Figure 3 It is the judgment rule function description table flightstatusfunc structure;

[0057] Figure 4 It is the flight status judgment main table flightstatus_m structure;

[0058] Figure 5 It is the flight status judgment subtable flightstatus_c structure;

[0059] Figure 6 It is the flight status criterion sub-subtable flightstatus_cc structure. DETAILED DESCRIPTION

[0060] The present invention provides a method and device for quickly improving the speed of identifying the flight status of a spacecraft. The main processing method is: firstly, various modes of flight status criteria are analyzed, and description rules of the criteria are formulated. Most flight status criteria can describe whether the logical expression, arithmetic expression or relational expression of real-time parameters of consecutive frames are true or not through C / C++ syntax; a small number of flight statuses need to be combined with the change trend of parameters over a period of time in the past, or the parameter value changes caused by triggering conditions as criteria. Create a main table, sub-table and sub-sub-table to describe the flight status criteria, respectively describe the brief information of the flight status, the relationship information of the flight status group criteria, and the detailed criterion information of each group of the flight status. Create a criterion rule function description table to realize the processing of complex logical judgments. The flight status criteria are imported or entered into the database, and then the flight status criteria related information is read through auxiliary tools, and the telemetry parameter code without double quotes, flight phase, feature point time, flight relative time, instruction code, etc. are converted into corresponding parameter storage index information, and converted into C / C++ header files and source programs according to the coding method of C / C++ language. Read the judgment rule function table and generate the header file and source program for judgment rule processing. Compile and link the header file and source program generated twice into a dynamic library for the spacecraft flight status identification software to call. The parameter value is directly obtained from the storage index information, and the flight status judgment condition is converted into the execution of C / C++ statements, thereby significantly improving the speed and efficiency of flight status identification. This method is different from the processing method using configuration files or scripting languages, and has good scalability for complex processing logic. Tests show that the method and device of the present invention increase the speed of judging the flight status of spacecraft by an order of magnitude, and have high flexibility, reliability and maintainability. It can be used for automatic monitoring of key states of spacecraft, automatic monitoring and early warning of satellite flight conditions for large constellation management.

[0061] The main principle of the present invention is: first, formulate the description rules of the criterion expression. Analyze the characteristics of the flight status identification criterion, and divide the criterion conditions into three categories: real-time results (for example, real-time calculation results of telemetry parameters), conditional results (for example, expected results of telemetry parameters after remote control commands), and historical results (for example, the change trend of one or some telemetry parameters in the historical period). Among them, the judgment of conditional results and historical trend changes may involve complex processing judgments. Through analysis and induction, several types of highly versatile functions are designed, and the function code is configured through static text. Through the logical operators, arithmetic operators, relational operators, etc. of the C / C++ language, the real-time results, as well as the historical results, the trend judgment function expressions of the conditional results, etc. are comprehensively described as the criterion of the flight status.

[0062] Create a database to store flight status criteria. It includes: flight status criterion master table flightstatus_m that describes brief flight status information, subtable flightstatus_c that contains flight status group criterion relationship information, subtable flightstatus_cc that contains detailed criterion information for each flight status group, and criterion rule function description table flightstatusfunc that describes complex processing logic. Import or enter criterion information into the database.

[0063] Conversion of criterion expressions: Convert the criterion expressions in the database into source code written in C / C++. Design an automatic conversion tool to convert the flight status discriminant expression into source code written in C / C++. Through the conversion tool, obtain the storage index information of parameter codes, flight phases, feature point moments, flight relative time, instruction codes, etc. without double quotes in the expression, and retain other characters and function names. Compile and link the automatically generated C / C++ coding source code to generate a dynamic library for direct call by the spacecraft flight status recognition software.

[0064] After adding, deleting, modifying or batch importing flight status criteria, the flight status recognition dynamic library can be automatically updated with one-click operation. This method can efficiently convert the criteria rules into a dynamic library and improve the efficiency of identifying and judging flight status by one order of magnitude.

[0065] The technical solution of the present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0066] Example 1

[0067] like Figure 1 As shown, embodiment 1 of the present invention proposes a method for improving the efficiency of spacecraft flight status recognition, the main steps of which are:

[0068] 1. Flight status criteria configuration management phase

[0069] 1.1 Formulate description rules for flight status criteria

[0070] Flight status criteria generally use three types of results: real-time results, historical results, and conditional results. Most criterion expressions use real-time results. Criterion expressions are mainly described by telemetry parameter codes, feature point moments, flight relative time, flight phase identifiers, etc., and support logical expressions, relational expressions, arithmetic expressions, etc. Some criteria require analysis of historical results, and a small number of criteria require the use of conditional results. Criteria that use historical results and conditional results generally have complex processing logic and require analysis and induction to design several or dozens of general functions. Define the naming rules for function names. The passed parameters can use parameter codes, instruction codes, previous relative durations, subsequent relative durations, absolute time values, and parameter values ​​that change or change relatively, etc.

[0071] The telemetry parameter codes passed in by ordinary expressions and function calls are consistent with the parameter codes in the telemetry parameter outline, and the instruction codes are consistent with the instruction codes in the instruction properties used by the measurement and control software. This makes it easy to view and directly import the flight status criterion file. Characteristic point moments, relative flight time, flight phase identifiers, etc., use the character identifiers specified by the interface. In order to represent the changing trend of parameters during a historical time interval or under certain conditions, it is necessary to design a function to determine the law of parameter changes. The function name starts with Func_ to reflect the trend of parameter changes as much as possible. For example, the function Func_isParaIncreasing is used to determine whether the parameter ParaCode is an increasing trend. For commonly used function names, see Figure 2 Commonly used judgment rule function names. Other symbols use the logical expression, relational expression, arithmetic expression, assignment operation and other symbols supported by C / C++ language.

[0072] 1.2 Create a database that describes the flight status criteria, and describe the flight status criteria through the criterion rule function description table flightstatusfunc and the associated flight status criterion main table flightstatus_m, flight status criterion subtable flightstatus_c and flight status criterion sub-subtable flightstatus_cc. Each flight status of each spacecraft is identified by a unique joint primary key of the spacecraft identifier SPACECRAFTID and the flight status identifier FLIGHTSTATUS_ID. The subtable flightstatus_c is associated with the main table flightstatus_m through the spacecraft identifier SPACECRAFTID and FLIGHTSTATUS_ID. The sub-subtable flightstatus_cc is associated with the subtable flightstatus_c through the spacecraft identifier SPACECRAFTID, the flight status identifier FLIGHTSTATUS_ID, and the criterion group serial number GROUP_ID.

[0073] Create a criterion rule function description table flightstatusfunc to describe the criteria of complex processing logic. The fields of the flightstatusfunc table include: universal identifier UNIVERSALID, spacecraft identifier SPACECRAFTID, function name FUNCTIONNAME, function declaration FUNCTIONDECLARE, function description FLIGHTSTATUSFUNC, function body FUNCTIONDEFFILENAME, flight status identifier FLIGHTSTATUS_ID, criterion group number GROUP_ID and specific criterion identifier CRIT_ID, etc. If it is a multi-task universal function, the spacecraft identifier SPACECRAFTID, flight status identifier FLIGHTSTATUS_ID, criterion group number GROUP_ID, and specific criterion identifier CRIT_ID are empty; if it is a single-task universal function, the flight status identifier FLIGHTSTATUS_ID, criterion group number GROUP_ID, and specific criterion identifier CRIT_ID are empty. Its table structure is as follows: Figure 3 shown.

[0074] Flight status criterion main table flightstatus_m: mainly describes the brief information of flight status. Including: spacecraft identification SPACECRAFTID, flight status identification FLIGHTSTATUS_ID, spacecraft name SPACECRAFTNAME, flight status name FLIGHTSTATUSNAME, normal or abnormal identification NORORABNOR, abnormal treatment plan, real-time / delay ratio judgment mark REALORDELAY, data source DATASOURCES used by flight status criterion, flight status related subsystem SUBSYSTEM and flight status importance GRADE. The table structure is as follows Figure 4 shown.

[0075] Each flight status can have multiple sets of criteria, each set of criteria can independently determine the flight status, and each set of criteria is assigned a GROUP_ID. The identification of the flight status, whether it is a normal state or an abnormal state, can generally be judged by multiple sets of criteria. When each set of criteria is met, it is considered that the flight status has occurred. The relationship between multiple specific criteria under each set of criteria is described through the flight status criterion subtable flightstatus_c (for example, "1&&2||!3", 1, 2, 3 in the string represent the 1st, 2nd, and 3rd specific criteria respectively, which is consistent with the CRIT_ID value). Each flight status has at most GroupNum groups of criteria (GroupNum is a macro definition, indicating the maximum number of groups, which can be adjusted).

[0076] The flight status criterion subtable flightstatus_c includes: spacecraft identifier SPACECRAFTID, flight status identifier FLIGHTSTATUS_ID, criterion group number GROUP_ID, criterion expression GROUPEXP, disposal plan DISPOSALPLAN when abnormal status occurs, script TIMEALGORITHM for correcting status occurrence time, flight status judgment precondition PRECONDITIONS, postcondition POSTCONDITIONS after status judgment, and data source DATASOURCES, etc. The table structure is as follows Figure 5 As shown:

[0077] Flight status criteria sub-subtable flightstatus_cc: mainly describes the specific parameters and their relationships under each group of flight status criteria, for example, the first criterion of the first group of "main power failure" is "DDDv0005 <= 0.5 &&DDDv007 <=0.5&&DDDf012==1". Each group of specific criteria is identified by the CRIT_ID (integer value, starting from 1) field. Relationships include logical expressions, arithmetic expressions, relational expressions, etc. Parameters mainly use telemetry parameters, and remote control commands, mission scenario identifiers, relative flight time, etc. can also be used. The table field information includes: spacecraft identifier SPACECRAFTID, flight status identifier FLIGHTSTATUS_ID, criterion group sequence number GROUP_ID, specific criterion identifier CRIT_ID, specific criterion expression CRITERIONEXP, data source DATASOURCES, parameter historical change trend PARAHISTTREND, parameter current change trend PARACURTREND, etc. Each specific criterion is assigned a CRIT_ID. Its table structure is as follows: Figure 6 shown.

[0078] 1.3 Manage flight status criteria information. Through the flight status criteria management interface, add, delete, check and modify flight status criteria, and support batch import and export of flight status criteria information.

[0079] 2. Flight status criteria conversion phase

[0080] 2.1 Establish a design parameter storage mechanism in advance and convert the parameter code to the corresponding storage location during initialization. Read telemetry parameter attribute information, task global shared interface configuration, remote control command sending interface configuration information, etc. Each parameter code and result value is stored in the following data structure, as follows:

[0081] typedef struct _ST_PamRslt

[0082] {

[0083] uint16_t usID;

[0084] QString szPamCode;

[0085] uint8_t ucRsltType;

[0086] uint8_t ucOutFlag;

[0087] uint8_t ucAvailFlag;

[0088] sint16_t ssRsltBytes;

[0089] double dRslt;

[0090] uint64_t ulRslt;

[0091] int64_t slRslt;

[0092] double dCyTime;

[0093] QString strCodes;

[0094] }ST_PamRslt;

[0095] #define MSGNUM 10

[0096] typedef struct _ST_PamRslt * ST_PamRsltPTR;

[0097] ST_PamRsltPTR pst_PamRslt[MSGNUM];

[0098] Among them, usID is the parameter serial number, obtained during initialization; ucRsltType is the result type, obtained during initialization; ucOutFlag is the overlimit flag, ucAvailFlag is the source code valid flag, ssRsltBytes is the result value length, dRslt stores the numeric result value, the parameter result type is variable, floating point type and integer types below 4 bytes (including 4 bytes) can be represented by this type, ulRslt, unsigned integers greater than 4 bytes are uniformly represented by 8-byte unsigned integers; slRslt, signed integers greater than 4 bytes are uniformly represented by 8-byte signed integers, and MSGNUM is defined to represent the maximum number of data sources. strCodes stores string type data.

[0099] For example, the value of DDDv0005 is stored in pst_PamRslt[1]

[15] .dRslt.

[0100] 2.2 Generate tm_flightstatusfunc.h header file

[0101] 2.2.1 Flight status identification header file, according to the C++ syntax requirements, write the included header files line by line: system header file, custom parameter storage structure header file, and judgment rule function description header file "tm_flightstatusfunc.h".

[0102] 2.3 Generate tm_flightstatusfunc.h header file

[0103] 2.3.1 Judgment rule function description header file, according to the C++ syntax requirements, write the included header files line by line: system header file.

[0104] Then read and write the information contained in the function declaration field FUNCTIONDECLARE of the judgment rule function description table flightstatusfunc line by line until it is finished.

[0105] 2.4 Generate tm_flightstatus.cpp module

[0106] 2.4.1 According to the C++ syntax requirements, write the included header files "tm_flightstatus.h" and "tm_flightstatusfunc.h" line by line.

[0107] 2.4.2 Read the flight status criterion information of the specified spacecraft ID and convert it. Create an index information IndexID for each group GROUP_ID under each flight status FLIGHTSTATUS_ID ID:

[0108] ;

[0109] in, Indicates the flight status indicator. Indicates the maximum number of criterion groups for flight status, Indicates the criterion group number.

[0110] Match the parameter codes, flight phase identifiers, feature point moments, flight relative time, and command codes without double quotes in the specific criterion expressions of each set of criteria with the parameter codes in the telemetry parameter attribute information, the flight phase identifiers, feature point moments, flight relative time in the task sharing information, and the command code variable names in the remote control command sending information. If they are completely matched, replace them with the storage location corresponding to the parameter code, and retain other information. Consider the C / C++ language code programming style to achieve the alignment and indentation style of compound statements (alignment of curly braces, Tab indentation, etc.).

[0111] 2.4.3 Use the switch method to use the index information IndexID of each group GROUP_ID under each flight status FLIGHTSTATUS_ID as the condition value of the case branch. The expression converted in 2.4.2 above is used as the statement to be executed to meet the case branch condition, and add a break;

[0112] 2.4.4 Repeat this process until every expression is completed. Finally, add the “default” branch to complete the function tm_flightstatus.

[0113] 2.4.5 Continue to write the preconditions in the flightstatus_c table into the void Pre_addParaCodeValue(const std::string& ParaCode, double dRslt) function (this function determines whether the current parameter code needs trend judgment after the flight status identification function parses the parameter result dRslt each time. If necessary, preprocessing is performed). Take out the string after the first "(" of each precondition, which is the actual parameter code. Compare ParaCode with the parameter code. If they match, write the precondition information.

[0114] 2.4.6 After closing the file, the tm_flightstatus.cpp file is written.

[0115] 2.5 Generate tm_flightstatusfunc.cpp module

[0116] 2.5.1 The first line of included header file: tm_flightstatusfunc.h.

[0117] 2.5.2 Read the criterion rule function description table flightstatusfunc in the valid record of the specified spacecraft identification, and read out the contents of the function definition file name in the table record in turn and write them into "tm_flightstatusfunc.cpp" until the writing is completed.

[0118] 2.5.3 After closing the file, tm_flightstatusfunc.cpp is written.

[0119] The function definition content of the judgment rule function description table flightstatusfunc table is exemplified as follows:

[0120] #ifndef ParaTrendFunc_CPP

[0121] #define ParaTrendFunc_CPP

[0122] #include <iostream>

[0123] #include <deque>

[0124] #include <unordered_map>

[0125] #include <qdatetime>

[0126] / / Define DataPoint structure

[0127] struct DataPoint {

[0128] double value;

[0129] QDateTime timestamp;

[0130] };

[0131] / / Define ParaTrendFunc namespace

[0132] namespace ParaTrendFunc {

[0133] static std::unordered_map<std::string, std::deque <datapoint>>increasingData;

[0134] static std::unordered_map<std::string, std::deque <datapoint>>decreasingData;

[0135] void addDataPoint(const std::string& ParaCode, double value,const QDateTime& timestamp) {

[0136] / / Add to both increasing and decreasing caches

[0137] increasingData[ParaCode].emplace_back(DataPoint{value,timestamp});

[0138] decreasingData[ParaCode].emplace_back(DataPoint{value,timestamp});

[0139] }

[0140] bool checkTrend(const std::deque <datapoint>& dataPoints, doubledTimeLen, bool isIncreasing) {

[0141] if (dataPoints.size() < 2) return false;

[0142] QDateTime currentTime = QDateTime::currentDateTime();

[0143] QDateTime startTime = currentTime.addSecs(-dTimeLen);

[0144] auto startIt = std::lower_bound(dataPoints.begin(),dataPoints.end(), startTime,

[0145] [](const DataPoint& dp, const QDateTime& time) {

[0146] return dp.timestamp < time;

[0147] });

[0148] if (startIt == dataPoints.end() || std::distance(startIt,dataPoints.end()) < 2) {

[0149] return false;

[0150] }

[0151] auto prevIt = startIt;

[0152] for (auto it = std::next(startIt); it != dataPoints.end(); ++it) {

[0153] if ((isIncreasing && it->value <= prevIt->value) || (!isIncreasing && it->value >= prevIt->value)) {

[0154] return false;

[0155] }

[0156] prevIt = it;

[0157] }

[0158] return true;

[0159] }

[0160] bool Func_isParaDecreasing (const std::string& ParaCode, doubledTimeLen) {

[0161] auto it = decreasingData.find(ParaCode);

[0162] if (it == decreasingData.end()) return false;

[0163] const auto& dataPoints = it->second;

[0164] bool result = checkTrend(dataPoints, dTimeLen, false);

[0165] if (!result) {

[0166] decreasingData.erase(ParaCode);

[0167] }

[0168] return result;

[0169] }

[0170] bool Func_isParaIncreasing(const std::string& ParaCode, doubledTimeLen) {

[0171] auto it = increasingData.find(ParaCode);

[0172] if (it == increasingData.end()) return false;

[0173] const auto& dataPoints = it->second;

[0174] bool result = checkTrend(dataPoints, dTimeLen, true);

[0175] if (!result) {

[0176] increasingData.erase(ParaCode);

[0177] }

[0178] return result;

[0179] }

[0180] …

[0181] };

[0182] using ParaTrendFunc::Func_isParaDecreasing;

[0183] using ParaTrendFunc::Func_isParaIncreasing; .......

[0185] #endif

[0186] Example of tm_flightstatus.cpp:

[0187] #include "tm_flightstatus.h"

[0188] bool tm_flightstatus(Sint_4 siIndex)

[0189] {

[0190] bool bRet = false;

[0191] switch(siIndex)

[0192] {

[0193] case 1: / / First set of criteria for flight status flag FLIGHTSTATUS_ID = 1

[0194] bRet=((((pst_PamResult[0]

[653] .dResult>=127.5&&pst_PamResult[0]

[653] .dResult<=142.5); ||(pst_PamRslt[1]

[677] .dRslt>=127.5&&pst_PamRslt[1]

[677] .dRslt<=142.5)||(pst_ PamRslt[1]

[701] .dRslt>=127.5&&pst_PamRslt[1]

[701] .dRslt<=142.5)||(pst_PamRsl t[1]

[725] .dRslt>=127.5&&pst_PamRslt[0]

[725] .dRslt<=142.5)||(pst_PamRslt[0][65 5].dRslt>=127.5&&pst_PamRslt[1]

[655] .dRslt<=142.5)||(pst_PamRslt[1]

[679] .dRs lt>=127.5&&pst_PamRslt[1]

[679] .dRslt<=142.5)||(pst_PamRslt[0]

[703] .dRslt>=127 .5&&pst_PamRaslt[0]

[703] .dRaslt<=142.5)||(pst_PamRaslt[1]

[727] .dRaslt>=127.5&&pst _PamRslt[1]

[727] .dRslt<=142.5))&&(g_dFXXDS>=125&&g_dFXXDS<=145)))?true:false;

[0195] break;

[0196] case 2 :

[0197] bRet=(((pst_PamResult[0]

[908] .dResult==128)&&(pst_PamResult[0]

[898] .dResult>=126&&pst_PamResult[1][8 98].dRslt<=144)&&(g_dFXXDS>=125&&g_dFXXDS<=146)&&(g_pst_KeyInfM[0].ucFlag==0)))?true:false;

[0198] break;

[0199] case 42: / / The first set of criteria for flight status identification FLIGHTSTATUS_ID=2

[0200] bRet=(((pst_PamRslt[0]

[908] .dRslt==128)&&(pst_PamRslt[1]

[898] .dRslt>144)&&(g_dFXXDS>144& &g_dFXXDS<=165)&&(g_pst_KeyInfM[0].ucFlag==0)&&(g_pst_KeyInfM[1].ucFlag==0)))?true:false;

[0201] break;

[0202] case 43: / / The second set of criteria for flight status identification FLIGHTSTATUS_ID=2 bRet=(((pst_PamRslt[1]

[908] .dRslt==128)&&(pst_PamRslt[1]

[543] .dRslt>144)&&(g_dFXXDS>144&&g_dFXXDS<=165)&&(g_pst_KeyInfM[0].ucFlag==0)&&(g_pst_KeyInfM[1].ucFlag==0)))?true:false;

[0203] break; ....

[0205] default:

[0206] break;

[0207] }

[0208] return bRet;

[0209] }

[0210] 2.6 Generate and verify dynamic library

[0211] 2.6.1 Compile and link the newly generated tm_flightstatus.cpp, tm_flightstatusfunc.cpp and header files. If there is an error in the code or criterion expression, the specific line of error will be reported. After correction, continue to verify the correctness of the syntax until the libFlightStatus_Identify.so dynamic library can be generated.

[0212] 2.6.2 Use the automatic test program to test the correctness of the latest flight status dynamic library, and make modifications if any problems are found until it is correct.

[0213] 2.6.3 Publish the latest verified flight status identification libFlightStatus_Identify.so dynamic library to the specific directory of the specified device.

[0214] Example 2

[0215] Embodiment 2 of the present invention provides a device for improving the efficiency of spacecraft flight status recognition, which is implemented based on the method of embodiment 1 and includes:

[0216] A rule establishment module is used to analyze the flight state criterion mode of the spacecraft, create a flight state description rule, and establish a flight state criterion table and a criterion rule function description table with an associated relationship according to the description rule; the flight state criterion table includes a main table, a sub-table and a sub-sub-table;

[0217] The input module is used to input or import the flight status criteria into the flight status criteria table. The criteria conditions are written in accordance with the C / C++ language requirements, supporting various logical expressions, arithmetic expressions and relational expressions, and writing the criteria rules and function bodies of complex logical processing into the criteria rule function description table;

[0218] A code conversion module is used to read the information of the flight status criterion table and the criterion rule function description table and convert them into header files and source programs written in C / C++ language;

[0219] Compile and generate module, used to compile and link to generate dynamic link library files after passing syntax verification;

[0220] The publishing module is used to publish the dynamic link library file after the automated testing tool has tested it correctly. The compiling and generating module is used to compile and link the dynamic link library file after the syntax verification has passed.

[0221] The release module is used to release the dynamic link library file after it has been tested correctly by the automated testing tool.

[0222] Experimental verification - flight status identification and processing delay comparison tool

[0223] 3.1 Start the spacecraft flight status identification software and load the libFlightStatus_Identify.so dynamic library generated by this method. Start the simulation data sending software, subscribe to the flight status identification results, send 1000 frames of data per second, record the sending time of each flight status that meets the criteria and the time of receiving the flight status identification results, calculate and store the processing delay of flight status analysis and judgment, the flight status identification software can correctly identify the flight status, and record the processing delay, of which the maximum processing delay is 1.3ms.

[0224] 3.2 The software that reads the configuration file and analyzes the criterion expression to identify the flight status through data drive has a minimum processing delay of 23ms. The software that uses the scripting language for identification has a minimum processing delay of 76.3ms. Comparing the processing delays of the three methods, the processing speed of the new method is at least one order of magnitude higher than that of the traditional method.

[0225] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention is described in detail with reference to the embodiments, it should be understood by those skilled in the art that any modification or equivalent replacement of the technical solutions of the present invention does not depart from the spirit and scope of the technical solutions of the present invention and should be included in the scope of the claims of the present invention.< / datapoint> < / datapoint> < / datapoint> < / qdatetime> < / deque> < / iostream>

Claims

1. A method for improving the efficiency of spacecraft flight status recognition, comprising: Analyze the flight state criterion mode of the spacecraft, create a flight state description rule, and establish a flight state criterion table and a criterion rule function description table with an associated relationship according to the description rule; the flight state criterion table includes a main table, a sub-table and a sub-sub-table; The flight status criteria are entered or imported into the flight status criteria table. The criteria conditions are written in accordance with the C / C++ language requirements, supporting various logical expressions, arithmetic expressions and relational expressions, and the criteria rules and function bodies of complex logical processing are written into the criteria rule function description table; Read the information of the flight status criterion table and the criterion rule function description table, and convert them into header files and source programs written in C / C++ language; After passing the syntax verification, compile and link to generate a dynamic link library file; After being tested correctly by the automated testing tool, the dynamic link library file is released; The main table of the flight status criterion table: used to describe brief information of the flight status, including: spacecraft identification, flight status identification, spacecraft name, flight status name, normal or abnormal identification, abnormal treatment plan, real-time / delay ratio identification mark, data source used for flight status criterion, flight status related subsystems and importance of flight status; wherein the flight status identification is a positive integer starting from 1 and increasing; Subtable, used to describe the relationship between each set of criteria that can independently determine the flight state. Each flight state includes one or more sets of criteria, and each set of criteria is assigned a criterion group number. The subtable field information includes: spacecraft identification, flight state identification, criterion group number, expressions between criteria, disposal plan when abnormal state occurs, script for correcting state occurrence time, preconditions for flight state judgment, postconditions after state judgment, and data source; Sub-sub-table, used to describe the detailed criterion information of each criterion group of the flight state; the sub-sub-table field information includes: spacecraft ID, flight state ID, criterion group serial number, specific criterion ID, specific criterion expression, data source, parameter historical change trend and parameter current change trend; Each flight state of each spacecraft is identified by a unique joint primary key of the spacecraft ID and the flight state ID. The sub-sub-table is associated with the sub-table through the spacecraft ID, flight state ID and criterion group sequence number, and the sub-table is associated with the main table through the spacecraft ID and flight state ID. The criterion rule function description table is used to describe general or special function criteria, and the table field information includes: general identification, spacecraft identification, function name, function declaration, function description, function body, flight status identification, criterion group serial number and specific criterion identification; If it is a multi-task general function, the spacecraft ID, flight status ID, criterion group number and specific criterion ID are empty; If it is a single-task general function, the flight status identifier, criterion group number and specific criterion identifier are empty; Read the flight status criteria table and convert it into header files and source programs written in C / C++ language; including: Step S0) reading the main table, sub-table and sub-sub-table of the flight status criterion table, converting the flight status criterion information into various expressions expressed in C / C++ language, and generating a header file; Step S1) reading the telemetry parameter attribute information of the selected spacecraft identification, as well as the mission sharing information and the remote control command sending information interface from the configuration information management database, storing them in corresponding data structures respectively, and establishing a storage index relationship of the parameter code; Step S2) According to C / C++ language rules, the first line adds the included header file; Step S3) Read the flight status criterion information of the designated spacecraft ID from the database in ascending order of the flight status ID: Create an index information IndexID for each criterion group under each flight status identification: ; in, Indicates the flight status indicator. Indicates the maximum number of criterion groups for flight status, Indicates the criterion group number; Match the parameter codes, flight phase identifiers, and characteristic point moment identifiers in all criterion expressions under each set of criteria with the parameter codes in the parameter attribute information, and the flight phase identifiers and characteristic point moment identifiers in the task sharing information. If they are completely matched, replace them with member variables in the corresponding data structure, and keep other characters or function names in the criterion expressions; Step S4) In a switch mode, the index information IndexID of each set of criteria group numbers under each flight status identification is used as the condition value of the case branch, the expression converted in step S3) is used as the statement to be executed to meet the case branch condition, and a "break" statement is added; Step S5) When the flight status criterion information conversion is completed, go to step S6), otherwise, go to step S3); Step S6) After adding the "default" statement, the compound statement is aligned and indented according to the C / C++ language programming style, thereby generating a source program file and closing it; Read the information in the judgment rule function description table and convert it into header files and source programs written in C / C++ language; including: Step T0) reading the criterion rule function description table, writing the information of the function declaration field recorded in the criterion rule function description table line by line until the writing is completed, and generating a header file; Step T1) According to the C / C++ language rules, add the included header file in the first line; Step T2) reads the judgment rule function description table, writes the contents of the function name, function declaration, function description, and function body fields in sequence, and generates a source program.

2. The method for improving the efficiency of spacecraft flight status recognition according to claim 1, characterized in that: The description rules include: Define a namespace to store the value information of each parameter, including storing the corresponding value information for each parameter and storing multiple trend change judgment data for the same parameter; A criterion rule function is defined, including a function name, a passed parameter, and a return type; the criterion rule function supports a variety of judgment parameter change trends, including increasing, decreasing, periodic changes, and regular change trends triggered by conditions within a required time period.

3. The method for improving the efficiency of spacecraft flight status recognition according to claim 2, characterized in that: The corresponding value information is stored for each parameter, including: storing parameter sequence number, parameter code, type of result value, over-limit flag, source code valid flag, length of result value, storing result value and data time according to the type of result value.

4. The method for improving the efficiency of spacecraft flight status recognition according to claim 2, characterized in that: The flight status criterion mode of the spacecraft includes: one or more of real-time result criterion, historical result criterion and conditional result criterion; wherein, For the real-time result criterion, it is determined whether the real-time parameters meet the requirement that the criterion rule expression is true within the required duration or number of consecutive frames. The real-time parameters include: telemetry parameters, command code in the remote control command sending information, flight phase identification in the global shared information, feature point time and flight relative time; For historical result judgment, determine whether the change characteristics of telemetry parameters meet the flight status change characteristics within the required historical time period; For the conditional result criterion, determine whether the triggering condition will trigger the telemetry parameter value to be updated to a predetermined value or value range.

5. The method for improving the efficiency of spacecraft flight status recognition according to claim 4, characterized in that: The codes of the telemetry parameters are consistent with the parameter codes in the telemetry parameter outline; the name of the flight status, remote control command code, flight phase identification, characteristic point time and flight relative time are consistent with the aerospace measurement and control application software system documents.

6. A device for improving the efficiency of spacecraft flight status recognition based on the method of claim 1, characterized in that: include: A rule establishment module is used to analyze the flight state criterion mode of the spacecraft, create a flight state description rule, and establish a flight state criterion table and a criterion rule function description table with an associated relationship according to the description rule; the flight state criterion table includes a main table, a sub-table and a sub-sub-table; The input module is used to input or import the flight status criteria into the flight status criteria table. The criteria conditions are written in accordance with the requirements of C / C++ language, supporting various logical expressions, arithmetic expressions and relational expressions, and writing the criteria rules and function bodies of complex logical processing into the criteria rule function description table; A code conversion module is used to read the information of the flight status criterion table and the criterion rule function description table and convert them into header files and source programs written in C / C++ language; Compile and generate module, used to compile and link to generate dynamic link library files after passing syntax verification; and The release module is used to release the dynamic link library file after it has been tested correctly by the automated testing tool.

Citation Information

Patent Citations

  • Artificial Intelligence Writing Method of Multi-platform and Multi-running Mode Source Code for Digital Vehicle

    CN109117125A

  • Programming Language Source Code Conversion

    US20180275977A1