Communication protocol analysis method and system
By establishing a data item mapping table, automatically matching and converting data items of different communication protocols, the cumbersome problems of data item analysis and conversion in the prior art are solved, and the efficiency, maintainability and scalability of the system are improved.
Patent Information
- Application Number
- CN202510291257.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-25
AI Technical Summary
When processing data from multiple communication protocols, the prior art requires individual analysis and transformation functions for each data item, resulting in huge code volume, redundant, and complex maintenance and debugging.
By establishing a data item mapping table, associated data items of different communication protocols, automatic matching and conversion of data is achieved. The specific steps include receiving the meter reading reply frame sent by the power meter, analyzing and converting the data according to the data item mapping table, and converting the data from the first communication protocol format to the second communication protocol format.
It greatly improves the efficiency of data parsing and the maintainability and scalability of the system, avoids the tedious process of writing parsing functions separately for each data item in the traditional method, and simplifies code management and protocol updates.
Smart Images

Figure CN119892955A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart grid technology, and in particular to a communication protocol parsing method and system. Background Art
[0002] With the rapid development of the power industry, related communication protocols are also constantly being updated. For example, the communication protocol of the energy meter has been gradually updated from the traditional DL / T 645 protocol to the DL / T 698 protocol, but in actual on-site operation and maintenance, the energy meter of the DL / T645 protocol still occupies a dominant position. Therefore, the power collection equipment must be compatible with the data parsing of these two protocols.
[0003] At present, the uplink communication protocol of the electricity collection equipment adopts the DL / T 698 protocol. Therefore, for the collected DL / T 645 protocol electric energy meter data, we need to parse it and convert it into the DL / T698 protocol format for storage, so as to report the data and interact with the main station. The traditional data parsing method is to write a parsing module for each DL / T 645 protocol data item separately, and then convert it into the corresponding DL / T 698 protocol data format for storage. The traditional parsing method is as follows: Due to the large number of data items in the electric energy meter, each data item needs to be parsed and converted separately, resulting in a large amount of code, redundancy, and it is very difficult to maintain and complicated to debug. Summary of the invention
[0004] (I) Purpose of the invention
[0005] The purpose of the present invention is to provide a communication protocol parsing method and system, which overcomes the problem of writing parsing and conversion functions separately for each data item. When a new data item needs to be parsed, it is only necessary to update the data table without modifying the parsing code, which greatly improves the efficiency, maintainability, scalability and accuracy of the system, and provides an efficient and flexible solution for data collection, transmission and storage in the power industry.
[0006] (II) Technical solution
[0007] To solve the above problem, the first aspect of the present invention provides a communication protocol parsing method, comprising the following steps:
[0008] Establishing a data item mapping table, wherein the data item mapping table is used to associate data items of the first communication protocol and the second communication protocol;
[0009] A meter reading reply frame sent by the electric energy meter is received, and the meter reading reply frame is parsed based on the data item mapping table, wherein the parsing includes:
[0010] According to the first data item identifier of the meter reading reply frame, obtaining a second data item identifier from the data item mapping table, wherein the second data item identifier corresponds to the first data item identifier;
[0011] Parse according to the second data item identifier and convert the data in the meter reading reply frame from the first communication protocol format to the second communication protocol format.
[0012] Further, the parsing according to the second data item identifier includes:
[0013] If a second data item identifier is obtained, parsing the data item corresponding to the second data item identifier;
[0014] If multiple identical second data item identifiers are obtained, parsing the structure data corresponding to the second data item identifiers;
[0015] If a plurality of different second data item identifiers are obtained, the data items corresponding to the second data item identifiers are parsed in sequence according to the order in the data item mapping table.
[0016] Furthermore, if a plurality of identical second data item identifiers are obtained, parsing the structure data corresponding to the second data item identifiers includes:
[0017] The data item format and occurrence time corresponding to each second data item identifier are searched respectively according to the data item mapping table, and the corresponding structure data is composed based on the data item format and the occurrence time, and then cyclic parsing is performed.
[0018] Further, if a plurality of different second data item identifiers are obtained, parsing the data items corresponding to the second data item identifiers in sequence according to the order in the data item mapping table includes:
[0019] The data item format and occurrence time corresponding to each second data item identifier are parsed in order from top to bottom.
[0020] Furthermore, the method further comprises:
[0021] receiving a meter reading data frame sent by the electric energy meter, and performing frame format verification on the meter reading data frame according to the first communication protocol;
[0022] If the verification is successful, a meter reading reply frame is generated based on the meter reading data frame.
[0023] Furthermore, the method further includes: parsing the meter reading reply frame according to a first communication protocol to obtain a first data item identifier.
[0024] Furthermore, the receiving the meter reading data frame sent by the electric energy meter and performing frame format verification on the meter reading data frame according to the first communication protocol includes:
[0025] The frame start character, data field length, frame end character and frame check of the meter reading data frame are verified respectively, and the following processing is performed according to the verification results:
[0026] If any of the information verification fails, the meter reading data frame is discarded;
[0027] If all the information is verified, a meter reading reply frame based on the first communication protocol is generated according to the meter reading data frame.
[0028] Furthermore, the method further comprises:
[0029] After the parsing is completed, the data converted into the second communication protocol format is stored as a conversion data frame, and the conversion data frame includes a second data item identifier and data corresponding to the second data item identifier.
[0030] Furthermore, the first communication protocol is the DLT645 protocol, and the second communication protocol is the DLT698 protocol; the first data item identifier is DLT_ID, and the second data item identifier includes a primary data item identifier M-OAD and a secondary data item identifier C-OAD, the primary data identifier includes real-time data, frozen data, and daily frozen data, and the secondary data item identifier C-OAD corresponds to the first data item identifier DLT_ID.
[0031] In addition, a second aspect of the present invention provides a communication protocol parsing system, comprising:
[0032] Establishing a mapping table module, used to establish a data item mapping table, wherein the data item mapping table is used to associate data items of the first communication protocol and the second communication protocol;
[0033] The parsing module is used to receive a meter reading reply frame sent by the electric energy meter, and parse the meter reading reply frame based on the data item mapping table, wherein the parsing includes:
[0034] According to the first data item identifier of the meter reading reply frame, obtaining a second data item identifier from the data item mapping table, wherein the second data item identifier corresponds to the first data item identifier;
[0035] Parse according to the second data item identifier, convert the data in the meter reading reply frame from the first communication protocol format to the second communication protocol format
[0036] (III) Beneficial effects
[0037] The above technical solution of the present invention has the following beneficial technical effects: the present invention provides a communication protocol parsing method and system, which greatly improves the efficiency of data parsing and the maintainability and scalability of the system. Especially when facing a large number of data items, the application of the mapping table makes the matching and conversion of data faster and more efficient. The method establishes a corresponding mapping table between the DL / T 645 protocol (first communication protocol) and the DL / T 698 protocol (second communication protocol), and the mapping table contains information such as data item identifiers, data content formats, and data lengths of the two protocols. The specific parsing and conversion process of the method is as follows: first, a data item mapping table is established to associate data items of the first communication protocol and the second communication protocol; then, a meter reading reply frame sent by the electric energy meter is received, and the meter reading reply frame is parsed based on the data item mapping table. The specific parsing principle includes: according to the first data item identifier of the meter reading reply frame, the first data item identifier of the DLT645 protocol corresponding to the meter reading reply frame is searched through the previously established mapping table, and then according to the first data item identifier of the DLT645 protocol, the second data item identifier is obtained in the data item mapping table, and the second data item identifier corresponds to the first data item identifier; finally, the data in the meter reading reply frame is parsed according to the second data item identifier, and converted from the first communication protocol format to the second communication protocol format. The advantage of this method is that it avoids writing a separate parsing and conversion function for each data item. When new data items need to be parsed, only the data table needs to be updated without modifying the parsing code, which greatly improves the scalability and maintainability of the system. Through the use of the data item mapping table, the corresponding C-OAD (the secondary / sub-data item identifier of the DLT 698 protocol, the DLT 698 protocol includes the main data item identifier M-OAD and the secondary data item identifier C-OAD) can be directly found according to DLT_ID (the first data item identifier of the DLT645 protocol), avoiding the cumbersome process of writing a parsing function for each data item separately in the traditional method, thereby greatly improving the efficiency of data parsing. Especially when facing a large number of data items, the application of the mapping table makes the matching and conversion of data faster and more efficient. Finally, the corresponding parsing results are converted to the DLT 698 protocol format for storage. This solution uses a mapping table to store the correspondence between the DL / T 645 protocol and the DL / T 698 protocol. When a new protocol data item is needed, only a new mapping relationship needs to be added to the table without modifying the underlying parsing logic or function code. This enables the system to flexibly respond to protocol updates and expansions, greatly improving the scalability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of the communication protocol parsing method of the present invention;
[0039] Figure 2 It is a schematic diagram of the communication protocol analysis system of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0041] like Figure 1 As shown, the first aspect of the present invention provides a communication protocol parsing method, comprising the following steps:
[0042] S1, establishing a data item mapping table, wherein the data item mapping table is used to associate data items of a first communication protocol and a second communication protocol; in an embodiment of the present invention, the first communication protocol is, for example, the DLT645 protocol, and the second communication protocol is, for example, the DLT698 protocol;
[0043] S2, receiving a meter reading reply frame sent by the electric energy meter, and parsing the meter reading reply frame based on the data item mapping table. The frame start character of the meter reading reply frame is 0x68, and the frame end character is 0x16.
[0044] The process of generating a meter reading reply frame includes: receiving a meter reading data frame sent by an electric energy meter, and performing frame format verification on the meter reading data frame according to a first communication protocol; if the verification is passed, generating a meter reading reply frame according to the meter reading data frame, and the specific process is: respectively verifying the frame start character, data field length, frame end character and frame check of the meter reading data frame, and performing the following processing according to the verification result:
[0045] (1) If any of the information fails to be verified, the meter reading data frame is discarded;
[0046] (2) If all the information is verified, a meter reading reply frame based on the first communication protocol is generated according to the meter reading data frame, and the meter reading reply frame is generated by the electric energy meter.
[0047] The parsing process in step S2 includes:
[0048] S21, according to the first data item identifier of the meter reading reply frame, obtain the second data item identifier from the data item mapping table, the second data item identifier corresponds to the first data item identifier. The first data item identifier is DLT_ID, the second data item identifier includes the main data item identifier M-OAD and the secondary data item identifier C-OAD, the main data identifier includes real-time data, frozen data and daily frozen data, the secondary data item identifier C-OAD corresponds to the first data item identifier DLT_ID. M-OAD is mainly used to distinguish data types, such as the main OAD of real-time data is 0, the main OAD of minute frozen data is 0x50020200, and the main OAD of daily frozen data is 0x50040200. For example, the M-OAD of real-time positive active power, minute frozen positive active power, and daily frozen positive active power are different, but the C-OAD is 0x00100200. In the present invention, the meter reading reply frame is first parsed according to the first communication protocol to obtain the first data item identifier.
[0049] S22, parsing according to the second data item identifier, converting the data in the meter reading reply frame from the first communication protocol format to the second communication protocol format. The parsing according to the second data item identifier includes three situations:
[0050] A. If a second data item identifier is obtained, parsing the data item corresponding to the second data item identifier;
[0051] B. If multiple identical second data item identifiers are obtained, the structure data corresponding to the second data item identifier is parsed. This step specifically includes: searching for the data item format and occurrence time corresponding to each second data item identifier according to the data item mapping table, forming the corresponding structure data based on the data item format and occurrence time, and then performing a circular analysis. In this step, the date_type (DLT698 protocol data item format) data item in the structure contains the length of the corresponding data item, and DLT_array (the number of array elements of the DLT645 protocol data item) represents the number of array elements, which can be used to parse the specific content of the message.
[0052] C. If multiple different second data item identifiers are obtained, the data items corresponding to the second data item identifiers are parsed in sequence according to the order in the data item mapping table, specifically including: parsing the data item format and occurrence time corresponding to each second data item identifier in sequence from top to bottom.
[0053] The method further includes S3: after the parsing is completed, storing the data converted into the second communication protocol format as a conversion data frame, wherein the conversion data frame includes a second data item identifier and data corresponding to the second data item identifier.
[0054] In addition, the second aspect of the present invention further provides a communication protocol parsing system, comprising:
[0055] A mapping table establishment module 21 is used to establish a data item mapping table, wherein the data item mapping table is used to associate data items of the first communication protocol and the second communication protocol;
[0056] The parsing module 22 is used to receive the meter reading reply frame sent by the electric energy meter, and parse the meter reading reply frame based on the data item mapping table, wherein the parsing includes:
[0057] According to the first data item identifier of the meter reading reply frame, obtaining a second data item identifier from the data item mapping table, wherein the second data item identifier corresponds to the first data item identifier;
[0058] Parse according to the second data item identifier and convert the data in the meter reading reply frame from the first communication protocol format to the second communication protocol format.
[0059] The present invention is described in detail below with reference to specific embodiments.
[0060] (I) Frame format verification and data analysis
[0061] 1. First, verify the format of the meter reading data frame returned by the electric energy meter:
[0062] Frame start character: Find the frame start character 0x68.
[0063] 2. Frame length (data field length) calculation: Calculate the position of the frame end character based on the data field length in the frame, and verify whether the end character is 0x16.
[0064] 3. Frame checksum verification: Calculate the frame checksum according to the DL / T 645 (DLT 645) protocol specification and compare it with the check bit in the frame to verify whether they are consistent.
[0065] If the frame format verification fails, the frame is discarded; if the verification passes, a DL / T 645 protocol meter reply frame M with the correct format is obtained.
[0066] (II) Establishing a data item mapping table between the DLT645 protocol (first communication protocol) and the DLT698 protocol (second communication protocol)
[0067] Establish a data item mapping table to associate the data items of the DL / T 645 protocol with the DL / T 698 (DLT 698) protocol. The mapping table structure is shown in Table 1:
[0068] Table 1 Corresponding mapping table between DL / T 645 protocol and DL / T 698 protocol
[0069]
[0070] In Table 1, the fields are explained as follows:
[0071] M-OAD: DLT698 protocol master data item identifier, indicating different types of data, such as real-time data (0x00000000) or frozen data (0x50020200), daily frozen data (0x50040200).
[0072] C-OAD: DLT698 protocol secondary data item identifier (sub-data item identifier), specific data item identifier, indicating, for example, positive electric energy (0x00100200) etc.
[0073] date_type: 698 protocol (DLT698 protocol) data item format, d_double_long_unsigned is a 4-byte unsigned integer, d_long_unsigned is a 2-byte unsigned integer, d_date_time_s is a 7-byte time data
[0074] DLT_ID:645 protocol data item identifier, indicating the specific identifier of the data item
[0075] DLT_type: 645 protocol data collection type, for example, DT_COM is real-time data, DT_RECORD is load data collection, DT_TIMES means collection by number of times, such as reading the frozen data of the previous day.
[0076] DLT_array: Array number of 645 protocol data items
[0077] DLT_format: The format of the 645 protocol data item, such as XXXXXX or YYMMDDhhmm.
[0078] (III) Mapping table lookup, analysis and conversion
[0079] First, the frame M is parsed according to the 645 protocol format to obtain the corresponding DLT_ID, and the corresponding C-OAD is obtained by looking up the table. One or more results may be returned and processed according to different situations.
[0080] Frame format:
[0081] 0x68|6-byte meter address|0x68 0x91|length|DLT_ID|data field|checksum|0x16
[0082] Parsing steps:
[0083] 1. Data identification extraction: According to DLT_ID (data item identification of DLT645 protocol), the corresponding C-OAD (sub-data item identification of DLT 698 protocol) is obtained by looking up the table.
[0084] 2. According to the search results, the corresponding analysis includes:
[0085] 2.1 If a C-OAD is found, parse its corresponding data item;
[0086] 2.2 When multiple identical C-OADs are returned, it indicates that the data content is a structure. For example, if 0x0101FF00 corresponds to two 0x10100200, it is parsed as structure data (such as maximum demand). For example, if DLT_ID is 0x0101FF00, the query table will return two identical 0x10100200.
[0087] Example: Parsing real-time demand data of electric meters (hexadecimal)
[0088] 68 01 00 00 00 00 00 68 91 2C 33 32 34 34 99 99 99 4B 3C 58 3C 3B 4444 44 4B 3C 58 3C 3B 55 55 55 4B 3C 58 3C 3B 66 66 66 4B 3C 58 3C 3B 77 77774C 3C 58 3C 3B 37 16;
[0089] Extract the data identifier 33 32 34 34, invert it and subtract 0x33 to get the value of DLT_ID 0x0101FF00;
[0090] 99 99 99 4B 3C 58 3C 3B 44 44 44 4B 3C 58 3C 3B 55 55 55 4B 3C 58 3C3B66 66 66 4B 3C 58 3C 3B 77 77 77 4C 3C 58 3C 3B is data content;
[0091] Define the 698 protocol 0x10100200 data item structure:
[0092] typedef struct tag_DEMAND
[0093] {
[0094] d_double_long_unsigned nValue;
[0095] d_date_time_s time;
[0096] }DEMAND;
[0097] DEMAND demand[5];
[0098] 0x0101FF00 corresponds to DLT_array as X in the table, and the single array content of the 698 protocol contains (d_double_long_unsigned) and the occurrence time (d_date_time_s), which is a structure. The DLT_format corresponding to the first 0x0101FF00 position is XXXXXX, indicating that the length of the first data item of the 698 protocol 0x0101FF00 array element structure in frame M is 3, and 99 99 99 is the value of Demand[0].nValue. The DLT_format corresponding to the second 0x0101FF00 position is YYMMDDhhmm, that is, 4B 3C 58 3C 3B is the value of Demand[0].time. After four cycles, the values of the remaining four array elements can be solved.
[0099] 2.3 If multiple different C-OADs are returned, parse the data items in sequence. When multiple different C-OADs are returned, parse them in the order from top to bottom in Table 1. For example, when reading the minute freeze data voltage data item 0x06100101, the corresponding 698 protocol data items C-0AD retrieved in Table 1 are 0x20210200 and 0x20000200, which represent the freeze time and voltage value respectively, that is, the 645 protocol uses one data identifier to represent two data identifiers in the 698 protocol.
[0100] The following is an example: Analyze the minute freeze positive active power of a single-phase electric energy meter
[0101] 68 50 49 09 23 00 10 68 91 0d 34 39 43 39 33 47 47 3b 57ab b8 c333d816;
[0102] Extract the data identifier 34 39 43 39, invert it and subtract 0x33 to get the value of DLT_ID 0x06100601;
[0103] According to the order of 0x20210200 and 0x00100201 retrieved by DLT_ID in Table 1, we first parse 0x20210200, and the corresponding DLT_format is YYMMDDhhmm, that is, 33 47 47 3b57 is the time. Subtract 0x33 to get the time as 0:00 on August 14, 2024. Assign this value to the 0x20210200 data item in the 698 protocol. The DLT_format corresponding to the second data item 0x00100201 is XXXXXXXX, and the value of the data field in the corresponding frame N is ab b8 c3 33. After conversion, it is assigned to the 0x00100201 data item.
[0104] For other data items, the mapping table is still used to parse and convert according to the corresponding format. The key is to look up the table without paying attention to the specific data item identifier. After the parsing is completed, the data converted into the DL / T698 protocol format is stored. The stored content includes the data item identifier and the corresponding data content.
[0105] The present invention provides a communication protocol parsing method and system. The method establishes a data mapping table between the DL / T 645 protocol and the DL / T 698 protocol. By parsing the return data frame of the electric energy meter, the two protocol data can be efficiently converted. The method has the following advantages: (1) Improving parsing efficiency: By using the data item mapping table, the corresponding C-OAD can be directly found according to the DLT_ID, avoiding the tedious process of writing a parsing function for each data item separately in the traditional method, thereby greatly improving the efficiency of data parsing. Especially when facing a large number of data items, the application of the mapping table makes the matching and conversion of data faster and more efficient. (2) Simplifying the code and enhancing the maintainability of the system: The traditional parsing method often requires writing an independent parsing module for each data item, resulting in bloated and difficult to maintain code. However, the present solution makes the parsing of newly added or modified data items simpler through the centralized management of the data item mapping table. It only needs to update the mapping table, avoiding the modification of a large number of parsing functions, thereby significantly improving the maintainability of the system. (3) Enhance the scalability of the system: This solution uses a mapping table to store the correspondence between the DL / T 645 protocol and the DL / T 698 protocol. When a new protocol data item is needed, it is only necessary to add a new mapping relationship to the table without modifying the underlying parsing logic or function code. This enables the system to flexibly respond to protocol updates and expansions, greatly improving the scalability of the system. (4) Reduce computational complexity: In traditional parsing methods, each data item needs to be processed separately, which may lead to lengthy calculations and repeated logic. Through the mapping table of this solution, when querying, it is only necessary to look up the table according to DLT_ID to obtain the corresponding C-OAD, and directly perform data parsing and conversion, thereby reducing repeated calculations and processing steps and optimizing system performance. (5) Improve the accuracy and consistency of data conversion: The use of a mapping table can ensure that the conversion rules of different protocol data items are unified, avoiding errors caused by manual coding or manual configuration, thereby improving the accuracy and consistency of data conversion and reducing potential errors and abnormal situations. (6) Facilitate debugging and testing: Due to the use of a standardized mapping table, the debugging process of this technical solution is simpler. Developers can directly understand the conversion rules and formats of each data item through the mapping table, reducing the complexity and uncertainty in the debugging process. In addition, when problems arise, the mapping table makes problem location and repair more intuitive and efficient. (7) Compatibility and adaptability: This solution not only supports the existing DL / T 645 protocol and DL / T 698 protocol, but can also be easily expanded to support new protocols or data items that may be introduced in the future. Through flexible configuration and the expansion capability of the mapping table, the system can be compatible with different versions of protocol requirements and adapt to industry development and standard changes.
[0106] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the claims attached to the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the attached claims, or the equivalent forms of such scope and boundaries. Obviously, the above embodiments are only examples made for clear explanation, and are not limitations on the implementation methods. For ordinary technicians in the field, other different forms of changes or modifications can be made on the basis of the above description. It is not necessary and impossible to list all the implementation methods here. And the obvious changes or modifications derived from this are still within the protection scope of the present invention.
[0107] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the instructions in the flow chart. Figure 1 A process or multiple processes and / or boxes Figure 1 The functions specified in one or more boxes. A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes the following process of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
Claims
1. A communication protocol parsing method, characterized in that: The method is used for power collection equipment and comprises the following steps: Establishing a data item mapping table, wherein the data item mapping table is used to associate data items of the first communication protocol and the second communication protocol; A meter reading reply frame sent by the electric energy meter is received, and the meter reading reply frame is parsed based on the data item mapping table, wherein the parsing includes: According to the first data item identifier of the meter reading reply frame, obtaining a second data item identifier from the data item mapping table, wherein the second data item identifier corresponds to the first data item identifier; Parse according to the second data item identifier and convert the data in the meter reading reply frame from the first communication protocol format to the second communication protocol format.
2. The communication protocol analysis method according to claim 1, characterized in that: The parsing according to the second data item identifier includes: If a second data item identifier is obtained, parsing the data item corresponding to the second data item identifier; If multiple identical second data item identifiers are obtained, parsing the structure data corresponding to the second data item identifiers; If a plurality of different second data item identifiers are obtained, the data items corresponding to the second data item identifiers are parsed in sequence according to the order in the data item mapping table.
3. The communication protocol analysis method according to claim 2, characterized in that: If a plurality of identical second data item identifiers are obtained, parsing the structure data corresponding to the second data item identifiers includes: The data item format and occurrence time corresponding to each second data item identifier are searched respectively according to the data item mapping table, and the corresponding structure data is composed based on the data item format and the occurrence time, and then cyclic parsing is performed.
4. The communication protocol analysis method according to claim 2, characterized in that: If a plurality of different second data item identifiers are obtained, then the data items corresponding to the second data item identifiers are parsed in sequence according to the order in the data item mapping table, including: The data item format and occurrence time corresponding to each second data item identifier are parsed in order from top to bottom.
5. The communication protocol analysis method according to claim 1, characterized in that: The method further comprises: receiving a meter reading data frame sent by the electric energy meter, and performing frame format verification on the meter reading data frame according to the first communication protocol; If the verification is successful, a meter reading reply frame is generated based on the meter reading data frame.
6. The communication protocol analysis method according to claim 5, characterized in that: The method further comprises: The meter reading reply frame is parsed according to the first communication protocol to obtain a first data item identifier.
7. The communication protocol analysis method according to claim 5, characterized in that: The receiving the meter reading data frame sent by the electric energy meter and performing frame format verification on the meter reading data frame according to the first communication protocol includes: The frame start character, data field length, frame end character and frame check of the meter reading data frame are verified respectively, and the following processing is performed according to the verification results: If any of the information verification fails, the meter reading data frame is discarded; If all the information is verified, a meter reading reply frame based on the first communication protocol is generated according to the meter reading data frame.
8. The communication protocol analysis method according to claim 1, characterized in that: The method further comprises: After the parsing is completed, the data converted into the second communication protocol format is stored as a conversion data frame, and the conversion data frame includes a second data item identifier and data corresponding to the second data item identifier.
9. The communication protocol analysis method according to claim 1, characterized in that: The first communication protocol is the DLT645 protocol, and the second communication protocol is the DLT698 protocol; the first data item identifier is DLT_ID, and the second data item identifier includes a primary data item identifier M-OAD and a secondary data item identifier C-OAD, the primary data identifier includes real-time data, frozen data, and daily frozen data, and the secondary data item identifier C-OAD corresponds to the first data item identifier DLT_ID.
10. A communication protocol analysis system, characterized in that: include: Establishing a mapping table module, used to establish a data item mapping table, wherein the data item mapping table is used to associate data items of the first communication protocol and the second communication protocol; The parsing module is used to receive a meter reading reply frame sent by the electric energy meter, and parse the meter reading reply frame based on the data item mapping table, wherein the parsing includes: According to the first data item identifier of the meter reading reply frame, obtaining a second data item identifier from the data item mapping table, wherein the second data item identifier corresponds to the first data item identifier; Parse according to the second data item identifier and convert the data in the meter reading reply frame from the first communication protocol format to the second communication protocol format.