A power heterogeneous protocol adaptive access and multi-granularity instruction issuing protocol conversion system and method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-20
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]协议适配效率低且成本高:各终端协议互不兼容,主站需针对每种协议开发独立适配模块,开发周期长、代码冗余度高,新增协议时需重构核心逻辑,系统扩展性极差;同时协议参数依赖人工手动配置,易出现配置错误,且无法适配现场协议动态变化场景;
Smart Images

Figure CN122554546A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system communication and data acquisition technology, and particularly relates to a system and method for adaptive access of heterogeneous power protocols and multi-granularity command issuance protocol conversion. Background Technology
[0002] Power system terminal equipment is diverse, encompassing low-power IoT terminals, outdated monitoring and control equipment, and substation auxiliary system equipment, employing various communication protocols such as HTTP, MQTT, Kafka, Haystack, and non-standard TCP protocols. However, power master stations generally use the IEC 60870-5-104 (IEC104) protocol for data exchange, resulting in the following core technical bottlenecks in existing protocol conversion systems:
[0003] Protocol adaptation is inefficient and costly: the protocols of various terminals are incompatible with each other, and the main station needs to develop independent adaptation modules for each protocol. The development cycle is long, the code redundancy is high, and the core logic needs to be reconstructed when adding a new protocol. The system has extremely poor scalability. At the same time, the protocol parameters rely on manual configuration, which is prone to configuration errors and cannot adapt to the dynamic changes of the protocol in the field.
[0004] Lack of multi-granularity command control: The power master station needs to issue two types of multi-granularity commands: object-oriented data structure control commands (such as overall station parameter adjustment) and single-point control commands (such as single device switching operation). The existing system lacks a unified command encapsulation, priority division, and duplicate filtering mechanism, which can easily lead to command execution conflicts, delays or loss, seriously affecting the security of dispatching operations.
[0005] Insufficient data transmission quality and real-time performance: Data loss, outliers, and timing disorder are prone to occur when multiple data sources are collected concurrently; the existing caching mechanism only supports a single storage type, and the disk I / O latency is high when the main station reads data, which cannot meet the real-time requirement of "millisecond-level response" for power dispatching.
[0006] Poor communication reliability and high maintenance costs: The system communication link is prone to failures such as interruption, data packet loss, and abnormal message parsing. Manual intervention is required to restart the link and resend data. It cannot achieve self-healing, resulting in poor continuous operation stability of the system and a large workload for maintenance.
[0007] The system architecture is highly coupled: the protocol access layer, core conversion layer, and main station interface layer are deeply interconnected. When adding a new protocol, upgrading a module, or fixing a fault, the core conversion logic and the main station program need to be modified, which makes maintenance difficult and risky.
[0008] In summary, existing technologies cannot meet the access requirements of heterogeneous terminals in power systems, nor can they guarantee the reliable execution of multi-granularity commands and the high-quality transmission of data. There is an urgent need to propose a new protocol conversion system to overcome the above-mentioned technical bottlenecks. Summary of the Invention
[0009] Purpose of the invention: The purpose of this invention is to provide a system and method for adaptive access of heterogeneous power protocols and multi-granularity command issuance protocol conversion that can improve the real-time performance of data transmission.
[0010] Technical solution: The power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system of the present invention includes: a master station, a standardization conversion module and a multi-protocol heterogeneous data acquisition module that are interconnected;
[0011] The main station issues multi-granularity control commands via the HTTP protocol, receives standardized data via standard protocols, and undertakes scheduling decision-making and data monitoring functions.
[0012] The standardization conversion module establishes long TCP connections with the main station and the multi-protocol heterogeneous data acquisition module. The standardization conversion module includes a standard protocol forwarding module, a data cache template, a control command issuance module, and a parsing and database entry module. The standard protocol forwarding module is configured as a TCP server to implement protocol communication with the main station, upload standardized data to the main station, and receive and parse control commands from the main station. The data cache template is responsible for data cache updates and standardization conversion. The control command issuance module is configured as an HTTP client, responsible for command verification, priority allocation, and distribution management. The parsing and database entry module is configured as a TCP server, responsible for parsing, verifying, and persistently storing uniformly formatted JSON messages in the database.
[0013] The multi-protocol heterogeneous data acquisition module includes a protocol adaptation module, a multi-protocol acquisition unit, a TCP client cluster, and a control forwarding service. The protocol adaptation module adopts an adapter design pattern, defining a unified interface for data acquisition and control command interaction, and encapsulating the communication logic of various communication protocols. The multi-protocol acquisition unit includes acquisition modules, such as an HTTP acquisition module, an MQTT acquisition module, a Kafka acquisition module, a Haystack acquisition module, and a TCP non-standard acquisition module. Each acquisition module converts the acquired raw heterogeneous data into a unified JSON format through the protocol adaptation module. The TCP client cluster is configured to use a multi-threaded concurrency and load balancing mechanism to batch report the unified JSON format data to the parsing and database module of the standardization conversion module, and supports reconnection after disconnection and data retransmission. The control forwarding service receives JSON format control commands issued by the control command issuing module in the standardization conversion module, routes the control commands to the corresponding acquisition modules in the multi-protocol acquisition unit according to the device ID and protocol type in the control commands, and feeds back the device execution results to the standardization conversion module.
[0014] Furthermore, the control forwarding service is responsible for receiving HTTP format control commands from the upper-layer master station, encapsulating the object-oriented data structure control commands into a unified format, and finally distributing them to the corresponding acquisition modules in the multi-protocol acquisition unit.
[0015] Furthermore, the parsing and data entry module is configured as a TCP server with preset JSON message parsing rules. It performs field verification on the received messages to ensure that the four fields of device unique identifier, data type, collected value and timestamp are complete and valid. After parsing, it calls the platform's front-end interface to realize data entry.
[0016] Furthermore, the data cache template is a memory-level cache module that adopts a real-time synchronization update mechanism. After the data is entered into the database, the cache content is updated synchronously, so that the main site will prioritize calling the memory cache when reading data.
[0017] Furthermore, the HTTP acquisition module is adapted to HTTP protocol terminal data acquisition and command reception, the MQTT acquisition module is adapted to IoT terminals, and the Kafka acquisition module is adapted to high-throughput big data acquisition scenarios. The standard for high-throughput big data acquisition scenarios is an acquisition rate greater than or equal to 10,000 records / second, a real-time acquisition rate greater than or equal to 1,000 records / second, or concurrent connections greater than or equal to 10,000 devices / gateways. The Haystack acquisition module is adapted to data interaction of the site auxiliary system, and the TCP non-standard protocol acquisition module is adapted to the custom binary protocol of the terminal that has been installed and used. Each acquisition module operates independently, and the multi-protocol acquisition unit allows for the expansion of new types of acquisition modules as needed.
[0018] Furthermore, the standardization conversion module integrates protocol adaptive identification function. After the system starts, it automatically detects the communication protocol type between the multi-protocol heterogeneous data acquisition module and the target device, and matches the corresponding parsing rules.
[0019] Furthermore, the data uplink process of the system is as follows: the multi-protocol acquisition unit collects the raw data of the target device, the protocol adaptation module converts the raw data into a unified JSON format, the TCP client cluster reports the JSON format data in batches to the standardization conversion module, the parsing and storage module of the standardization conversion module parses and verifies the legality of the received data, and preprocesses the data that passes the verification, the data caching module stores the preprocessed data, and the standard protocol forwarding module frames the data according to the preset protocol format and uploads it to the main station;
[0020] The data downlink and feedback process of the system is as follows: the main station issues control commands in a preset format; the standard protocol forwarding module parses the control commands; the data caching module temporarily stores the parsed control commands; the control command issuing module encapsulates the control commands into JSON format messages and issues them; the control forwarding service of the multi-protocol heterogeneous data acquisition module receives the messages and routes them to the acquisition modules corresponding to the multi-protocol acquisition units via the protocol adaptation module; each acquisition module converts the control commands into a format recognizable by the device and issues them to the target device; the target device executes the control commands and reports the execution results; the TCP client cluster reports the execution results transmitted by the protocol adaptation module to the standardization conversion module; the standardization conversion module feeds back the execution results to the main station through the standard protocol forwarding module, forming a control closed loop.
[0021] Based on the same inventive concept, the present invention also provides a method for adaptive access and multi-granularity command delivery protocol conversion of power heterogeneous protocols in a power heterogeneous protocol adaptive access and multi-granularity command delivery protocol conversion system according to any one of the above claims, comprising:
[0022] S1: Each acquisition module in the multi-protocol acquisition unit of the multi-protocol heterogeneous data acquisition module automatically detects the terminal communication protocol type, and after acquiring the terminal's raw data, it is uniformly encapsulated into a standard JSON message containing the target device's unique identifier, data type, acquired value, and timestamp, and transmitted to the parsing and database module of the standardization conversion module through a TCP long connection;
[0023] S2: The parsing and database module performs format validation and content parsing on the JSON message, removes invalid data, corrects abnormal data, and then persists the data to the database. At the same time, it pushes the parsed standardized data to the data cache template of the standardization conversion module to update the memory cache.
[0024] S3: The main station sends out two types of multi-granularity control commands, namely object-oriented data structure control and single-point control, via the HTTP protocol. After receiving the commands, the control forwarding service completes the legality verification, priority division and duplicate command filtering, and accurately distributes them to the corresponding acquisition modules in the multi-protocol acquisition unit according to the command granularity. Each acquisition module converts them into a format that the terminal can recognize before sending them out for execution.
[0025] S4: The data cache template reads standardized data, calls the protocol stack to convert it into a standard protocol message, and reports it to the main station through the standard protocol forwarding module of the standardization conversion module, completing the closed-loop data transmission;
[0026] S5: The system monitors the status of the communication link in real time. When a fault occurs, it automatically triggers the link restart and data retransmission process to ensure the continuous and stable operation of the system.
[0027] Furthermore, the priority division rule for the multi-granularity control instructions in step S3 is as follows:
[0028] Core instructions are set to high priority, and regular instructions are set to normal priority. High-priority instructions are dispatched and executed first to avoid instruction execution conflicts. The core instructions include single-point remote control and emergency tripping, and the regular instructions include object-oriented data structure control instructions.
[0029] Furthermore, step S5 specifically involves: when the system detects a link interruption, data packet loss, or abnormal message parsing, it automatically restarts the corresponding protocol client link, re-initiates data collection or command issuance requests, and automatically restores normal communication after the fault is cleared.
[0030] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. Multi-protocol adaptive access with comprehensive compatibility: It integrates five types of protocol acquisition clients, which can adaptively identify various heterogeneous protocols such as HTTP, MQTT, Kafka, Haystack, and TCP. No manual configuration of protocol parameters is required, completely solving the problem of narrow protocol compatibility in existing protocol conversion technologies. It can seamlessly access various heterogeneous terminals in power plants, with compatibility far exceeding conventional solutions. 2. Precise multi-granularity instruction control and efficient execution: It distinguishes between object-oriented data structure control and single-point instructions, and uses an instruction priority scheduling mechanism. Core instructions such as single-point remote control and emergency tripping are set to high priority, while conventional instructions such as object-oriented data structure control are set to ordinary priority. It also filters duplicate instructions and avoids execution conflicts, ensuring priority response to core scheduling instructions. This significantly improves instruction execution accuracy and scheduling efficiency, meeting the precise needs of power dispatching. 3. Optimized transmission performance and outstanding real-time performance: It sets up a memory-level data cache template, and updates the cache synchronously after data parsing and storage. The main station prioritizes calling the memory cache when reading data, significantly reducing disk I / O latency. 4. Convenient operation and maintenance, high operational stability: Integrated protocol adaptive identification function, automatically detects terminal protocol type after system startup, eliminating the need for manual configuration of protocol parameters, significantly reducing operation and maintenance costs; At the same time, it is equipped with communication anomaly self-healing function, automatically triggering link restart and data retransmission when link interruption, data packet loss and other faults occur, ensuring continuous and stable system operation without manual intervention; 5. Decoupled architecture, strong scalability: Adopting a three-layer modular decoupled architecture, the protocol access layer, core conversion layer and main station interface layer are independent of each other. Adding a new protocol only requires expanding the corresponding client module, without modifying the core conversion logic and main station program, reducing maintenance costs by more than 60%, adapting to the long-term iterative upgrade needs of the power system; 6. Strong compatibility, convenient deployment: Seamlessly connects to existing power dispatching main station systems (such as the D5000 system), without modifying the main station program, achieving stable communication through TCP long connection, flexible deployment, can be quickly applied to various substations, new energy stations, and switching stations for automation transformation scenarios, with strong practicality. Attached Figure Description
[0031] Figure 1 This is a system framework diagram of an embodiment of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0033] Example 1, such as Figure 1As shown, the power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system of this embodiment includes: a master station 100, a standardization conversion module 200 and a multi-protocol heterogeneous data acquisition module 300 that are interconnected.
[0034] The main station 100 issues multi-granularity control commands via the HTTP protocol, receives standardized data via standard protocols, and undertakes scheduling decision-making and data monitoring functions.
[0035] The standardization conversion module 200 establishes long TCP connections with the main station 100 and the multi-protocol heterogeneous data acquisition module 300, respectively. The standardization conversion module 200 includes a standard protocol forwarding module 201, a data cache template 202, a control command issuing module 203, and a parsing and database entry module 204. The standard protocol forwarding module 201 is configured as a TCP server to realize protocol communication with the main station 100, complete the uploading of standardized data to the main station 100, and receive and parse the control commands of the main station 100. The data cache template 202 is responsible for data cache updates and standardization conversion. The control command issuing module 203 is configured as an HTTP client to be responsible for command verification, priority division, and distribution management. The parsing and database entry module 204 is configured as a TCP server to be responsible for parsing, verifying, and persistently storing unified format JSON messages in the database.
[0036] The multi-protocol heterogeneous data acquisition module 300 includes a protocol adaptation module 306, a multi-protocol acquisition unit, a TCP client cluster 308, and a control forwarding service 307. The protocol adaptation module 306 adopts an adapter design pattern, defining a unified data acquisition and control command interaction interface and encapsulating the communication logic of various communication protocols. The multi-protocol acquisition unit includes acquisition modules, including an HTTP acquisition module 301, an MQTT acquisition module 302, a Kafka acquisition module 303, a Haystack acquisition module 304, and a TCP non-standard acquisition module 305. Each acquisition module, through the protocol adaptation module 306, transmits data to the target application. The collected raw heterogeneous data is converted into a unified JSON format; the TCP client cluster 308 is configured to use a multi-threaded concurrency and load balancing mechanism to batch report the unified JSON format data to the parsing and storage module 204 of the standardization conversion module 200, and supports disconnection reconnection and data retransmission functions; the control forwarding service 307 is used to receive JSON format control commands issued by the control command issuing module 203 in the standardization conversion module 200, and route the control commands to the corresponding acquisition modules in the multi-protocol acquisition unit according to the device ID and protocol type in the control commands, and feed back the device execution results to the standardization conversion module 200.
[0037] Specifically, the upper-level power master station 100 adopts the existing power dispatch master station system (such as the D5000 system) as the dispatch core, responsible for issuing multi-granularity control commands (object-oriented data structure control, single-point commands), receiving IEC 60870-5-104 standard protocol data after protocol conversion, completing data monitoring, dispatch decision and historical storage functions, and establishing stable communication with the standardization conversion module through TCP long connection.
[0038] The standardized conversion module 200 is deployed between the main station 100 and the multi-protocol heterogeneous data acquisition module 300, establishing long TCP connections with both. As the core hub for data conversion and command forwarding, it integrates protocol adaptive identification functionality. Upon system startup, it automatically detects the communication protocol types between the multi-protocol heterogeneous data acquisition module 300 and the target device, matching the corresponding parsing rules. It includes the following functional units:
[0039] (1) Standard Protocol Forwarding Module 201: Configured as a TCP server, integrating HTTP control forwarding service and control encapsulation and distribution module, mainly realizing IEC 60870-5-104 protocol communication with the master station 100, completing the uploading of standardized data to the master station 100, as well as the reception, legality verification, priority division, duplicate instruction filtering and distribution control of the master station 100 control commands;
[0040] (2) Data caching template 202: Configured as a memory-level caching module, it adopts a real-time synchronous update mechanism, is responsible for data cache updates and standardization conversion, and realizes buffering, deduplication, time-series sorting and persistent storage of collected data. When the main station 100 reads data, it prioritizes calling the memory cache, effectively reducing disk IO latency and improving data access efficiency.
[0041] (3) Control command issuing module 203: that is, HTTP client, configured to encapsulate the control commands issued by the main station 100 into a unified JSON format message and issue it to the multi-protocol heterogeneous data acquisition module 300. It also supports timeout retransmission and failure alarm of control commands, and is responsible for command verification, priority division and distribution control to ensure reliable command issuance.
[0042] (4) Parsing and Data Entry Module 204: Configured as a TCP server, with preset JSON message parsing rules, adopting an asynchronous IO model, listening to and receiving JSON format data messages uploaded by the multi-protocol heterogeneous data acquisition module 300, completing message parsing and data validity verification (ensuring that the four core fields of device unique identifier, data type, collected value, and timestamp are complete and valid), calling the platform front-end interface to persist the valid data into the database, and synchronously pushing it to the data cache template 202 to ensure the standardization and reliability of data persistence.
[0043] The multi-protocol heterogeneous data acquisition module 300 is deployed between field terminal equipment and protocol converters, and is responsible for acquiring various types of terminal data and forwarding control commands. It includes the following functional units:
[0044] (1) Protocol adaptation module 306: It adopts the adapter design pattern, defines a unified data acquisition and control command interaction interface, encapsulates the communication logic of various industrial communication protocols, supports protocol adaptive recognition, automatically detects the terminal communication protocol type after system startup, matches the corresponding parsing rules, and does not require manual configuration of protocol parameters.
[0045] (2) Multi-protocol acquisition unit: including HTTP acquisition module 301, MQTT acquisition module 302, Kafka acquisition module 303, Haystack acquisition module 304 and TCP non-standard acquisition module 305. The five types of acquisition modules operate independently and can be expanded as needed. Among them, HTTP acquisition module 301 is adapted to HTTP protocol terminal data acquisition and command reception, MQTT acquisition module 302 is adapted to low-power IoT terminals, Kafka acquisition module 303 is adapted to big data high-throughput acquisition scenarios. The standard for big data high-throughput acquisition scenarios is an acquisition rate greater than or equal to 10,000 messages / second, a real-time acquisition rate greater than or equal to 1,000 messages / second, or concurrent connections greater than or equal to 10,000 devices / gateways, Haystack acquisition module 304 is adapted to field station auxiliary system data interaction, and TCP non-standard protocol acquisition module 305 is adapted to old terminal custom binary protocols. Each acquisition module converts the acquired raw heterogeneous data into a unified JSON format through the protocol adaptation module.
[0046] (3) TCP client cluster 308: Configured to use a multi-threaded concurrency and load balancing mechanism to report data in a unified JSON format in batches to the parsing and database module 204 of the protocol converter, and supports disconnection reconnection and data resending functions to ensure that data is not lost and is transmitted efficiently.
[0047] (4) Control forwarding service 307: that is, the HTTP server, which is configured to receive JSON format control commands issued by the protocol converter control command issuing module 203, route the control commands to the corresponding acquisition module in the multi-protocol acquisition unit according to the device ID and protocol type in the command, and feed back the device execution results to the protocol converter to form a control closed loop.
[0048] Unified JSON Intermediate Data Layer: Serving as a bridge between heterogeneous and standard data, the raw heterogeneous data collected by the multi-protocol heterogeneous data acquisition module 300 is uniformly encapsulated into JSON messages containing core fields such as device unique identifier (deviceId), dataset (data), data type (dataType), collected value (value), and collected timestamp (timestamp). This shields the differences in underlying protocols, achieves standardized data processing, and provides a unified data foundation for subsequent parsing, caching, and protocol conversion.
[0049] The technical solution in this embodiment revolves around three core aspects: multi-protocol adaptive access, multi-granularity command control, and high real-time transmission. It achieves a closed loop of heterogeneous protocol adaptation, accurate command issuance, and efficient data transmission. The specific process is as follows:
[0050] (1) Data uplink process (collection → main station)
[0051] The multi-protocol acquisition unit collects raw data from the target device → the protocol adaptation module 306 converts the raw data into a unified JSON format → the TCP client cluster 308 uploads the JSON format data in batches to the standardization conversion module (protocol converter) 200 → the protocol converter's parsing and database entry module 204 parses and verifies the validity of the data → the parsing and database entry module 204 persists the valid data into the database and pushes it to the data cache template 202 → the standard protocol forwarding module 201 frames the data according to the IEC 60870-5-104 protocol format and uploads it to the main station 100.
[0052] (2) Control command downlink and feedback process (master station → device)
[0053] The main station 100 issues multi-granularity control commands in HTTP format → the standard protocol forwarding module 201's HTTP control forwarding service receives and verifies the commands → the control command issuing module 203 encapsulates the control commands into JSON format messages and issues them → the control forwarding service 307 of the multi-protocol heterogeneous data acquisition module 300 receives the messages and routes them to the acquisition modules corresponding to the multi-protocol acquisition units → the acquisition modules convert the control commands into a format recognizable by the device and issue them to the target device → the target device executes the commands and reports the execution results → the TCP client cluster 308 reports the execution results to the protocol converter 200 → the protocol converter converts the execution results into the IEC 60870-5-104 protocol format through the standard protocol forwarding module 201 and feeds them back to the main station 100, forming a control closed loop.
[0054] Example 2, based on the same inventive concept, the present invention also provides a method for adaptive access and multi-granularity command delivery protocol conversion of power heterogeneous protocols in a power heterogeneous protocol adaptive access and multi-granularity command delivery protocol conversion system according to any one of the above claims, comprising:
[0055] S1: Each acquisition module in the multi-protocol acquisition unit of the multi-protocol heterogeneous data acquisition module automatically detects the terminal communication protocol type, and after acquiring the terminal's raw data, it is uniformly encapsulated into a standard JSON message containing the target device's unique identifier, data type, acquired value, and timestamp, and transmitted to the parsing and database module of the standardization conversion module through a TCP long connection;
[0056] S2: The parsing and database module performs format validation and content parsing on the JSON message, removes invalid data, corrects abnormal data, and then persists the data to the database. At the same time, it pushes the parsed standardized data to the data cache template of the standardization conversion module to update the memory cache.
[0057] S3: The main station sends out two types of multi-granularity control commands, namely object-oriented data structure control and single-point control, via the HTTP protocol. After receiving the commands, the control forwarding service completes the legality verification, priority division and duplicate command filtering, and accurately distributes them to the corresponding acquisition modules in the multi-protocol acquisition unit according to the command granularity. Each acquisition module converts them into a format that the terminal can recognize before sending them out for execution.
[0058] S4: The data cache template reads standardized data, calls the protocol stack to convert it into a standard protocol message, and reports it to the main station through the standard protocol forwarding module of the standardization conversion module, completing the closed-loop data transmission;
[0059] S5: The system monitors the status of the communication link in real time. When a fault occurs, it automatically triggers the link restart and data retransmission process to ensure the continuous and stable operation of the system.
[0060] Furthermore, the priority division rule for the multi-granularity control instructions in step S3 is as follows:
[0061] Core instructions are set to high priority, and regular instructions are set to normal priority. High-priority instructions are dispatched and executed first to avoid instruction execution conflicts. The core instructions include single-point remote control and emergency tripping, and the regular instructions include object-oriented data structure control instructions.
[0062] Furthermore, step S5 specifically involves: when the system detects a link interruption, data packet loss, or abnormal message parsing, it automatically restarts the corresponding protocol client link, re-initiates data collection or command issuance requests, and automatically restores normal communication after the fault is cleared.
[0063] Example 3, the power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system of this example includes: a master station 100, a standardization conversion module 200 and a multi-protocol heterogeneous data acquisition module 300 that are interconnected;
[0064] The main station 100 issues multi-granularity control commands via the HTTP protocol, receives standardized data via standard protocols, and undertakes scheduling decision-making and data monitoring functions.
[0065] The standardization conversion module 200 establishes long TCP connections with the main station 100 and the multi-protocol heterogeneous data acquisition module 300, respectively. The standardization conversion module 200 includes a standard protocol forwarding module 201, a data cache template 202, a control command issuing module 203, and a parsing and database entry module 204. The standard protocol forwarding module 201 is configured as a TCP server to realize protocol communication with the main station 100, complete the uploading of standardized data to the main station 100, and receive and parse the control commands of the main station 100. The data cache template 202 is responsible for data cache updates and standardization conversion. The control command issuing module 203 is configured as an HTTP client to be responsible for command verification, priority division, and distribution management. The parsing and database entry module 204 is configured as a TCP server to be responsible for parsing, verifying, and persistently storing unified format JSON messages in the database.
[0066] The multi-protocol heterogeneous data acquisition module 300 includes a protocol adaptation module 306, a multi-protocol acquisition unit, a TCP client cluster 308, and a control forwarding service 307. The protocol adaptation module 306 adopts an adapter design pattern, defining a unified data acquisition and control command interaction interface and encapsulating the communication logic of various communication protocols. The multi-protocol acquisition unit includes acquisition modules, including an HTTP acquisition module 301, an MQTT acquisition module 302, a Kafka acquisition module 303, a Haystack acquisition module 304, and a TCP non-standard acquisition module 305. Each acquisition module, through the protocol adaptation module 306, transmits data to the target application. The collected raw heterogeneous data is converted into a unified JSON format; the TCP client cluster 308 is configured to use a multi-threaded concurrency and load balancing mechanism to batch report the unified JSON format data to the parsing and storage module 204 of the standardization conversion module 200, and supports disconnection reconnection and data retransmission functions; the control forwarding service 307 is used to receive JSON format control commands issued by the control command issuing module 203 in the standardization conversion module 200, and route the control commands to the corresponding acquisition modules in the multi-protocol acquisition unit according to the device ID and protocol type in the control commands, and feed back the device execution results to the standardization conversion module 200.
[0067] Specifically:
[0068] 1. Implementation details of multi-protocol adaptive access
[0069] The protocol adaptation module 306 is developed in Java and defines a unified interface (including a data acquisition interface, an instruction receiving interface, and a protocol identification interface) based on the adapter design pattern. Each protocol acquisition module implements this interface. Protocol identification is achieved through port scanning and message feature matching. After automatically identifying the terminal protocol type, the corresponding adaptation module is called to perform data acquisition and instruction conversion.
[0070] In the multi-protocol acquisition unit: HTTP acquisition module 301 uses HttpClient to implement data acquisition and command reception; MQTT acquisition module 302 is based on the Eclipse Paho client, supports subscription / publish mode, and is adapted to low-power IoT terminals; Kafka acquisition module 303 is based on the Kafka Consumer API, supports consumer group mechanism, and is adapted to high-throughput acquisition scenarios. The standard for high-throughput big data acquisition scenarios is an acquisition rate greater than or equal to 10,000 messages / second, a real-time acquisition rate greater than or equal to 1,000 messages / second, or concurrent connections greater than or equal to 10,000 devices / gateways; Haystack acquisition module 304 is based on the Haystack Java SDK to realize data interaction of the site auxiliary system; TCP non-standard acquisition module 305 uses Socket programming, supports custom binary protocol parsing, and is adapted to older terminals. The raw data collected by various terminals (such as voltage, current, and device operating status) is parsed by the corresponding client and uniformly encapsulated into a JSON message containing four core fields: deviceId (unique device identifier, such as "Substation_01"), data (data set), dataType (data type, such as "voltage" or "current"), value (collected value, such as "110kV"), and timestamp (collection time, such as "2024-05-20 14:30:00"). This ensures a unified data format and masks differences in underlying protocols. The data is then transmitted to the parsing and database module 204 via a TCP long connection.
[0071] TCP client cluster 308 is developed in Java and uses the Netty framework to implement multi-threaded concurrency. It is configured with a connection pool (default connection count 100) and supports load balancing (using a round-robin algorithm). Disconnection reconnection adopts a timed detection mechanism (default detection interval 10s). After disconnection, it automatically re-establishes the connection, caches unsent data, and resends it in batches after the connection is restored.
[0072] Control forwarding service 307: Developed using Spring Boot, it implements HTTP server functionality. After receiving JSON format control commands, it parses the device ID and protocol type, and routes them to the corresponding acquisition module through the protocol adaptation module. The command execution results are encapsulated in a unified JSON format and reported to the protocol converter through a TCP client cluster.
[0073] 2. Details of Multi-granularity Command Issuance and Control Implementation
[0074] The upper-level power dispatching master station system 100 generates two types of multi-granularity control instructions based on power dispatching business scenarios: one type is object-oriented data structure control instructions, suitable for batch equipment management scenarios (such as simultaneous inspection of multiple terminals, batch parameter configuration), the instruction format includes batch equipment identifiers, control parameters, execution time, etc., and is sent to the HTTP control forwarding service 307 via the HTTP protocol. The other type is single-point instructions, suitable for single-terminal precise control scenarios (such as single-device remote control, emergency tripping), the instruction format includes single-device identifiers, control instructions, priority identifiers, etc., and is sent to the standard protocol forwarding module 201 via the IEC104 standard protocol, and then sent to the HTTP control forwarding service 307 via the control instruction sending module.
[0075] After receiving the instruction, the control forwarding service 307 first performs dual verification: first, identity verification, confirming that the instruction originates from an authorized master station to prevent unauthorized instruction access; second, message verification, checking the instruction format, device identifier, and control parameters for completeness and validity, eliminating invalid instructions with incorrect formats or missing parameters. After successful verification, instruction priority is assigned: core instructions related to equipment safety, such as single-point remote control and emergency tripping, are set to high priority, while routine batch instructions, such as object-oriented data structure control, are set to normal priority. Simultaneously, the system automatically retrieves recent instruction records, filtering out duplicate requests for the same device and the same instruction to avoid instruction execution conflicts.
[0076] After priority classification and duplicate filtering are completed, precise distribution is carried out at the instruction granularity: control instructions are encapsulated and issued using object-oriented data structures, batch instructions are encapsulated into a unified format and issued to multiple corresponding protocol clients, and then converted by the clients into a protocol format that the terminals can recognize and issued to multiple terminals for execution simultaneously; single high-priority instructions are directly issued to the protocol client corresponding to the target device without additional encapsulation, and are quickly transmitted to the terminal for execution, ensuring that core instructions are responded to first and improving scheduling efficiency.
[0077] After the terminal executes the command, it sends the execution result (such as "execution successful", "execution failed", "parameter abnormal") back to the corresponding protocol client. The client encapsulates the feedback result into a standard JSON message and transmits it to the parsing and storage module 204. After parsing and caching, the standard protocol forwarding module 201 converts it into an IEC 60870-5-104 protocol message and reports it to the upper-level master station system 100. The master station 100 displays the command execution status in real time, forming a complete closed loop of command issuance-execution-feedback.
[0078] 3. Details of data parsing, caching optimization, and transmission implementation
[0079] After receiving the standard JSON message transmitted by the multi-protocol heterogeneous data acquisition module 300, the parsing and data entry module 204 first verifies the message fields, checking whether the four core fields deviceId, data, dataType, value, and timestamp are complete and whether the data types match (e.g., the value field is numeric and the timestamp field is time format). Invalid messages with missing fields or incorrect formats are removed. Data with abnormal values (e.g., voltage exceeding a reasonable range) is corrected to ensure data validity.
[0080] After verification and correction, the parsing and data entry module 204 calls the power dispatching platform's front-end interface to persistently store the valid data in a specified relational database. Simultaneously, it pushes the parsed standardized data (including device identifier, data type, collected values, and timestamps) to the data cache template 202, updating the memory cache content and ensuring real-time consistency between cached and database data. The data cache template 202 is configured with a cache expiration mechanism to periodically clean up invalid data exceeding a preset time (e.g., 24 hours) to prevent memory overflow and ensure stable operation of the cache module.
[0081] When the upper-level master station system 100 initiates a data read request, it prioritizes calling the memory-cached data in the data cache template 202, eliminating the need for frequent access to the disk database. This significantly reduces disk I / O latency, lowering the master station data access latency from hundreds of milliseconds to tens of milliseconds, a latency reduction of over 90%. Simultaneously, it alleviates the operational pressure on the database, meeting the high real-time and high reliability requirements of 24 / 7 power dispatching. The data cache template 202 pushes the cached standardized data to the standard protocol forwarding module 201. This module calls the IEC 60870-5-104 protocol stack to convert the data into standard protocol messages, which are then reported to the master station system via a TCP long connection, completing the data transmission loop.
[0082] 4. Implementation details of communication anomaly self-healing and system scalability
[0083] During system operation, the communication link status between modules is monitored in real time (such as the link between the main station and the standardization conversion module, the standardization conversion module and the multi-protocol client, and the client and the terminal). When a fault such as link interruption, data packet loss, or abnormal packet parsing occurs, the communication fault self-healing process is automatically triggered.
[0084] (1) Link interruption fault: After the system detects that the TCP connection is broken, it automatically restarts the corresponding protocol client, re-initiates the link connection request, and re-collects data or issues instructions after the connection is successfully established;
[0085] (2) Data packet loss failure: When the parsing and data entry module detects that the JSON message is missing or incomplete, it automatically sends a data retransmission request to the corresponding client, and the client retransmits the data until the message is completely received;
[0086] (3) Parsing anomaly: When a message parsing failure occurs (such as format error or field mismatch), it is automatically reported to the client. The client re-encapsulates the message and transmits it, while recording the anomaly log for subsequent maintenance and troubleshooting. The entire self-healing process requires no manual intervention, ensuring continuous and stable system operation and reducing maintenance workload.
[0087] This invention adopts a three-layer modular decoupled architecture. The protocol access layer (multi-protocol heterogeneous data acquisition module 300), the core conversion layer (standardized conversion module 200), and the master station interface layer (upper-layer master station module 100) are independent of each other. Each layer communicates through a standardized interface and has no direct coupling relationship. When a new communication protocol is added to the power system (such as the subsequent addition of a CoAP protocol terminal), only the corresponding CoAP protocol acquisition client needs to be added to expand the functionality of the protocol access layer. There is no need to modify the core logic of protocol conversion (parsing and storage, caching, protocol forwarding) and the master station program, which greatly reduces the system expansion cost and adapts to the long-term iterative upgrade needs of the power system.
Claims
1. A protocol conversion system for adaptive access and multi-granularity command issuance of heterogeneous power protocols, characterized in that, include: The interconnected main station, standardized conversion module, and multi-protocol heterogeneous data acquisition module; The main station issues multi-granularity control commands via the HTTP protocol, receives standardized data via standard protocols, and undertakes scheduling decision-making and data monitoring functions. The standardization conversion module establishes long TCP connections with the main station and the multi-protocol heterogeneous data acquisition module, respectively. The standardization conversion module includes a standard protocol forwarding module, a data cache template, a control command issuing module, and a parsing and database insertion module. The standard protocol forwarding module is configured as a TCP server to realize protocol communication with the main station, complete the uploading of standardized data to the main station, and receive and parse the main station's control commands. The data cache template is responsible for data cache updates and standardization conversion. The control command issuance module is configured as an HTTP client, responsible for command verification, priority allocation, and distribution management; the parsing and database entry module is configured as a TCP server, responsible for parsing, verifying, and persistently storing JSON messages in a unified format. The multi-protocol heterogeneous data acquisition module includes a protocol adaptation module, a multi-protocol acquisition unit, a TCP client cluster, and a control forwarding service. The protocol adaptation module adopts an adapter design pattern, defining a unified interface for data acquisition and control command interaction, and encapsulating the communication logic of various communication protocols. The multi-protocol acquisition unit includes acquisition modules, such as an HTTP acquisition module, an MQTT acquisition module, a Kafka acquisition module, a Haystack acquisition module, and a TCP non-standard acquisition module. Each acquisition module converts the acquired raw heterogeneous data into a unified JSON format through the protocol adaptation module. The TCP client cluster is configured to use a multi-threaded concurrency and load balancing mechanism to batch report the unified JSON format data to the parsing and database module of the standardization conversion module, and supports reconnection after disconnection and data retransmission. The control forwarding service receives JSON format control commands issued by the control command issuing module in the standardization conversion module, routes the control commands to the corresponding acquisition modules in the multi-protocol acquisition unit according to the device ID and protocol type in the control commands, and feeds back the device execution results to the standardization conversion module.
2. The power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system according to claim 1, characterized in that, The control forwarding service is responsible for receiving HTTP format control commands from the upper-layer master station, encapsulating the object-oriented data structure control commands into a unified format, and finally distributing them to the corresponding acquisition modules in the multi-protocol acquisition unit.
3. The power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system according to claim 1, characterized in that, The parsing and data entry module is configured as a TCP server with preset JSON message parsing rules. It performs field verification on the received messages to ensure that the four fields of device unique identifier, data type, collected value and timestamp are complete and valid. After parsing, it calls the platform's front-end interface to realize data entry.
4. The power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system according to claim 1, characterized in that, The data cache template is a memory-level cache module that uses a real-time synchronization update mechanism. After the data is entered into the database, the cache content is updated synchronously, so that the main site will prioritize calling the memory cache when reading data.
5. The power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system according to claim 1, characterized in that, The HTTP acquisition module is adapted for HTTP protocol terminal data acquisition and command reception; the MQTT acquisition module is adapted for IoT terminals; the Kafka acquisition module is adapted for high-throughput big data acquisition scenarios. The standard for high-throughput big data acquisition scenarios is an acquisition rate greater than or equal to 10,000 records / second, a real-time acquisition rate greater than or equal to 1,000 records / second, or concurrent connections greater than or equal to 10,000 devices / gateways; the Haystack acquisition module is adapted for data interaction of the site auxiliary system; and the TCP non-standard protocol acquisition module is adapted for the custom binary protocol of the terminal that has been installed and used. Each acquisition module operates independently, and the multi-protocol acquisition unit allows for the expansion of new types of acquisition modules as needed.
6. The power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system according to claim 1, characterized in that, The standardized conversion module integrates protocol adaptive recognition function. After the system starts, it automatically detects the communication protocol type between the multi-protocol heterogeneous data acquisition module and the target device, and matches the corresponding parsing rules.
7. The power heterogeneous protocol adaptive access and multi-granularity command issuance protocol conversion system according to claim 1, characterized in that, The data uplink process of the system is as follows: the multi-protocol acquisition unit collects the raw data of the target device, the protocol adaptation module converts the raw data into a unified JSON format, the TCP client cluster reports the JSON format data in batches to the standardization conversion module, the parsing and storage module of the standardization conversion module parses and verifies the legality of the received data, and preprocesses the data that passes the verification, the data caching module stores the preprocessed data, and the standard protocol forwarding module frames the data according to the preset protocol format and uploads it to the main station. The data downlink and feedback process of the system is as follows: the main station issues control commands in a preset format; the standard protocol forwarding module parses the control commands; the data caching module temporarily stores the parsed control commands; the control command issuing module encapsulates the control commands into JSON format messages and issues them; the control forwarding service of the multi-protocol heterogeneous data acquisition module receives the messages and routes them to the acquisition modules corresponding to the multi-protocol acquisition units via the protocol adaptation module; each acquisition module converts the control commands into a format recognizable by the device and issues them to the target device; the target device executes the control commands and reports the execution results; the TCP client cluster reports the execution results transmitted by the protocol adaptation module to the standardization conversion module; the standardization conversion module feeds back the execution results to the main station through the standard protocol forwarding module, forming a control closed loop.
8. A method for adaptive access and multi-granularity command delivery protocol conversion of power heterogeneous protocols in a power heterogeneous protocol adaptive access and multi-granularity command delivery protocol conversion system according to any one of claims 1-7, characterized in that, include: S1: Each acquisition module in the multi-protocol acquisition unit of the multi-protocol heterogeneous data acquisition module automatically detects the terminal communication protocol type, and after acquiring the terminal's raw data, it is uniformly encapsulated into a standard JSON message containing the target device's unique identifier, data type, acquired value, and timestamp, and transmitted to the parsing and database module of the standardization conversion module through a TCP long connection; S2: The parsing and database module performs format validation and content parsing on the JSON message, removes invalid data, corrects abnormal data, and then persists the data to the database. At the same time, it pushes the parsed standardized data to the data cache template of the standardization conversion module to update the memory cache. S3: The main station sends out two types of multi-granularity control commands, namely object-oriented data structure control and single-point control, via the HTTP protocol. After receiving the commands, the control forwarding service completes the legality verification, priority division and duplicate command filtering, and accurately distributes them to the corresponding acquisition modules in the multi-protocol acquisition unit according to the command granularity. Each acquisition module converts them into a format that the terminal can recognize before sending them out for execution. S4: The data cache template reads standardized data, calls the protocol stack to convert it into a standard protocol message, and reports it to the main station through the standard protocol forwarding module of the standardization conversion module, completing the closed-loop data transmission; S5: The system monitors the status of the communication link in real time. When a fault occurs, it automatically triggers the link restart and data retransmission process to ensure the continuous and stable operation of the system.
9. The method for adaptive access and multi-granularity command issuance protocol conversion of power heterogeneous protocols according to claim 8, characterized in that, The priority division rule for the multi-granularity control commands mentioned in step S3 is as follows: Core instructions are set to high priority, and regular instructions are set to normal priority. High-priority instructions are dispatched and executed first to avoid instruction execution conflicts. The core instructions include single-point remote control and emergency tripping, and the regular instructions include object-oriented data structure control instructions.
10. The method for adaptive access and multi-granularity command issuance protocol conversion of power heterogeneous protocols according to claim 8, characterized in that, Specifically, step S5 involves the system automatically restarting the corresponding protocol client link when it detects link interruption, data packet loss, or abnormal message parsing, and re-initiating data collection or command issuance requests. Normal communication is automatically restored after the fault is cleared.