A power data acquisition method, readable storage medium and device

By identifying the industrial protocol characteristics of devices and using a pre-configured template library to automatically identify and convert data, the complexity of development and maintenance difficulties in power data acquisition in existing technologies have been solved, enabling convenient adaptation and efficient data acquisition of multi-source devices in the power Internet of Things.

CN122120366APending Publication Date: 2026-05-29GUODIAN NANJING AUTOMATION SOFTWARE ENG

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUODIAN NANJING AUTOMATION SOFTWARE ENG
Filing Date
2026-04-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing power data acquisition solutions suffer from long development cycles, high costs, difficult maintenance, and poor scalability. In particular, they require separate development of drivers or communication services for various protocols and devices, and have high technical barriers.

Method used

By identifying the industrial protocol characteristics of the equipment and using a pre-configured template library to match and parse templates, the protocol type is automatically identified and converted into key-value pairs of data points with standard semantics, thus enabling convenient collection and transmission of equipment data.

Benefits of technology

It significantly reduces the complexity of system development, deployment and maintenance, enables flexible adaptation to multi-source heterogeneous devices and zero-coding protocol access, and improves the system's scalability and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120366A_ABST
    Figure CN122120366A_ABST
Patent Text Reader

Abstract

The application discloses a kind of electric power data acquisition method, readable storage medium and device, belong to industrial internet of things and power system automation technical field;A kind of electric power data acquisition method, based on the industrial protocol characteristics of access equipment to identify the protocol type of access equipment, select the analysis template compatible with the protocol type of access equipment by pre-configured template library, finally using analysis template to the data stream of access equipment is parsed and processed, the original binary or byte stream data of access equipment is converted into the key-value pair data point with standard semantics, data acquisition is convenient, adapt to the access of multi-source heterogeneous equipment in power internet of things, greatly reduce the complexity of system development, deployment and maintenance, solve the problem that current electric power data acquisition needs to be separately developed special drive or communication service for different protocol equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a power data acquisition method, a readable storage medium, and a device, belonging to the field of industrial Internet of Things and power system automation technology. Background Technology

[0002] In IoT systems for power, energy, and industrial control, real-time data collection is required from numerous field devices (such as smart meters, distribution terminals, protection devices, sensors, and PLCs). These devices come from various manufacturers and use different communication protocols, such as Modbus, IEC104, IEC101, and OPCUA. Traditional data acquisition solutions typically employ a front-end server model, developing dedicated drivers or communication services for each protocol. This hard-coded approach has significant drawbacks: Long development cycle and high cost: Every time a new protocol or new device model is connected, developers need to code, test and deploy, which is time-consuming and labor-intensive.

[0003] Maintenance difficulties: The driver code is tightly coupled with the main program, making it complex to modify or upgrade the protocol parsing logic, and prone to introducing errors.

[0004] Poor scalability: The system lacks flexibility and cannot quickly respond to the needs of field equipment upgrades or the addition of new protocol types.

[0005] High technical threshold: Protocol parsing ability depends on the developer's programming skills and understanding of specific protocols, making it difficult to accumulate and reuse knowledge. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a power data acquisition method, a readable storage medium and device. The data acquisition is convenient, adaptable to the access of multi-source heterogeneous devices in the power Internet of Things, greatly reduces the complexity of system development, deployment and maintenance, and solves the problem that current power data acquisition requires the separate development of dedicated drivers or communication services for devices with different protocols.

[0007] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution: This invention provides a method for acquiring power data, comprising: Based on the data stream from the access device, determine the corresponding industrial protocol characteristics; Identify the protocol type of access devices based on industrial protocol characteristics; Select a parsing template from the pre-configured template library that matches the protocol type of the access device; The data stream from the access device is parsed using a parsing template, converting the original binary or byte stream data from the access device into key-value pairs with standard semantics. Transmit key-value pairs of data points to the target bus.

[0008] Furthermore, the industrial protocol features include device connectivity features, message structure features, and interactive session features; The connection features include a default port number and a connection establishment mode; The message structure features include a specific byte sequence, a fixed header length, a message length, a message type, and a parsing offset algorithm corresponding to different measurement point types of data; Interactive session characteristics include specific function code sequences and request-response pairing patterns.

[0009] Furthermore, the identification of the protocol type of the access device based on industrial protocol characteristics includes: The industrial protocol characteristics corresponding to the access device are matched with a pre-established protocol characteristic library at multiple levels until the protocol type of the access device can be identified. The protocol feature library contains pre-stored industrial protocol features and their corresponding protocol types.

[0010] Furthermore, the step of performing multi-level matching between the industrial protocol characteristics corresponding to the access device and a pre-established protocol characteristic library includes: Perform a preliminary match between the connection characteristics and message structure characteristics of the access device and the industrial protocol characteristics of the existing protocols in the protocol feature library. If the match is successful, output the corresponding protocol type. Otherwise, initiate at least one exploratory protocol handshake interaction with the access device to obtain a request-response message pair that characterizes the request-response pairing mode of the access device; Based on the request-response message pairs, obtain the interaction session characteristics of the access device; The protocol type of the access device is obtained by accurately matching the interaction session characteristics of the access device with the protocol feature library.

[0011] Furthermore, the parsing template includes a protocol frame structure definition and data point table mapping rules; The data point table mapping rules include: Map the device's original address, measurement point number, register index, or tag name to a standard measurement point ID; Associating the standard measurement point ID with the data type, scaling factor, and engineering units, it can be represented as follows: ; in, Indicates the measurement point ID. Indicates the original address. Represents data type, Indicates the scaling factor. Indicates the engineering unit.

[0012] Furthermore, the configuration method of the template library includes: Generate the corresponding initial parsing template based on the protocol type of the industrial protocol to be configured; Based on the extensions of different manufacturers to the standard protocol, the protocol frame structure definition and data point table mapping rules of the initial parsing template are adjusted to obtain a new parsing template; The new parsing template is annotated with the corresponding industrial protocol name and stored in the template library to obtain the configured template library.

[0013] Furthermore, the step of using a parsing template to parse the data stream of the access device, converting the original binary or byte stream data of the access device into key-value pairs with standard semantics, includes: Based on the protocol type of the access device, obtain the start byte of the data field and the register width of the data stream of the access device; Based on the starting byte of the data field and the register width of the data stream from the access device, the original binary or byte stream data is extracted; Using a parsing template corresponding to the access device protocol type, floating-point values ​​are calculated through data point table mapping rules to generate key-value pairs of data points with standard semantics.

[0014] Furthermore, the parsing template also includes a channel interaction process definition, which is represented as: the protocol message interaction process between the master station and the access device.

[0015] Another aspect of the present invention provides a power data acquisition device, the device comprising: The feature extraction module is used to determine the corresponding industrial protocol features based on the data stream of the access device; The protocol identification module is used to identify the protocol type of the access device based on the characteristics of industrial protocols; The template matching module is used to select a parsing template that matches the protocol type of the access device from the pre-configured template library; The numerical processing module is used to parse and process the data stream of the access device using a parsing template, converting the raw binary or byte stream data of the access device into key-value pairs with standard semantics. The transmission module is used to transmit key-value pair data points to the target bus.

[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the power data acquisition method described above.

[0017] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: 1. This invention identifies the protocol type of access devices based on the industrial protocol characteristics of the access devices. It selects parsing templates that are compatible with the protocol type of the access devices through a pre-configured template library. Finally, the parsing templates are used to parse and process the data stream of the access devices, converting the original binary or byte stream data of the access devices into key-value pairs with standard semantics. This makes data acquisition convenient, adapts to the access of multi-source heterogeneous devices in the power Internet of Things, greatly reduces the complexity of system development, deployment and maintenance, and solves the problem that current power data acquisition requires the separate development of dedicated drivers or communication services for different protocol devices. 2. This invention parses and processes the data stream of the access device by parsing the data point table mapping rules of the parsing template. It can also adjust the protocol frame structure definition and data point table mapping rules of the initial parsing template according to the extensions of different manufacturers based on standard protocols to obtain new parsing templates. By flexibly describing the protocol frame format and interaction logic, the template library can be expanded, fundamentally achieving the goal of "zero coding" for protocol access. Attached Figure Description

[0018] Figure 1 This is a flowchart of a power data acquisition method provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the identification of access device protocol types provided in an embodiment of the present invention; Figure 3 This is a flowchart of selecting an access device parsing template provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a power data acquisition device provided in an embodiment of the present invention. Detailed Implementation

[0019] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0020] Example 1

[0021] like Figure 1 As shown, this embodiment provides a power data acquisition method, including: Step 1: Determine the corresponding industrial protocol characteristics based on the data stream of the access device; Among them, the characteristics of industrial protocols include the device's connection characteristics, message structure characteristics, and interactive session characteristics; Connection characteristics include the default port number and connection establishment mode; The message structure features include a specific byte sequence, a fixed header length, message length, message type, and parsing offset algorithms corresponding to different measurement point types of data; Interactive session characteristics include specific function code sequences and request-response pairing patterns; Taking the Modbus TCP protocol as an example: First, based on the data stream of the access device, record its five-tuple information. Then, without interfering with normal communication, copy an initial data packet. By parsing the first few packets of the initial data packet, the industrial protocol characteristics of the access device, including the default port number, the packet header "0001 00 00 00 06", and the function code "03", are extracted.

[0022] Step 2: Identify the protocol type of the access device based on the characteristics of industrial protocols; Based on industrial protocol characteristics, the protocol type of the access device is identified, including multi-level matching of the industrial protocol characteristics corresponding to the access device with a pre-established protocol characteristic library until the protocol type of the access device can be identified.

[0023] It should be noted that the protocol feature library contains pre-stored industrial protocol features and their corresponding protocol types.

[0024] like Figure 2 As shown, the industrial protocol characteristics corresponding to the access device are matched with a pre-established protocol characteristic library at multiple levels, including: Perform a preliminary match between the connection characteristics and message structure characteristics of the access device and the industrial protocol characteristics of the existing protocols in the protocol feature library. If the match is successful, output the corresponding protocol type. Otherwise, initiate at least one exploratory protocol handshake interaction with the access device to obtain a request-response message pair that characterizes the request-response pairing mode of the access device; Based on the request-response message pairs, obtain the interaction session characteristics of the access device; Based on the interaction session characteristics of the access device and the protocol feature library, the protocol type of the access device is determined to be Modbus TCP.

[0025] Step 3: Select a parsing template from the pre-configured template library that matches the protocol type of the access device; The parsing template includes the protocol frame structure definition and data point table mapping rules; Data point table mapping rules include: Map the device's original address, measurement point number, register index, or tag name to a standard measurement point ID; Associating the standard measurement point ID with the data type, scaling factor, and engineering units, it can be represented as follows: ; in, Indicates the measurement point ID. Indicates the original address. Represents data type, Indicates the scaling factor. Indicates the engineering unit; For example, a parsing template named "ModbusTCP_Standard.yaml" is loaded from the template library. This template defines the MBAP header structure, exception response criteria, and a dot table mapping list in YAML format; one of the mappings is: , Represents voltage, unit is .

[0026] The template library is configured as follows: Generate the corresponding initial parsing template based on the protocol type of the industrial protocol to be configured; Based on the extensions of different manufacturers to the standard protocol, the protocol frame structure definition and data point table mapping rules of the initial parsing template are adjusted to obtain a new parsing template; The new parsing template is annotated with the corresponding industrial protocol name and stored in the template library to obtain the configured template library.

[0027] For example: If a special version of the Modbus protocol needs to be added, an initial parsing template of the corresponding format is generated according to the type of Modbus protocol. After adjusting the frame structure definition and dot table mapping as required, it is saved as a new template "ModbusTCP_Vendor.yaml". The new template is named "ModbusTCP_Vendor". It defines the MBAP header structure, exception response judgment, and a dot table mapping list in YAML format, without requiring any code to be written or deployed. It should be noted that the parsing template in this embodiment also includes a channel interaction process definition, which is represented as: the protocol message interaction process between the master station and the access device.

[0028] Step 4: Use a parsing template to parse the data stream of the access device, converting the original binary or byte stream data of the access device into key-value pairs with standard semantics; like Figure 3 As shown, a parsing template is used to parse the data stream of the access device, converting the raw binary or byte stream data of the access device into key-value pairs with standard semantics. Specifically, this includes: Based on the protocol type of the access device, obtain the start byte of the data field and the register width of the data stream of the access device; Based on the starting byte of the data field and the register width of the data stream from the access device, the original binary or byte stream data is extracted; Using a parsing template corresponding to the access device protocol type, floating-point values ​​are calculated through data point table mapping rules to generate key-value pair data points with standard semantics, represented as follows: , Represents a timestamp.

[0029] Step 5: Transmit the key-value pair data points to the target bus.

[0030] Example 2

[0031] like Figure 4 As shown, this embodiment provides a power data acquisition device, including: The feature extraction module is used to determine the corresponding industrial protocol features based on the data stream of the access device; The protocol identification module is used to identify the protocol type of the access device based on the characteristics of industrial protocols; The template matching module is used to select a parsing template that matches the protocol type of the access device from the pre-configured template library; The numerical processing module is used to parse and process the data stream of the access device using a parsing template, converting the raw binary or byte stream data of the access device into key-value pairs with standard semantics. The transmission module is used to transmit key-value pair data points to the target bus.

[0032] Example 3

[0033] This embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the following method steps: Based on the data stream from the access device, determine the corresponding industrial protocol characteristics; Identify the protocol type of access devices based on industrial protocol characteristics; Select a parsing template from the pre-configured template library that matches the protocol type of the access device; The data stream from the access device is parsed using a parsing template, converting the original binary or byte stream data from the access device into key-value pairs with standard semantics. Transmit key-value pairs of data points to the target bus.

[0034] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0035] This invention is described with reference to flowchart illustrations of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each step in the flowchart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 One or more processes or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0036] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 The function specified in one or more processes.

[0037] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 Steps of a specified function in one or more processes.

[0038] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for acquiring power data, characterized in that, include: Based on the data stream from the access device, determine the corresponding industrial protocol characteristics; Identify the protocol type of access devices based on industrial protocol characteristics; Select a parsing template from the pre-configured template library that matches the protocol type of the access device; The data stream from the access device is parsed using a parsing template, converting the original binary or byte stream data from the access device into key-value pairs with standard semantics. Transmit key-value pairs of data points to the target bus.

2. The power data acquisition method according to claim 1, characterized in that, The industrial protocol features include device connectivity features, message structure features, and interactive session features; The connection features include a default port number and a connection establishment mode; The message structure features include a specific byte sequence, a fixed header length, a message length, a message type, and a parsing offset algorithm corresponding to different measurement point types of data; Interactive session characteristics include specific function code sequences and request-response pairing patterns.

3. The power data acquisition method according to claim 2, characterized in that, The method of identifying the protocol type of access devices based on industrial protocol characteristics includes: The industrial protocol characteristics corresponding to the access device are matched with a pre-established protocol characteristic library at multiple levels until the protocol type of the access device can be identified. The protocol feature library contains pre-stored industrial protocol features and their corresponding protocol types.

4. The power data acquisition method according to claim 3, characterized in that, The step of performing multi-level matching between the industrial protocol features corresponding to the access device and a pre-established protocol feature library includes: Perform a preliminary match between the connection characteristics and message structure characteristics of the access device and the industrial protocol characteristics of the existing protocols in the protocol feature library. If the match is successful, output the corresponding protocol type. Otherwise, initiate at least one exploratory protocol handshake interaction with the access device to obtain a request-response message pair that characterizes the request-response pairing mode of the access device; Based on the request-response message pairs, obtain the interaction session characteristics of the access device; The protocol type of the access device is obtained by accurately matching the interaction session characteristics of the access device with the protocol feature library.

5. The power data acquisition method according to claim 1, characterized in that, The parsing template includes the protocol frame structure definition and data point table mapping rules; The data point table mapping rules include: Map the device's original address, measurement point number, register index, or tag name to a standard measurement point ID; Associating the standard measurement point ID with the data type, scaling factor, and engineering units, it can be represented as follows: ; in, Indicates the measurement point ID. Indicates the original address. Represents data type, Indicates the scaling factor. Indicates the engineering unit.

6. The power data acquisition method according to claim 5, characterized in that, The configuration method for the template library includes: Generate the corresponding initial parsing template based on the protocol type of the industrial protocol to be configured; Based on the extensions of different manufacturers to the standard protocol, the protocol frame structure definition and data point table mapping rules of the initial parsing template are adjusted to obtain a new parsing template; The new parsing template is annotated with the corresponding industrial protocol name and stored in the template library to obtain the configured template library.

7. The power data acquisition method according to claim 5, characterized in that, The step of parsing the data stream of the access device using a parsing template, converting the original binary or byte stream data of the access device into key-value pairs with standard semantics, includes: Based on the protocol type of the access device, obtain the start byte of the data field and the register width of the data stream of the access device; Based on the starting byte of the data field and the register width of the data stream from the access device, the original binary or byte stream data is extracted; Using a parsing template corresponding to the access device protocol type, floating-point values ​​are calculated through data point table mapping rules to generate key-value pairs of data points with standard semantics.

8. The power data acquisition method according to claim 1, characterized in that, The parsing template also includes a channel interaction process definition, which is represented as: the protocol message interaction process between the master station and the access device.

9. A power data acquisition device, characterized in that, The device includes: The feature extraction module is used to determine the corresponding industrial protocol features based on the data stream of the access device; The protocol identification module is used to identify the protocol type of the access device based on the characteristics of industrial protocols; The template matching module is used to select a parsing template that matches the protocol type of the access device from the pre-configured template library; The numerical processing module is used to parse and process the data stream of the access device using a parsing template, converting the original binary or byte stream data of the access device into key-value pairs with standard semantics. The transmission module is used to transmit key-value pair data points to the target bus.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the power data acquisition method as described in any one of claims 1 to 8.