Multi-protocol adaptation layer service method and device
By constructing a multi-protocol adaptation layer service method, the multi-protocol adaptation problem of the virtual power plant platform was solved, which improved the system's scalability, stability and security, and reduced operation and maintenance costs and the impact of failures.
Patent Information
- Application Number
- CN202511198365.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-12-05
AI Technical Summary
Existing virtual power plant platforms face challenges such as multiple interaction protocols, inconsistent data formats, high coupling, security risks, and insufficient monitoring and disaster recovery capabilities. They lack a unified adaptation layer design, resulting in high system complexity, high maintenance costs, and poor stability.
A multi-protocol adaptation layer service approach is constructed, including a plug-in architecture, a data conversion engine, a routing management module, a security control layer, and a status monitoring and disaster recovery module, to achieve protocol parsing, data transmission, security protection, and fault tolerance.
The plug-in architecture reduces the need to modify the core code, improves system scalability and stability, reduces risks through a unified security policy, and enhances system availability and operational efficiency through monitoring and disaster recovery mechanisms.
Smart Images

Figure CN121078075A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of energy internet, and specifically provides a multi-protocol adaptation layer service method and device. BACKGROUND
[0002] With the rapid development of energy internet, as the core technology of aggregating distributed energy resources (such as photovoltaic, energy storage, electric vehicles, and adjustable load), virtual power plants need to interact with external load sides and other platforms in real time to realize functions such as demand response, power balance, and market transactions. However, existing virtual power plant platforms face the following technical bottlenecks when interfacing with external systems:
[0003] (1) Fragmentation of interaction protocols: External platforms may use multiple data interaction methods, such as HTTP / RESTful API, message queue, file transfer protocol, database direct connection, or even private protocols. Traditional virtual power plant platforms usually develop customized interfaces for a single protocol, leading to code duplication, high maintenance costs, and difficulty in expansion.
[0004] (2) Non-uniform data formats: Different external platforms have significantly different requirements for data formats, such as JSON, XML, CSV, or custom binary formats. In existing technologies, virtual power plants need to develop special data parsing and packaging modules for each platform, leading to increased system complexity and errors in data conversion processes.
[0005] (3) High coupling: The core business logic of virtual power plants is deeply coupled with external interfaces. If the external platform interface changes or new interfacing requirements are added, the core code needs to be modified and redeployed, affecting system stability and usability.
[0006] (4) Security risks: Different interaction methods face different security threats, such as DDOS attacks for API interfaces, access permission control for database direct connections, and encryption and integrity verification for file transfers. Existing technologies lack a unified security protection mechanism, making them vulnerable.
[0007] (5) Insufficient monitoring and disaster recovery capabilities: Traditional solutions lack unified monitoring of interface call status, message queue backlog, and file transfer exceptions, making fault location difficult and lacking automatic retry, fuse degradation, and other disaster recovery strategies.
[0008] Although existing patents and literature contain solutions for single-protocol adaptation or data conversion, there is no general adaptation layer architecture that can cover multiple protocols, support dynamic expansion, and decouple from virtual power plant platforms. Therefore, an innovative adaptation layer design is needed to address the above problems. SUMMARY
[0009] The present application is aimed at the deficiencies of the prior art, and provides a multi-protocol adaptation layer service method with high practicability.
[0010] The present application further provides a multi-protocol adaptation layer service device with reasonable design and safety.
[0011] The present application further provides a multi-protocol adaptation layer service device with reasonable design and safety.
[0012] The present application further provides a multi-protocol adaptation layer service device with reasonable design and safety.
[0013] S1, constructing an adaptation layer as an entrance for interacting with an external platform, responsible for protocol analysis, connection management and data transmission;
[0014] S2, a data conversion engine undertaking the task of standardized conversion of heterogeneous data formats;
[0015] S3, a routing management module dynamically selecting an optimal interaction channel based on a multi-dimensional decision algorithm;
[0016] S4, a security control layer integrating a multi-level security mechanism, including protocol-level security, application-level security and operation-level security;
[0017] S5, a state monitoring and disaster recovery module collecting running indexes of each protocol channel in real time and displaying system health states through a visual panel.
[0018] Further, in step S1, the adaptation layer includes plug-in registration and discovery, protocol interface standardization, plug-in hot plug and resource isolation and unloading;
[0019] In the plug-in registration and discovery, each protocol plug-in contains a metadata description file, declaring supported protocol types, version compatibility and necessary configuration parameters, and the adaptation layer scans the plug-in directory when starting, and registers available plug-ins through a class loader, without the need of restarting the service to take effect;
[0020] The protocol interface standardization requires that all plug-ins must implement a unified protocol interface;
[0021] The plug-in hot plug is based on an OSGi framework or a custom class loader, allowing dynamic addition, removal or update of protocol plug-ins during runtime;
[0022] The resource isolation and unloading automatically releases connection pools and thread resources occupied by the plug-in when the plug-in is unloaded.
[0023] Further, in step S2, a JSON Schema or Protobuf definition is used to define an intermediate data model by the adaptation layer, and two-way mapping is realized through the data conversion engine;
[0024] The intermediate data model is designed based on power industry standards, including device status, control instructions and market information.
[0025] Further, the data conversion process is:
[0026] (1) Input analysis: according to the external data format, call the corresponding parser to extract the original data field;
[0027] (2) Rule mapping: through XSLT conversion, JSONata query or custom script, map the original field to the corresponding attribute of the intermediate model;
[0028] (3) Data verification: check the completeness of the mandatory field, the legality of the numerical range, discard the illegal data and record the log;
[0029] (4) Output packaging: according to the requirements of the target platform, convert the intermediate model into the specified format.
[0030] Further, in step S3, the routing management module adopts a dynamic weight distribution algorithm, a weighted round robin WeightedRound Robin combined with a least connection number Least Connections strategy,
[0031] Real-time monitoring of the RTT and bandwidth utilization of each channel, setting the weight according to the instruction type, calculating the health score based on the historical success rate;
[0032] When the main channel fails continuously for more than a threshold value, it is automatically marked as unavailable and switched to the backup channel, and at the same time, the state of the failed channel is periodically detected, and after recovery, the traffic is gradually diverted to ensure stability.
[0033] Further, in step S4, TLS1.3 is forcibly enabled, two-way certificate authentication is configured, weak encryption suites are disabled, ACL permissions are set, the access range of the Topic of the producer / consumer is limited, read-only accounts, IP white list restrictions are used, and SQL injection is prevented through the ORM framework;
[0034] Sensitive fields are encrypted using AES-256-GCM, the key is dynamically managed through KMS, SHA-256 hash value is attached during file transfer, and the receiver verifies the data integrity.
[0035] Further, in step S5, based on the Hystrix mode, when the error rate of a channel exceeds a threshold value (such as 30%), the fuse is triggered and a degraded response is returned, for retryable failed tasks, enter the delay queue and retry according to the exponential backoff strategy, when a new protocol plug-in is online, first verify it in a small traffic environment, and gradually increase the traffic ratio.
[0036] Further, in step S5, by Prometheus+Grafana integration, key indicators are displayed, real-time monitoring panels are displayed, detailed logs of each interaction are recorded, ELK centralized analysis is performed, automatic alarm rules are configured, operation and maintenance personnel are notified to intervene, and dynamic adjustment of routing strategies and fuse thresholds is supported through a REST API or a management interface.
[0037] A multi-protocol adaptation layer service device, comprising: at least one memory and at least one processor;
[0038] The at least one memory is configured to store a machine-readable program.
[0039] The at least one processor is configured to invoke the machine-readable program to perform a multi-protocol adaptation layer service method.
[0040] Compared with the prior art, the multi-protocol adaptation layer service method and device of the present application has the following outstanding advantages:
[0041] According to the plug-in architecture, the addition of protocol adaptation only needs to develop an independent plug-in, without modifying the core code. The intelligent routing and disaster recovery mechanism reduces the impact of single-point failure and guarantees business continuity. The unified security policy covers all interaction protocols, reducing the risk of data leakage and attacks. The standardized data model and configuration-driven approach shorten the new platform connection period by more than 50%. Through the visual monitoring interface, operation and maintenance personnel can quickly locate bottlenecks and optimize interaction strategies. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings described below are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0043] Figure 1 It is a structural diagram of a multi-protocol adaptation layer service method;
[0044] Figure 2 It is a flowchart of a multi-protocol adaptation layer service method. DETAILED DESCRIPTION
[0045] In order to make the person skilled in the art better understand the scheme of the present application, the present application will be further described in detail below in combination with specific embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0046] A preferred embodiment is given below:
[0047] As shown in Figure 1 , 2 , a multi-protocol adaptation layer service method in this embodiment has the following steps:
[0048] S1, build an adaptation layer as an entrance to interact with external platforms, responsible for protocol parsing, connection management, and data transmission;
[0049] Integrate multiple protocol processors through a plug-in architecture, including HTTP / RESTful API clients, message queue producers / consumers, file transfer clients, database connectors, etc. Each protocol plug-in independently encapsulates its communication logic and interacts with the upper module through a unified interface (such as connect(), send(), receive(), disconnect()).
[0050] The protocol adaptation layer adopts a microkernel architecture, and the core system only defines abstract protocol interfaces. Specific protocol implementations are dynamically loaded in the form of plug-ins to ensure the high scalability of the system:
[0051] Plug-in registration and discovery: Each protocol plug-in contains a metadata description file (such as plugin.yaml), which declares the supported protocol types (such as HTTP, message queue), version compatibility, and required configuration parameters (such as endpoint URL, authentication information). The adaptation layer scans the plug-in directory when starting and dynamically registers available plug-ins through the class loader, without the need to restart the service to take effect.
[0052] Protocol interface standardization: all plug-ins must implement a unified protocol interface, including:
[0053] Connection management: initialize connection pool, handle disconnection and reconnection;
[0054] Data transmission: encapsulate request / response model, support synchronous call and asynchronous message subscription;
[0055] Configuration management: parse external platform parameters (such as message queue Topic name, FTP directory path), and support hot update.
[0056] Plug-in hot swapping: based on OSGi framework or custom class loader, allows dynamically adding, removing or updating protocol plug-ins at runtime. For example, when a WebSocket protocol requirement for a third-party platform is added, only the corresponding WebSocket plug-in needs to be developed and deployed to the specified directory. The adaptation layer automatically recognizes and enables the plug-in without modifying the core code.
[0057] Resource Isolation and Offloading: To prevent plugin conflicts, each protocol plugin runs in an independent class loading environment, ensuring the isolation of dependent libraries between plugins. When a plugin is unloaded, it automatically releases its occupied connection pool, threads, and other resources, avoiding memory leaks.
[0058] S2, the data conversion engine undertakes the task of standardizing the conversion of heterogeneous data formats;
[0059] Through a predefined intermediate data model (based on CIM / 61850 standard extension), JSON, XML, CSV, and other format data input by external platforms are converted into a unified internal data structure, while output data conforming to the requirements of external platforms are generated in reverse. The conversion process relies on rule engines (such as Drools) or template mapping techniques (such as XSLT, JSONata), supporting dynamic loading of conversion rules to adapt to different platform data specifications.
[0060] To eliminate the differences in data formats between different platforms, the model adopts a hierarchical structure, defined using JSON Schema or Protobuf, to ensure cross-platform compatibility. The adaptation layer defines the intermediate data model and implements bidirectional mapping through the data conversion engine:
[0061] Intermediate data model design: based on power industry standards (such as IEC 61850, CIM) extension, covering virtual power plant core business entities;
[0062] Device status: including real-time power, operating mode, fault code of distributed energy (photovoltaic, energy storage);
[0063] Control instructions: such as load regulation instructions, charge and discharge plans, market bidding quantities;
[0064] Market information: electricity price, trading period, settlement rules, etc.
[0065] Data conversion process:
[0066] (1) According to the external data format (such as XML, CSV), call the corresponding parser to extract the original data fields;
[0067] (2) Map the original fields to the corresponding properties of the intermediate model through XSLT conversion (for XML), JSONata query (for JSON), or custom scripts;
[0068] (3) Check the completeness of mandatory fields, the legality of numerical ranges (such as non-negative power values), discard illegal data and record logs;
[0069] (4) Convert the intermediate model to the specified format (such as EDI messages required by the power grid dispatching platform) according to the requirements of the target platform.
[0070] Version compatibility management: support data model versioning, when external platform upgrades data format, automatically match conversion rules through version identification. For example, the migration from old version model to new version model can be realized by smooth transition through Diff Patch.
[0071] S3, the routing management module dynamically selects the optimal interaction channel based on multi-dimensional decision algorithm;
[0072] Considering the real-time network bandwidth, delay, target platform load state, service priority (such as real-time control instruction priority higher than historical data synchronization) and other factors, combined with weight configuration to generate routing strategy.
[0073] For example, high real-time instructions are preferentially transmitted through HTTP interface, while large-scale historical data is uploaded asynchronously through FTP to avoid blocking core business.
[0074] The routing management module uses dynamic weight allocation algorithm to ensure the efficiency and robustness of the interaction channel:
[0075] Real-time monitoring of RTT (round trip time) and bandwidth utilization of each channel; set weight according to instruction type (such as emergency peak cutting instruction as the highest level); calculate health score based on historical success rate (such as HTTP interface success rate 95% in the last 10 minutes) and current load (such as message queue backlog message number).
[0076] Weighted Round Robin (Weighted Round Robin) and Least Connections (Least Connections) combination strategy. For example, instructions with high real-time requirements prefer channels with the lowest delay and health score greater than 90%; for batch data synchronization tasks, select FTP channels with sufficient bandwidth and idle queues.
[0077] When the main channel fails continuously for more than a threshold (such as 5 times), it is automatically marked as unavailable and switched to the backup channel. At the same time, the state of the failed channel is periodically detected, and after recovery, it is gradually drained to ensure stability.
[0078] S4, the security control layer integrates multi-level security mechanisms, including protocol-level security, application-level security and operation-level security;
[0079] Forced to enable TLS1.3, configure two-way certificate authentication, disable weak encryption suite, set ACL permission, limit producer / consumer Topic access range, use read-only account, IP whitelist limit, and prevent SQL injection through ORM framework.
[0080] Sensitive fields (such as user privacy information) are encrypted using AES-256-GCM, the key is dynamically managed through KMS, and SHA-256 hash value is attached during file transmission, and the receiver verifies the data integrity.
[0081] S5, the state monitoring and disaster recovery module collects the running indexes of each protocol channel in real time, and displays the system health status through a visual panel.
[0082] Based on the Hystrix mode, when the error rate of a channel exceeds a threshold (such as 30%), a fuse is triggered and a degraded response (such as cache data) is returned. For tasks that can be retried (such as network jitter), enter the delay queue and retry according to the exponential backoff strategy. When a new protocol plug-in is online, it is first verified in a small traffic environment, and the traffic ratio is gradually expanded.
[0083] In terms of monitoring and operation:
[0084] Through the integration of Prometheus+Grafana, key indicators are displayed and real-time monitoring panels are provided.
[0085] Protocol performance: average response time of interface, message processing throughput;
[0086] Resource usage: connection pool utilization, thread pool active number;
[0087] Abnormal statistics: classification of failed requests (timeout, format error, permission denial).
[0088] Detailed logs (such as request content, response status, time consumption) are recorded for each interaction, ELK (Elasticsearch, Logstash, Kibana) centralized analysis is supported, distributed tracking (such as Jaeger) is integrated, and performance bottlenecks of cross-protocol calls are located.
[0089] Configure automatic alarm rules (such as FTP transmission timeout for more than 1 hour), notify the operation and maintenance personnel to intervene, support dynamic adjustment of routing strategy, fuse threshold and other parameters through REST API or management interface.
[0090] Based on the above method, a multi-protocol adaptation layer service device in the embodiment includes at least one memory and at least one processor.
[0091] The at least one memory is used to store machine readable programs.
[0092] The at least one processor is used to call the machine readable programs and execute a multi-protocol adaptation layer service method.
[0093] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A multi-protocol adaptation layer service method, characterized in that, It has the following steps: S1. Construct an adaptation layer as the entry point for interaction with external platforms, responsible for protocol parsing, connection management, and data transmission; S2, the data conversion engine undertakes the task of standardizing the conversion of heterogeneous data formats; S3, the routing management module dynamically selects the optimal interaction channel based on a multi-dimensional decision-making algorithm; S4. The security control layer integrates multi-layered security mechanisms, including protocol-level security, application-level security, and operation-level security. The S5 status monitoring and disaster recovery module collects operational metrics from each protocol channel in real time and displays the system's health status through a visual panel.
2. The multi-protocol adaptation layer service method according to claim 1, characterized in that, In step S1, the adaptation layer includes plugin registration and discovery, protocol interface standardization, plugin hot-plugging, and resource isolation and unloading; Each protocol plugin in the plugin registration and discovery process contains a metadata description file that declares the supported protocol types, version compatibility, and required configuration parameters. When the adaptation layer starts, it scans the plugin directory and dynamically registers available plugins through the class loader, which takes effect without restarting the service. The protocol interface standardization requires all plugins to implement a unified protocol interface; The hot-plugging of the plugins is based on the OSGi framework or a custom class loader, allowing protocol plugins to be added, removed, or updated dynamically at runtime. The resource isolation and uninstallation mechanism automatically releases the connection pool and thread resources it occupies when the plugin is uninstalled.
3. The multi-protocol adaptation layer service method according to claim 2, characterized in that, In step S2, the adapter layer defines the intermediate data model using JSON Schema or Protobuf, and implements bidirectional mapping through the data transformation engine; The intermediate data model is designed based on power industry standards and includes equipment status, control commands, and market information.
4. The multi-protocol adaptation layer service method according to claim 3, characterized in that, The data conversion process is as follows: (1) Input parsing: Call the corresponding parser according to the external data format to extract the original data fields; (2) Rule mapping: Map the original fields to the corresponding attributes of the intermediate model through XSLT transformation, JSONata query or custom script; (3) Data validation: Check the completeness of required fields and the validity of numerical ranges, discard illegal data and record it in the log; (4) Output encapsulation: Convert the intermediate model into the specified format according to the requirements of the target platform.
5. The multi-protocol adaptation layer service method according to claim 4, characterized in that, In step S3, the routing management module employs a dynamic weight allocation algorithm, combining a weighted round-robin strategy with the minimum number of connections (LeastConnections). Real-time monitoring of RTT and bandwidth utilization of each channel; setting weights according to command type; and calculating health scores based on historical success rates. When the main channel fails continuously for more than a threshold, it is automatically marked as unavailable and switched to the backup channel. At the same time, the status of the faulty channel is periodically detected, and traffic is gradually diverted after recovery to ensure stability.
6. The multi-protocol adaptation layer service method according to claim 5, characterized in that, In step S4, TLS 1.3 is forcibly enabled, two-way certificate authentication is configured, weak encryption suites are disabled, ACL permissions are set, the topic access scope of producers / consumers is restricted, read-only accounts and IP whitelists are used for restriction, and SQL injection is prevented through the ORM framework; Sensitive fields are encrypted using AES-256-GCM, the key is dynamically managed via KMS, and a SHA-256 hash value is appended during file transfer, allowing the receiver to verify data integrity.
7. A multi-protocol adaptation layer service method according to claim 6, characterized in that, In step S5, based on the Hystrix mode, when the error rate of a certain channel exceeds the threshold (e.g., 30%), the circuit breaker is triggered and a degradation response is returned. For retryable failed tasks, they are entered into the delay queue and retried according to the exponential backoff strategy. When a new protocol plugin is launched, it is first verified in a low-traffic environment and the traffic ratio is gradually increased.
8. A multi-protocol adaptation layer service method according to claim 7, characterized in that, In step S5, through the integration of Prometheus and Grafana, key metrics are displayed, a real-time monitoring panel is provided, detailed logs of each interaction are recorded, ELK centralized analysis is performed, automatic alarm rules are configured, and operation and maintenance personnel are notified to intervene. It also supports dynamic adjustment of routing policies and circuit breaker thresholds through REST API or management interface.
9. A multi-protocol adaptation layer service device, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to perform the method according to any one of claims 1 to 8.
Citation Information
Cited By
A multi-protocol adaptive parsing and double-factor binding rapid physical examination system and method
CN122679172A
