Electric energy quality monitoring terminal automatic configuration method and system supporting multiple protocols
Through multi-dimensional analysis methods and preset protocol mapping templates, the automated configuration of the power quality monitoring terminal in a multi-protocol environment is realized, and the problems of difficult configuration, low identification efficiency and complex adaptation of new protocols are solved, which improves deployment efficiency and operation and maintenance level.
Patent Information
- Application Number
- CN202411916643.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-24
AI Technical Summary
The power quality monitoring terminal is difficult to configure in a multi-protocol environment, the protocol identification efficiency is inefficient, and the new protocol adaptation is complex, resulting in low system deployment efficiency and complex operation and maintenance.
Multi-dimensional analysis methods are adopted, including decision trees and feature vector matching, to achieve efficient and accurate protocol recognition. By preset protocol mapping templates, we automatically identify the protocol family and specific protocol types, generate standard configuration instruction sets, and automate terminal configuration.
It significantly improves the accuracy and efficiency of protocol identification, reduces the complexity of system maintenance, realizes the automated configuration of power quality monitoring terminals, and supports large-scale deployment in multi-protocol environments.
Smart Images

Figure CN119728505A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power quality monitoring, and in particular to an automatic configuration method and system for a power quality monitoring terminal supporting multiple protocols. Background Art
[0002] With the continuous advancement of smart grid construction, power quality monitoring systems play an increasingly important role in power systems. As the core component of the system, power quality monitoring terminals need to interact with various monitoring platforms for data. Due to historical reasons and differences in application scenarios, there are multiple communication protocol standards in power systems, including IEC 60870-5-104, DNP3.0, Modbus, etc. This coexistence of multiple protocols poses a huge challenge to the deployment and configuration of power quality monitoring terminals.
[0003] At present, the configuration of power quality monitoring terminals mainly has the following technical problems: First, the terminal configuration process usually requires manual intervention, and the configuration personnel must be familiar with various protocol specifications, which not only increases labor costs but also easily leads to configuration errors. Secondly, the existing protocol identification methods are mainly based on fixed feature matching rules, which cannot effectively handle variants and new versions of the protocol, resulting in low accuracy of protocol identification. Thirdly, when encountering new protocol types, the system often requires manual analysis and updating of configuration rules, and lacks adaptive learning capabilities. Finally, the data conversion between different protocols lacks unified standards and automation means, which increases the complexity of system maintenance. These problems seriously restrict the large-scale deployment and efficiency improvement of power quality monitoring systems.
[0004] Therefore, there is an urgent need for a solution that can support automatic identification of multiple protocols, has protocol adaptive learning capabilities, and realizes terminal configuration automation to improve the deployment efficiency and operation and maintenance level of the power quality monitoring system. Summary of the invention
[0005] In order to solve the technical problems of difficult configuration of power quality monitoring terminals in a multi-protocol environment, low protocol recognition efficiency and complex adaptation of new protocols, the present invention provides an automatic configuration method and system for power quality monitoring terminals supporting multiple protocols.
[0006] The technical solution adopted by the present invention is: a method for automatically configuring a power quality monitoring terminal supporting multiple protocols, characterized by comprising the following steps:
[0007] S1. Establishing a communication connection between the power quality monitoring terminal and the configuration system, obtaining the power quality monitoring terminal model identifier, MAC address, IP address and protocol version number of the power quality monitoring terminal;
[0008] S2. Capturing the communication data packets of the power quality monitoring terminal through a network packet capture tool, and extracting the characteristics of the communication data packets, including statistical characteristics and structural characteristics;
[0009] S3. Match the historical protocol records in the preset protocol mapping template according to the power quality monitoring terminal model identifier, and obtain a candidate list of protocol families based on the protocol version number and the version range in the terminal historical record library, and use a decision tree to perform hierarchical identification on the statistical features. The decision tree matches the statistical features in turn. In each layer of identification, the current feature is matched with the corresponding features of each protocol family in the candidate list of protocol families stored in the preset protocol mapping template. If it does not match all known protocol families, it is determined to be a new protocol, and a new protocol family category is established for the new protocol in the preset protocol mapping template, and it is stored as a new specific protocol type, including its statistical features, structural features and feature vectors;
[0010] After the protocol family is identified, a protocol type feature vector is constructed based on the structural features, and cosine similarity matching is performed with the feature vectors of each specific protocol type in the protocol family in the preset protocol mapping template to determine the specific protocol type;
[0011] S4. Based on the specific protocol type, for a known protocol, obtain its corresponding field definition table from a preset protocol mapping template, determine data conversion methods such as data type conversion and byte order conversion according to the field mapping relationship between the source protocol and the target protocol, and for a newly identified protocol, generate an initial field definition table according to the field characteristics in the communication data packet, establish a basic mapping relationship with the target protocol, and generate a standard configuration instruction set for configuring the power quality monitoring terminal;
[0012] S5. Issue the standard configuration instruction set in steps, wait for the response confirmation of the power quality monitoring terminal after each configuration instruction is issued, and verify the communication status after receiving the successful response of the power quality monitoring terminal.
[0013] The preset protocol mapping template is a database that integrates information required for protocol identification, protocol conversion and configuration instruction generation, including a terminal protocol record library, a protocol family feature library, a protocol type feature library and a protocol conversion rule library.
[0014] A further technical solution is that the features of the communication data packet extracted in S2 include:
[0015] Extract statistical features, including the mean and variance of frame length, the frequency distribution of function codes, the mean and variance of data field length, and the time interval characteristics of adjacent messages;
[0016] Extract structural features, including the identification position in the frame format, the function code position and type in the data field, the address field position, and the verification method.
[0017] A further technical solution is that obtaining the candidate list of the protocol family in S3 specifically includes:
[0018] According to the power quality monitoring terminal model, the historical protocol records stored in the preset protocol mapping template are matched to obtain a first protocol family candidate list commonly used by the model, the protocol version number is matched with the version range of the corresponding protocol family stored in the terminal historical record library of the preset protocol mapping template, and the correctness of the source of the data packet is confirmed by comparing the consistency of the IP address with the source IP address in the communication data packet captured by S2, so as to obtain a protocol family candidate list;
[0019] A further technical solution is that: the hierarchical identification of the statistical features by using a decision tree in S3 specifically includes:
[0020] Within the scope of the protocol family candidate list, the first layer of the decision tree matches the frame length feature with the corresponding candidate protocol family frame length range stored in the protocol family feature library of the preset protocol mapping template, the second layer of the decision tree matches the function code feature with the corresponding candidate protocol family function code set stored in the protocol family feature library, the third layer of the decision tree matches the data domain feature with the corresponding candidate protocol family data domain format stored in the protocol family feature library, and the fourth layer of the decision tree matches the time interval feature with the corresponding candidate protocol family time parameter stored in the protocol family feature library. According to the matching results of the above four layers, it is determined whether the power quality monitoring terminal belongs to a known protocol family or a new protocol.
[0021] A further technical solution is that the processing of the new protocol in S3 specifically includes:
[0022] When the four-layer features of the decision tree do not match the known protocol family, a new protocol family category is created in the preset protocol mapping template, and the statistical features of the current communication data packet are stored in the protocol family feature library as the features of the protocol family, including the frame length range, function code set, data field format and time parameter information; the structural features of the current communication data packet are stored in the protocol type feature library after normalization, including the identification position, function code position and type, address field position and verification method, as the first specific protocol type under the new protocol family;
[0023] Generate and store feature vectors of the protocol family and specific protocol type for subsequent protocol identification.
[0024] A further technical solution is that: S3 further analyzes the structural features to determine the specific protocol type, including:
[0025] Based on the protocol family range determined by the decision tree, the same normalization processing is applied to the structural features and the structural features in the protocol type feature library in the preset protocol mapping template, all position information in the structural features is converted into an offset relative to the starting position of the frame format, and the type of the function code is converted into a unified code;
[0026] Based on the normalized structural features, a fixed-dimensional 0-1 protocol type feature vector is constructed. When the feature exists, the corresponding position takes a value of 1, and when it does not exist, the value is 0; the cosine similarity of the protocol type feature vector and the feature vector of each specific protocol type in the protocol family stored in the preset protocol mapping template is calculated. When the cosine similarity exceeds a preset threshold, the protocol type with the highest similarity is determined as the recognition result, and the recognition of the specific protocol type is completed within the protocol family determined by the decision tree.
[0027] A further technical solution is that the processing of the known protocol in S4 specifically includes:
[0028] Read the field definition table corresponding to the specific protocol type from the protocol conversion rule library in the preset protocol mapping template as the source protocol field definition, determine the target protocol according to the configuration requirements, and match the field mapping relationship between the source protocol and the target protocol in the protocol conversion rule library in the preset protocol mapping template; determine the data conversion method based on the field mapping relationship, including data type mapping, byte order conversion, field extension and truncation rules, which are used to handle data format differences between different protocols;
[0029] According to the data conversion method, the configuration requirements are converted into a standard configuration instruction set that conforms to the target protocol, including configuration instructions for device parameters, communication parameters and data acquisition rules, and a checksum, protocol identifier, address information and frame identifier are added for encapsulation according to the protocol specification.
[0030] A further technical solution is that the processing of the new protocol in S4 specifically includes:
[0031] According to the analysis results of the communication data packet, the position, length and data type of the key fields are identified, and an initial field definition table is generated;
[0032] Basic mapping of the identified fields with the common fields of the target protocol;
[0033] Use the default data conversion method to generate a basic configuration instruction set, including necessary device parameter and communication parameter configuration instructions;
[0034] The generated field definition table and mapping relationship are stored in the protocol conversion rule library of the preset protocol mapping template.
[0035] A further technical solution is that the preset protocol mapping template is a database that integrates the information required for protocol identification, protocol conversion and configuration instruction generation, wherein a protocol family refers to a set of protocols with similar statistical characteristics, specifically including:
[0036] Terminal protocol record library, which stores the power quality monitoring terminal models and their corresponding historical protocol records, as well as the version range information of the protocol family;
[0037] The protocol family feature library stores the statistical features of the existing protocol family, including the frame length range, function code set, data field format and time parameter information, as well as the feature vector of the protocol family;
[0038] The protocol type feature library stores the structural features of specific protocol types, including the identification position, function code position and type, address field position and verification method, and feature vectors of specific protocol types;
[0039] The protocol conversion rule base stores the field definition table of specific protocol types and the field mapping relationship between protocols.
[0040] The present invention also discloses an automatic configuration system for a power quality monitoring terminal supporting multiple protocols, which is characterized by comprising:
[0041] Communication module: used to establish a communication connection between the power quality monitoring terminal and the configuration system, and obtain the model identifier, MAC address, IP address and protocol version number of the power quality monitoring terminal;
[0042] Feature extraction module: used to capture the communication data packets of the power quality monitoring terminal through the network packet capture tool and extract the feature information of the communication data packets;
[0043] Protocol identification module: used to match the preset protocol mapping template according to the model identifier and protocol version number, and identify the protocol family and determine the specific protocol type based on the feature information;
[0044] Configuration instruction module: used to obtain field definitions and conversion rules from the preset protocol mapping template according to the specific protocol type and generate a standard configuration instruction set;
[0045] Execution module: used to issue standard configuration instruction sets step by step and verify the configuration results.
[0046] The beneficial effects of the present invention are as follows:
[0047] (1) The present invention uses a multi-dimensional analysis method that combines hierarchical decision trees with statistical features and structural features to achieve efficient and accurate protocol identification. The method uses a four-layer decision tree to analyze frame length, function code, data domain, and time interval features step by step, significantly improving the accuracy of protocol identification. In particular, when dealing with complex protocol variants, the system can still maintain stable recognition performance, effectively solving the problem of low protocol identification efficiency in traditional methods.
[0048] (2) The protocol mapping template system designed by the present invention establishes a complete protocol information management framework. Through the hierarchical design of the terminal protocol record library, the protocol family feature library, the protocol type feature library and the protocol conversion rule library, the system realizes the precise positioning and efficient management of protocol features. This systematic design not only improves the flexibility of protocol identification, but also greatly reduces the complexity of system maintenance, providing a reliable guarantee for the continuous expansion of the protocol library.
[0049] (3) The present invention introduces an intelligent new protocol processing mechanism, giving the system autonomous learning capabilities. When the system encounters an unknown protocol, it can automatically analyze features, establish mapping relationships, and generate configuration templates, thereby achieving dynamic expansion of the protocol library. This adaptive mechanism significantly improves the versatility of the system, enabling it to continuously adapt to the development of communication protocols and effectively reducing system maintenance costs.
[0050] (4) The present invention realizes the full process automation of power quality monitoring terminal configuration. Through standardized configuration process and intelligent protocol conversion mechanism, the system can automatically complete the whole process from protocol identification to command issuance, avoiding errors that may be caused by manual intervention, and significantly improving configuration efficiency and accuracy. This technological innovation provides strong support for the large-scale deployment of power quality monitoring systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 The present invention is a flow chart of a method for automatically configuring a power quality monitoring terminal.
[0052] Figure 2 Generates a flow chart for configuration instructions. DETAILED DESCRIPTION
[0053] like Figure 1 As shown, the main steps of the method provided by the present invention are as follows:
[0054] S1: Establish a communication connection between the power quality monitoring terminal and the configuration system, and obtain the model identifier, MAC address, IP address and protocol version number of the power quality monitoring terminal;
[0055] S2: Capture the communication data packets of the power quality monitoring terminal through the network packet capture tool, and extract the characteristics of the communication data packets, including statistical characteristics and structural characteristics;
[0056] S3: Matching the preset protocol mapping template according to the power quality monitoring terminal model identifier, using a decision tree for hierarchical identification to determine the protocol family, and determining the specific protocol type through feature vector matching;
[0057] S4: Generate a standard configuration instruction set based on the specific protocol type;
[0058] S5: Issue the standard configuration instruction set in steps and verify the configuration results.
[0059] As a preferred embodiment of the present invention, in step S1, the specific process of establishing a communication connection and obtaining terminal information is as follows:
[0060] S101: The configuration system discovers the power quality monitoring terminal device in the local network through network scanning, and obtains its IP address and MAC address. Specifically, the network scanning is performed using the TCP / IP protocol, the detection message is sent using the ICMP protocol, and the IP address to which the response is received is recorded.
[0061] S102: The configuration system sends a connection request to the discovered terminal device and establishes a reliable communication connection using the TCP protocol. Preferably, the system performs timeout management on the connection. If no terminal response is received within a preset time (usually 30 seconds), the connection request is re-initiated and retried up to 3 times.
[0062] S103: After successfully establishing the communication connection, the configuration system sends an identity authentication request to the terminal, and the terminal needs to return basic information such as its model identifier, device serial number, etc. The system verifies the legitimacy of the received information to ensure the integrity and accuracy of the data.
[0063] S104: The configuration system parses the information packet returned by the terminal, extracts the model identifier, and queries the local device type database according to the model identifier to obtain the protocol version number range supported by the model terminal. At the same time, the system records the online status and communication parameters of the terminal.
[0064] S105: Configure the system to maintain a heartbeat connection with the terminal and periodically send heartbeat packets to detect the terminal status. Preferably, if the heartbeat response of the terminal is not received for three consecutive times, the system will mark the terminal as offline and record relevant information in the log.
[0065] As a preferred embodiment of the present invention, in step S2, the specific process of capturing the communication data packet of the power quality monitoring terminal and extracting the features by using a network packet capture tool is as follows:
[0066] S201: Start the network packet capture tool, set the packet capture filtering rules, set the filtering conditions to the two-way communication data packets related to the IP address of the power quality monitoring terminal, preferably, set the packet capture time window to 5 minutes to ensure that enough communication data samples are obtained.
[0067] S202: Preprocess the captured communication data packets, remove damaged data packets and duplicate data packets, and sort the data packets in chronological order to prepare for subsequent feature extraction.
[0068] S203: Extract the statistical characteristics of the communication data packets, calculate the mean frame length of all data packets, calculate the standard deviation of the frame length, and establish the distribution characteristics of the frame length; calculate the frequency of occurrence of the function code in the data packet, and generate a function code frequency distribution histogram; calculate the mean and variance of the data domain length, analyze the change law of the data domain length, calculate the time interval between adjacent messages, and obtain time characteristics such as the minimum interval, maximum interval and average interval.
[0069] S204: Extracting structural features of the communication data packet, specifically including: analyzing the data frame format, locating and recording the positions of the frame start identifier and the frame end identifier; locating the position of the function code in the data field, identifying the type and encoding method of the function code; determining the position and length of the address field, including the source address and target address information; identifying the verification method of the data packet, including the position and calculation method of the verification fields such as the checksum and CRC check.
[0070] S205: The extracted statistical features and structural features are normalized to generate a feature data set. For statistical features, normalization is performed so that each feature value falls within the interval [0,1]; for structural features, each field position information is converted into an offset relative to the start position of the frame.
[0071] S206: The processed feature data set is passed as input to a subsequent protocol identification module for identification of the protocol family and determination of the specific protocol type.
[0072] As a preferred embodiment of the present invention, in step S3, the specific process of performing protocol identification according to terminal information and communication characteristics is as follows:
[0073] S301: Based on the model identifier of the power quality monitoring terminal, match the terminal protocol record library of the preset protocol mapping template, obtain the protocol records that have been used in the model terminal, and form a preliminary candidate list of protocol families. At the same time, compare the obtained protocol version number with the version range of each protocol family stored in the terminal history record library to filter out the protocol family with matching version numbers. By comparing the terminal IP address with the source IP address in the captured communication data packet, the correctness of the source of the data packet is verified, and the candidate list of protocol families is finally determined.
[0074] S302: Construct a four-layer decision tree model to perform hierarchical identification of the statistical features of communication data packets. Within the determined candidate list of protocol families, the decision tree performs feature matching according to the following levels:
[0075] First layer: Match the frame length mean and variance with the frame length range stored in the protocol family feature library in the preset protocol mapping template;
[0076] The second layer: matching the function code frequency distribution with the function code set stored in the protocol family feature library;
[0077] The third layer: matches the data field length feature with the data field format stored in the protocol family feature library;
[0078] Layer 4: Match the message time interval characteristics with the time parameters stored in the protocol family feature library.
[0079] S303: According to the result of the four-layer matching of the decision tree, determine whether the current protocol belongs to a known protocol family or a new protocol. When the four-layer features do not match the known protocol family, create a new protocol family category in the preset protocol mapping template, and store the statistical features of the current communication data packet as the features of the protocol family in the protocol family feature library, including the generation and storage of feature vectors.
[0080] S304: For the identified protocol family, further analyze its structural features to determine the specific protocol type. First, the structural features are normalized, all position information is converted into offsets relative to the start position of the frame format, and the encoding method of the function code is unified. Then, based on the normalized structural features, a fixed-dimensional 0-1 protocol type feature vector is constructed.
[0081] S305: Calculate the cosine similarity between the constructed protocol type feature vector and the feature vectors of each specific protocol type in the protocol family in the preset protocol mapping template. Preferably, the similarity threshold is set to 0.85, and when the calculated cosine similarity exceeds the threshold, the protocol type with the highest similarity is selected as the recognition result.
[0082] S306: For the newly identified protocol, its structural features are normalized and stored in the protocol type feature library, including information such as identification position, function code position and type, address field position and verification method, and a feature vector is generated as the first specific protocol type under the new protocol family.
[0083] As a preferred embodiment of the present invention, refer to Figure 2 In step S4, the specific process of generating a standard configuration instruction set according to the protocol identification result is as follows:
[0084] S401: For the identified known protocol, read the corresponding field definition table from the protocol conversion rule base of the preset protocol mapping template, which contains the name, position, length, data type and other detailed information of each field in the source protocol. According to the system configuration requirements, determine the target protocol type, and find the field mapping relationship between the source protocol and the target protocol in the protocol conversion rule base.
[0085] S402: Formulate a data conversion plan based on the field mapping relationship. Specifically, it includes: determining data type conversion rules to handle data type differences between different protocols; determining byte order conversion methods to solve byte order differences between different protocols; formulating field extension and truncation rules to handle field length mismatches; establishing a value range mapping relationship to ensure that data is converted within a valid range.
[0086] S403: For the newly identified protocol, generate an initial field definition table by analyzing the structure of the communication data packet. This process includes: identifying the location and length of key fields; inferring the data type of each field; establishing the semantic association of the field; and determining the valid value range of the field.
[0087] S404: Perform basic mapping between the fields of the new protocol and the common fields of the target protocol to establish a preliminary conversion relationship. Priority is given to matching fields related to basic configuration, including but not limited to key configuration items such as device address, communication parameters, sampling rate, etc. For fields that cannot establish a direct mapping relationship, use default values or reserved fields for processing.
[0088] S405: Generate a standard configuration instruction set according to the configuration requirements and conversion rules. For known protocols, the configuration instruction set includes: basic device parameter configuration instructions; communication parameter configuration instructions; data collection rule configuration instructions; alarm threshold configuration instructions; system time synchronization instructions.
[0089] S406: Standardize and encapsulate the generated configuration instructions, and add necessary protocol elements: add a protocol identifier; calculate and add a checksum; fill in address information; add a frame identifier; and adjust the byte order according to the protocol specification.
[0090] S407: For new protocols, the generated field definition table and mapping relationship are stored in the protocol conversion rule library of the preset protocol mapping template for subsequent configuration of similar terminals. At the same time, a feedback mechanism for the execution effect of configuration instructions is established to verify and optimize the conversion rules.
[0091] As a preferred embodiment of the present invention, in step S5, the specific process of issuing the standard configuration instruction set and verifying the configuration result in steps is as follows:
[0092] S501: Prioritize the standard configuration instruction set according to the dependency of the configuration instructions. Put the basic communication parameter configuration at the highest priority, followed by the basic device parameter configuration, then the data collection rule configuration, and finally the advanced function configuration to ensure the orderliness and reliability of the configuration process.
[0093] S502: Establish a configuration status management mechanism to record the execution status and response result of each configuration instruction. The status information includes the instruction sequence number, sending time, response time, execution result code and response data. The system uses this mechanism to track the configuration progress in real time and handle configuration anomalies in a timely manner.
[0094] S503: Send configuration instructions one by one in order of priority. After each configuration instruction is sent, the system enters a waiting state. Preferably, the response timeout is set to 3 seconds. During the waiting period, the system continuously monitors the response information of the terminal until the response data is received or the timeout limit is reached.
[0095] S504: Parse and verify the response data returned by the terminal. The verification content includes: the integrity and correctness of the response data; the legitimacy of the response code; the consistency between the read-back value and the issued value of the configuration parameter; and the compliance of the communication quality indicator.
[0096] S505: Preferably, according to the verification result, the system takes corresponding processing measures:
[0097] If the verification is successful, the configuration status record is updated and the next configuration instruction is executed;
[0098] If the verification fails, the exception handling process is started: the reason for the failure is recorded; an attempt is made to resend the current command, up to 3 times; if it still fails after the retries, the configuration process is terminated and a fault diagnosis report is generated.
[0099] S506: Preferably, after all configuration instructions are issued, the system performs a comprehensive verification of the terminal communication status. The verification items include: stability of communication connection; real-time data transmission; accuracy of data collection; and effectiveness of alarm function.
[0100] As a preferred embodiment of the present invention, the preset protocol mapping template is an integrated database system, and its specific implementation process is as follows:
[0101] Construction and maintenance of terminal protocol record library: The terminal protocol record library adopts a relational database structure to establish a mapping relationship between the power quality monitoring terminal model and its historically used protocol. Each record contains the terminal model identifier, a list of protocol families used in the past, version range information of each protocol family, usage time period and usage frequency statistics. The system continuously updates the records based on the actual usage of the terminal to ensure the timeliness of the data. When a new protocol is found to be used by the terminal, the corresponding entry is automatically added to the record library.
[0102] Organization and update of protocol family feature library: The protocol family feature library adopts a multi-dimensional feature matrix storage structure to record the statistical feature information of each existing protocol family. For each protocol family, the system maintains its feature vector, including information such as the statistical distribution parameters of the frame length, the frequency table of function code usage, the data field format description, and the time parameter characteristics. The feature library supports dynamic expansion and can adapt to the feature storage requirements of the newly added protocol family. Through the real-time learning mechanism, the system continuously optimizes and updates the feature parameters according to the accumulation of communication data to improve the representativeness of the features.
[0103] Establishment and expansion of protocol type feature library: The protocol type feature library adopts a hierarchical storage structure to store the structural feature information of specific protocol types. The feature record of each protocol type includes detailed information such as the location and format of the protocol identifier, the location and type of the function code, the distribution characteristics of the address field, and the verification method. The system converts various structural features into standardized feature vectors through normalization processing, which is convenient for subsequent similarity calculation and protocol identification. For newly discovered protocol types, the system automatically creates new feature records and establishes associations with existing protocols.
[0104] Implementation and management of the protocol conversion rule library: The protocol conversion rule library uses a graph structure to store the conversion rules between protocols, including field definition tables and field mapping relationships. The field definition table records the field attributes of each protocol in detail, including field name, data type, length limit, valid value range and other information. The field mapping relationship describes the correspondence between fields of different protocols, including data type conversion rules, byte order processing methods, value range mapping, etc. The system supports dynamic addition and update of rules to ensure the integrity and accuracy of conversion rules.
[0105] Preferably, the system has established a strict data consistency maintenance mechanism to ensure the synchronization and association of data among the four sub-databases. When any sub-database is updated, the system automatically checks and updates the associated data records to maintain data integrity. At the same time, the system implements a version control mechanism to record the template change history and support data rollback and audit tracking.
[0106] Preferably, the preset protocol mapping template implements a multi-level access control mechanism to restrict data access and modification operations according to user permissions. The system adopts a transaction processing mechanism to ensure data consistency under concurrent access. At the same time, a data caching mechanism is implemented to improve the response speed of frequently accessed data.
[0107] Preferably, the system has established a complete data backup mechanism to regularly back up template data and save incremental update records. In the event of data anomalies, it can quickly restore to the most recent correct state to ensure system reliability and data security.
Claims
1. A method for automatically configuring a power quality monitoring terminal supporting multiple protocols, characterized in that: The following steps are involved: S1. Establishing a communication connection between the power quality monitoring terminal and the configuration system, obtaining the power quality monitoring terminal model identifier, MAC address, IP address and protocol version number of the power quality monitoring terminal; S2. Capturing the communication data packets of the power quality monitoring terminal through a network packet capture tool, and extracting the characteristics of the communication data packets, including statistical characteristics and structural characteristics; S3. Match the historical protocol records in the preset protocol mapping template according to the power quality monitoring terminal model identifier, and obtain a candidate list of protocol families based on the protocol version number and the version range in the terminal historical record library, and use a decision tree to perform hierarchical identification on the statistical features. The decision tree matches the statistical features in turn. In each layer of identification, the current feature is matched with the corresponding features of each protocol family in the candidate list of protocol families stored in the preset protocol mapping template. If it does not match all known protocol families, it is determined to be a new protocol, and a new protocol family category is established for the new protocol in the preset protocol mapping template, and it is stored as a new specific protocol type, including its statistical features, structural features and feature vectors; After the protocol family is identified, a protocol type feature vector is constructed based on the structural features, and cosine similarity matching is performed with the feature vectors of each specific protocol type in the protocol family in the preset protocol mapping template to determine the specific protocol type; S4. Based on the specific protocol type, for a known protocol, obtain its corresponding field definition table from a preset protocol mapping template, determine data conversion methods such as data type conversion and byte order conversion according to the field mapping relationship between the source protocol and the target protocol, and for a newly identified protocol, generate an initial field definition table according to the field characteristics in the communication data packet, establish a basic mapping relationship with the target protocol, and generate a standard configuration instruction set for configuring the power quality monitoring terminal; S5. issuing the standard configuration instruction set in steps, waiting for the response confirmation of the power quality monitoring terminal after each configuration instruction is issued, and after receiving a successful response from the power quality monitoring terminal, verifying its communication status; The preset protocol mapping template is a database that integrates information required for protocol identification, protocol conversion and configuration instruction generation, including a terminal protocol record library, a protocol family feature library, a protocol type feature library and a protocol conversion rule library.
2. The method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to claim 1, characterized in that: The feature of the communication data packet extracted in S2 includes: Extract statistical features, including the mean and variance of frame length, the frequency distribution of function codes, the mean and variance of data field length, and the time interval characteristics of adjacent messages; Extract structural features, including the identification position in the frame format, the function code position and type in the data field, the address field position, and the verification method.
3. The method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to claim 1, characterized in that: The acquisition of the protocol family candidate list in S3 specifically includes: According to the power quality monitoring terminal model, the historical protocol records stored in the preset protocol mapping template are matched to obtain a candidate list of the first protocol family commonly used by the model, the protocol version number is matched with the version range of the corresponding protocol family stored in the terminal history record library of the preset protocol mapping template, and the correctness of the source of the data packet is confirmed by comparing the consistency of the IP address with the source IP address in the communication data packet captured by S2 to obtain a candidate list of the protocol family.
4. The method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to claim 1, characterized in that: The hierarchical identification of the statistical features by using a decision tree in S3 specifically includes: Within the scope of the protocol family candidate list, the first layer of the decision tree matches the frame length feature with the corresponding candidate protocol family frame length range stored in the protocol family feature library of the preset protocol mapping template, the second layer of the decision tree matches the function code feature with the corresponding candidate protocol family function code set stored in the protocol family feature library, the third layer of the decision tree matches the data domain feature with the corresponding candidate protocol family data domain format stored in the protocol family feature library, and the fourth layer of the decision tree matches the time interval feature with the corresponding candidate protocol family time parameter stored in the protocol family feature library. According to the matching results of the above four layers, it is determined whether the power quality monitoring terminal belongs to a known protocol family or a new protocol.
5. The method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to claim 1, characterized in that: The processing of the new protocol in S3 specifically includes: When the four-layer features of the decision tree do not match the known protocol family, a new protocol family category is created in the preset protocol mapping template, and the statistical features of the current communication data packet are stored in the protocol family feature library as the features of the protocol family, including the frame length range, function code set, data field format and time parameter information; the structural features of the current communication data packet are stored in the protocol type feature library after normalization, including the identification position, function code position and type, address field position and verification method, as the first specific protocol type under the new protocol family; Generate and store feature vectors of the protocol family and specific protocol type for subsequent protocol identification.
6. The method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to claim 1, characterized in that: The structural features are further analyzed in S3 to determine the specific protocol type, which specifically includes: Based on the protocol family range determined by the decision tree, the same normalization processing is applied to the structural features and the structural features in the protocol type feature library in the preset protocol mapping template, all position information in the structural features is converted into an offset relative to the starting position of the frame format, and the type of the function code is converted into a unified code; Based on the normalized structural features, a fixed-dimensional 0-1 protocol type feature vector is constructed. When the feature exists, the corresponding position takes a value of 1, and when it does not exist, the value is 0; the cosine similarity of the protocol type feature vector and the feature vector of each specific protocol type in the protocol family stored in the preset protocol mapping template is calculated. When the cosine similarity exceeds a preset threshold, the protocol type with the highest similarity is determined as the recognition result, and the recognition of the specific protocol type is completed within the protocol family determined by the decision tree.
7. The method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to claim 1, characterized in that: The processing of the known protocol in S4 specifically includes: Read the field definition table corresponding to the specific protocol type from the protocol conversion rule library in the preset protocol mapping template as the source protocol field definition, determine the target protocol according to the configuration requirements, and match the field mapping relationship between the source protocol and the target protocol in the protocol conversion rule library in the preset protocol mapping template; determine the data conversion method based on the field mapping relationship, including data type mapping, byte order conversion, field extension and truncation rules, which are used to handle data format differences between different protocols; According to the data conversion method, the configuration requirements are converted into a standard configuration instruction set that conforms to the target protocol, including configuration instructions for device parameters, communication parameters and data acquisition rules, and a checksum, protocol identifier, address information and frame identifier are added for encapsulation according to the protocol specification.
8. The method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to claim 1, characterized in that: The processing of the new protocol in S4 specifically includes: According to the analysis results of the communication data packet, the position, length and data type of the key fields are identified, and an initial field definition table is generated; Basic mapping of the identified fields with the common fields of the target protocol; Use the default data conversion method to generate a basic configuration instruction set, including necessary device parameter and communication parameter configuration instructions; The generated field definition table and mapping relationship are stored in the protocol conversion rule library of the preset protocol mapping template.
9. A method for automatically configuring a power quality monitoring terminal supporting multiple protocols according to any one of claims 1 to 8, characterized in that: The preset protocol mapping template is a database that integrates the information required for protocol identification, protocol conversion, and configuration instruction generation, wherein a protocol family refers to a set of protocols with similar statistical characteristics, specifically including: Terminal protocol record library, which stores the power quality monitoring terminal models and their corresponding historical protocol records, as well as the version range information of the protocol family; The protocol family feature library stores the statistical features of the existing protocol family, including the frame length range, function code set, data field format and time parameter information, as well as the feature vector of the protocol family; The protocol type feature library stores the structural features of specific protocol types, including the identification position, function code position and type, address field position and verification method, and feature vectors of specific protocol types; The protocol conversion rule base stores the field definition table of specific protocol types and the field mapping relationship between protocols.
10. An automatic configuration system for power quality monitoring terminals supporting multiple protocols, characterized in that: include: A communication module, used to establish a communication connection between the power quality monitoring terminal and the configuration system, and obtain a model identifier, MAC address, IP address and protocol version number of the power quality monitoring terminal; A feature extraction module, used to capture the communication data packet of the power quality monitoring terminal through a network packet capture tool, and extract feature information of the communication data packet; A protocol identification module, used to match a preset protocol mapping template according to the model identifier and the protocol version number, and to identify the protocol family and determine the specific protocol type based on the feature information; A configuration instruction module, used to obtain field definitions and conversion rules from a preset protocol mapping template according to the specific protocol type, and generate a standard configuration instruction set; The execution module is used to issue the standard configuration instruction set step by step and verify the configuration result.
Citation Information
Patent Citations
Industrial communication multi-protocol conversion system
CN114222009A
Edge IOT multi-protocol intelligent terminal manufacturing system based on OPC object link
CN117579647A
Automatic identification method and system for intelligent equipment terminal of power distribution network
CN119011454A
Cited By
Sensing equipment communication method, system and equipment for intelligent transportation system
CN119922245A
A communication method, system and device for a sensing device in an intelligent transportation system
CN119922245B
IOT edge communication base station for verification of flexible intelligent driving electric energy meter
CN120075313A
Multi-mode identification industrial protocol adaptation method and terminal
CN120223772A
Rapid access method, system and device for distribution network station area end equipment
CN120263881A