Distributed energy revenue automatic distribution method and system based on IOT

By using IoT technology to divide distributed energy systems into subnets, synchronize clocks, and optimize paths, combined with smart contracts, the problem of unfair revenue distribution under centralized management is solved, and efficient and transparent energy trading is achieved.

CN120996319APending Publication Date: 2025-11-21STATE GRID GANSU ELECTRIC POWER CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511503041.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In existing technologies, the distribution of revenue from distributed energy systems relies on a centralized management model, which fails to comprehensively consider factors such as network topology, transmission costs, response time, and energy matching, resulting in unfair distribution and low efficiency.

Method used

The system receives data from distributed energy devices via an IoT communication gateway, divides the energy subnet, uses a distributed clock synchronization protocol and a long short-term memory network to calculate communication delay and line loss, predicts energy matching degree, selects the optimal mutual assistance transmission path, and realizes automatic distribution of revenue through smart contracts.

Benefits of technology

It enables the automated and transparent allocation of distributed energy revenue, improves the fairness and efficiency of energy trading, reduces transmission losses, and enhances the reliability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120996319A_ABST
    Figure CN120996319A_ABST
Patent Text Reader

Abstract

The invention provides an IOT-based distributed energy revenue automatic distribution method and system, and relates to the technical field of Internet of Things and distributed energy management, and the method comprises the steps: receiving energy data through an Internet of Things communication gateway, dividing energy subnets according to geographic positions, unifying a time reference through a distributed clock synchronization protocol when energy transmission is executed, and transmitting the energy data to the Internet of Things communication gateway; an energy network topological graph is constructed, the energy matching degree is predicted based on the long and short-term memory network, the optimal mutual aid transmission path is selected, the path and the weight are written into the intelligent contract to automatically distribute benefits, and the energy utilization rate and the distribution fairness are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of Internet of Things (IoT) and distributed energy management technology, and in particular to an automatic distribution method and system for distributed energy revenue based on IoT. Background Technology

[0002] With the development of the energy internet, distributed energy systems have become an important supplement to energy supply. Distributed energy systems typically consist of various small-scale power generation devices such as solar, wind, and biomass power, characterized by geographical dispersion, moderate scale, and proximity to users. The widespread application of IoT technology has made interconnection between distributed energy devices possible, enabling efficient energy allocation and utilization through the collection, transmission, and analysis of energy data. Currently, energy sharing and revenue distribution in distributed energy systems mainly rely on a centralized management model, where scheduling and settlement are handled by a unified central system.

[0003] As energy systems develop towards greater decentralization and autonomy, there is an urgent need for an automatic distribution method for distributed energy revenue based on Internet of Things (IoT) technology. This method should comprehensively consider factors such as network topology, transmission costs, response time, and energy matching to achieve a fairer, more efficient, and intelligent distribution of revenue. Summary of the Invention

[0004] This invention provides a method and system for automatic distribution of distributed energy revenue based on IoT, which can solve the problems in the prior art.

[0005] A first aspect of this invention provides a method for automatically distributing distributed energy revenue based on IoT, comprising: The system receives energy data from multiple distributed energy devices via an IoT communication gateway; these distributed energy devices are used as device nodes and divided into multiple energy subnets according to their geographical location and power supply range. Energy transmission is performed in each energy subnet. The time base of each device node is unified through a distributed clock synchronization protocol. The communication delay between device nodes is calculated in real time. When the communication delay exceeds the delay threshold, the backup communication path is automatically switched and the response timeliness score of the device node is calculated. Based on the energy production data, an energy network topology is constructed, and the energy transmission distance and line loss between device nodes are calculated. Combined with the load rate of each device node, the comprehensive cost of each transmission path is calculated. In each energy subnet, based on the long short-term memory network, the energy matching degree of each device node is predicted. When the energy matching degree is lower than the matching threshold, based on the energy network topology, combined with the comprehensive cost and response timeliness score, the optimal mutual assistance transmission path is selected, and the mutual assistance benefit weight of the relevant device nodes is calculated. The optimal mutual aid transmission path and mutual aid benefit weight are written into the smart contract, and the smart contract is executed to complete the automatic distribution of benefits.

[0006] Energy transmission is performed in each energy subnet. A distributed clock synchronization protocol unifies the time base of each device node, and communication latency between device nodes is calculated in real time. When the communication latency exceeds a latency threshold, an alternative communication path is automatically switched, and the response timeliness score of each device node is calculated, including: Multiple device nodes within the energy subnet are divided into source device nodes and target device nodes for energy transmission according to their communication connection relationships, and their energy transmission timestamps are recorded. The clock deviation between device nodes is calculated based on the energy timestamps. Combined with the historical clock deviation sequence, the clock deviation is corrected using a Kalman filter algorithm to obtain the clock reference value for each device node. Based on the clock reference value, the communication delay during the communication process of each device node is monitored. When the communication delay exceeds the delay threshold, an alternative communication path is identified based on the communication connection relationship. Based on the delay fluctuation data of each alternative communication path, the reliability score of each alternative communication path is calculated. The alternative communication path with the highest reliability score and a load rate lower than the load threshold is selected as the optimal path, and the communication data is switched from the original path to the optimal path. The response timeliness score of a device node is calculated based on the communication latency and path switching frequency during the communication process.

[0007] The clock skew between device nodes is calculated based on the energy timestamp. Combined with historical clock skew sequences, a Kalman filter algorithm is used to correct the clock skew, resulting in the clock reference value for each device node, including: Energy timestamp data of device nodes are continuously collected within a sliding time window, and the clock deviation value at each sampling moment is calculated to form a historical clock deviation sequence. Based on the historical clock deviation sequence, a state vector is formed by the clock deviation value and the rate of change of clock deviation, and the covariance matrix is ​​obtained by combining the standard deviation of the historical clock deviation sequence. Based on the state vector and the covariance matrix, the state prediction equation is used to calculate the predicted value of the state vector at the next moment. The deviation between the predicted value and the actual measured value is used as the prediction error. The Kalman gain is adaptively adjusted based on the prediction error, and the optimal estimate of the state vector is recalculated. The local clock of each device node is corrected in real time based on the optimal estimate to obtain the clock reference value of each device node.

[0008] Based on the energy production data, an energy network topology is constructed, and the energy transmission distance and line loss between device nodes are calculated. Combining the load rate of each device node, the comprehensive cost of each transmission path is calculated, including: Credit scores are calculated based on historical energy production data of device nodes, edge weights are determined by physical distance, edge selection relationships are established based on the energy surplus ratio and edge weights between device nodes, and the minimum spanning tree algorithm is used for structural optimization to obtain the energy network topology. Based on the energy network topology, the Euclidean distance between the current device node and its connected device nodes is obtained. A nonlinear function of the ratio of the current device node's transmission power to its rated power is calculated and multiplied by the Euclidean distance to obtain the energy transmission distance of each transmission path. Based on the energy transmission distance, combined with the transmission current and line resistance, the basic loss is calculated. The basic loss is corrected based on the power change rate and the transmission path curvature to obtain the line loss of each transmission path. Based on the difference between the line loss and the load rate between the device nodes, the comprehensive cost of each transmission path is obtained.

[0009] Credit scores are calculated based on historical energy production data of device nodes. Edge weights are determined by combining physical distance. Edge connections are established based on the energy surplus ratio between device nodes and edge weights, including: Historical energy production data of equipment nodes are acquired, and node evaluation characteristics are calculated. Based on the node evaluation characteristics, a credit score for the equipment nodes is obtained. Based on the physical distance and load power between equipment nodes, the original edge weights between equipment nodes are calculated. According to the credit score, the original edge weights are corrected to obtain corrected edge weights. The energy surplus value is obtained by subtracting the load power from the power generation of the device node. The energy surplus ratio is obtained by calculating the ratio of the energy surplus values ​​of adjacent device nodes. When the corrected edge weight between device nodes is less than the edge weight threshold and the energy surplus ratio is negative, an edge connection relationship is established between the device nodes.

[0010] The minimum spanning tree algorithm is used for structural optimization to obtain the energy network topology, including: Based on the edge connection relationships between device nodes, the search space is constructed by adding connecting edges layer by layer starting from the first layer. The number of connecting edges added at each layer is determined by the layer number. The added connecting edges are not repeated between different layers and do not form loops. Each edge combination in the search space is used as a candidate spanning tree. Traverse each candidate spanning tree, extract the connecting edges with edge selection relationships, calculate the sum of their corrected edge weights, and select the candidate spanning tree with the smallest sum of corrected edge weights as the optimal spanning tree; Obtain the neighboring device node information of each device node in the optimal spanning tree, calculate the energy surplus difference between each device node and its neighboring device nodes, determine the energy transmission direction based on the energy surplus difference, mark the determined energy transmission direction on the optimal spanning tree, and obtain the final energy network topology.

[0011] In each energy subnet, based on a long short-term memory network, the energy matching degree of each device node is predicted. When the energy matching degree is lower than the matching threshold, based on the energy network topology, combined with the comprehensive cost and response timeliness scores, the optimal mutual aid transmission path is selected, and the mutual aid benefit weights of the relevant device nodes are calculated, including: In each energy subnet, historical energy production data of each device node is obtained and reconstructed into a state vector; multi-layer convolution and pooling operations are performed on the state vector to obtain multi-scale convolution features; based on the long short-term memory network, the energy matching degree of the device node at the current moment is calculated. When the energy matching degree is lower than the matching threshold, based on the energy network topology, multiple unoccupied device nodes are identified, energy mutual assistance paths are generated, an objective function including comprehensive cost and device node response timeliness score is constructed, and the energy mutual assistance path with the largest objective function value is selected as the optimal mutual assistance transmission path. Calculate the energy transmission value of the equipment node during the mutual assistance period, calculate the voltage fluctuation value of the equipment node before and after mutual assistance, and obtain the mutual assistance benefit weight of each equipment node.

[0012] The optimal mutual aid transmission path and the mutual aid benefit weight are written into a smart contract, and the smart contract is executed to complete the automatic distribution of benefits, including: Create a master control contract and deploy a data storage contract and an execution logic contract, and write the optimal mutual aid transmission path and the mutual aid benefit weight into the master control contract; Obtain the power supply of each device node in the current time period and the transmission efficiency of the corresponding optimal mutual assistance transmission path. Calculate the cumulative energy of the device node in the current time period to obtain the energy supply contribution weight of the device node. Combine the mutual assistance benefit weight to obtain the benefit distribution weight of the device node. Monitor the operating status of each device node. When the accumulated energy exceeds the energy trigger threshold or the device running time exceeds the time trigger interval, the trigger information will be broadcast to all device nodes. Receive verification information returned by the device nodes. When the number of verification messages exceeds the verification quantity threshold, calculate the total mutual benefit revenue based on the actual transmitted electricity and the transaction price between the device nodes. The total revenue of the mutual aid is allocated according to the revenue allocation weight of the device nodes to obtain the revenue allocation amount of each device node. The revenue allocation amount is written into the data storage contract and the revenue is automatically allocated through the execution logic contract.

[0013] A second aspect of the present invention provides an automatic distribution system for distributed energy revenue based on IoT, comprising: The first unit is used to receive energy data sent by multiple distributed energy devices through an Internet of Things communication gateway; and to divide the multiple distributed energy devices into multiple energy subnets according to their geographical location and power supply range, using the multiple distributed energy devices as device nodes. The second unit is used to perform energy transmission in each energy subnet. It unifies the time base of each device node through a distributed clock synchronization protocol, calculates the communication delay between device nodes in real time, and automatically switches to a backup communication path and calculates the response timeliness score of the device node when the communication delay exceeds the delay threshold. The third unit is used to construct an energy network topology based on the energy production data, calculate the energy transmission distance and line loss between equipment nodes, and calculate the comprehensive cost of each transmission path in combination with the load rate of each equipment node. The fourth unit is used to predict the energy matching degree of each device node in each energy subnet based on the long short-term memory network. When the energy matching degree is lower than the matching threshold, the optimal mutual assistance transmission path is selected based on the energy network topology map, combined with the comprehensive cost and response timeliness score, and the mutual assistance benefit weight of the relevant device nodes is calculated. The fifth unit is used to write the optimal mutual aid transmission path and mutual aid benefit weight into the smart contract, and execute the smart contract to complete the automatic distribution of benefits.

[0014] A third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0015] The beneficial effects of this application are as follows: This invention enables the automatic allocation of distributed energy revenue through Internet of Things (IoT) technology, effectively solving the problems of complex revenue calculation and opaque allocation in traditional energy trading, and significantly improving the fairness and efficiency of energy trading.

[0016] This invention, based on a distributed clock synchronization protocol and a long short-term memory network, achieves precise time synchronization and energy matching degree prediction among energy devices, ensuring automatic switching to backup paths when communication delays occur. At the same time, it calculates the comprehensive cost based on line loss and load rate, effectively reducing energy transmission loss and improving the reliability and stability of the system.

[0017] This invention incorporates the optimal mutual aid transmission path and revenue distribution weights into a smart contract, thereby automating and making the revenue distribution process transparent, eliminating human intervention, significantly improving the operating efficiency of distributed energy systems, and providing a feasible technical solution for the commercial application of the energy internet. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the automatic distribution method of distributed energy revenue based on IoT according to an embodiment of the present invention. Figure 2 A schematic diagram of the clock synchronization and communication path optimization architecture for distributed energy networks. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0021] Figure 1 This is a flowchart illustrating the automatic distribution method of distributed energy revenue based on IoT according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes: The system receives energy data from multiple distributed energy devices via an IoT communication gateway; these distributed energy devices are used as device nodes and divided into multiple energy subnets according to their geographical location and power supply range. Energy transmission is performed in each energy subnet. The time base of each device node is unified through a distributed clock synchronization protocol. The communication delay between device nodes is calculated in real time. When the communication delay exceeds the delay threshold, the backup communication path is automatically switched and the response timeliness score of the device node is calculated. Based on the energy production data, an energy network topology is constructed, and the energy transmission distance and line loss between device nodes are calculated. Combined with the load rate of each device node, the comprehensive cost of each transmission path is calculated. In each energy subnet, based on the long short-term memory network, the energy matching degree of each device node is predicted. When the energy matching degree is lower than the matching threshold, based on the energy network topology, combined with the comprehensive cost and response timeliness score, the optimal mutual assistance transmission path is selected, and the mutual assistance benefit weight of the relevant device nodes is calculated. The optimal mutual aid transmission path and mutual aid benefit weight are written into the smart contract, and the smart contract is executed to complete the automatic distribution of benefits.

[0022] Figure 2This is a schematic diagram of a distributed energy network clock synchronization and communication path optimization architecture. In one optional implementation, energy transmission is performed in each energy subnet. A distributed clock synchronization protocol unifies the time base of each device node, and the communication latency between device nodes is calculated in real time. When the communication latency exceeds a latency threshold, an alternative communication path is automatically switched, and the response timeliness score of the device node is calculated, including: Multiple device nodes within the energy subnet are divided into source device nodes and target device nodes for energy transmission according to their communication connection relationships, and their energy transmission timestamps are recorded. The clock deviation between device nodes is calculated based on the energy timestamps. Combined with the historical clock deviation sequence, the clock deviation is corrected using a Kalman filter algorithm to obtain the clock reference value for each device node. Based on the clock reference value, the communication delay during the communication process of each device node is monitored. When the communication delay exceeds the delay threshold, an alternative communication path is identified based on the communication connection relationship. Based on the delay fluctuation data of each alternative communication path, the reliability score of each alternative communication path is calculated. The alternative communication path with the highest reliability score and a load rate lower than the load threshold is selected as the optimal path, and the communication data is switched from the original path to the optimal path. The response timeliness score of a device node is calculated based on the communication latency and path switching frequency during the communication process.

[0023] In practical applications, an energy subnet containing 10 device nodes is defined as follows: Device Node 1, Device Node 3, and Device Node 5 are designated as source device nodes, and Device Node 2, Device Node 4, Device Node 6, Device Node 7, Device Node 8, Device Node 9, and Device Node 10 are designated as target device nodes. When a source device node transmits energy to a target device node, it records the energy transmission timestamp. For example, the start timestamp for device node 1 transmitting energy to device node 2 is T. 1start =10:15:30.250, end timestamp is T 1end =10:15:35.750; Device node 2 records the start timestamp of receiving energy as T. 2start =10:15:30.500, end timestamp is T 2end =10:15:36.000.

[0024] In the example above, the clock skew between device node 1 and device node 2 can be calculated as the difference in start timestamps, i.e., T2. start -T1 start=0.250 seconds, generate a historical clock skew sequence, for example, the skew values ​​of the past 10 communications are [0.248, 0.252, 0.249, 0.251, 0.247, 0.253, 0.250, 0.248, 0.251, 0.250] seconds. A Kalman filter algorithm is used to correct the clock skew, calculating the predicted value and uncertainty of the skew based on historical data. Assume the average skew of the historical data is 0.250 seconds, the variance is 0.0001 seconds squared, the current measurement skew is 0.252 seconds, and the measurement uncertainty is 0.0002 seconds squared. The corrected clock skew value is calculated using Kalman gain, and the uncertainty is updated to 0.00008 seconds squared. By performing similar calculations on the skew between all device nodes, the clock reference value for each device node is obtained.

[0025] Based on a unified clock reference value, the communication latency of each device node during communication is monitored. For example, if device node 1 sends a data packet to device node 7 at 10:20:15.000 and device node 7 receives it at 10:20:15.035, considering a clock deviation of 0.002 seconds, the actual communication latency is 0.033 seconds. The latency data of all communication links is continuously monitored and compared with a preset latency threshold (e.g., 0.050 seconds). When a communication latency exceeding the threshold is detected, for example, if the communication latency between device node 1 and device node 7 suddenly increases to 0.075 seconds, exceeding the 0.050-second threshold, an alternative communication path will be identified based on the communication connection relationship. In the example above, there are three alternative paths: path A (device node 1 → device node 3 → device node 7), path B (device node 1 → device node 4 → device node 9 → device node 7), and path C (device node 1 → device node 5 → device node 8 → device node 7).

[0026] Reliability scores were calculated based on delay fluctuation data for each backup communication path. The delays measured for the most recent 10 times for path A were [0.042, 0.043, 0.041, 0.044, 0.043, 0.042, 0.044, 0.045, 0.043, 0.042] seconds, with an average delay of 0.043 seconds and a standard deviation of 0.001 seconds. The average delay for path B was 0.038 seconds, with a standard deviation of 0.003 seconds. The average delay for path C was 0.040 seconds, with a standard deviation of 0.002 seconds. Taking both the average delay and standard deviation into account, the reliability score for each path was calculated. In the reliability score calculation for path A, the average delay of 0.043 seconds exceeded the baseline value of 0.035 seconds by 0.008 seconds, corresponding to a delay score of 88 points. The standard deviation of 0.001 seconds was equal to the baseline value, corresponding to a stability score of 100 points. The overall score is calculated using a weighted average of 85 points, specifically as follows: a latency score of 88 points multiplied by a weight of 0.6, plus a stability score of 100 points multiplied by a weight of 0.4. In the scoring calculation for Path B, the average latency of 0.038 seconds is relatively good compared to the baseline, resulting in a latency score of 92 points. However, the standard deviation of 0.003 seconds is relatively large compared to the baseline, leading to a stability score of 70 points and an overall score of 82 points. Path C has an average latency of 0.040 seconds, a latency score of 85 points, a standard deviation of 0.002 seconds, a stability score of 82 points, and an overall score of 84 points.

[0027] Simultaneously, the load rate of each backup path is checked. Path A's current load rate is 65%, lower than the preset load threshold of 75%; Path B's load rate is 70%, also lower than the threshold; Path C's load rate is 80%, higher than the threshold. Considering both reliability score and load rate, Path A is selected as the optimal path, and communication data is switched from the original path to Path A. The path switching operation is recorded, and data transmission through the new path begins. After the switch, the communication latency of the new path is continuously monitored to confirm its stability. For example, the latency of the first 5 communication transactions after the switch is [0.043, 0.044, 0.042, 0.043, 0.043] seconds, all within the threshold range, indicating a successful switch.

[0028] The response timeliness score of a device node is calculated based on its communication latency and path switching frequency. For example, device node 7 has an average communication latency of 0.045 seconds and a path switching frequency of 3 times in the past 24 hours. The full score benchmark for communication latency is set at 0.030 seconds, and the full score benchmark for path switching frequency is less than 1 time. The latency performance score is determined by comparing the deviation between the actual average latency and the benchmark value. Device node 7's actual latency of 0.045 seconds exceeds the benchmark value by 0.015 seconds, which is 50%, corresponding to a latency performance score of 75 points. The switching stability score is calculated based on the deviation between the switching frequency and the benchmark value. Device node 7 exceeded the benchmark value 2 out of 3 times, corresponding to a stability score of 85 points. The latency performance weight is set to 60%, and the switching stability weight is set to 40%. A base score of 80 points is obtained by weighted averaging. Further considering the duration of latency exceeding the threshold (cumulative 25 minutes, deducting 10 points) and the stability after switching (average latency improvement of 20%, increasing by 5 points), the final response timeliness score of device node 7 is calculated to be 75 points.

[0029] Using the above methods, the system can achieve efficient clock synchronization and communication path optimization in the energy subnet, ensuring the stability and reliability of energy transmission. It can also evaluate the performance of each device node through response timeliness scores, providing data support for the operation and maintenance and optimization of the energy network.

[0030] In one optional implementation, the clock skew between device nodes is calculated based on the energy timestamp, and the clock skew is corrected using a Kalman filter algorithm in conjunction with the historical clock skew sequence to obtain the clock reference value for each device node, including: Energy timestamp data of device nodes are continuously collected within a sliding time window, and the clock deviation value at each sampling moment is calculated to form a historical clock deviation sequence. Based on the historical clock deviation sequence, a state vector is formed by the clock deviation value and the rate of change of clock deviation, and the covariance matrix is ​​obtained by combining the standard deviation of the historical clock deviation sequence. Based on the state vector and the covariance matrix, the state prediction equation is used to calculate the predicted value of the state vector at the next moment. The deviation between the predicted value and the actual measured value is used as the prediction error. The Kalman gain is adaptively adjusted based on the prediction error, and the optimal estimate of the state vector is recalculated. The local clock of each device node is corrected in real time based on the optimal estimate to obtain the clock reference value of each device node.

[0031] This implementation uses an energy timestamp as a reference. Clock deviation is calculated through continuous sampling, and energy timestamp data is collected every 10 seconds within a 30-minute sliding time window. For example, there are three device nodes A, B, and C, with node A as the reference node. At time t, the timestamp of node A is T. A (t), where the timestamp of node B is T. B (t), where the timestamp of node C is T. C (t). The clock offset between node B and node A is calculated as ΔAB(t) = T. B (t) - T A (t), the clock deviation between node C and node A is ΔAC(t) = T. C (t) - T A (t). Through continuous sampling, the historical clock deviation sequences ΔAB = [ΔAB(tn), ΔAB(t-n+1), ..., ΔAB(t)] and ΔAC = [ΔAC(tn), ΔAC(t-n+1), ..., ΔAC(t)] can be obtained, where n is the number of sampling points within the sliding window.

[0032] Based on the historical clock deviation sequence, a state vector and a covariance matrix are constructed. The state vector contains two components: the clock deviation value and the rate of change of the clock deviation. For node B, the state vector can be represented as [ΔAB(t), dΔAB(t) / dt], where dΔAB(t) / dt represents the rate of change of the clock deviation, which can be calculated by dividing the difference in deviation between two adjacent samples by the sampling interval. Similarly, the state vector of node C is [ΔAC(t), dΔAC(t) / dt]. The covariance matrix reflects the uncertainty and correlation of each component of the state vector. Based on the standard deviation of the historical clock deviation sequence, the covariance matrix P is calculated. For node B, assuming the standard deviation of the historical deviation sequence is 0.05 ms and the standard deviation of the rate of change of deviation is 0.002 ms / s, the initial covariance matrix can be set as a diagonal matrix with diagonal elements of (0.05). 2 and (0.002) 2 The initial uncertainties of these two state variables are represented by . In practical applications, system noise and measurement noise can affect the accuracy of clock synchronization. The system noise matrix Q represents the uncertainty during the state transition process and can be empirically set as a diagonal matrix with diagonal elements of 0.001 and 0.0001, respectively. The measurement noise R represents the uncertainty during the measurement process and can be set to 0.01, indicating that the standard deviation of the measurement deviation is 0.1 ms.

[0033] The core of the Kalman filter algorithm consists of two steps: prediction and update. The prediction step uses the state transition equation to predict the state vector at the next time step. Assuming the current time is t, the predicted state vector at time t+1 is X'(t+1) = A * X(t), where A is the state transition matrix. For clock synchronization problems, this can be represented as a 2×2 matrix, showing the relationship between clock skew and the rate of change of skew within one sampling period. Simultaneously, the prediction step also updates the covariance matrix: P'(t+1) = A * P(t) * A T + Q, where A T Let A be the transpose of A, and Q be the system noise matrix. The update step compares the predicted value with the actual measured value, calculating the prediction error e(t+1) = Z(t+1) - H * X'(t+1), where Z(t+1) is the actual measured value at time t+1, and H is the measurement matrix, representing the mapping relationship from the state vector to the measured value. For clock synchronization problems, H can be represented as [1, 0], indicating that only the clock deviation value is measured. The Kalman gain K is calculated as K(t+1) = P'(t+1) * H. T * (H* P'(t+1) * H T + R) (-1) , where R is the measurement noise, update the state vector and covariance matrix: X(t+1) = X'(t+1) + K(t+1) * e(t+1), P(t+1) = (I - K(t+1) * H) * P'(t+1), where I is the identity matrix.

[0034] The optimal estimate of clock skew is calculated using the Kalman filter algorithm. Taking node B as an example, the measured clock skew at a certain moment is 2.5ms, with a skew change rate of 0.01ms / s. The Kalman filter algorithm predicts a skew of 2.3ms, with a skew change rate of 0.009ms / s. The calculated prediction error is 0.2ms. Based on the Kalman gain (set to 0.4), the updated skew estimate is 2.38ms, with a skew change rate of 0.0094ms / s. Based on the optimal estimate, the local clock of the device nodes is corrected in real time. For node B, the corrected time is T'B(t) = TB(t) - ΔAB(t), where ΔAB(t) is the clock skew estimate corrected by the Kalman filter algorithm. Similarly, for node C, the corrected time is T'C(t) = TC(t) - ΔAC(t). This method ensures that the clocks of all nodes are synchronized, improving time consistency.

[0035] In practical tests, this method can improve the clock synchronization accuracy between nodes from the millisecond level to the microsecond level. For example, in a distributed energy system with 10 nodes, after adopting this method, the maximum clock deviation between nodes was reduced from 5ms to 50μs, meeting the requirements for high-precision time synchronization and providing a strong guarantee for the stable operation of the distributed energy system.

[0036] In one optional implementation, based on the energy production data, an energy network topology is constructed, and the energy transmission distance and line loss between device nodes are calculated. Combining the load rate of each device node, the comprehensive cost of each transmission path is calculated, including: Credit scores are calculated based on historical energy production data of device nodes, edge weights are determined by physical distance, edge selection relationships are established based on the energy surplus ratio and edge weights between device nodes, and the minimum spanning tree algorithm is used for structural optimization to obtain the energy network topology. Based on the energy network topology, the Euclidean distance between the current device node and its connected device nodes is obtained. A nonlinear function of the ratio of the current device node's transmission power to its rated power is calculated and multiplied by the Euclidean distance to obtain the energy transmission distance of each transmission path. Based on the energy transmission distance, combined with the transmission current and line resistance, the basic loss is calculated. The basic loss is corrected based on the power change rate and the transmission path curvature to obtain the line loss of each transmission path. Based on the difference between the line loss and the load rate between the device nodes, the comprehensive cost of each transmission path is obtained.

[0037] In this specific embodiment, historical energy production data of the device nodes needs to be obtained. This data includes the energy production of each node at different points in time. For each device node, a credit score is calculated by analyzing the stability, reliability, and volatility of its historical energy production. For example, if the average energy production data of a device node over the past 30 days is 100 kW and the standard deviation is 10 kW, the calculated stability index is 0.1, which translates to a credit score of 90. The physical distance between each device node is obtained, which can be calculated using geographic coordinates. For example, if the coordinates of node A are (12.5, 30.2) and the coordinates of node B are (15.8, 32.1), the distance between the two nodes is calculated as 3.76 km using the Euclidean distance formula. A method for calculating edge weights is designed by combining the physical distance with the node credit scores. The edge weight is equal to the physical distance divided by the geometric mean of the credit scores of the two endpoints. For example, if the credit scores of nodes A and B are 90 and 85 respectively, then the weight of edge AB is 3.76 / (90×85). 0.5 ≈0.043.

[0038] Calculate the energy surplus of each node by subtracting local load demand from current energy production. For any two nodes, calculate their energy surplus ratio; the closer the ratio is to 1, the better the energy complementarity. For example, if node A has a surplus of 50 kW and node B has a surplus of 45 kW, the surplus ratio is 50 / 45 ≈ 1.11, indicating good energy complementarity between the two nodes. Establish edge selection relationships based on edge weights and energy surplus ratios. Edges with smaller weights and energy surplus ratios closer to 1 have higher selection priority. After sorting all edges by priority, use Kruskal's minimum spanning tree algorithm for network topology optimization. Starting with the highest priority edge, add edges sequentially to the network while ensuring no loops are formed. For example, in a network with 10 nodes, the algorithm selects 9 edges to form the optimal energy network topology.

[0039] Based on the constructed energy network topology, the energy transmission distance of each transmission path is calculated to obtain the Euclidean distance between connected nodes. For example, the distance between nodes A and B is 3.76 kilometers. The ratio of the current node's transmission power to its rated power is calculated. This is a non-linear function, expressed as the transmission power divided by the cube root of the rated power. For example, if node A has a transmission power of 80 kW and a rated power of 100 kW, the calculated ratio is approximately 0.93. Multiplying this ratio by the Euclidean distance, the energy transmission distance of this path is approximately 3.76 × 0.93 ≈ 3.50 kilometers. Line loss is calculated based on the energy transmission distance. First, the base loss is calculated based on the transmission current and line resistance. The base loss equals the square of the current multiplied by the line resistance multiplied by the energy transmission distance. For example, if the transmission current is 20 amps, the line resistance is 0.01 ohms / km, and the energy transmission distance is 3.50 kilometers, then the base loss is 20 amps / km. 2 ×0.01×3.50≈14.00 watts.

[0040] Considering the dynamic factors in energy transmission, a correction for base loss is necessary. The power change rate represents the degree of power change per unit time, calculated by dividing the absolute value of the power difference between two adjacent time points by the time interval. For example, if node A's power at two adjacent time points is 80 kW and 76 kW respectively, with a time interval of 5 minutes, then the power change rate is |80-76| / (5×60)≈0.0133 kW / s. The transmission path curvature reflects the deviation of the actual transmission path from a straight path, calculated by dividing the actual path length by the straight-line distance. For example, if the actual path length is 4.2 km and the straight-line distance is 3.76 km, then the curvature is 4.2 / 3.76≈1.12. The base loss is multiplied by (1 + power change rate) and then by the curvature to obtain the corrected line loss. Using the above data as an example, the corrected line loss is 14.00×(1+0.0133)×1.12≈15.90 watts. The load rate of connected nodes is obtained, equal to the current load power divided by the equipment's maximum load capacity. For example, the load rates of nodes A and B are 0.8 and 0.65, respectively. Calculate the absolute value of the load rate difference: |0.8 - 0.65| = 0.15. The overall cost equals the line loss multiplied by (1 + load rate difference). Using the above data as an example, the overall cost of transmission path AB is 15.90 × (1 + 0.15) ≈ 18.29 watts.

[0041] The above methods enable the construction of efficient energy network topologies and accurate calculation of the comprehensive cost of each transmission path, providing a basis for energy dispatching and network optimization. In practical applications, weighting coefficients and scoring criteria can be adjusted according to the characteristics of different scenarios to meet specific needs.

[0042] In one optional implementation, a credit score is calculated based on the historical energy production data of the device nodes, edge weights are determined by combining physical distance, and edge connections are established based on the energy surplus ratio between device nodes and the edge weights, including: Historical energy production data of equipment nodes are acquired, and node evaluation characteristics are calculated. Based on the node evaluation characteristics, a credit score for the equipment nodes is obtained. Based on the physical distance and load power between equipment nodes, the original edge weights between equipment nodes are calculated. According to the credit score, the original edge weights are corrected to obtain corrected edge weights. The energy surplus value is obtained by subtracting the load power from the power generation of the device node. The energy surplus ratio is obtained by calculating the ratio of the energy surplus values ​​of adjacent device nodes. When the corrected edge weight between device nodes is less than the edge weight threshold and the energy surplus ratio is negative, an edge connection relationship is established between the device nodes.

[0043] This embodiment provides a method for calculating credit scores based on historical energy production data of device nodes, determining edge weights by combining physical distance, and establishing edge connection relationships based on the energy surplus ratio between device nodes and edge weights.

[0044] In the energy internet environment, it is necessary to acquire historical energy production data of equipment nodes. For solar power equipment node M, 25,920 data records were collected over the past 180 days. Each record contains detailed information such as timestamp, instantaneous power, cumulative electricity generation, solar radiation intensity, panel temperature, and inverter efficiency. The data acquisition frequency was set to once every 10 minutes to ensure that various state changes during equipment operation could be captured. The average daily power generation of the equipment in different time windows such as the most recent 30, 60, 90, and 180 days was calculated, and the average value and standard deviation for each time period were obtained through statistical analysis. The average daily power generation of equipment node M in the most recent 30 days was 120 kWh, with a standard deviation of 15 kWh and a coefficient of variation of 12.5%; the average daily power generation in the most recent 90 days was 115 kWh, with a standard deviation of 18 kWh and a coefficient of variation of 15.7%. Establish production stability evaluation standards: a coefficient of variation of less than 10% is excellent, 10% to 20% is good, 20% to 30% is average, and more than 30% is poor.

[0045] Based on the equipment's technical specifications and installed capacity, the theoretical maximum power generation was calculated. A capacity prediction model was established by combining historical meteorological data and equipment operating conditions. Equipment node M has an installed capacity of 150 kW, a theoretical annual power generation of 180,000 kWh, and an actual annual power generation of 162,000 kWh, achieving a capacity utilization rate of 90%. Reliability indicators such as the number of failures, failure duration, mean time between failures (MTBF), and failure recovery time were statistically analyzed during the evaluation period. Equipment node M experienced 5 failures during its 180-day operating period, with a total failure time of 48 hours, an MTBF of 36 days, and an MTBF of 9.6 hours. Subtracting the 48-hour failure time from the total operating time of 4320 hours and dividing by the total operating time yields an operational reliability of 98.9%. The energy conversion efficiency and technological advancement of the equipment nodes were analyzed, and the power generation efficiency of the equipment under different operating conditions was calculated, including multiple dimensions such as peak efficiency, average efficiency, and part-load efficiency. The peak efficiency of equipment node M under standard test conditions was 21.8%, the annual weighted average efficiency was 19.5%, and the efficiency under low light conditions was 16.2%. An efficiency benchmark library was established, and the actual efficiency of the equipment was compared with the industry standard of similar equipment. The energy efficiency performance of equipment node M exceeded the industry average by 7.3%.

[0046] The evaluation characteristics of nodes with different dimensions and numerical ranges are converted into a unified scoring standard. A percentage-based scoring system is adopted, mapping the original values ​​of each characteristic to a range of 0 to 100 points. For equipment node M, the production stability characteristic corresponds to 85 points, capacity utilization rate to 90 points, operational reliability to 92 points, and energy efficiency performance to 88 points. A weighted summation method is used to obtain the comprehensive credit score of the equipment node. Multiplying the production stability score of 85 points by a weight of 40% yields 34 points; the capacity utilization rate score of 90 points by a weight of 25% yields 22.5 points; the operational reliability score of 92 points by a weight of 20% yields 18.4 points; and the energy efficiency performance score of 88 points by a weight of 15% yields 13.2 points. The weighted sum of these four scores yields the final credit score of equipment node M: 88.1 points.

[0047] The original edge weights between device nodes are calculated based on the physical distance and load power between them. The physical distance can be calculated using the GPS coordinates of the device nodes, while the load power is the average of the load power of the two nodes. The original edge weights are directly proportional to the physical distance and inversely proportional to the load power. For example, if the physical distance between device nodes A and B is 500 meters, the load power of node A is 5.2kW, and the load power of node B is 6.8kW, then the calculated original edge weight is 0.42. The original edge weights are then corrected based on the credit scores of the device nodes to obtain the corrected edge weights. During the correction process, nodes with higher credit scores have smaller correction coefficients for their edge weights. The corrected edge weight is equal to the original edge weight multiplied by the correction coefficient. For example, if the credit scores of nodes A and B are 88 and 75 respectively, then their correction coefficients are 0.12 and 0.25 respectively, and the corrected edge weight between points A and B is calculated as 0.42 × (0.12 + 0.25) / 2 = 0.08.

[0048] Calculate the energy surplus value of each device node, which is the generated power minus the load power. For example, device node A has a generated power of 8.5kW and a load power of 5.2kW, so its energy surplus value is 3.3kW; device node B has a generated power of 4.5kW and a load power of 6.8kW, so its energy surplus value is -2.3kW. Calculate the energy surplus ratio between adjacent device nodes, which is the energy surplus value of node B divided by the energy surplus value of node A, resulting in -2.3 / 3.3 = -0.7. When the corrected edge weight between device nodes is less than the preset edge weight threshold and the energy surplus ratio is negative, an edge connection is established between these two device nodes. In this example, the corrected edge weight between nodes A and B is 0.08. Assuming the preset edge weight threshold is 0.1 and the energy surplus ratio is -0.7, the establishment condition is met, therefore an edge connection is established between nodes A and B. By establishing edge connections, nodes with positive energy surplus can supply power to nodes with negative energy surplus, thereby achieving efficient energy allocation. For example, node A can supply 2.3kW of power to node B, enabling node B to meet its load demand, while node A still has an energy surplus of 1.0kW.

[0049] The nodes in the entire network determine whether to establish edge connections using the method described above, ultimately forming an energy distribution network. In this network, nodes with high credit scores, short physical distances, and strong energy complementarity are more likely to establish connections, thereby achieving efficient energy distribution and utilization.

[0050] The implementation of this method can effectively improve the energy utilization efficiency in the energy internet, reduce energy waste, and at the same time take into account the reliability and stability of device nodes, which helps to build a safer and more efficient energy distribution network.

[0051] In one optional implementation, the minimum spanning tree algorithm is used for structural optimization to obtain the energy network topology, including: Based on the edge connection relationships between device nodes, the search space is constructed by adding connecting edges layer by layer starting from the first layer. The number of connecting edges added at each layer is determined by the layer number. The added connecting edges are not repeated between different layers and do not form loops. Each edge combination in the search space is used as a candidate spanning tree. Traverse each candidate spanning tree, extract the connecting edges with edge selection relationships, calculate the sum of their corrected edge weights, and select the candidate spanning tree with the smallest sum of corrected edge weights as the optimal spanning tree; Obtain the neighboring device node information of each device node in the optimal spanning tree, calculate the energy surplus difference between each device node and its neighboring device nodes, determine the energy transmission direction based on the energy surplus difference, mark the determined energy transmission direction on the optimal spanning tree, and obtain the final energy network topology.

[0052] In practical applications, the device nodes in an energy network can be distributed energy devices, such as wind turbines, solar panels, and energy storage devices. For an energy network containing six device nodes, labeled A, B, C, D, E, and F, connections are detected between nodes A and B / C, B and D / E, C and F, and D and E / F. An adjacency list data structure is established to store these connections. Node A's adjacency list contains B and C, and node B's adjacency list contains A, D, and E. A progressive edge addition strategy is employed to generate the search space for candidate spanning trees. The system defines a hierarchical structure for the search space, with each level representing a specific number of edges. The number of edges is progressively increased starting from the first level, which contains the fewest connecting edges. For a network of 6 nodes, a spanning tree must contain 5 edges to ensure connectivity between all nodes. The system constructs the search space starting with 1 edge in the first level. The first level of the search space contains all single-edge connections in the network, with 9 possible choices: edge AB, edge AC, edge BD, edge BE, edge CF, edge DE, edge DF, edge EF, and edge DF. The number of connecting edges added in each level follows an increasing pattern: 2 edges are added in the second level, 3 edges in the third level, and so on, until 5 edges are added in the fifth level to form a complete spanning tree.

[0053] To ensure that added edges between different layers meet the technical requirements of being non-repeating and loop-free, a set of selected edges is maintained. Each time a new edge is added, it is checked whether the edge already exists in the current set to avoid selecting the same edge repeatedly. For loop detection, a depth-first search algorithm is used to check whether adding a new edge forms a closed loop. When adding edge AC to existing edges AB and BC, the algorithm finds that node A can be reached from node C via path ABC. Adding a direct connection edge AC would form a triangular loop, and the system rejects this edge addition operation. The loop detection algorithm starts searching from the starting node of the new edge and looks for a path to the ending node through existing edges. If a path is found, it indicates that a loop has formed.

[0054] In each layer, all edge combinations are enumerated to ensure a complete candidate space is generated. In the second layer, two non-repeating edges that do not form a cycle are selected. Combinations include AB-BD, AB-BE, AB-CF, AB-DE, AB-DF, AB-EF, AC-BD, AC-BE, AC-CF, etc. A recursive combination algorithm is used to generate all legal edge combinations, and cycle detection and duplication checks are performed on each combination. In the third layer, three edges are selected. A third edge is added to the legal combinations from the second layer, ensuring that the new three-edge combination still satisfies the no-cycle constraint. Each legal edge combination in the search space is converted into a corresponding candidate spanning tree structure. Each edge combination is checked to see if it can connect all nodes in the network. Only edge combinations that achieve full network connectivity are considered valid candidate spanning trees. For the edge combination AB-BD-DE-EF-CF, it is verified that this combination can connect all 6 nodes: node A is connected to node B through edge AB, node B is connected to node D through edge BD, node D is connected to node E through edge DE, node E is connected to node F through edge EF, and node F is connected to node C through edge CF. All nodes are connected. A tree data structure is constructed to represent this candidate spanning tree, recording the weight, capacity, reliability, and other attribute information of each edge.

[0055] A breadth-first search algorithm is used to verify the connectivity integrity of candidate spanning trees. The algorithm starts from any root node and traverses all reachable nodes through edge connections, comparing the number of visited nodes with the total number of nodes in the network. For a candidate structure containing the edge AB-AC-BD-BE-CF, the algorithm starts from node A and visits nodes B, C, D, and E in sequence, but cannot reach node F. This indicates that the edge combination cannot form a complete spanning tree, and such edge combinations that do not meet the connectivity requirements are removed from the candidate set. Edges with smaller weights and higher reliability are prioritized for constructing candidate spanning trees, while obviously inferior edge combinations are excluded. When a portion of the edge combinations can no longer be expanded into a valid spanning tree, the search process for that branch is terminated early.

[0056] By traversing all candidate spanning trees and calculating the sum of their corrected edge weights, the candidate spanning tree with the smallest sum of corrected edge weights can be found. After calculation, the candidate spanning tree containing edges AB, BC, BE, and CD has a corrected edge weight sum of 1.32, which is the smallest among all candidate spanning trees; therefore, it is selected as the optimal spanning tree. After obtaining the optimal spanning tree, it is necessary to determine the energy transmission direction between each device node. This step is based on the energy surplus of each node. Energy surplus refers to the amount of energy remaining after subtracting the energy consumed by the device node from the energy it generates. If a node has a positive energy surplus, it means that the node can output energy; if it is negative, it needs to obtain energy from the outside.

[0057] For each device node in the optimal spanning tree, calculate the energy surplus difference between it and its neighboring nodes. For example, if node A has an energy surplus of +50kW and its neighboring node B has an energy surplus of -30kW, then the energy surplus difference between them is 80kW. Based on this difference, determine the energy flow from A to B. For example, the energy surpluses of the five device nodes are: A (+50kW), B (-30kW), C (+20kW), D (-25kW), and E (-15kW). The optimal spanning tree contains edges AB, BC, BE, and CD. Calculate the energy surplus difference between adjacent nodes: Edge AB: A (+50kW) and B (-30kW), the difference is 80kW, energy flows from A to B; Edge BC: B (-30kW) and C (+20kW), the difference is 50kW, energy flows from C to B; Edge BE: B (-30kW) and E (-15kW), since B has obtained energy from A and C, there is surplus energy, so energy flows from B to E; Edge CD: C (+20kW) and D (-25kW), the difference is 45kW, energy flows from C to D.

[0058] By marking the determined energy transmission directions on each connecting edge of the optimal spanning tree, the final energy network topology is obtained. This structure considers not only the economics of physical connections (by minimizing the sum of corrected edge weights) but also the actual demand for energy transmission (by determining the energy flow direction).

[0059] In practical applications, energy network topology also needs to consider transmission capacity limitations. For example, edge AB can only carry a maximum energy transmission capacity of 100kW. If the calculated energy transmission demand exceeds this value, the network structure needs to be adjusted or additional transmission channels need to be added. In addition, energy surplus varies over time, such as solar power generation varying with sunshine hours and wind power generation varying with wind speed. Therefore, the optimal topology can be calculated separately for different time periods to form a dynamic adjustment scheme.

[0060] Through the above method, the present invention provides an efficient energy network topology optimization scheme, which is applicable to the design and operation optimization of various distributed energy systems, can significantly improve energy utilization efficiency, reduce transmission loss, and provide technical support for realizing energy interconnection.

[0061] In one optional implementation, within each energy subnet, based on a long short-term memory network, the energy matching degree of each device node is predicted. When the energy matching degree is lower than a matching threshold, based on the energy network topology, combined with comprehensive cost and response timeliness scores, the optimal mutual aid transmission path is selected, and the mutual aid benefit weights of the relevant device nodes are calculated, including: In each energy subnet, historical energy production data of each device node is obtained and reconstructed into a state vector; multi-layer convolution and pooling operations are performed on the state vector to obtain multi-scale convolution features; based on the long short-term memory network, the energy matching degree of the device node at the current moment is calculated. When the energy matching degree is lower than the matching threshold, based on the energy network topology, multiple unoccupied device nodes are identified, energy mutual assistance paths are generated, an objective function including comprehensive cost and device node response timeliness score is constructed, and the energy mutual assistance path with the largest objective function value is selected as the optimal mutual assistance transmission path. Calculate the energy transmission value of the equipment node during the mutual assistance period, calculate the voltage fluctuation value of the equipment node before and after mutual assistance, and obtain the mutual assistance benefit weight of each equipment node.

[0062] In practical applications, historical energy production data for each device node in each energy subgrid is acquired. For example, for a solar power generation device node, its hourly power generation data over the past 30 days is collected, forming 720 data points. Similarly, for wind power generation device nodes, their hourly power generation data over the past 30 days is also collected. The collected data is reconstructed into a state vector, which contains the sequence of energy production values ​​for each device node within a time window. For example, if the data from the most recent 24 hours is used as a time window, the state vector dimension is 24. For multiple device nodes, multiple state vectors can be constructed, each corresponding to the time series data of one device node.

[0063] Multi-layer convolution and pooling operations are performed on the state vector to extract multi-scale convolutional features. Specifically, a three-layer convolutional network is used: the first layer uses 32 3×3 convolutional kernels with a stride of 1; the second layer uses 64 3×3 convolutional kernels with a stride of 1; and the third layer uses 128 3×3 convolutional kernels with a stride of 1. Each convolutional layer is followed by a max-pooling layer with a pooling window size of 2×2 and a stride of 2, effectively reducing the feature map size while retaining important features. After convolution and pooling, the resulting feature map is flattened into a one-dimensional vector, which is then used as input to the Long Short-Term Memory (LSTM) network.

[0064] The energy matching degree of a device node at the current moment is calculated using a Long Short-Term Memory (LSTM) network. This network consists of an LSM layer with 128 hidden units, followed by a fully connected layer with 64 neurons, and finally an output layer with 1 neuron. The network input is the convolutional features obtained in the previous step, and the output is the predicted energy matching degree for the current moment, ranging from [0,1]. For example, for a solar power generation device node, if its predicted energy matching degree is 0.85, it means that the node can meet 85% of its energy needs; while for a wind power generation device node, if its predicted energy matching degree is 0.35, it means that the node can only meet 35% of its energy needs.

[0065] A matching threshold of 0.6 is set. When the energy matching degree falls below this threshold, an energy sharing mechanism is triggered. For example, if the energy matching degree of a wind power generation node is 0.35, which is below the threshold of 0.6, additional energy needs to be allocated from other nodes. Based on a pre-built energy network topology, currently unoccupied device nodes are identified. For example, at a certain moment, there are 10 device nodes in the energy network, of which nodes 1, 3, 5, 7, and 9 are unoccupied and can participate in energy sharing. Multiple energy sharing paths are generated. For example, there are three paths from node 1 to node 5: path A passes through nodes 1-2-5, path B passes through nodes 1-3-4-5, and path C passes through nodes 1-6-5.

[0066] For each path, an objective function is constructed, comprehensively considering the overall path cost and the device node response timeliness score. The overall cost includes transmission distance cost and energy loss cost. Transmission distance cost is directly proportional to the total path length. For example, if path A is 10 kilometers long and the cost per kilometer is 5 yuan, then the transmission distance cost is 50 yuan. Energy loss cost is related to the transmission distance and energy type. For example, if the energy loss rate on path A is 2%, and 100 kWh of electricity is transmitted with a loss of 2 kWh, calculated at 0.5 yuan per kWh, the energy loss cost is 1 yuan. The device node response timeliness score reflects the device's response speed. For example, the average response time of node 2 is 0.5 seconds, node 3 is 0.8 seconds, and node 4 is 0.3 seconds. The shorter the response time, the higher the timeliness score. In the specific calculation, the response time is converted into a score; for example, a response time of 0.5 seconds corresponds to a score of 0.9, a response time of 0.8 seconds corresponds to a score of 0.7, and a response time of 0.3 seconds corresponds to a score of 0.95. The timeliness score of a path is a weighted average of the scores of all nodes on that path. By comparing the objective function values ​​of different paths, the path with the highest objective function value is selected as the optimal mutual aid transmission path. For example, if the objective function value of path A is 0.85, the objective function value of path B is 0.72, and the objective function value of path C is 0.78, then path A is selected as the optimal mutual aid transmission path.

[0067] After determining the optimal path, the energy transfer value of each equipment node during the mutual assistance period is calculated. For example, if a wind power generation equipment node has an energy matching degree of 0.35, a demand of 100 kWh, and a shortage of 65 kWh, the system will allocate 65 kWh from other nodes through the optimal mutual assistance transmission path. The voltage fluctuation values ​​of the equipment nodes before and after mutual assistance are calculated. For example, if a node's voltage was 220 V before mutual assistance and 217 V after, the voltage fluctuation is 3 V. Based on the energy transfer value and voltage fluctuation value, the mutual assistance benefit weight of each equipment node is calculated. For example, if a node provides 30 kWh, accounting for 46.15% of the total mutual assistance power, and its voltage fluctuation is 2 V, lower than the system average fluctuation of 3 V, then this node receives a higher benefit weight of 0.55. These benefit weights are used for subsequent energy transaction settlement to ensure a fair distribution of mutual assistance benefits.

[0068] Through the above steps, this invention realizes energy matching degree prediction and optimal mutual assistance transmission path selection based on long short-term memory network, effectively improving energy utilization efficiency and system stability.

[0069] In one optional implementation, the optimal mutual aid transmission path and the mutual aid benefit weight are written into a smart contract, and the smart contract is executed to complete the automatic distribution of benefits, including: Create a master control contract and deploy a data storage contract and an execution logic contract, and write the optimal mutual aid transmission path and the mutual aid benefit weight into the master control contract; Obtain the power supply of each device node in the current time period and the transmission efficiency of the corresponding optimal mutual assistance transmission path. Calculate the cumulative energy of the device node in the current time period to obtain the energy supply contribution weight of the device node. Combine the mutual assistance benefit weight to obtain the benefit distribution weight of the device node. Monitor the operating status of each device node. When the accumulated energy exceeds the energy trigger threshold or the device running time exceeds the time trigger interval, the trigger information will be broadcast to all device nodes. Receive verification information returned by the device nodes. When the number of verification messages exceeds the verification quantity threshold, calculate the total mutual benefit revenue based on the actual transmitted electricity and the transaction price between the device nodes. The total revenue of the mutual aid is allocated according to the revenue allocation weight of the device nodes to obtain the revenue allocation amount of each device node. The revenue allocation amount is written into the data storage contract and the revenue is automatically allocated through the execution logic contract.

[0070] In practical applications, a master control contract needs to be created and deployed, along with auxiliary data storage and execution logic contracts. The master control contract manages the overall logic, the data storage contract stores relevant data, and the execution logic contract handles specific calculations and allocation operations. When creating the master control contract, basic parameters such as the contract owner's address, administrator permission list, and contract effective time need to be set. After the master control contract is created, the system writes the optimal mutual aid transmission path and mutual aid benefit weights into the master control contract. For example, for an energy mutual aid network containing 5 device nodes, the optimal mutual aid transmission path can be represented as a 5×5 matrix, where the element (i,j) represents whether a transmission path from node i to node j exists and its efficiency value; the mutual aid benefit weights can be represented as a vector of length 5, corresponding to the basic benefit weights of each node.

[0071] Periodically acquire the power supply data of each device node within the current time period. Collect real-time power supply data for each device node in kilowatts (kW) within a 15-minute time period. Simultaneously, combine this data with the transmission efficiency data in the optimal mutual aid transmission path to calculate the actual effective power supply of each device node. Transmission efficiency is typically expressed as a percentage; for example, a transmission efficiency of 92% from node A to node B means that if node A outputs 100 kWh of electricity, node B can receive 92 kWh. Accumulate the effective power supply within each time period to obtain the cumulative energy of each device node in the current settlement period. Based on the cumulative energy data, calculate the energy supply contribution weight of each device node. For example, if the cumulative energy of five nodes are 120 kWh, 80 kWh, 150 kWh, 60 kWh, and 90 kWh respectively, their supply contribution weights are 24%, 16%, 30%, 12%, and 18%. Combine these supply contribution weights with the previously set mutual aid benefit weights to obtain the final benefit allocation weight for each device node. If the mutual benefit weights are set to 1.1, 0.9, 1.0, 1.2, and 0.8 respectively, the final benefit distribution weights will be 26.4%, 14.4%, 30%, 14.4%, and 14.4%.

[0072] The system continuously monitors the operational status of each device node, including its accumulated energy value and runtime. When the accumulated energy of any device node exceeds a preset energy trigger threshold (e.g., 500 kWh), or the runtime of the current settlement period exceeds a time trigger interval (e.g., 24 hours), the trigger information is automatically broadcast to all participating device nodes. The trigger information includes key data such as the current trigger conditions, total accumulated energy, and a list of participating nodes. Upon receiving the trigger information, each device node must return verification information to confirm the accuracy of the data for the current settlement period. The master contract receives and counts the verification information. When the number of verification messages exceeds a preset verification threshold (e.g., 67% of the total number of nodes, i.e., at least 4 nodes need to confirm in this example), the data for the current settlement period is considered valid. At this point, the total mutual aid revenue is calculated based on the actual electricity transmitted between device nodes and the negotiated transaction price. If a total of 500 kWh of electricity was traded in this settlement period, and the average transaction price was 0.8 yuan / kWh, then the total mutual aid revenue would be 400 yuan.

[0073] Based on the previously calculated revenue distribution weights for each device node, the system allocates the total mutual aid revenue. Continuing the example above, according to the distribution weights of 26.4%, 14.4%, 30%, 14.4%, and 14.4%, the five nodes receive revenues of 105.6 yuan, 57.6 yuan, 120 yuan, 57.6 yuan, and 57.6 yuan respectively. These revenue distribution amounts are written into the data storage contract, recording information including node identifier, revenue amount, and settlement time. Subsequently, the execution logic contract is triggered, automatically executing the revenue distribution operation. The execution logic contract checks the account status of each node to ensure the account is valid and transfers the corresponding amount to the account address of each node. At the same time, the contract generates a transaction certificate containing information such as transaction hash value, timestamp, and amount, and synchronizes the certificate to all participating nodes to ensure transparent and traceable transactions. The entire process requires no manual intervention, achieving fully automated allocation of energy mutual aid revenue.

[0074] In addition, there is an exception handling mechanism. When a node goes offline or data is inconsistent, an arbitration procedure will be initiated, and other nodes will vote to ensure that the smart contract can still operate normally and distribute the benefits fairly, even if some nodes fail.

[0075] This invention relates to an IoT-based distributed energy revenue automatic distribution system, comprising: The first unit is used to receive energy data sent by multiple distributed energy devices through an Internet of Things communication gateway; and to divide the multiple distributed energy devices into multiple energy subnets according to their geographical location and power supply range, using the multiple distributed energy devices as device nodes. The second unit is used to perform energy transmission in each energy subnet. It unifies the time base of each device node through a distributed clock synchronization protocol, calculates the communication delay between device nodes in real time, and automatically switches to a backup communication path and calculates the response timeliness score of the device node when the communication delay exceeds the delay threshold. The third unit is used to construct an energy network topology based on the energy production data, calculate the energy transmission distance and line loss between equipment nodes, and calculate the comprehensive cost of each transmission path in combination with the load rate of each equipment node. The fourth unit is used to predict the energy matching degree of each device node in each energy subnet based on the long short-term memory network. When the energy matching degree is lower than the matching threshold, the optimal mutual assistance transmission path is selected based on the energy network topology map, combined with the comprehensive cost and response timeliness score, and the mutual assistance benefit weight of the relevant device nodes is calculated. The fifth unit is used to write the optimal mutual aid transmission path and mutual aid benefit weight into the smart contract, and execute the smart contract to complete the automatic distribution of benefits.

[0076] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0077] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An automatic distribution method for distributed energy revenue based on IoT, characterized in that, include: Receive energy data sent by multiple distributed energy devices through an IoT communication gateway; The multiple distributed energy devices are used as device nodes and divided into multiple energy subnetworks according to their geographical location and power supply range; Energy transmission is performed in each energy subnet. The time base of each device node is unified through a distributed clock synchronization protocol. The communication delay between device nodes is calculated in real time. When the communication delay exceeds the delay threshold, the backup communication path is automatically switched and the response timeliness score of the device node is calculated. Based on the energy production data, an energy network topology is constructed, and the energy transmission distance and line loss between device nodes are calculated. Combined with the load rate of each device node, the comprehensive cost of each transmission path is calculated. In each energy subnet, based on the long short-term memory network, the energy matching degree of each device node is predicted. When the energy matching degree is lower than the matching threshold, based on the energy network topology, combined with the comprehensive cost and response timeliness score, the optimal mutual assistance transmission path is selected, and the mutual assistance benefit weight of the relevant device nodes is calculated. The optimal mutual aid transmission path and mutual aid benefit weight are written into the smart contract, and the smart contract is executed to complete the automatic distribution of benefits.

2. The method according to claim 1, characterized in that, Energy transmission is performed in each energy subnet. A distributed clock synchronization protocol unifies the time base of each device node, and communication latency between device nodes is calculated in real time. When the communication latency exceeds a latency threshold, an alternative communication path is automatically switched, and the response timeliness score of each device node is calculated, including: Multiple device nodes within the energy subnet are divided into source device nodes and target device nodes for energy transmission according to their communication connection relationships, and their energy transmission timestamps are recorded. The clock deviation between device nodes is calculated based on the energy timestamps. Combined with the historical clock deviation sequence, the clock deviation is corrected using a Kalman filter algorithm to obtain the clock reference value for each device node. Based on the clock reference value, the communication delay during the communication process of each device node is monitored. When the communication delay exceeds the delay threshold, an alternative communication path is identified based on the communication connection relationship. Based on the delay fluctuation data of each alternative communication path, the reliability score of each alternative communication path is calculated. The alternative communication path with the highest reliability score and a load rate lower than the load threshold is selected as the optimal path, and the communication data is switched from the original path to the optimal path. The response timeliness score of a device node is calculated based on the communication latency and path switching frequency during the communication process.

3. The method according to claim 2, characterized in that, The clock skew between device nodes is calculated based on the energy timestamp. Combined with historical clock skew sequences, a Kalman filter algorithm is used to correct the clock skew, resulting in the clock reference value for each device node, including: Energy timestamp data of device nodes are continuously collected within a sliding time window, and the clock deviation value at each sampling moment is calculated to form a historical clock deviation sequence. Based on the historical clock deviation sequence, a state vector is formed by the clock deviation value and the rate of change of clock deviation, and the covariance matrix is ​​obtained by combining the standard deviation of the historical clock deviation sequence. Based on the state vector and the covariance matrix, the state prediction equation is used to calculate the predicted value of the state vector at the next moment. The deviation between the predicted value and the actual measured value is used as the prediction error. The Kalman gain is adaptively adjusted based on the prediction error, and the optimal estimate of the state vector is recalculated. The local clock of each device node is corrected in real time based on the optimal estimate to obtain the clock reference value of each device node.

4. The method according to claim 1, characterized in that, Based on the energy production data, an energy network topology is constructed, and the energy transmission distance and line loss between device nodes are calculated. Combining the load rate of each device node, the comprehensive cost of each transmission path is calculated, including: Credit scores are calculated based on historical energy production data of device nodes, edge weights are determined by physical distance, edge selection relationships are established based on the energy surplus ratio and edge weights between device nodes, and the minimum spanning tree algorithm is used for structural optimization to obtain the energy network topology. Based on the energy network topology, the Euclidean distance between the current device node and its connected device nodes is obtained. A nonlinear function of the ratio of the current device node's transmission power to its rated power is calculated and multiplied by the Euclidean distance to obtain the energy transmission distance of each transmission path. Based on the energy transmission distance, combined with the transmission current and line resistance, the basic loss is calculated. The basic loss is corrected based on the power change rate and the transmission path curvature to obtain the line loss of each transmission path. Based on the difference between the line loss and the load rate between the device nodes, the comprehensive cost of each transmission path is obtained.

5. The method according to claim 4, characterized in that, Credit scores are calculated based on historical energy production data of device nodes. Edge weights are determined by combining physical distance. Edge connections are established based on the energy surplus ratio between device nodes and edge weights, including: Historical energy production data of equipment nodes are acquired, and node evaluation characteristics are calculated. Based on the node evaluation characteristics, a credit score for the equipment nodes is obtained. Based on the physical distance and load power between equipment nodes, the original edge weights between equipment nodes are calculated. According to the credit score, the original edge weights are corrected to obtain corrected edge weights. The energy surplus value is obtained by subtracting the load power from the power generation of the device node. The energy surplus ratio is obtained by calculating the ratio of the energy surplus values ​​of adjacent device nodes. When the corrected edge weight between device nodes is less than the edge weight threshold and the energy surplus ratio is negative, an edge connection relationship is established between the device nodes.

6. The method according to claim 4, characterized in that, The minimum spanning tree algorithm is used for structural optimization to obtain the energy network topology, including: Based on the edge connection relationships between device nodes, the search space is constructed by adding connecting edges layer by layer starting from the first layer. The number of connecting edges added at each layer is determined by the layer number. The added connecting edges are not repeated between different layers and do not form loops. Each edge combination in the search space is used as a candidate spanning tree. Traverse each candidate spanning tree, extract the connecting edges with edge selection relationships, calculate the sum of their corrected edge weights, and select the candidate spanning tree with the smallest sum of corrected edge weights as the optimal spanning tree; Obtain the neighboring device node information of each device node in the optimal spanning tree, calculate the energy surplus difference between each device node and its neighboring device nodes, determine the energy transmission direction based on the energy surplus difference, mark the determined energy transmission direction on the optimal spanning tree, and obtain the final energy network topology.

7. The method according to claim 1, characterized in that, In each energy subnet, based on a long short-term memory network, the energy matching degree of each device node is predicted. When the energy matching degree is lower than the matching threshold, based on the energy network topology, combined with the comprehensive cost and response timeliness scores, the optimal mutual aid transmission path is selected, and the mutual aid benefit weights of the relevant device nodes are calculated, including: In each energy subnet, historical energy production data of each device node is obtained and reconstructed into a state vector; multi-layer convolution and pooling operations are performed on the state vector to obtain multi-scale convolution features; based on the long short-term memory network, the energy matching degree of the device node at the current moment is calculated. When the energy matching degree is lower than the matching threshold, based on the energy network topology, multiple unoccupied device nodes are identified, energy mutual assistance paths are generated, an objective function including comprehensive cost and device node response timeliness score is constructed, and the energy mutual assistance path with the largest objective function value is selected as the optimal mutual assistance transmission path. Calculate the energy transmission value of the equipment node during the mutual assistance period, calculate the voltage fluctuation value of the equipment node before and after mutual assistance, and obtain the mutual assistance benefit weight of each equipment node.

8. The method according to claim 1, characterized in that, The optimal mutual aid transmission path and the mutual aid benefit weight are written into a smart contract, and the smart contract is executed to complete the automatic distribution of benefits, including: Create a master control contract and deploy a data storage contract and an execution logic contract, and write the optimal mutual aid transmission path and the mutual aid benefit weight into the master control contract; Obtain the power supply of each device node in the current time period and the transmission efficiency of the corresponding optimal mutual assistance transmission path. Calculate the cumulative energy of the device node in the current time period to obtain the energy supply contribution weight of the device node. Combine the mutual assistance benefit weight to obtain the benefit distribution weight of the device node. Monitor the operating status of each device node. When the accumulated energy exceeds the energy trigger threshold or the device running time exceeds the time trigger interval, the trigger information will be broadcast to all device nodes. Receive verification information returned by the device nodes. When the number of verification messages exceeds the verification quantity threshold, calculate the total mutual benefit revenue based on the actual transmitted electricity and the transaction price between the device nodes. The total revenue of the mutual aid is allocated according to the revenue allocation weight of the device nodes to obtain the revenue allocation amount of each device node. The revenue allocation amount is written into the data storage contract and the revenue is automatically allocated through the execution logic contract.

9. An IoT-based distributed energy revenue automatic distribution system, used to implement the method as described in any one of claims 1-8, characterized in that, include: The first unit is used to receive energy data sent by multiple distributed energy devices through an Internet of Things (IoT) communication gateway; The multiple distributed energy devices are used as device nodes and divided into multiple energy subnetworks according to their geographical location and power supply range; The second unit is used to perform energy transmission in each energy subnet. It unifies the time base of each device node through a distributed clock synchronization protocol, calculates the communication delay between device nodes in real time, and automatically switches to a backup communication path and calculates the response timeliness score of the device node when the communication delay exceeds the delay threshold. The third unit is used to construct an energy network topology based on the energy production data, calculate the energy transmission distance and line loss between equipment nodes, and calculate the comprehensive cost of each transmission path in combination with the load rate of each equipment node. The fourth unit is used to predict the energy matching degree of each device node in each energy subnet based on the long short-term memory network. When the energy matching degree is lower than the matching threshold, the optimal mutual assistance transmission path is selected based on the energy network topology map, combined with the comprehensive cost and response timeliness score, and the mutual assistance benefit weight of the relevant device nodes is calculated. The fifth unit is used to write the optimal mutual aid transmission path and mutual aid benefit weight into the smart contract, and execute the smart contract to complete the automatic distribution of benefits.

10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 8.