Multi-power communication protocol analysis method and device, electronic equipment and medium

Through standard information exchange model and general frame structure model, the power communication protocol type is identified, which solves the problem of inconvenience in the analysis of multiple protocols in the existing technology, and realizes rapid switching and detailed analysis of multi-power communication protocols, improving the data of the power automation system Communication efficiency.

CN119071204APending Publication Date: 2024-12-03SHENZHEN CLOU ELECTRONICS
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410995032.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The prior art is difficult to effectively parse and handle multiple power communication protocols, which makes protocol resolution inconvenient when multiple protocols are used in complex power automation configurations and systems.

Method used

The standard information exchange model is used to obtain the power communication protocol packets to be parsed, and the protocol type is identified through the general frame structure model and protocol key bit mark structure, and the protocol content is analyzed and stored, supporting the rapid switching and analysis of multi-power communication protocols.

Benefits of technology

It realizes the rapid identification and matching of multiple power communication protocols, and then conducts detailed analysis and display, solving the problem of rapid protocol switching and analysis when using multiple protocols for data communication under complex conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071204A_ABST
    Figure CN119071204A_ABST
Patent Text Reader

Abstract

The invention provides a multi-power communication protocol analysis method and device, electronic equipment and a medium, and the method comprises the steps: obtaining a to-be-analyzed power communication protocol message through a standard information exchange model, enabling the to-be-analyzed power communication protocol message to be a byte array type communication frame, enabling the communication frame to serve as a parameter to be transmitted into a protocol interface function, and the protocol interface function identifies the protocol type of the communication frame by adopting a general frame structure model and a protocol key bit marking structure, analyzes the protocol type to obtain a protocol content analysis result of the communication frame, and stores the protocol type of the communication frame and the protocol content analysis result. According to the invention, multiple electric power communication protocols can be quickly identified and matched, and then the protocol content is analyzed in detail and displayed visually, so that the matching, analysis and display of the multiple electric power communication protocols are realized; the problem that the protocol needs to be quickly switched and analyzed when a plurality of protocols are used for data communication in the electric power automation configuration and system under the complex condition is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power automation technology, and in particular to a multi-power communication protocol parsing method, a multi-power communication protocol parsing device, an electronic device and a computer-readable medium. Background Art

[0002] The power communication protocol refers to a set of standardized protocols used to transmit communications between various devices in the power system. It defines the communication format, transmission method and rules. It ensures that data and instructions can be effectively exchanged between various devices to achieve monitoring, control and management of the power system.

[0003] In the power system, a variety of power communication protocols are used to connect equipment, monitor parameters, and control transmission data. The choice of power communication protocol should be based on the application scenario and needs.

[0004] At present, the common communication protocols include MODBUS, DL / T 645-2007, DL / T 698.45, 1376.1, 1376.2, IEC101, IEC104 and other protocols. Due to the wide variety of communication protocols and the complexity of the protocol content, it is difficult for people to fully and detailed parse and analyze these protocols. Therefore, various terminal and power-related system software manufacturers have developed various protocol parsing methods and parsing tools to help R&D, testing, power systems and other places where communication protocols are needed to parse related protocols.

[0005] Currently, the protocol analysis methods on the market often only analyze one protocol, and the analysis methods and result display methods are different. However, many power automation-related configurations and power systems often use multiple protocols to meet business processing under different conditions, so single protocol analysis becomes less convenient. Summary of the invention

[0006] In view of the above problems, the present invention is proposed to provide a multi-power communication protocol parsing method and a corresponding multi-power communication protocol parsing device, an electronic device and a computer-readable medium that overcome the above problems or at least partially solve the above problems.

[0007] The present invention discloses a multi-power communication protocol parsing method, the method comprising:

[0008] Acquire the power communication protocol message to be parsed through a standard information exchange model; the power communication protocol message to be parsed is a communication frame of byte array type;

[0009] Passing the communication frame as a parameter into the protocol interface function;

[0010] The protocol interface function uses a general frame structure model and a protocol key bit mark structure to identify the protocol type of the communication frame and parse to obtain a protocol content parsing result of the communication frame;

[0011] The protocol type and protocol content parsing result of the communication frame are stored.

[0012] Optionally, the general frame structure model is used to describe the common infrastructure of various power communication protocols; and the protocol key bit tag structure is used to describe the key fields of a specific power communication protocol.

[0013] Optionally, the general frame structure model includes a start character, a length field, a control field, an address field, a frame header check, variable-length link user data, a frame check and an end character.

[0014] Optionally, the protocol interface function uses a general frame structure model and a protocol key bit mark structure to identify the protocol type of the communication frame and parse to obtain a protocol content parsing result of the communication frame, including:

[0015] The protocol interface function parses the incoming communication frame according to the general frame structure to obtain each protocol data item of the general frame structure and the data content corresponding to the protocol data item;

[0016] The data information of the general frame structure is matched with the protocol key bit mark structure to determine the protocol type of the communication frame.

[0017] Optionally, storing the protocol type and protocol content parsing result of the communication frame includes:

[0018] The protocol content parsing result is preloaded into the memory by preloading, and the protocol content parsing result is cached by structure + data dictionary, wherein the data dictionary uses the protocol data item as the dictionary key and the data content corresponding to the protocol data item as the dictionary value.

[0019] Optionally, storing the protocol type and protocol content parsing result of the communication frame includes:

[0020] When storing the protocol type and protocol content parsing result of the communication frame, MD5 is used to encrypt the protocol type and protocol content parsing result of the communication frame, and CRC is used to verify the integrity of the protocol type and protocol content parsing result of the communication frame.

[0021] The present invention also discloses a multi-power communication protocol parsing device, the device comprising:

[0022] The power communication protocol acquisition module is used to acquire the power communication protocol message to be parsed through a standard information exchange model; the power communication protocol message to be parsed is a communication frame of a byte array type;

[0023] A communication frame input module, used for inputting the communication frame as a parameter into the protocol interface function;

[0024] An identification and analysis module, used for the protocol interface function to identify the protocol type of the communication frame by using a general frame structure model and a protocol key bit mark structure and to parse and obtain a protocol content analysis result of the communication frame;

[0025] The storage module is used to store the protocol type and protocol content parsing results of the communication frame.

[0026] Optionally, the general frame structure model is used to describe the common infrastructure of various power communication protocols; and the protocol key bit tag structure is used to describe the key fields of a specific power communication protocol.

[0027] Optionally, the general frame structure model includes a start character, a length field, a control field, an address field, a frame header check, variable-length link user data, a frame check and an end character.

[0028] Optionally, the identification and parsing module includes:

[0029] The protocol content parsing submodule is used for the protocol interface function to parse the incoming communication frame according to the universal frame structure, and obtain each protocol data item of the universal frame structure and the data content corresponding to the protocol data item;

[0030] The protocol type identification submodule is used to match the data information of the general frame structure with the protocol key bit mark structure to determine the protocol type of the communication frame.

[0031] Optionally, the storage module includes:

[0032] The storage submodule is used to preload the protocol content parsing results into the memory in a preloaded manner, and cache the protocol content parsing results in a structure + data dictionary manner, wherein the data dictionary uses the protocol data item as the dictionary key and the data content corresponding to the protocol data item as the dictionary value.

[0033] Optionally, storing the protocol type and protocol content parsing result of the communication frame includes:

[0034] The encryption verification storage submodule is used to use MD5 to encrypt the protocol type and protocol content parsing results of the communication frame when storing the protocol type and protocol content parsing results of the communication frame, and use CRC to verify the integrity of the protocol type and protocol content parsing results of the communication frame.

[0035] The present invention also discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0036] The memory is used to store computer programs;

[0037] The processor is used to implement the multi-power communication protocol parsing method as described in the present invention when executing the program stored in the memory.

[0038] The present invention also discloses one or more computer-readable media on which instructions are stored, and when executed by one or more processors, the processors execute the multi-power communication protocol parsing method as described in the present invention.

[0039] The present invention includes the following advantages:

[0040] The multi-power communication protocol parsing method of the present invention obtains the power communication protocol message to be parsed through the standard information exchange model, the power communication protocol message to be parsed is a communication frame of byte array type, the communication frame is passed as a parameter to the protocol interface function, the protocol interface function uses a general frame structure model and a protocol key bit mark structure to identify the protocol type of the communication frame and parse to obtain the protocol content parsing result of the communication frame, and stores the protocol type and protocol content parsing result of the communication frame. The present invention can quickly identify and match multiple power communication protocols, and then parse the protocol content in detail and intuitively display it, realizing the matching, parsing and display of multiple power communication protocols, and solving the problem of rapid protocol switching and parsing when the power automation configuration and system use multiple protocols for data communication under complex conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flowchart of the steps of a multi-power communication protocol parsing method provided by an embodiment of the present invention;

[0042] Figure 2 is a schematic diagram of a standard information exchange model provided by an embodiment of the present invention;

[0043] Figure 3 is a schematic diagram of a general frame structure model provided by an embodiment of the present invention;

[0044] Figure 4 It is a structural block diagram of a multi-power communication protocol parsing device provided by an embodiment of the present invention;

[0045] Figure 5 is a block diagram of an electronic device provided by an embodiment of the present invention;

[0046] Figure 6It is a schematic diagram of a computer-readable medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] Reference Figure 1 , shows a flowchart of a multi-power communication protocol parsing method provided in an embodiment of the present invention, which may specifically include the following steps:

[0049] Step 101, obtaining a power communication protocol message to be parsed through a standard information exchange model; the power communication protocol message to be parsed is a communication frame of a byte array type;

[0050] Step 102, passing the communication frame as a parameter into the protocol interface function;

[0051] Step 103, the protocol interface function uses a general frame structure model and a protocol key bit mark structure to identify the protocol type of the communication frame and parse to obtain a protocol content parsing result of the communication frame;

[0052] Step 104, storing the protocol type and protocol content parsing result of the communication frame.

[0053] The multi-power communication protocol parsing method of the embodiment of the present invention can quickly switch and parse multiple power communication protocols during data communication, such as "DL / T 645-2007 Multi-function Electric Energy Meter Communication Protocol", "DL / T 698.45 Electric Energy Information Collection and Management System-Object-oriented Data Exchange Protocol", "GDW1376.1 Electric Power User Electricity Consumption Information Collection System Communication Protocol" and "GDW1376.2 Concentrator Local Communication Module Interface Protocol".

[0054] Specifically, the present invention first uses a standard information exchange model, such as Figure 2 As shown, the power communication protocol message to be parsed is received. These messages exist in the form of byte arrays (Byte[]), representing valid data frames in the communication process. Then, the above byte array is passed as a parameter to a specially designed protocol interface function. This protocol interface function integrates a general frame structure model and a protocol key bit mark structure, which can quickly identify the protocol type of the communication frame and deeply parse the protocol content. After the interface function is parsed, the protocol type of the communication frame and the detailed protocol content parsing results are stored and displayed for subsequent query or further processing.

[0055] Among them, the general frame structure model can be used to describe the basic structure shared by various power communication protocols. Figure 3, the general frame structure model may include a start character, a length field, a control field, an address field, a frame header check, a variable length link user data, a frame check, and an end character. The protocol key bit tag structure may be used to describe the key fields of a specific power communication protocol. The protocol key bit tag structure may include a start character, a length field, a control field, an address field, a frame header check, a variable length link user data, a frame check, and an end character. The protocol key bit tag structure is shown below:

[0056] STRUCT{

[0057] BYTE start character,

[0058] BYTE[2] length field L,

[0059] BYTE control field C,

[0060] BYTE[6] address field A,

[0061] BYTE frame header check HCS,

[0062] BYTE[n] link user data,

[0063] BYTE frame check FCS,

[0064] BYTE end character

[0065] }

[0066] Where n represents the variable number of bytes.

[0067] In order to facilitate integration and application in power automation host computer configuration and power system, the present invention uses C# dynamic link library as a method used by power automation host computer configuration and power system, and calls the parsing method by DllImport declaration interface. The present invention uses a custom host computer control edited by the Silverlight user-defined control of Microsoft VisualC#2019. The control interface is divided into a message frame input box and a frame parsing box. After the frame input box inputs the message, the frame parsing box parses it according to the message structure. The parsed content can be displayed in a list to improve the convenience of information viewing.

[0068] Through the multi-power communication protocol parsing method of this embodiment, the power automation host computer configuration and the power system can quickly switch and parse protocols when multiple protocols are needed for data communication.

[0069] In one embodiment of the present invention, the protocol interface function uses a general frame structure model and a protocol key bit mark structure to identify the protocol type of the communication frame and parse to obtain a protocol content parsing result of the communication frame, including:

[0070] The protocol interface function parses the incoming communication frame according to the general frame structure to obtain each protocol data item of the general frame structure and the data content corresponding to the protocol data item;

[0071] The data information of the general frame structure is matched with the protocol key bit mark structure to determine the protocol type of the communication frame.

[0072] In an embodiment of the present invention, when the protocol interface function receives the communication frame passed in as a parameter, it will be parsed according to the general frame structure, and compared and adapted with different protocol key bit mark structures to determine the protocol type of the communication frame. Specifically, the protocol interface function will first parse the incoming communication frame according to the definition of the general frame structure, including identifying the starting character of the frame, reading the length field to determine the length of subsequent data, parsing key fields such as the control field and the address field, and calculating and verifying the frame check (such as HCS and FCS) to ensure the integrity and correctness of the data. In the process of parsing the general frame structure, the protocol interface function will extract key information related to the protocol key bit mark structure, such as the value of the control field, the value of the address field, etc. This information will be used for subsequent comparison and adaptation with different protocol key bit mark structures.

[0073] Next, the protocol interface function will compare and adapt the extracted key information with multiple predefined protocol key bit tag structures, that is, compare the key fields of each protocol key bit tag structure one by one to see if there are any matching items. If all the key fields of a protocol key bit tag structure match the extracted information, then it can be determined that the communication frame belongs to the protocol type. Once a matching protocol key bit tag structure is found, the protocol interface function can determine the protocol type of the communication frame and may further perform subsequent processing operations related to the protocol, such as data decoding, business logic processing, etc.

[0074] In one embodiment of the present invention, storing the protocol type and protocol content parsing result of the communication frame includes:

[0075] The protocol content parsing result is preloaded into the memory by preloading, and the protocol content parsing result is cached by structure + data dictionary, wherein the data dictionary uses the protocol data item as the dictionary key and the data content corresponding to the protocol data item as the dictionary value.

[0076] After obtaining the protocol type and protocol content parsing results of the communication frame, the storage method adopted in the embodiment of the present invention can improve data access efficiency and system response speed, that is, it adopts a preloading technology combined with a structure + data dictionary caching strategy to achieve efficient management and fast access to the protocol content parsing results. Specifically, firstly, the protocol content parsing results are preloaded into the memory by preloading to reduce the disk I / O operations during data access, because reading data directly from the memory is much faster than reading from the disk. Secondly, in order to more conveniently manage and query these preloaded data, the present invention adopts a structure + data dictionary caching method, in which the data dictionary uses the protocol data item as the dictionary key and the data content corresponding to the protocol data item as the dictionary value, making the query and update of data very intuitive and efficient.

[0077] In one embodiment of the present invention, storing the protocol type and protocol content parsing result of the communication frame includes:

[0078] When storing the protocol type and protocol content parsing result of the communication frame, MD5 is used to encrypt the protocol type and protocol content parsing result of the communication frame, and CRC is used to verify the integrity of the protocol type and protocol content parsing result of the communication frame.

[0079] In order to further ensure the security, integrity and manageability of the protocol type of the communication frame and the protocol content parsing results, in this embodiment of the present invention, a protocol content file in ClouDB format is introduced as a storage medium, and MD5 encryption and CRC verification technology are combined to enhance the data protection mechanism.

[0080] ClouDB format is an efficient data storage format designed for cloud environments. It supports the storage of structured, semi-structured and unstructured data, while providing good scalability and flexibility. By storing the protocol type of the communication frame and the results of the protocol content analysis in ClouDB format, fast data reading and writing, efficient compression, and flexible query and management can be achieved. In addition, storage in ClouDB format has good cross-platform compatibility, allowing data to be seamlessly migrated and used in different systems and environments.

[0081] At the same time, in order to ensure the security of data, MD5 encryption technology is used to encrypt the protocol type of the communication frame and the results of the protocol content analysis. In addition, in order to verify the integrity of the data, CRC (cyclic redundancy check) technology is used. When storing the protocol type and protocol content analysis results of the communication frame, the CRC check code of these data can be calculated and stored together with the data. When it is necessary to read these data, its CRC check code is recalculated and compared with the stored check code. If the two are consistent, it means that there is no error in the data during storage and transmission; if they are inconsistent, it means that the data may have been tampered with or damaged and needs to be processed accordingly.

[0082] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0083] Reference Figure 4 , shows a structural block diagram of a multi-power communication protocol parsing device provided in an embodiment of the present invention, which may specifically include the following modules:

[0084] The power communication protocol acquisition module 401 is used to acquire the power communication protocol message to be parsed through a standard information exchange model; the power communication protocol message to be parsed is a communication frame of a byte array type;

[0085] The communication frame input module 402 is used to input the communication frame as a parameter into the protocol interface function;

[0086] An identification and analysis module 403, which is used for the protocol interface function to identify the protocol type of the communication frame by using a general frame structure model and a protocol key bit mark structure and to parse and obtain a protocol content analysis result of the communication frame;

[0087] The storage module 404 is used to store the protocol type and protocol content parsing results of the communication frame.

[0088] Optionally, the general frame structure model is used to describe the common infrastructure of various power communication protocols; and the protocol key bit tag structure is used to describe the key fields of a specific power communication protocol.

[0089] Optionally, the general frame structure model includes a start character, a length field, a control field, an address field, a frame header check, variable-length link user data, a frame check and an end character.

[0090] Optionally, the identification and parsing module includes:

[0091] The protocol content parsing submodule is used for the protocol interface function to parse the incoming communication frame according to the universal frame structure, and obtain each protocol data item of the universal frame structure and the data content corresponding to the protocol data item;

[0092] The protocol type identification submodule is used to match the data information of the general frame structure with the protocol key bit mark structure to determine the protocol type of the communication frame.

[0093] Optionally, the storage module includes:

[0094] The storage submodule is used to preload the protocol content parsing results into the memory in a preloaded manner, and cache the protocol content parsing results in a structure + data dictionary manner, wherein the data dictionary uses the protocol data item as the dictionary key and the data content corresponding to the protocol data item as the dictionary value.

[0095] Optionally, storing the protocol type and protocol content parsing result of the communication frame includes:

[0096] The encryption verification storage submodule is used to use MD5 to encrypt the protocol type and protocol content parsing results of the communication frame when storing the protocol type and protocol content parsing results of the communication frame, and use CRC to verify the integrity of the protocol type and protocol content parsing results of the communication frame.

[0097] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0098] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0099] Memory 503, used for storing computer programs;

[0100] The processor 501 is used to implement the multi-power communication protocol parsing method described in the above embodiment when executing the program stored in the memory 503.

[0101] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0102] The communication interface is used for communication between the above terminal and other devices.

[0103] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0104] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0105] like Figure 6 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 601 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the multi-power communication protocol parsing method described in the above embodiment.

[0106] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is executed on a computer, the computer executes the multi-power communication protocol parsing method described in the above embodiment.

[0107] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0108] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0109] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for analyzing multiple power communication protocols, characterized in that: The method comprises: Acquire the power communication protocol message to be parsed through a standard information exchange model; the power communication protocol message to be parsed is a communication frame of byte array type; Passing the communication frame as a parameter into the protocol interface function; The protocol interface function uses a general frame structure model and a protocol key bit mark structure to identify the protocol type of the communication frame and parse to obtain a protocol content parsing result of the communication frame; The protocol type and protocol content parsing result of the communication frame are stored.

2. The method according to claim 1, characterized in that The general frame structure model is used to describe the common basic structure of various power communication protocols; the protocol key bit mark structure is used to describe the key fields of a specific power communication protocol.

3. The method according to claim 2, characterized in that The general frame structure model includes a start character, a length field, a control field, an address field, a frame header check, link user data of variable length, a frame check and an end character.

4. The method according to claim 1, characterized in that: The protocol interface function uses a general frame structure model and a protocol key bit mark structure to identify the protocol type of the communication frame and parse to obtain the protocol content parsing result of the communication frame, including: The protocol interface function parses the incoming communication frame according to the general frame structure to obtain each protocol data item of the general frame structure and the data content corresponding to the protocol data item; The data information of the general frame structure is matched with the protocol key bit mark structure to determine the protocol type of the communication frame.

5. The method according to claim 4, characterized in that The protocol type and protocol content parsing results of the communication frame are stored, including: The protocol content parsing result is preloaded into the memory by preloading, and the protocol content parsing result is cached by structure + data dictionary, wherein the data dictionary uses the protocol data item as the dictionary key and the data content corresponding to the protocol data item as the dictionary value.

6. The method according to claim 1, characterized in that The protocol type and protocol content parsing results of the communication frame are stored, including: When storing the protocol type and protocol content parsing result of the communication frame, MD5 is used to encrypt the protocol type and protocol content parsing result of the communication frame, and CRC is used to verify the integrity of the protocol type and protocol content parsing result of the communication frame.

7. A multi-power communication protocol analysis device, characterized in that: The device comprises: The power communication protocol acquisition module is used to acquire the power communication protocol message to be parsed through a standard information exchange model; the power communication protocol message to be parsed is a communication frame of a byte array type; A communication frame input module, used for inputting the communication frame as a parameter into a protocol interface function; An identification and analysis module, used for the protocol interface function to identify the protocol type of the communication frame by using a general frame structure model and a protocol key bit mark structure and to parse and obtain a protocol content analysis result of the communication frame; The storage module is used to store the protocol type and protocol content parsing results of the communication frame.

8. The device according to claim 7, characterized in that The general frame structure model is used to describe the common basic structure of various power communication protocols; the protocol key bit mark structure is used to describe the key fields of a specific power communication protocol.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the multi-power communication protocol parsing method as described in any one of claims 1-6 when executing the program stored in the memory.

10. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the multi-power communication protocol parsing method according to any one of claims 1-6.

Citation Information

Cited By

  • Adaptive interface adaptation method and device for communication machine room

    CN119759818A

  • Dynamic protocol analysis method, device and equipment for electric power communication terminal

    CN120499296A