Analysis method and device of satellite telemetry protocol and electronic equipment
By automatically analyzing the satellite telemetry protocol by using regular expression matching and parsing templates, the limitations of manual analysis and static rules in the existing technology are solved, processing efficiency and adaptability are improved, and automated satellite telemetry data analysis is realized.
Patent Information
- Application Number
- CN202510461110.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-01
AI Technical Summary
The existing satellite telemetry protocol analysis methods rely on manual parsing and static rules, making it difficult to efficiently process large-scale and diverse telemetry files.
By obtaining the description file sent by the target satellite, using the regular expression matching and parsing templates in the rule base, the satellite telemetry protocol in the first description format is automatically converted to the second description format, and mask data is generated and processed data is processed to parse the satellite telemetry data.
It improves the structured processing efficiency of satellite telemetry protocol, reduces manual intervention, enhances the adaptability to different file formats and telemetry descriptions, and realizes automated data analysis and processing.
Smart Images

Figure CN120238593A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of satellite telemetry technology. Specifically, it relates to a method, device, and electronic device for parsing satellite telemetry protocols. Background Art
[0002] In practical applications, satellite telemetry protocols are usually stored and transmitted in the form of text or files. These files contain detailed descriptions of telemetry parameters, such as data ranges, units, relevant formulas, and other information. To facilitate subsequent analysis and processing, these descriptive data must be converted into a structured telemetry parameter table and effectively decoded and calculated. Existing satellite telemetry protocols usually rely on manual parsing and static rules, which have certain limitations when dealing with large-scale and diverse telemetry files. Summary of the Invention
[0003] The purpose of the embodiments of this application is to provide a method, device, and electronic device for parsing satellite telemetry protocols to improve the processing efficiency of satellite telemetry protocol structuring.
[0004] In a first aspect, this application provides a method for parsing a satellite telemetry protocol. The method includes:
[0005] Obtain a description file sent by a target satellite. The description file includes multiple satellite telemetry protocols in a first description format. Each satellite telemetry protocol includes interrelated satellite telemetry parameter names, satellite telemetry parameter types, and satellite telemetry protocol description data. Parse each satellite telemetry protocol in the first description format into a satellite telemetry protocol in a second description format through the following steps: Based on the satellite telemetry parameter type in the current satellite telemetry protocol, match multiple regular expressions arranged in priority order from a rule library; Based on the regular expressions, match the satellite telemetry protocol description data in the current satellite telemetry protocol to obtain mask data and processing data corresponding to the satellite telemetry parameter type as the satellite telemetry protocol in the second description format, where the mask data is used to parse the corresponding target description field from the satellite telemetry data sent by the target satellite, and the processing data is used to convert the target description field into an actual description field.
[0006] Preferably, multiple parsing templates are stored in the rule library. Each parsing template includes multiple regular expressions arranged in priority order. The regular expressions and corresponding priorities between different parsing templates are different. Match multiple regular expressions arranged in priority order from the rule library through the following method:
[0007] Determine the type tag of the target satellite and the format tag of the first description format;
[0008] Match a parsing template associated with the type tag and / or format tag from the rule library.
[0009] Preferably, the parsing template includes at least a first regular expression and a second regular expression, and the masked data is obtained by the following method:
[0010] Match the byte offset value from the satellite telemetry protocol description data in the current satellite telemetry protocol through the first regular expression;
[0011] Match the start value of the bit field range and the end value of the bit field range from the satellite telemetry protocol description data in the current satellite telemetry protocol through the second regular expression;
[0012] Generate masked data according to the matched byte offset value, start value of the bit field range, and end value of the bit field range.
[0013] Preferably, the masked data includes a byte offset value and a mask value. The decimal mask value X is calculated and converted to hexadecimal by the following method:
[0014] x 偏移 = x end - x start + 1;
[0015]
[0016] Wherein, x start is the start value of the bit field range, x end is the end value of the bit field range, and x 偏移 is the byte offset value.
[0017] Preferably, the step of matching the byte offset value from the satellite telemetry protocol description data in the current satellite telemetry protocol through the first regular expression specifically includes:
[0018] When the data of the tuple type is matched from the first string of the satellite telemetry protocol description data through the first regular expression, determine the value of the first element in the tuple type data as the byte offset value.
[0019] Preferably, the step of matching the start value of the bit field range and the end value of the bit field range from the satellite telemetry protocol description data in the current satellite telemetry protocol through the second regular expression specifically includes:
[0020] When the data of the tuple type is matched from the second string of the satellite telemetry protocol description data through the first regular expression, determine whether the length of the tuple type data is greater than 1;
[0021] If so, use the minimum value in the tuple type data as the start value of the bit field range and the maximum value in the tuple type data as the end value of the bit field range.
[0022] Preferably, determine whether the maximum value / minimum value in the tuple type data is within the preset bit field range;
[0023] If so, perform the step of determining the start value and the end value of the bit field range.
[0024] In a second aspect, the present application provides an analysis device for a satellite telemetry protocol. The device includes:
[0025] An acquisition module, configured to acquire a description file sent by a target satellite. The description file includes multiple satellite telemetry protocols in a first description format. Each satellite telemetry protocol includes a satellite telemetry parameter name, a satellite telemetry parameter type, and satellite telemetry protocol description data that are associated with each other;
[0026] An analysis module, configured to analyze each satellite telemetry protocol in the first description format into a satellite telemetry protocol in a second description format through the following steps:
[0027] Based on the satellite telemetry parameter type in the current satellite telemetry protocol, match multiple regular expressions arranged in priority order from a rule library;
[0028] Based on the regular expressions, match the satellite telemetry protocol description data in the current satellite telemetry protocol to obtain mask data and processing data corresponding to the satellite telemetry parameter type, as the satellite telemetry protocol in the second description format,
[0029] wherein the mask data is used to parse a corresponding target description field from the satellite telemetry data sent by the target satellite, and the processing data is used to convert the target description field into an actual description field.
[0030] In a third aspect, the present application provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform the steps of the satellite telemetry protocol analysis method as described above.
[0031] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it performs the steps of the satellite telemetry protocol analysis method as described above.
[0032] A method, device, and electronic device for parsing a satellite telemetry protocol provided by this application. Among them, the method includes obtaining a description file sent by a target satellite. The description file includes multiple satellite telemetry protocols in a first description format. Each satellite telemetry protocol includes interrelated satellite telemetry parameter names, satellite telemetry parameter types, and satellite telemetry protocol description data. Parse each satellite telemetry protocol in the first description format into a satellite telemetry protocol in the second description format through the following steps: Based on the satellite telemetry parameter type in the current satellite telemetry protocol, match multiple regular expressions arranged in priority order from the rule library; Based on the regular expressions, match the satellite telemetry protocol description data in the current satellite telemetry protocol to obtain mask data and processing data corresponding to the satellite telemetry parameter type as the satellite telemetry protocol in the second description format. Among them, the mask data is used to parse the corresponding target description field from the satellite telemetry data sent by the target satellite, and the processing data is used to convert the target description field into an actual description field. Dynamically selecting the parsing method based on the type of the description file can automatically identify and adapt to different file formats and telemetry descriptions, improving the processing efficiency of protocol parsing and enhancing applicability at the same time. Brief Description of the Drawings
[0033] To more clearly illustrate the technical solutions of the embodiments of this application, the following will briefly introduce the drawings required to be used in the embodiments of this application. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.
[0034] Figure 1 It is a flowchart of a method for parsing a satellite telemetry protocol provided by an embodiment of this application;
[0035] Figure 2 It is a schematic structural diagram of an electronic device provided by an embodiment of this application. Detailed Embodiments
[0036] The following will describe the technical solutions in the embodiments of this application with reference to the drawings in the embodiments of this application.
[0037] Embodiment 1
[0038] Satellite telemetry protocols are usually stored and transmitted in text or description file formats. Satellite telemetry protocols contain detailed descriptions for parsing telemetry parameters, such as information on data ranges, units, relevant formulas, etc.
[0039] Figure 1 It is a flowchart of a method for parsing a satellite telemetry protocol provided by an embodiment of this application. As Figure 1As shown in the figure, the present application provides a method for parsing a satellite telemetry protocol, which can be executed by a parsing system:
[0040] Obtain a description file sent by a target satellite. The description file includes multiple satellite telemetry protocols in the first description format. Each satellite telemetry protocol includes interrelated satellite telemetry parameter names, satellite telemetry parameter types, and satellite telemetry protocol description data.
[0041] Upload the description file to be parsed to the parsing system. Here, the description file is formed according to the rules of the satellite telemetry data of the target satellite and is used to describe the interpretation method (the number of bytes occupied, the extraction position, and subsequent processing algorithms, etc.) and data attributes (including satellite telemetry parameter names, satellite telemetry parameter types, etc.) of each satellite telemetry parameter.
[0042] Here, the satellite telemetry parameter types can include count type, status type, numerical type, and reserved type.
[0043] Parse each satellite telemetry protocol in the first description format into a satellite telemetry protocol in the second description format through the following steps:
[0044] S1. Based on the satellite telemetry parameter type in the current satellite telemetry protocol, match multiple regular expressions arranged in priority order from the rule library.
[0045] Exemplarily, the satellite telemetry protocol in the first description format can be "001, A01, W3 bytes bit5-2 Interface synchronization status: 1: Synchronized; 0: Unsynchronized".
[0046] Among them, "001" is the identifier corresponding to the satellite telemetry parameter name, "A01" is the identifier corresponding to the satellite telemetry parameter type, "W3 bytes bit5-2 Interface" is used to indicate the extraction method of the satellite telemetry parameter, and "Synchronization status: 1: Synchronized; 0: Unsynchronized" is used to indicate the expression meaning of the parameter value of the satellite telemetry parameter.
[0047] S2. Based on the regular expressions, match the satellite telemetry protocol description data in the current satellite telemetry protocol to obtain mask data and processing data corresponding to the satellite telemetry parameter type as the satellite telemetry protocol in the second description format.
[0048] Among them, the mask data is used to parse the corresponding target description field from the satellite telemetry data sent by the target satellite, and the processing data is used to convert the target description field into an actual description field.
[0049] Finally, the output satellite telemetry protocol in the second description format can include "Mask parsing: 3, 0x3C; Formula number: 3; Processing method: 1 - Synchronized | 0 - Unsynchronized".
[0050] The rule library stores multiple parsing templates. Each parsing template includes multiple regular expressions arranged in priority order, and the regular expressions and their corresponding priorities are different between different parsing templates.
[0051] Here, regular expressions corresponding to different types can be pre-written, and initial priorities can be assigned to these rules. These rules are separated from the core business of the program and highly decoupled, and can adapt to the parsing of different space telemetry protocols. Only by correctly writing regular expressions can information matching be completed.
[0052] Specifically, multiple regular expressions arranged in priority order can be matched from the rule library through the following method:
[0053] Determine the type label of the target satellite and the format label of the first description format; match the parsing template associated with the type label and / or format label from the rule library.
[0054] Here, the format of the description file can be obtained through the type of the target satellite for setting the parsing template, or other conditions can be used for matching, without limitation.
[0055] Different telemetry file formats and data descriptions may vary, so regular expressions need to be dynamically adjusted according to the actual file content. Through flexible regular expression matching, the system can adapt to various complex telemetry data formats, thereby improving the degree of automation of data processing. With the emergence of new telemetry file formats or requirements, regular expressions can be quickly adjusted and extended to ensure the scalability and continuous adaptability of the system.
[0056] By combining the technology of dynamic regular expressions, the processing of satellite telemetry data can greatly reduce manual intervention and improve the accuracy and efficiency of data processing. This provides a basis for the automated parsing and further analysis of satellite telemetry data.
[0057] Embodiment 2
[0058] In an embodiment of the present application, the satellite telemetry protocol of the first description format may be "001, A01, W3 bytes bit5-2 interface synchronization status: 1: synchronized; 0: unsynchronized". When the satellite telemetry parameter type is a status type, the parsing template includes at least a first regular expression and a second regular expression, and the mask data includes a byte offset value and a mask value. The mask data is obtained through the following method:
[0059] Match the byte offset value from the satellite telemetry protocol description data in the current satellite telemetry protocol through the first regular expression.
[0060] Match the start value and end value of the bit field range from the satellite telemetry protocol description data in the current satellite telemetry protocol through the second regular expression.
[0061] Generate mask data based on the matched byte offset value, bit field range start value, and bit field range end value.
[0062] Here, the decimal mask value X can be calculated and converted to hexadecimal in the following way:
[0063] x 偏移 = x end - x start + 1;
[0064]
[0065] Among them, x start is the bit field range start value, x end is the bit field range end value, x 偏移 is the byte offset value.
[0066] Exemplarily, for the first regular expression r"W(\d+)", it can match "W3" → matches = [('3',)]. For the second regular expression r"W(\d+)\s+bit(\d+)-(\d+)", it can match "bit5-2" → matches = [('3',),('5','2')]. Then the byte offset can be obtained: matches[0][0] → 3; the bit field range: matches[-1] → ('5','2') → start_bit = 5, end_bit = 2. Finally, the mask value is generated:
[0067] high_bit = 5, low_bit = 2 → num_bits = 4 → mask = 0b00111100 → hex_mask = 0x3C.
[0068] That is to say, the final mask data is "3, 0x3C".
[0069] The processed data can be parsed in the following way. At this time, the processed data here is used to indicate different states represented by different parameter values of the satellite telemetry parameters:
[0070] By using the third regular expression r"1:([^;]+);0:([^;,。?!:;]+)" to match "1: Synchronized; 0: Unsynchronized", the status_matches = [('Synchronized', 'Unsynchronized')] can be obtained.
[0071] Result processing: Use re.findall(patterns_n[0]) to extract the status description group; match[0] → ('synchronized') & match[1] → ('not synchronized'); Standardized output f"1-{match[0]}|0-{match[1] → 1-synchronized|0-not synchronized.
[0072] The finally processed data is "1 - synchronized|0 - not synchronized".
[0073] Furthermore, according to the description information of each satellite telemetry protocol, the system can simultaneously match multiple results with multiple rules (perform multi-pattern matching on each telemetry protocol according to multiple regular expressions to obtain multiple matching results). Since multiple regular expressions will match multiple results during the matching process, in order to obtain the correct mask information, it is necessary to select the correct matching result through arbitration for subsequent processing.
[0074] That is, the step of matching the byte offset value from the satellite telemetry protocol description data in the current satellite telemetry protocol through the first regular expression may specifically include:
[0075] When the data type matched from the first string of the satellite telemetry protocol description data through the first regular expression is a tuple type data, determine the first element value in the tuple type data as the byte offset value.
[0076] Exemplarily, if it is a single complete byte description type (only W10 is included in the parameter description), by default, rule 1 is used for matching. In principle, there will be at least two matching results for the rest of the forms. For example: [10, (10, 7, 4)]. The arbitration rule is: the number of matching items is greater than 1 and it is the last matching item of all matching results, because the last matching item is the most complete data (10, 7, 4). Note: A telemetry protocol may have multiple description methods. Single complete byte description type: such as "W10" represents that the parameter occupies the entire 10th byte; bit type: such as W10 bit7~4, represents that the parameter occupies the high 4 bits of the 10th byte.
[0077] Multi-regular collaboration can be completed through the following steps. The purpose is to extract the byte offset (byte_offset) and bit field range (start_bit and end_bit) from the input string, and finally generate the mask value:
[0078] matches = [];
[0079] for pattern in patterns:;
[0080] matches.extend(pattern.findall(input_str)).
[0081] Assume that the first match (matches[0]) is the byte offset (e.g., 3). If the match result is a tuple (e.g., ('3',)), extract the first element as the byte offset. Ensure that the key information (byte offset) is extracted first through the sequential priority.
[0082] Embodiment III
[0083] In order to further improve the parsing accuracy, in an embodiment of the present application, the steps of matching the starting value and ending value of the bit field range from the satellite telemetry protocol description data in the current satellite telemetry protocol through the second regular expression specifically include:
[0084] When the data matched from the second string of the satellite telemetry protocol description data through the first regular expression is of tuple type data, determine whether the length of the tuple type data is greater than 1;
[0085] If so, use the minimum value in the tuple type data as the starting value of the bit field range, and use the maximum value in the tuple type data as the ending value of the bit field range.
[0086] And determine whether the maximum value / minimum value in the tuple type data is within the preset bit field range; if so, execute the steps of determining the starting value and ending value of the bit field range.
[0087] Specifically, the code corresponding to this part of the function can be expressed as:
[0088] def mask calculation(byte offset, start bit, end bit):
[0089] # Bit field range check;
[0090] assert 0 <= start bit <= 7, "Bit field out of bounds";
[0091] assert 0 <= end bit <= 7, "Bit field out of bounds";
[0092] # Mask dynamic generation;
[0093] high bit = max(start bit, end bit);
[0094] low bit = min(start bit, end bit);
[0095] number of bits = high bit - low bit + 1;
[0096] mask value = ((1 << number of bits) - 1) << low bit;
[0097] return f"{byte offset},0x{mask value:02X}".
[0098] Furthermore, the bit field range verification and matching strategy is as follows: Assume that the last match item (matches[-1]) contains a bit field range (such as ('5', '2')). If the match item is a tuple and its length > 1, it is parsed as the start bit and the end bit. If the bit field is out of bounds (such as start_bit > 7), an error message is returned. If no bit field is matched (such as len(matches) == 1), the 0xFF full mask is used by default. The specific logic code can be as follows:
[0099] last_match = matches[-1] # Use the last match result as the bit field description
[0100] if len(last_match) > 1: # If the number of matching elements is greater than 1, otherwise do not parse
[0101] start_bit = int(last_match[0])
[0102] end_bit = int(last_match[1]).
[0103] In this way, by verifying the bit field range (0 - 7), the error rate of format conversion can be reduced, and at the same time, bitx start -x end and bitx end -x start in both writing methods can automatically identify the start value and the end value respectively.
[0104] Example 4
[0105] In a specific embodiment of the present application, a system for reverse parsing of spacecraft telemetry protocols based on dynamic rule loading and bit field parsing is provided, which is used to automatically extract and convert the telemetry description information in the file by using regular matching technology and convert it into a telemetry parameter table required for satellite telemetry parsing. Specifically, the system can achieve automatic data processing through the following steps:
[0106] Step 1: Write corresponding regular expressions for different satellite telemetry protocol description rules and assign initial priorities to these regular expressions to form corresponding parsing templates. These templates are separated from the core business of the program and are highly decoupled, and can adapt to the parsing of different space telemetry protocols. Only by correctly writing regular expressions can information matching be completed.
[0107] Step 2: Receive the description file from the satellite, and the system loads the corresponding regular expression rules.
[0108] Step 3: The system uses regular expressions to extract the description information corresponding to satellite telemetry parameters from the input description file. This description information usually includes parameter type, parameter range, parameter unit, etc. The system can efficiently extract these key information, avoiding manual processing of the file one by one.
[0109] Step 4: To improve the system's parsing ability for files, multi-rule matching is designed. It can completely extract various types of description information and perform multi-rule parallel matching on the telemetry data stream. According to the description information of each satellite telemetry protocol, the system can simultaneously match multiple results with multiple rules.
[0110] Step 5: Byte extraction rule arbitration. Since multiple regular expressions will match multiple results during the matching process, in order to obtain the correct mask information, it is necessary to select the correct matching result through arbitration for subsequent processing. For example, if it is a single complete byte description type (only "W10" is included in the parameter description), rule 1 is used by default. In other forms, there will generally be at least two matching results, such as: [10, (10, 7, 4)]. The arbitration rule is: the number of matching items is greater than 1 and it is the last matching item of all matching results, because the last matching item is the most complete data (10, 7, 4). Note: A telemetry protocol may have multiple description methods. Single complete byte description type: such as "W10" represents that the parameter occupies the entire 10th byte; bit type: such as W10 bit7~4, represents that the parameter occupies the high 4 bits of the 10th byte.
[0111] Step 6: Automatic parsing of telemetry masks: The telemetry data contains mask fields, which are used to identify the validity of the data or specific operating conditions. By automatically parsing these masks, the system can accurately determine which data is valid and which needs further processing or to be ignored. Output result example: The parameter description information is "W10 bit7~4", and the output result through matching is "(10, 0XF0)".
[0112] Step 7: Formula matching and calculation: Telemetry parameters need to be converted or calculated according to specific formulas (such as unit conversion, data standardization, etc.). The system can identify and apply predefined formulas (processing methods) by means of text analysis and extracting feature fields, and at the same time use regular expressions to extract the status information of the telemetry and format the data.
[0113] Step 8: Output the structured parsing result and record it. Generation of telemetry parameter table: The extracted data is converted into a structured telemetry parameter table through predefined rules. These tables usually include fields such as telemetry parameter name, minimum value, maximum value, unit, etc., which are convenient for subsequent processing and analysis.
[0114] Specifically, the parsing system may include a dynamic rule loading module (corresponding to the start_processing function in the code). The logical code of the dynamic rule loading module may be as follows:
[0115] def dynamic_rule_loading():
[0116] # Obtain multiple groups of regular expressions in real time from the GUI interface
[0117] original_rules = user_input.split('\n')
[0118] # Dynamically compile and cache regular objects
[0119] effective_rules = [re.compile(expr, re.IGNORECASE) for expr in original_rules if expr]
[0120] # Establish a rule priority queue
[0121] return priority_sorting(effective_rules)
[0122] The dynamic rule loading module can support injecting multiple groups of regular expressions through a text box during runtime (see the regex_entry component in the GUI). The re.IGNORECASE is used to achieve case-insensitive matching. A rule priority queue is automatically generated in the input order.
[0123] The parsing system also includes a status description conversion engine (corresponding to the process_excel function in the code). The status description conversion engine can be implemented in the following way: adopting a regular matching strategy (patterns_n), extracting the status description group through re.findall(patterns_n[0]), and generating a standardized output using list comprehension (join([f"1-{x}|0-{y}"])) # List comprehension is a method in Python to efficiently create lists, and the logical code can be:
[0124] status_matches = re.findall(patterns_n[0], input_str)
[0125] status_result = "|".join([f"1-{match[0]}|0-{match[1]}" for match in status_matches])
[0126] In a specific embodiment, the input sample may be "W3 byte bit5-2 interface synchronization status: 1: synchronized; 0: unsynchronized".
[0127] The mask generator byte matching process is as follows:
[0128] 1. The first regular expression r"W(\d+)" → matches "W3" → matches = [('3',)];
[0129] 2. The second regular expression r"bit(\d+)-(\d+)" → matches "bit5-2" → matches = [('3',),
[0130] ('5','2')];
[0131] The result processing is as follows:
[0132] Byte offset: matches[0][0] → 3;
[0133] Bit field range: matches[-1] → ('5','2') → start_bit = 5, end_bit = 2;
[0134] Mask generation:
[0135] high_bit = 5, low_bit = 2 → num_bits = 4 → mask = 0b00111100 → hex_mask = 0x3C.
[0136] Finally, "3, 0x3C" is obtained.
[0137] The status parser matching process is as follows:
[0138] r"1:([^;]+);0:([^;,。?!:;]+)" → matches "1: Synchronized; 0: Unsynchronized" → status_matches = [('Synchronized', 'Unsynchronized')];
[0139] The result processing process is as follows:
[0140] re.findall(patterns_n[0]) extracts the status description group;
[0141] match[0] → ('Synchronized') & match[1] → ('Unsynchronized');
[0142] Standardized output f"1-{match[0]}|0-{match[1]} → 1-Synchronized|0-Unsynchronized;
[0143] Final system output: Mask parsing: 3, 0x3C; Formula number: 3; Processing method: 1-Synchronized|0-Unsynchronized.
[0144] The spacecraft telemetry protocol reverse parsing method and system based on dynamic rule loading and bit field parsing provided by the present invention have the following advantages and remarkable effects compared with the prior art:
[0145] (1) By combining the data in the Excel file with regular expressions, automated satellite telemetry data parsing is achieved. This technical solution avoids the cumbersome calculation process of manual parsing one by one in the traditional method, greatly improving the efficiency and accuracy of data processing. Specifically, by matching fields such as "count", "status", "mode", and "reservation" with regular expressions, the system can automatically extract relevant data and generate masks, reducing human intervention and errors.
[0146] (2) In the prior art, when parsing data, it usually relies on fixed pattern matching methods, lacking flexibility. However, the present invention adopts dynamically generated regular expression patterns, which can perform precise matching according to different data formats. By combining multiple regular expression patterns (such as "count" or "status"), the system can extract the required information from the input data more accurately.
[0147] (3) By automatically generating byte offsets and masks, it is possible to effectively parse the fields related to bit operations in satellite telemetry data. Compared with the hard-coding method of the prior art, the present invention can adapt to different bit ranges and data formats by dynamically calculating and automatically generating masks, significantly enhancing the ability to process diverse data. Especially when the data field range is wide, the system can judge and generate the correct mask, avoiding errors that may occur during manual processing.
[0148] (4) Automatically select an appropriate formula for processing based on the input data. For example, by judging the field type (such as "count" or "status"), the formula number is dynamically selected, thereby achieving more refined parsing. The prior art often needs to rely on preset formulas or manual input of formulas, while the dynamic formula selection mechanism of the present invention improves the processing speed and at the same time ensures the flexibility and accuracy of processing.
[0149] Based on the same inventive concept, an apparatus for parsing a satellite telemetry protocol is further provided in an embodiment of the present application. The apparatus includes:
[0150] An acquisition module, configured to acquire a description file sent by a target satellite, where the description file includes multiple satellite telemetry protocols in a first description format, and each satellite telemetry protocol includes interrelated satellite telemetry parameter names, satellite telemetry parameter types, and satellite telemetry protocol description data;
[0151] A parsing module, configured to parse each satellite telemetry protocol in the first description format into a satellite telemetry protocol in a second description format through the following steps:
[0152] Based on the satellite telemetry parameter types in the current satellite telemetry protocol, multiple regular expressions arranged in priority are matched from the rule library;
[0153] Based on the regular expressions, match the satellite telemetry protocol description data in the current satellite telemetry protocol to obtain mask data and processing data corresponding to the satellite telemetry parameter types, as the satellite telemetry protocol in the second description format;
[0154] Among them, the mask data is used to parse the corresponding target description fields from the satellite telemetry data sent by the target satellite, and the processing data is used to convert the target description fields into actual description fields.
[0155] Please refer to Figure 2 , Figure 2 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 2 shown in, the electronic device 200 includes a processor 210, a memory 220, and a bus 230.
[0156] The memory 220 stores machine-readable instructions executable by the processor 210. When the electronic device 200 runs, the processor 210 communicates with the memory 220 through the bus 230. When the machine-readable instructions are executed by the processor 210, the steps of a method for parsing a satellite telemetry protocol in the method embodiment as shown above can be executed. The specific implementation manner can refer to the method embodiment and will not be elaborated here. Figure 1 shown in, the steps of a method for parsing a satellite telemetry protocol in the method embodiment as shown above can be executed. The specific implementation manner can refer to the method embodiment and will not be elaborated here.
[0157] An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of a method for parsing a satellite telemetry protocol in the method embodiment as shown above can be executed. The specific implementation manner can refer to the method embodiment and will not be elaborated here. Figure 1 shown in, the steps of a method for parsing a satellite telemetry protocol in the method embodiment as shown above can be executed. The specific implementation manner can refer to the method embodiment and will not be elaborated here.
[0158] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0159] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical or other forms.
[0160] In addition, the units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] Furthermore, in each embodiment of the present application, the various functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0162] It should be noted that if the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs and other various media that can store program codes.
[0163] In this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0164] The above are only the embodiments of the present application and are not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for analyzing a satellite telemetry protocol, characterized in that: The method comprises: Acquire a description file sent by a target satellite, wherein the description file includes a plurality of satellite telemetry protocols in a first description format, each satellite telemetry protocol including mutually associated satellite telemetry parameter names, satellite telemetry parameter types, and satellite telemetry protocol description data; Each satellite telemetry protocol in the first description format is parsed into a satellite telemetry protocol in the second description format by the following steps: Based on the satellite telemetry parameter type in the current satellite telemetry protocol, multiple regular expressions arranged in priority are matched from the rule base; Based on the regular expression, the satellite telemetry protocol description data in the current satellite telemetry protocol is matched to obtain mask data and processing data corresponding to the satellite telemetry parameter type as the satellite telemetry protocol in the second description format, The mask data is used to parse the corresponding target description field from the satellite telemetry data sent by the target satellite, and the processed data is used to convert the target description field into an actual description field.
2. The method according to claim 1, characterized in that The rule base stores multiple parsing templates, which include multiple regular expressions arranged by priority. Different parsing templates have different regular expressions and corresponding priorities. Multiple regular expressions arranged by priority are matched from the rule base in the following way: Determining a type tag of the target satellite and a format tag of the first description format; A parsing template associated with the type tag and / or format tag is matched from the rule base.
3. The method according to claim 2, characterized in that The parsing template includes at least the first regular expression and the second regular expression, and the mask data is obtained in the following manner: Matching a byte offset value from satellite telemetry protocol description data in the current satellite telemetry protocol by using a first regular expression; Matching a bit field range start value and a bit field range end value from the satellite telemetry protocol description data in the current satellite telemetry protocol by using a second regular expression; The mask data is generated according to the matched byte offset value, bit field range start value and bit field range end value.
4. The method according to claim 3, characterized in that The mask data includes a byte offset value and a mask value. The decimal mask value X is calculated and converted into hexadecimal in the following manner: x 偏移 =x end -x start +1; Among them, x start is the starting value of the bit range, x end is the bit field range end value, x 偏移 The byte offset value.
5. The method according to claim 3, characterized in that: The step of matching a byte offset value from satellite telemetry protocol description data in the current satellite telemetry protocol by using a first regular expression specifically includes: When tuple type data is matched from the first character string of the satellite telemetry protocol description data through the first regular expression, the first element value in the tuple type data is determined as the byte offset value.
6. The method according to claim 1, characterized in that The step of matching the bit field range start value and the bit field range end value from the satellite telemetry protocol description data in the current satellite telemetry protocol by using the second regular expression specifically includes: When the tuple type data is matched from the second character string of the satellite telemetry protocol description data by the first regular expression, determining whether the length of the tuple type data is greater than 1; If so, the minimum value in the tuple type data is used as the starting value of the bit field range, and the maximum value in the tuple type data is used as the ending value of the bit field range.
7. The method according to claim 6, characterized in that Determine whether the maximum / minimum value in the tuple type data is within the preset bit field range; If yes, the step of determining the starting value of the bit field range and the ending value of the bit field range is performed.
8. A satellite telemetry protocol parsing device, characterized in that: The device comprises: an acquisition module, configured to acquire a description file sent by a target satellite, wherein the description file includes a plurality of satellite telemetry protocols in a first description format, each satellite telemetry protocol including mutually associated satellite telemetry parameter names, satellite telemetry parameter types, and satellite telemetry protocol description data; The parsing module is used to parse each satellite telemetry protocol in the first description format into a satellite telemetry protocol in the second description format through the following steps: Based on the satellite telemetry parameter type in the current satellite telemetry protocol, multiple regular expressions arranged in priority are matched from the rule base; Based on the regular expression, the satellite telemetry protocol description data in the current satellite telemetry protocol is matched to obtain mask data and processing data corresponding to the satellite telemetry parameter type as the satellite telemetry protocol in the second description format, The mask data is used to parse the corresponding target description field from the satellite telemetry data sent by the target satellite, and the processed data is used to convert the target description field into an actual description field.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the satellite telemetry protocol parsing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the satellite telemetry protocol parsing method according to any one of claims 1 to 7 are executed.