Substation protocol standardization conversion method and system
By adopting packet preprocessing, protocol type identification and multi-threaded parallel conversion techniques in the substation, the problem of poor real-time protocol conversion in the substation is solved, and efficient and accurate protocol conversion and packaging are achieved.
Patent Information
- Application Number
- CN202411728811.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-11-28
AI Technical Summary
There are a large number of different types of communication protocols in the substation, resulting in low packet resolution efficiency and poor real-time protocol conversion, affecting the rapid response capability of the substation system.
A standardized conversion method and system for substation protocol is proposed. By acquiring target data packets for preprocessing, establishing a judgment model for protocol type identification, and adopting multi-threaded and multi-process parallel conversion technology to achieve fast and accurate conversion and packaging of data packets.
It improves the accuracy and efficiency of protocol identification, enhances the real-time and accuracy of protocol conversion, and is suitable for conversion of different types of protocols, including conversion between old and new protocols and uncertain protocols and standard protocols.
Smart Images

Figure CN119814892A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of substation protocol standardization conversion, and in particular to a substation protocol standardization conversion method and system. Background Art
[0002] Substation protocol standardization refers to the process of unifying and standardizing the communication protocols between various devices and systems in a substation. It aims to ensure that equipment produced by different manufacturers can communicate and interoperate with each other, thereby improving the reliability and efficiency of the substation. The substation protocol standardization conversion device is a device used in the substation automation system. Its main function is to realize the conversion between different communication protocols. This device can play a bridging role in the substation, enabling intelligent devices using different communication protocols to communicate and exchange data with each other, thereby improving the integration and efficiency of the substation automation system.
[0003] Since there are a large number of different types of protocols in substations, including international standard protocols, industry-wide protocols, and customized protocols by equipment manufacturers, these protocols vary greatly in data format, frame structure, communication rules, and semantics. When parsing and converting data packets, parsing the entire data packet will cause the basic information at the header of the data packet and the checksum information at the tail to mix with each other, affecting the parsing process of the data packet. When the data flow is large, the conversion device may not be able to complete the protocol conversion in time due to insufficient processing speed, resulting in delays and affecting the rapid response capability of the entire substation system. In order to improve the real-time performance of protocol conversion, we propose a substation protocol standardization conversion device and method. Summary of the invention
[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0005] In view of the above existing problems, the present invention is proposed.
[0006] Therefore, the present invention provides a substation protocol standardization conversion method and system, which can solve the problems mentioned in the background technology.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] In a first aspect, the present invention provides a substation protocol standardization conversion method, comprising:
[0009] Acquire a target substation data packet, and perform a first preprocessing on the data packet;
[0010] Establishing a first judgment model, and performing a first judgment on the first preprocessing result according to the first judgment model;
[0011] A second preprocessing is performed on the first preprocessing result that meets the first judgment result to complete the substation protocol standardization conversion.
[0012] As a preferred solution of the substation protocol standardization conversion method of the present invention, wherein: the second preprocessing of the first preprocessing result that meets the first judgment result includes:
[0013] Performing a first stratification on the first preprocessing results that meet the first judgment result;
[0014] Performing a first data conversion on the result after the first stratification;
[0015] A second judgment is performed on the result after the first data conversion.
[0016] As a preferred solution of the substation protocol standardization conversion method of the present invention, wherein: the second preprocessing of the first preprocessing result that meets the first judgment result further includes:
[0017] Performing a first encapsulation on the result after the first data conversion that meets the second judgment result;
[0018] A first configuration is performed on the first encapsulation result to complete the substation protocol standardization conversion.
[0019] As a preferred solution of the substation protocol standardization conversion method of the present invention, wherein: performing a first judgment on the first preprocessing result according to the first judgment model includes:
[0020] The first judgment model is used to perform a first judgment on the first preprocessing result;
[0021] The first judgment is used to judge whether the target protocol type identification in the first preprocessing result is correct;
[0022] The first judgment model is any model that can implement the first judgment.
[0023] As a preferred solution of the substation protocol standardization conversion method of the present invention, wherein: the first judgment on the first preprocessing result according to the first judgment model further includes:
[0024] The first judgment includes a first segment analysis and a second tail analysis;
[0025] Performing a first segment analysis on the first preprocessing result using the first judgment model;
[0026] A second tail analysis is performed on the result after the first segment analysis to obtain a first preprocessing result that meets the first judgment result.
[0027] In a second aspect, the present invention provides a substation protocol standardization conversion system, comprising:
[0028] A protocol identification module configured with a first pre-processing function;
[0029] A protocol parsing module configured with a first judgment function;
[0030] A data conversion module configured with a first layer and a first data conversion function;
[0031] A verification encapsulation module configured with a second judgment function.
[0032] As a preferred solution of the substation protocol standardization conversion system of the present invention, the protocol parsing module at least includes:
[0033] A data splitting unit configured with a first segment parsing function;
[0034] A data parsing unit is configured with a second tail parsing function.
[0035] As a preferred solution of the substation protocol standardization conversion system of the present invention, the verification and encapsulation module at least includes:
[0036] A data verification unit configured with a second judgment function;
[0037] A data encapsulation unit configured with a first encapsulation function.
[0038] In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned method when executing the computer program.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method described above when executed by a processor.
[0040] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention proposes a method and system for substation protocol standardization conversion, obtains a target substation data packet, and performs a first preprocessing on the data packet; establishes a first judgment model, and performs a first judgment on the first preprocessing result according to the first judgment model; performs a second preprocessing on the first preprocessing result that meets the first judgment result, and completes the substation protocol standardization conversion. The collected substation data packets are scanned by the protocol identification module, and the data packets are preliminarily screened by feature word recognition. For those data packets that cannot be identified by feature word recognition, deep packet detection technology is used for in-depth analysis to identify the protocol type, and then the data packets are split using the protocol parsing module, and a multi-field parsing task is established. The message queue communication method is used between the field parsing tasks to realize the segmented parsing of the data packet, which eliminates the phenomenon of data information mixing when the data packet is parsed as a whole. At the same time, the technical solution not only improves the accuracy and efficiency of protocol identification by constructing a complete identification operation stability monitoring and evaluation system, but also provides effective support for the continuous optimization and improvement of the system. With strong support, the stable and efficient operation of network communication is finally realized. When converting the parsed data, the data packets are layered according to the protocol layer through the data conversion module, and further allocated according to the size of the data block in each layer. For data in different protocol layers, multi-threading is used to convert the data in parallel. For different data blocks in the same protocol layer, multi-process is used to convert them in parallel, which improves the data conversion efficiency, speeds up the data conversion process, and improves the accuracy and real-time performance of protocol conversion. It is not only suitable for different types of protocol conversion in substations, but also for the conversion between old and new protocols of the same type, as well as the conversion between uncertain protocols or non-standard protocols and standard protocols. It has a wide range of applications and strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0042] Figure 1 A method flow chart of a substation protocol standardization conversion method and system provided by an embodiment of the present invention;
[0043] Figure 2 An overall system structure diagram of a substation protocol standardization conversion method and system provided by an embodiment of the present invention;
[0044] Figure 3An overall system detail structure diagram of a substation protocol standardization conversion method and system provided by an embodiment of the present invention;
[0045] Figure 4 A protocol monitoring unit structure diagram of a substation protocol standardization conversion method and system provided by an embodiment of the present invention;
[0046] Figure 5 A conversion and encapsulation structure diagram of a substation protocol standardization conversion method and system provided by an embodiment of the present invention;
[0047] Figure 6 An internal structural diagram of a computer device of a substation protocol standardization conversion method and system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0049] Example 1
[0050] Reference Figure 1-Figure 6 , which is the first embodiment of the present invention, and provides a substation protocol standardization conversion method and system, including:
[0051] There are some problems in the existing related technologies, such as low efficiency of data packet parsing and poor real-time performance of protocol conversion.
[0052] This application provides a method that can effectively solve the above-mentioned problems. Next, we will combine multiple embodiments to explain in detail how to implement the substation protocol standardization conversion method;
[0053] Figure 1 A method flow chart of a substation protocol standardization conversion method and system is shown, including:
[0054] S101, obtaining a target substation data packet and performing a first preprocessing on the data packet;
[0055] In an optional embodiment, the target substation data packet is a data packet generated during the operation of the substation containing a characteristic word, and may include substation equipment status information, fault alarm information, control commands, etc. The characteristic word is used to identify the type and content of the data packet, so that the data packet can be more accurately identified and classified by the system after preprocessing. For example, a data packet of equipment status information may contain a specific characteristic word such as "status", while a data packet of fault alarm information may contain a characteristic word such as "alarm".
[0056] In an optional embodiment, in the preprocessing stage, the system first decodes the target substation data packet and extracts the characteristic words in the data packet. Then, the data packets are classified according to the characteristic words and subsequently processed respectively. For example, the data packet of the equipment status information will be sent to the status information processing module, and the data packet of the fault alarm information will be sent to the fault processing module.
[0057] In an optional embodiment, in order to improve the real-time performance of protocol conversion, the system of the present invention adopts multi-threading technology. Each processing module runs on an independent thread and can process different types of data packets in parallel. In this way, even when the data flow is large, the system can maintain efficient operation without bottlenecks caused by slow processing of a single module. For example, the state information processing module and the fault processing module can run at the same time, and data is exchanged between them through a thread-safe message queue to ensure that the data packets can be processed in time.
[0058] In an optional embodiment, different types of data packets have different corresponding first preprocessing methods. For example, when performing the first preprocessing on the substation equipment status information data packet, it may include steps such as removing redundant information and verifying the integrity of the data packet; while for the fault alarm information data packet, it may be necessary to extract key alarm information and format it.
[0059] In an embodiment of the present application, the first preprocessing includes at least a feature word recognition operation, which first involves scanning the feature words in the data packets to exclude some obviously non-compliant protocol types. For those data packets that cannot be identified by feature word recognition, deep packet inspection technology is used to perform in-depth analysis to identify the protocol type.
[0060] It should be noted that obtaining the target substation data packet and performing the first preprocessing on the data packet can effectively reduce the amount of data to be processed subsequently and improve the processing efficiency of the protocol identification module. Through preliminary screening, data packets that obviously do not belong to the target protocol can be quickly excluded, thereby reducing further processing of these data packets, saving system resources, and speeding up the overall protocol conversion speed.
[0061] S102, establishing a first judgment model, and performing a first judgment on the first preprocessing result according to the first judgment model;
[0062] In an embodiment of the present application, performing a first judgment on the first preprocessing result according to the first judgment model includes:
[0063] The first judgment model is used to perform a first judgment on the first preprocessing result;
[0064] The first judgment is used to judge whether the target protocol type identification in the first preprocessing result is correct;
[0065] The first judgment model is any model that can implement the first judgment.
[0066] In an optional embodiment, the first judgment model can be constructed by combining a machine learning algorithm after determining the first judgment content. For example, a decision tree, a support vector machine, a neural network or other algorithms can be used to train the model so that it can accurately identify the protocol type according to the characteristics of the data packet. Through a large amount of historical data training, the model can learn the characteristic patterns of different protocol data packets and quickly and accurately classify new data packets in practical applications.
[0067] In an optional embodiment, the first judgment model can also be designed in other ways. For example, a rule base can be constructed based on the expert system principle, which contains characteristic rules of various protocols. After the data packet is preprocessed, the system will match the data packet according to the rules in the rule base to identify the protocol type of the data packet. This method is particularly suitable for identifying protocol types with a high degree of structure and clear rules.
[0068] In an optional embodiment, a multi-field parsing task can be established to perform parsing and verification to establish a first judgment model, wherein each field parsing task focuses on a specific field in the data packet, such as source address, destination address, port number, protocol type, etc. In this way, a more detailed analysis of the data packet can be performed, thereby improving the accuracy of protocol identification.
[0069] In the embodiment of the present application, the construction and training process of the first judgment model can be divided into the following steps:
[0070] First, collect a large number of substation data packet samples, which should cover various protocol types to ensure the generalization ability of the model;
[0071] Then, these samples are preprocessed to extract features that are helpful for protocol identification, such as the length of the data packet, the value of specific fields, the structure of the data packet, etc.
[0072] Next, select a suitable machine learning algorithm and train the model using the extracted features and the corresponding protocol type labels;
[0073] After training is completed, the performance of the model is evaluated through methods such as cross-validation to ensure that its recognition accuracy on unknown data meets the requirements;
[0074] Finally, the trained model is deployed to the protocol identification module for real-time protocol type identification.
[0075] It should be noted that the accuracy and efficiency of protocol identification can be significantly improved by using the first judgment model constructed by machine learning algorithms. Compared with traditional rule-based identification methods, machine learning models can automatically learn and adapt to changes in data packet characteristics, thereby better coping with new or non-standard protocols that may appear in substations.
[0076] In the embodiment of the present application, performing a first judgment on the first preprocessing result according to the first judgment model further includes:
[0077] The first judgment includes a first segment analysis and a second tail analysis;
[0078] Performing a first segment analysis on the first preprocessing result using the first judgment model;
[0079] A second tail analysis is performed on the result after the first segment analysis to obtain a first preprocessing result that meets the first judgment result.
[0080] In an optional embodiment, the first segment parsing and the second tail parsing can be implemented using different parsing techniques. For example, the first segment parsing can adopt a parsing method based on regular expressions, which can flexibly match and extract key information in the data packet. By defining a series of regular expression rules, the data packet can be accurately segmented and the content extracted. The second tail parsing can adopt a parsing method based on pattern matching, which identifies the end of the data packet through a predefined protocol tail pattern to ensure the integrity of the data packet.
[0081] In an optional embodiment, the first segment parsing and the second tail parsing can be used in combination to improve the accuracy and robustness of the parsing. For example, the key fields of the data packet are first extracted by the first segment parsing, and then the correctness of these fields is verified by the second tail parsing. If it is found in the second tail parsing that the tail of the data packet does not conform to the expected protocol format, the system can readjust the rules of the first segment parsing to adapt to the changes in the data packet. This iterative parsing process helps to improve the accuracy of protocol identification and reduce the possibility of misjudgment.
[0082] In the embodiment of the present application, the implementation of the first segment parsing and the second tail parsing can rely on a high-performance parsing engine. The parsing engine can be a specially designed software module or a functional component integrated in the protocol identification module. The parsing engine needs to have efficient data processing capabilities to support real-time parsing of large-scale data packets. In addition, the parsing engine should also have good scalability so that it can adapt to new protocols or protocol changes that may appear in the future.
[0083] In the embodiment of the present application, the steps of first segment parsing and second tail parsing can be further refined into the following operations:
[0084] First, the first preprocessing result is subjected to a first segmentation analysis, the data packet is segmented according to predefined fields, and the value of each field is extracted;
[0085] Then, a second tail parsing is performed on the field values obtained by the first segment parsing to verify whether these field values meet the format requirements of the target protocol;
[0086] If the field value passes the verification of the second tail parsing, the first preprocessing result is considered valid and the subsequent processing steps can be performed;
[0087] If the field value fails the validation of the second trailer parsing, it is necessary to readjust the rules of the first segment parsing or perform a deeper analysis of the packet to determine the correct protocol type.
[0088] It should be noted that the combination of the first segment parsing and the second tail parsing can effectively improve the accuracy and efficiency of protocol identification. This segment parsing method can not only handle highly structured protocols, but also those with complex structures or variable formats. In addition, by continuously optimizing parsing rules and algorithms, the performance of the system can be further improved so that it can adapt to the ever-changing network environment and protocol standards.
[0089] S103, performing second preprocessing on the first preprocessing result that meets the first judgment result, and completing the substation protocol standardization conversion.
[0090] In an embodiment of the present application, performing a second preprocessing on the first preprocessing result that satisfies the first judgment result includes:
[0091] Performing a first stratification on the first preprocessing results that meet the first judgment result;
[0092] Performing a first data conversion on the result after the first stratification;
[0093] A second judgment is performed on the result after the first data conversion.
[0094] In an optional embodiment, the first stratification is performed on the first preprocessing result that meets the first judgment result, and each stratified data needs to undergo a first data conversion, and the first data conversion is a synchronous conversion.
[0095] In an optional embodiment, the first layer and the first data conversion may use different protocol conversion technologies to adapt to the conversion requirements of different protocol layers. For example, for the transport layer protocol, the TCP / IP protocol stack may be used for conversion; while for the application layer protocol, customized conversion processing may be required according to the semantic rules of the specific protocol. In this way, the accuracy and efficiency of the conversion process can be ensured.
[0096] In the embodiments of the present application, relevant technical personnel can select specific means of the first layer and the first data conversion operation according to actual needs, and the present application does not limit it.
[0097] In the embodiment of the present application, performing second preprocessing on the first preprocessing result that meets the first judgment result further includes:
[0098] Performing a first encapsulation on the result of the first data conversion that meets the second judgment result;
[0099] A first configuration is performed on the first encapsulation result to complete the standardized conversion of the substation protocol.
[0100] In an optional embodiment, the second judgment is to judge whether the format and structure of the converted data are correct, which can be done using a variety of methods, for example, regular expression matching, XML Schema validation and other technologies can be used to ensure the correctness of the data format. If the data format is incorrect, the system will return an error message and may trigger a re-conversion process.
[0101] In an optional embodiment, the first encapsulation is to encapsulate the converted data according to the requirements of the target protocol to ensure that the data packet conforms to the format of the target protocol. The encapsulation process may include adding necessary header information, padding the data packet to meet the minimum length requirement, calculating and adding a checksum, and the like.
[0102] In an optional embodiment, the first configuration is to configure the encapsulated data packet according to the specific requirements of the target substation, which may include setting specific transmission parameters, adjusting the priority of the data packet, adding security encryption, etc. After completing these configurations, the data packet can be sent to the target substation for further processing.
[0103] It should be noted that, through the above steps, the substation protocol standardization conversion method and system provided by the present invention can effectively convert data packets of different sources and formats into a unified protocol format, thereby realizing efficient communication between different devices and systems within the substation. In addition, the method and system also have good scalability and adaptability, can adapt to new protocols and protocol changes that may appear in the future, and ensure the long-term stable operation of the substation communication system.
[0104] In summary, the substation protocol standardization conversion method and system of the present invention, by establishing a first judgment model for efficient and accurate protocol identification, combines the first preprocessing and second preprocessing steps, to achieve fast and accurate conversion and encapsulation of data packets, greatly improving the efficiency and reliability of substation communications.
[0105] Example 2
[0106] This embodiment also provides a substation protocol standardization conversion system, including:
[0107] A protocol identification module configured with a first pre-processing function;
[0108] A protocol parsing module configured with a first judgment function;
[0109] A data conversion module configured with a first layer and a first data conversion function;
[0110] A verification encapsulation module configured with a second judgment function.
[0111] In the embodiment of the present application, the protocol parsing module at least includes:
[0112] A data splitting unit configured with a first segment parsing function;
[0113] A data parsing unit is configured with a second tail parsing function.
[0114] In the embodiment of the present application, the verification package module at least includes:
[0115] A data verification unit configured with a second judgment function;
[0116] A data encapsulation unit configured with a first encapsulation function.
[0117] In an optional embodiment, the protocol parsing module may further include:
[0118] A data feature unit configured with a feature word recognition function;
[0119] A data depth analysis unit configured with deep packet inspection technology.
[0120] In an optional embodiment, the verification package module may further include:
[0121] A data verification unit configured with a data verification function;
[0122] A data encapsulation unit configured with a data encapsulation function.
[0123] In an optional embodiment, the data feature unit is used to perform preliminary screening of the collected substation data packets and quickly identify the protocol type of the data packet through feature word recognition technology. For those data packets that cannot be determined through feature word recognition, the data depth analysis unit uses deep packet detection technology to perform in-depth analysis to ensure accurate identification of the protocol type.
[0124] In an optional embodiment, the data verification unit is responsible for verifying the data packet to ensure the integrity and accuracy of the data during the conversion process. The data encapsulation unit encapsulates the data according to the converted data format to ensure the security and reliability of the data packet during the transmission process.
[0125] To sum up, through the collaborative work of the above-mentioned modules, the substation protocol standardization conversion system of the present invention can efficiently and accurately complete the communication protocol conversion between different devices and systems in the substation, thereby improving the integration and efficiency of the entire substation automation system and ensuring the reliability and efficiency of the substation.
[0126] The above-mentioned unit modules may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above-mentioned modules.
[0127] This embodiment also provides a computer device, which may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a standardized conversion method for a substation protocol is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0128] This embodiment further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0129] Obtaining a target substation data packet, and performing a first preprocessing on the data packet;
[0130] Establishing a first judgment model, and performing a first judgment on the first preprocessing result according to the first judgment model;
[0131] A second preprocessing is performed on the first preprocessing result that meets the first judgment result to complete the substation protocol standardization conversion.
[0132] Example 3
[0133] In a preferred embodiment, the design is as follows Figure 2-5 The complete system shown in the figure implements the method flow of the present application, wherein: Figure 2 As shown, the overall system may include a protocol identification module 100, a protocol analysis module 200, a data conversion module 300, and a verification and packaging module 400;
[0134] In the embodiment of the present application, the protocol identification module 100 first performs feature word recognition on the collected substation data packet, searches for a byte sequence matching the feature word in the feature word library, and identifies the corresponding protocol type. If the feature word recognition corresponds to multiple protocol types, a deep packet inspection is performed on the data packet, and the binary data structure and text data structure of the data packet are judged by using the deep packet inspection technology, the corresponding protocol type is identified, and the protocol data packet is passed to the corresponding protocol parsing module 200;
[0135] In the embodiment of the present application, the protocol parsing module 200 first splits the data packet into multiple parsing tasks, establishes a multi-field parsing task, adopts a message queue communication method between the field parsing tasks, realizes the segmented parsing of the data packet, and executes the data load parsing task and the tail check parsing task according to the information after the header parsing. The protocol identification is judged by the result of the tail check parsing task. If the check result passes, the integrated parsing result is transmitted to the data conversion module 300. If the check result fails, the protocol is re-identified.
[0136] In the embodiment of the present application, the data conversion module 300 transmits the parsed data packets to the protocol parsing module 200 and layers them according to the protocol layer, and further distributes them according to the size of the data block within each layer. For data of different protocol layers, a multi-threaded method is used to perform parallel conversion on the data. For different data blocks of the same protocol layer, a multi-process method is used to perform parallel conversion, and the converted data is transmitted to the verification and encapsulation module 400;
[0137] In an embodiment of the present application, the verification and encapsulation module 400 takes the specification of the target protocol as the standard, first merges the conversion results of multiple data block parallel processing units, then verifies the format and structure of the conversion results of each protocol layer parallel processing unit, and encapsulates the converted data according to the frame structure and format requirements of the target protocol.
[0138] In the embodiments of the present application, Figure 3 As shown, the protocol identification module 100 includes a signature recognition unit 110, a deep packet inspection unit 120 and a protocol monitoring unit 130;
[0139] In the embodiment of the present application, the signature recognition unit 110 scans the collected substation data packets byte by byte, searches for byte sequences matching signatures in the signature library, quickly screens the data packets, excludes non-compliant protocol types, and passes protocols that cannot be determined by signature recognition to the deep packet inspection unit 120;
[0140] In the embodiment of the present application, the deep packet inspection unit 120 uses deep packet inspection technology to analyze the content of the data packet, analyze the specific content and behavior characteristics of the protocol, and then identify the protocol type;
[0141] In an embodiment of the present application, the protocol identification module 100 first performs feature word recognition on the collected substation data packets, searches for byte sequences that match the feature words in the feature word library, and identifies the corresponding protocol type. If the feature word recognition corresponds to multiple protocol types, deep packet inspection is performed on the data packet, and the binary data structure and text data structure of the data packet are judged using deep packet inspection technology to identify the corresponding protocol type, and the protocol data packet is passed to the corresponding protocol parsing module 200.
[0142] In the embodiments of the present application, Figure 4 As shown, the protocol monitoring unit 130 includes an identification data real-time monitoring component 131, a scan byte total extraction component 132, an identification operation stability evaluation coefficient acquisition component 133, a comparison component 134 and an abnormality determination and alarm component 135;
[0143] In the embodiment of the present application, the recognition data real-time monitoring component 131 is used to monitor in real time the recognition response time corresponding to the byte scanning start time to the protocol transmission start time during each recognition process of the feature word recognition unit 110;
[0144] In the embodiment of the present application, the total number of scanned bytes extraction component 132 is used to extract the total number of scanned bytes in each recognition process of the feature word recognition unit 110;
[0145] In the embodiment of the present application, the recognition operation stability evaluation coefficient acquisition component 133 is used to obtain the recognition operation stability evaluation coefficient by using the corresponding recognition response time and the total number of scanned bytes in each recognition process of the feature word recognition unit 110;
[0146] In an optional embodiment, the identification operation stability evaluation coefficient is obtained by the following formula:
[0147]
[0148] Wherein, H represents the recognition operation stability evaluation coefficient; n represents the total number of recognition times of the feature word recognition unit 110; T i represents the recognition response time corresponding to the i-th recognition; T i+1 T represents the recognition response time corresponding to the i+1th recognition; c represents the preset reference value of recognition response time; L represents the first adjustment coefficient; s represents the second adjustment coefficient; k represents the third adjustment coefficient;
[0149] In an optional embodiment, the first adjustment coefficient is obtained by the following formula:
[0150]
[0151] Wherein, L represents the first adjustment coefficient; N i Indicates the number of bytes corresponding to the i-th recognition; N i+1 Indicates the number of bytes corresponding to the i+1th recognition; T i represents the recognition response time corresponding to the i-th recognition; T i+1 Indicates the recognition response time corresponding to the i+1th recognition;
[0152] In an optional embodiment, the second adjustment coefficient is obtained by the following formula:
[0153]
[0154] Wherein, s represents the second adjustment coefficient; T c Indicates the preset reference value of recognition response time; N c Indicates the preset reference value of the number of bytes; N max Indicates the maximum number of bytes completed in a single scan during n identifications; T max Indicates the recognition response time corresponding to the maximum number of bytes completed in a single scan process among n recognitions;
[0155] In an optional embodiment, the third adjustment coefficient is obtained by the following formula:
[0156]
[0157] Wherein, k represents the third adjustment coefficient; N max Indicates the maximum number of bytes completed in a single scan during n identifications; T max Indicates the recognition response time corresponding to the maximum number of bytes completed in a single scan process in n recognitions; N min Indicates the minimum number of bytes required to complete a single scan in n recognitions; T min Indicates the recognition response time corresponding to the minimum number of bytes completed in a single scan process in n recognitions; T c Indicates the preset reference value of recognition response time; T p represents the average value of the recognition response duration corresponding to n recognition processes; m represents the number of recognition times of the feature word recognition unit 110 between the minimum number of bytes corresponding to a single recognition and the maximum number of bytes corresponding to a single recognition;
[0158] In the embodiment of the present application, the comparison component 134 is used to compare the identified operation stability evaluation coefficient with a preset evaluation coefficient threshold;
[0159] In the embodiment of the present application, the abnormality determination and alarm component 135 is used to determine that there is a stability abnormality in the recognition process of the feature word recognition unit 110 and issue an abnormality alarm when the recognition operation stability evaluation coefficient is lower than a preset evaluation coefficient threshold.
[0160] The technical effect of the above technical solution is: by real-time monitoring of the recognition response time of the feature word recognition unit 110, that is, the time interval from the start of byte scanning to the start of protocol transmission, the module can quickly capture any delay or acceleration phenomenon in the recognition process, and provide basic data for subsequent analysis and evaluation. Extracting the total number of scanned bytes in each recognition process helps to understand the relationship between recognition efficiency and data volume, and provides a basis for optimizing recognition algorithms and resource allocation. Using the above mathematical model, a comprehensive evaluation coefficient H is calculated by comprehensively considering multiple dimensions such as recognition response time and total number of scanned bytes. The introduction of this coefficient not only quantifies the stability of the recognition process, but also makes the stability evaluation more scientific and objective. The introduction of the first adjustment coefficient L, the second adjustment coefficient s, and the third adjustment coefficient k enables the evaluation coefficient to be more flexible to meet the needs of different recognition scenarios. These coefficients are calculated by complex formulas, taking into full account factors such as the number of recognitions, the change in the number of bytes, and the response time, ensuring the accuracy and comprehensiveness of the evaluation results. By comparing the calculated recognition operation stability evaluation coefficient with the preset evaluation coefficient threshold, once insufficient stability is found, the abnormal judgment and alarm mechanism are immediately triggered. This instant feedback mechanism can quickly attract the attention of operation and maintenance personnel, making it easier to take timely measures to avoid the impact of stability issues on protocol recognition and even the entire system operation. Through continuous monitoring and evaluation, operation and maintenance personnel can clearly understand the operating status of the feature word recognition unit 110 under different conditions, so as to optimize the recognition algorithm, adjust the system configuration or upgrade the hardware equipment in a targeted manner to continuously improve the stability and efficiency of protocol recognition. Stable protocol recognition capabilities are crucial to maintaining smooth network communications and ensuring the accuracy of data transmission. The implementation of this technical solution not only enhances the reliability of the system, but also improves users' trust and satisfaction with the system.
[0161] In summary, this technical solution not only improves the accuracy and efficiency of protocol identification by building a complete identification operation stability monitoring and evaluation system, but also provides strong support for the continuous optimization and improvement of the system, and ultimately achieves stable and efficient operation of network communications.
[0162] In the embodiment of the present application, the protocol parsing module 200 includes a data splitting unit 210 and a data parsing unit 220;
[0163] The data splitting unit 210 locates the header field, data payload field and tail field of each protocol layer according to the protocol standard document, splits them, and establishes parsing tasks for the corresponding fields;
[0164] The data parsing unit 220 parses the parsing tasks of the corresponding fields in sequence according to the protocol parsing standard of the protocol, and parses the current field based on the parsing result of the previous field. Finally, it determines whether the protocol identification is correct based on the verification parsing result of the tail field.
[0165] Protocol standard documents provide unified rules for communication between different devices, systems and software, and specify in detail the format of protocol data, including the structure of the header, data part and tail, as well as data encoding methods such as character encoding, binary encoding and data compression methods.
[0166] In order to ensure that the parsing information between fields will not be mixed when parsing the corresponding field tasks, the data parsing unit 220 adopts a message queue communication method between field parsing tasks. The previous field parsing task sends the parsed data packet or conversion request as a message to the queue, and other field parsing tasks obtain the message from the message queue and process it;
[0167] Message queue is an asynchronous communication mechanism for transmitting messages (data) between different modules. One module encapsulates data into messages and sends them to the message queue. Other modules obtain messages from the message queue and process them.
[0168] The message queue implements asynchronous communication between field parsing tasks. The sender and the receiver do not need to be in operation at the same time, which helps to decouple the fields and make the system architecture more flexible. At the same time, as a buffer, it controls the data flow. When the data is generated faster than the processing speed, the message queue can temporarily store the data to avoid data loss. It distinguishes the data parsed by each field task to prevent the mixing of parsed information between fields and ensure the accuracy of the parsed data.
[0169] In the embodiments of the present application, Figure 5 As shown, the data conversion module 300 includes a data stratification unit 310 and a data conversion unit 320;
[0170] The data layering unit 310 decomposes the data conversion task into link layer, network layer,
[0171] The transport layer and the application layer are independent tasks, and the data in the same layer is subdivided according to the size of the data block in the same layer;
[0172] The data conversion unit 320 uses a multi-process parallel conversion method to perform data conversion on data blocks of different sizes at the same layer, and uses a multi-threaded parallel conversion method to perform data conversion on data of different protocol layers.
[0173] In order to better identify the boundary of parallel conversion, the data layering unit 310 identifies the boundary of parallel conversion based on data dependency and determines which data layers can be converted in parallel;
[0174] When the input data of one task directly depends on the output data of another task, there is a direct data dependency. When there is no direct input and output data dependency between two tasks, but they have an indirect dependency through intermediate data or other tasks, it is an indirect dependency. When the two tasks have no data association, that is, the execution of one task does not depend on any data of the other task, then they can be executed in parallel.
[0175] Each task is regarded as a node. For example, in protocol parsing and conversion, link layer parsing, network layer parsing, transport layer parsing, application layer parsing and conversion tasks of each layer are respectively regarded as nodes. According to the data dependency relationship between tasks, the nodes are connected. For example, if task A directly or indirectly depends on the result of task B, then a directed edge is drawn from node B to node A. By constructing a data dependency graph in this way, the dependency relationship between tasks can be intuitively seen. In the data dependency graph, there may be parallel boundaries between tasks represented by nodes that are not directly or indirectly connected by directed edges. For example, if node C and node D are not connected in any way, then task C and task D may be executed in parallel. The boundaries of parallel conversion are accurately identified based on the data dependency relationship. At the same time, the data layer that can be converted in parallel is determined to speed up the parsing data conversion rate.
[0176] In an optional embodiment, in order to ensure the consistency and accuracy of data during parallel conversion, the data conversion unit 320 uses a lock mechanism to ensure data consistency when performing multi-threaded parallel conversion, and uses a communication mechanism to coordinate shared data to ensure data accuracy when performing multi-process data conversion;
[0177] Among them, the mutex lock is the most common lock mechanism. Its basic principle is that at the same time, only one thread can obtain the lock. When a thread obtains the mutex lock, other threads trying to obtain the lock will be blocked until the thread holding the lock releases the lock. Parallel conversion technology refers to the use of multiple threads, processes or resources to process different parts of data at the same time during data conversion to speed up recovery. It breaks the traditional sequential recovery mode and makes full use of the system's multi-core processors, multi-disk I / O channels and other hardware resources. The data conversion task is divided into multiple subtasks for parallel execution. By analyzing the structure and content of the backup data, the parts that can be converted independently are determined. For example, when converting the parsed data, the data packets are layered and a conversion thread is assigned to each layer. These parallel conversion tasks can be performed simultaneously. They are independent of each other, but they work together to complete the conversion of the entire data.
[0178] The verification and encapsulation module 400 includes a data verification unit 410 and a data encapsulation unit 420;
[0179] In an optional embodiment, the data verification unit 410 checks whether the length of the converted data meets the requirements according to the target protocol specification, checks whether the order of each field in the converted data is consistent with the target protocol specification, and finally verifies whether the format and content of the header and the footer meet the requirements;
[0180] In an optional embodiment, the data encapsulation unit 420 encapsulates the converted data that meets the requirements of the target protocol, fills in each field in sequence according to the format requirements of the target protocol header, and after the header encapsulation is completed, places the converted data in the correct position according to the format of the target protocol, and finally fills the tail check information into the last part of the data packet to complete the encapsulation of the entire data packet.
[0181] In order to more accurately verify and encapsulate the converted data, the data encapsulation unit 420 calculates the checksum of the entire data packet according to the checksum calculation method specified by the target protocol when encapsulating the tail check information, and adds the checksum information to the tail field. At the receiving end, the tail information will be used to verify the integrity of the data and correctly parse the data packet;
[0182] In an optional embodiment, the checksum is calculated by performing mathematical operations on a specific portion of the data, such as an entire data packet, a data block, etc., to generate a relatively short value (checksum value), which represents a characteristic of the original data. At the receiving end or when reading the data, the checksum is calculated again on the received data using the same calculation method, and then the new checksum value is compared with the original checksum value;
[0183] In an optional embodiment, when encapsulating data, a checksum of the data is added to facilitate verification of whether the converted data complies with the target protocol standard when the substation protocol is standardized, thereby improving the accuracy of data conversion.
[0184] Example 4
[0185] Example 3 is the conversion between different types of protocols in a substation. The substation protocol standardization conversion method and system are also applicable to the conversion between the same type of old protocol and the new protocol, as follows:
[0186] In an optional embodiment, the type of the old protocol is identified by the protocol identification module 100, and the collected substation data packets are scanned byte by byte by the feature word identification unit 110 to find the byte sequence matching the feature word in the feature word library, and the data packets are quickly screened to exclude the non-compliant protocol types, and the protocols that cannot be determined by the feature word identification are transferred to the deep packet inspection unit 120. The deep packet inspection unit 120 uses the deep packet inspection technology to analyze the content of the data packet, analyze the specific content and behavior characteristics of the protocol, and then identify the type of the old protocol;
[0187] In an optional embodiment, the protocol parsing module 200 uses the data splitting unit 210 to locate the header field, data load field and tail field of each protocol layer according to the protocol standard document, and splits the old protocol data packet to establish the parsing task of the corresponding field. The data parsing unit 220 parses the parsing task of the corresponding field in turn, and parses the current field based on the parsing result of the previous field. Finally, according to the verification parsing result of the tail field, it is determined whether the recognition of the old protocol is correct;
[0188] In an optional embodiment, the data conversion module 300 layers the parsed data packets transmitted by the protocol parsing module 200 according to the protocol layer, and further distributes them according to the size of the data block within each layer. For data of different protocol layers, a multi-threaded method is used to perform parallel conversion on the data. For different data blocks of the same protocol layer, a multi-process method is used to perform parallel conversion, thereby improving the data conversion rate.
[0189] The verification and encapsulation module 400 uses the specifications of the target protocol as the standard, first merges the conversion results of multiple data block parallel processing units, then verifies the format and structure of the conversion results of each protocol layer parallel processing unit, and encapsulates the converted data into a new protocol according to the frame structure and format requirements of the target protocol.
[0190] Example 5
[0191] In addition to the above embodiments, the substation protocol standardization conversion method and system are also applicable to the conversion between some uncertain protocols or non-standard protocols and standard protocols, as follows:
[0192] In an optional embodiment, when the protocol identification module 100 identifies the uncertain protocol or non-standard protocol, the deep packet inspection unit 120 is directly used to identify the data packet transmitted by the uncertain protocol or non-standard protocol, and the deep packet inspection technology is used to analyze the content of the data packet to analyze the specific content and behavior characteristics of the protocol, thereby identifying the type of the protocol;
[0193] In an optional embodiment, the protocol parsing module 200 uses the data splitting unit 210 to locate the header field, data load field and tail field of each protocol layer according to the protocol standard document, and splits the old protocol data packet to establish a parsing task for the corresponding field. The parsing task does not include the content that does not conform to the protocol standard transmitted by the uncertain protocol or non-standard protocol, and only parses the data that conforms to the protocol standard. The data parsing unit 220 parses the parsing tasks of the corresponding fields in turn, and parses the current field based on the parsing result of the previous field. Finally, based on the verification parsing result of the tail field, it is determined whether the recognition of the old protocol is correct;
[0194] In an optional embodiment, the data conversion module 300 layers the parsed data packets transmitted by the protocol parsing module 200 according to the protocol layer, and further distributes them according to the size of the data block within each layer. For data of different protocol layers, a multi-threaded method is used to perform parallel conversion on the data. For different data blocks of the same protocol layer, a multi-process method is used to perform parallel conversion, thereby improving the data conversion rate.
[0195] In an optional embodiment, the verification and encapsulation module 400 uses the specifications of the target protocol as the standard, first merges the conversion results of multiple data block parallel processing units, and then verifies the format and structure of the conversion results of each protocol layer parallel processing unit, and encapsulates the converted data into a standard protocol according to the frame structure and format requirements of the target protocol.
[0196] The substation protocol standardization conversion method and system scans the collected substation data packets through the protocol identification module 100, and performs preliminary screening of the data packets through feature word recognition. For those data packets that cannot be identified through feature word recognition, deep packet detection technology is used for in-depth analysis to identify the protocol type, and then the data packets are split using the protocol parsing module 200 to establish a multi-field parsing task. The message queue communication method is used between the field parsing tasks to implement segmented parsing of the data packets, thereby eliminating the phenomenon of data information mixing when parsing the data packets as a whole. When converting the parsed data, data conversion is performed Module 300 stratifies data packets according to protocol levels, and further distributes them according to data block size within each layer. For data in different protocol layers, multi-threading is used to perform parallel conversion of data. For different data blocks in the same protocol layer, multi-process is used to perform parallel conversion, thereby improving data conversion efficiency, accelerating the data conversion process, and improving the accuracy and real-time performance of protocol conversion. The substation protocol standardization conversion device and method are not only suitable for different types of protocol conversions within the substation, but also for conversions between old and new protocols of the same type, as well as conversions between uncertain protocols or non-standard protocols and standard protocols. It has a wide range of applications and strong practicality.
[0197] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
[0198] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt 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.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0199] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0200] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0201] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0202] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0203] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A substation protocol standardization conversion method, characterized in that: include: Acquire a target substation data packet, and perform a first preprocessing on the data packet; Establishing a first judgment model, and performing a first judgment on the first preprocessing result according to the first judgment model; A second preprocessing is performed on the first preprocessing result that meets the first judgment result to complete the substation protocol standardization conversion.
2. The substation protocol standardization conversion method according to claim 1, characterized in that: The performing second preprocessing on the first preprocessing result that meets the first judgment result includes: Performing a first stratification on the first preprocessing results that meet the first judgment result; Performing a first data conversion on the result after the first stratification; A second judgment is performed on the result after the first data conversion.
3. The substation protocol standardization conversion method according to claim 2, characterized in that: The performing second preprocessing on the first preprocessing result that meets the first judgment result also includes: Performing a first encapsulation on the result after the first data conversion that meets the second judgment result; A first configuration is performed on the first encapsulation result to complete the substation protocol standardization conversion.
4. The substation protocol standardization conversion method according to claim 3, characterized in that: The performing a first judgment on the first preprocessing result according to the first judgment model includes: The first judgment model is used to perform a first judgment on the first preprocessing result; The first judgment is used to judge whether the target protocol type identification in the first preprocessing result is correct; The first judgment model is any model that can implement the first judgment.
5. The substation protocol standardization conversion method according to claim 4, characterized in that: The performing a first judgment on the first preprocessing result according to the first judgment model further includes: The first judgment includes a first segment analysis and a second tail analysis; Performing a first segment analysis on the first preprocessing result using the first judgment model; A second tail analysis is performed on the result after the first segment analysis to obtain a first preprocessing result that meets the first judgment result.
6. A substation protocol standardization conversion system, characterized in that: include: A protocol identification module configured with a first pre-processing function; A protocol parsing module configured with a first judgment function; A data conversion module configured with a first layer and a first data conversion function; A verification encapsulation module configured with a second judgment function.
7. The substation protocol standardization conversion system according to claim 6, characterized in that: The protocol analysis module at least includes: A data splitting unit configured with a first segment parsing function; A data parsing unit is configured with a second tail parsing function.
8. The substation protocol standardization conversion system according to claim 7, characterized in that: The verification package module at least includes: A data verification unit configured with a second judgment function; A data encapsulation unit configured with a first encapsulation function.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Hierarchical configuration processing method and system for panoramic monitoring data of transformer substation
CN112187938A
Base station monitoring analysis method, device and system, electronic equipment and storage medium
CN113950088A
Transformer substation power and environment monitoring alarm processing system and method
CN115208059A
Method for realizing cross-modal data protocol conversion on FPGA (Field Programmable Gate Array) and FPGA
CN118069653A
System and method for flow control within a stateful protocol processing system
US7802001B1