Electric energy meter data distributed storage method based on improved PoS consensus
By introducing the weight computer system and spatiotemporal characteristic analysis of grid load perception into the power blockchain, dynamically adjusting node weights and optimizing data sharding, the problem of insufficient correlation between power load fluctuations and consensus efficiency is solved, and system performance and adaptability are improved.
Patent Information
- Application Number
- CN202510388027.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The existing technology has insufficient correlation with the fluctuations in power load and consensus efficiency. The traditional PoS mechanism has failed to dynamically adjust the node weight to deal with changes in power grid load, resulting in disconnection between resource allocation and grid demand. At the same time, the spatio-temporal characteristics of the power meter data are low in matching with the traditional sharding strategy, which increases the overhead of cross-shashing query and reduces system efficiency.
By introducing a weight computer system for grid load perception, the node weights in the PoS consensus are dynamically adjusted, combined with the spatiotemporal and spatial characteristics analysis of the electricity meter data, the electricity meter clustering is constructed, and a spatiotemporal optimization sharding scheme is designed to optimize node grouping and data sharding.
It effectively solves the problem of disconnection between power blockchain resource allocation and power grid demand, improves the performance and adaptability of the system, reduces cross-slice query overhead, and improves system efficiency.
Smart Images

Figure CN119902721A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to power electronics technology, and in particular to a distributed storage method for electric energy meter data based on improved PoS consensus. Background Art
[0002] With the in-depth advancement of smart grid construction, the amount of data generated by electricity meters has exploded, posing severe challenges to data storage and processing systems. Traditional centralized storage faces capacity bottlenecks, single point failure risks and data credibility issues, while blockchain distributed storage provides a new solution for electricity meter data management with its tamper-proof, traceable and decentralized characteristics. The construction of power blockchain is of great significance to promoting the transparency of power market transactions, improving the intelligence of power grid dispatching and ensuring data security and reliability. Especially in the context of smart microgrids and energy Internet, the blockchain-based electricity meter data storage method can realize decentralized collaboration involving multiple parties, provide infrastructure support for energy data value mining and intelligent decision-making, and has important research value for promoting the construction of energy Internet ecology and the digital transformation of power systems.
[0003] At present, the research on blockchain storage of electric energy meter data mainly focuses on basic consensus mechanism and simple sharding strategy. In terms of consensus mechanism, researchers mostly use standard PoW (proof of work) or PoS (proof of stake) algorithms, and some work attempts to introduce reputation mechanism or identity authentication to enhance security; in terms of data sharding, random sharding based on hash function or simple geographical partitioning strategy is mainly adopted. In data storage design, unified storage strategy is mostly adopted; verification mechanism mainly relies on general cryptographic verification. In terms of system adaptability, static configuration parameters are mostly used, and the response ability to changes in grid load is limited.
[0004] In summary, the existing technology faces two key technical problems: on the one hand, there is insufficient correlation between power load fluctuations and consensus efficiency. The traditional PoS mechanism does not take into account the operating status of the underlying physical system (such as the power grid), resulting in the resource allocation of the blockchain system being out of touch with the actual needs of the power grid, and unable to prioritize key data processing when the power grid load is peak or fluctuating violently; on the other hand, the temporal and spatial characteristics of meter data have a low match with the sharding strategy. The meter data has a unique temporal and spatial correlation (the electricity consumption patterns of adjacent meters and similar users are highly similar), while the traditional hash-based random sharding strategy disperses related data to different shards, increasing the cross-shard query overhead and reducing system efficiency. Summary of the invention
[0005] Purpose of the invention: To provide a distributed storage method for electric energy meter data based on improved PoS consensus, in order to solve the above technical problems.
[0006] Technical solution: A distributed storage method for electric energy meter data based on improved PoS consensus, comprising the following steps:
[0007] Obtain the electric energy meter data, analyze its spatiotemporal characteristics, form electric energy meter clusters, and construct a spatiotemporal characteristic model of the electric energy meter data;
[0008] Obtain blockchain network node information, calculate node performance indicators and network delay between nodes;
[0009] Based on the spatiotemporal characteristic model of electric energy meter data, node performance indicators and network delay, nodes are grouped into node clusters, and the affinity between meter clusters and node clusters is calculated;
[0010] Based on affinity, the meters are clustered into node clusters and responsibilities are assigned to the nodes;
[0011] When working, the data access characteristics of each meter cluster are obtained and designed, the data heat evaluation function is designed, the hot data replication strategy and data life cycle management strategy are formulated, and the time-space optimized sharding solution is output.
[0012] Beneficial effects: The present invention introduces a grid load-aware weight calculation mechanism to enable the PoS consensus to dynamically adjust node weights according to the grid load status. At the same time, based on the spatiotemporal characteristic analysis of the electricity meter data, the meter clustering is constructed and the spatiotemporal optimized shard allocation is performed, which effectively solves the above technical problems and significantly improves the performance and adaptability of the power blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a flow chart of the present invention.
[0014] Figure 2 It is a flow chart of step S1 of the present invention.
[0015] Figure 3 It is a flow chart of step S2 of the present invention.
[0016] Figure 4 It is a flow chart of step S3 of the present invention.
[0017] Figure 5 It is a flow chart of step S4 of the present invention.
[0018] Figure 6 It is a flow chart of step S5 of the present invention. DETAILED DESCRIPTION
[0019] In order to make the technical problem of the present invention clearer, the following provides embodiments of the present invention and gives a more comprehensive description. However, the specific embodiments given here are only used to explain the present invention and are not used to limit the use environment and scope of the invention.
[0020] When processing the data of electric energy meters: First, the data of electric energy meters has significant temporal and spatial correlation, and the electricity consumption patterns of adjacent electric energy meters or similar users are often highly similar. The current hash-based sharding strategy causes the relevant data to be randomly dispersed to different shards, increasing the cross-shard query overhead; second, the load of the power system has obvious time-varying characteristics, but the existing PoS consensus lacks the ability to perceive this and cannot dynamically adjust the node weight according to the load status, making the system resource allocation out of touch with the actual needs of the power grid; third, the access to the data of the electric energy meter is unbalanced, some real-time monitoring data is frequently accessed while historical data is rarely used, and the unified storage strategy leads to congestion in accessing hot data and waste of cold data storage; fourth, the power data must comply with the physical constraints of the power system, and the existing verification mechanism only focuses on data integrity and source authentication, and cannot detect abnormal data that meets cryptographic requirements but violates physical laws; fifth, the static sharding configuration cannot adapt to the changes in the topology of the power grid and the evolution of the load distribution. As time goes by, the system performance gradually declines, but there is a lack of effective adaptive adjustment mechanism. In addition, there is a lack of clear mapping relationship between blockchain nodes and physical facilities of the power grid, which makes it difficult to optimize the allocation of related node resources according to the load status of the substation, affecting the system's response capabilities in power grid emergencies.
[0021] Therefore, a distributed storage method for electric energy meter data based on improved PoS consensus is proposed. Figure 1 As shown, including:
[0022] Step S1: Improvement of the PoS consensus mechanism for grid load awareness, including:
[0023] Obtain regional real-time load data and substation load data from the SCADA system, apply sliding window average processing to the regional real-time load data, and calculate the load fluctuation index; determine the current load status based on the smoothed load data and load fluctuation index, combined with the preset threshold; obtain the original staked amount, regional information and historical reliability index of the node from the blockchain network, and calculate the adjusted staked amount; calculate the node weight after load adjustment based on the load status, substation load data, adjusted staked amount and node regional information, and use it in the subsequent consensus process; the specific process is as follows:
[0024] Step S11, obtaining regional real-time load data and substation load data from the SCADA system, applying a 15-minute sliding window average to the regional real-time load data to obtain smoothed load data, and obtaining a load fluctuation index by calculating a square root formula;
[0025] Step S12, receiving smoothed load data and load fluctuation index, classifying the grid load state into high load high fluctuation, high load low fluctuation, low load high fluctuation or low load low fluctuation according to preset load threshold and fluctuation threshold, and outputting the current load state and substation load data;
[0026] Step S13: Obtain the original pledge amount, regional information, and historical reliability index of each node from the blockchain network, and calculate the adjusted pledge amount according to the historical reliability adjustment formula;
[0027] Step S14, receiving the load status, substation load data, adjusted pledge amount and node area information, associating the node with the corresponding substation, setting the weight adjustment factor according to different load status, calculating the load status adjustment item, and finally obtaining the node weight after load adjustment.
[0028] Step S2: Analysis of spatiotemporal characteristics of electric energy meter data and model construction, including:
[0029] The original data of historical electric energy meters are obtained from the electric energy meter database, and data cleaning and time regularization are performed to obtain regularized electric energy meter data; the daily load curve and weekly load curve are extracted from the regularized electric energy meter data, and the time similarity matrix is calculated; the geographical location information of the electric energy meters and the power grid topology are obtained from the power grid topology database, the electrical distance and geographical distance between the electric energy meters are calculated, and the spatial similarity matrix is generated; the temporal similarity matrix and the spatial similarity matrix are combined to calculate the spatiotemporal similarity, and the hierarchical clustering algorithm is applied to form electric energy meter clusters, extract clustering feature vectors, and construct the spatiotemporal characteristic model of electric energy meter data; the specific process is as follows:
[0030] Step S21, obtaining the historical electric energy meter original data of the past 30 days from the electric energy meter database, performing data cleaning, removing abnormal values, obtaining cleaned electric energy meter data, performing time regularization on the cleaned electric energy meter data, unifying the sampling interval to 15 minutes, and outputting the regularized electric energy meter data;
[0031] Step S22, receiving the regularized meter data, extracting the daily load curve and weekly load curve of each meter, extracting the spectrum characteristics of the meter data using Fourier transform, and calculating the time similarity matrix between the meters based on the spectrum characteristics and the load curve;
[0032] Step S23, obtaining the geographical location information of the electric meters and the topological structure of the electric grid from the electric grid topology database, calculating the electrical distance and geographical distance between the electric meters, and combining the two distance indicators to calculate the spatial similarity matrix between the electric meters;
[0033] Step S24, receiving the time similarity matrix and the space similarity matrix, applying weights to calculate the spatiotemporal similarity, using a hierarchical clustering algorithm to divide the electric meters into several clusters, extracting the eigenvector of each cluster, establishing a mapping relationship between the electric meters and the clusters, and constructing a spatiotemporal characteristic model of the electric energy meter data including the similarity matrix, clusters and eigenvectors.
[0034] Step S3: Design of spatiotemporal-aware sharding strategy, including:
[0035] Obtain the network node list and the computing power, storage capacity and network bandwidth of each node from the blockchain network monitoring module, and calculate the comprehensive performance index; obtain the node geographic location information and network delay matrix; cluster the nodes into node clusters based on the spatiotemporal characteristic model of the electric energy meter data, node performance indicators, node geographic location and network delay matrix, assign electric meter clusters to each node cluster, and design the node responsibilities within the shard; design the intra-shard communication protocol and inter-shard communication protocol, build the shard routing table and inter-shard data consistency protocol; design the data heat evaluation function based on the electric energy meter data access mode, formulate the hot data replication strategy and data life cycle management strategy, and output the spatiotemporal optimized sharding plan; the specific process is as follows:
[0036] Step S31: Obtain the currently active network node list and the computing power, storage capacity and network bandwidth of each node from the blockchain network monitoring module, apply weights to calculate the comprehensive performance index of each node, obtain the geographical location information of each node and the network delay matrix between nodes;
[0037] Step S32, receiving the spatiotemporal characteristic model of electric energy meter data, node performance indicators, node geographic location and network delay matrix, applying the K-means algorithm to cluster active nodes according to geographic location and network delay to form node clusters; calculating the affinity between the electric energy meter clusters and the node clusters, solving the optimal allocation problem, and determining the mapping relationship between the electric energy meter clusters and the node clusters; subdividing the node responsibilities in each node cluster, including the primary sharding node, the backup node and the verification node, and generating a spatiotemporal optimized sharding scheme;
[0038] Step S33: Receive the spatiotemporally optimized sharding scheme, design the intra-shard communication protocol, including the data synchronization message format and the consensus message format; design the inter-shard communication protocol, including the cross-shard query message format and the cross-shard transaction message format; establish a shard routing table, including the scope of responsibility and communication address of each shard; formulate an inter-shard data consistency protocol to handle data update operations involving multiple shards;
[0039] Step S34, receiving the spatiotemporal optimized sharding scheme and the spatiotemporal characteristic model of the electric energy meter data, designing a data heat evaluation function to evaluate the access frequency of the electric energy meter data, formulating a hot data replication strategy based on the function, and replicating the frequently accessed data between nodes; according to the time characteristics of the electric energy meter data, designing a data lifecycle management strategy, including data compression, archiving and cleaning strategies, and updating and outputting the final spatiotemporal optimized sharding scheme.
[0040] Step S4: Adaptive consensus and sharding dynamic adjustment mechanism, including:
[0041] Periodically obtain the latest regional real-time load data and substation load data, calculate the current load state, and predict the predicted load state sequence for the next hour; adjust the consensus parameters, including the number of verification nodes and block time interval, and update the verifier selection probability according to the load state, predicted load state sequence, and load-adjusted node weight; evaluate the performance indicators of the current spatiotemporal optimized sharding scheme, including the cross-shard transaction ratio, node load balance, and data access latency, and set the sharding adjustment threshold function; when the performance indicator exceeds the threshold, trigger the sharding adjustment, redesign the sharding scheme based on the latest spatiotemporal characteristic model of the electric energy meter data and the load state, formulate a smooth transition strategy, complete the sharding adjustment, and output the adaptive sharding storage strategy; the specific process is:
[0042] Step S41, receiving the latest regional real-time load data and substation load data every 5 minutes, applying the above method to calculate the current load state, using the time series prediction model to process the historical load data, and predicting the load state sequence every 5 minutes in the next hour;
[0043] Step S42: receiving the load status, the predicted load status sequence and the node weight after load adjustment, adjusting the consensus parameters according to the load status, including the number of verification nodes and the block time interval; updating the probability of each node being selected as a verifier, and outputting the adjusted consensus parameters;
[0044] Step S43: Receive the spatiotemporally optimized sharding scheme, load status, and predicted load status sequence, calculate the performance indicators of the current sharding scheme, including the cross-sharding transaction ratio, node load balance, and data access latency; design a sharding adjustment threshold function based on the load status, and trigger sharding adjustment when the performance indicator exceeds the threshold; formulate a pre-adjustment plan when the predicted load status shows that there will be significant changes in the future;
[0045] Step S44, receiving the sharding adjustment flag, performance indicators, pre-adjustment plan, spatiotemporal optimized sharding scheme and spatiotemporal characteristic model of the electric energy meter data; when sharding adjustment is required, redesigning the sharding scheme based on the latest status; formulating a smooth transition strategy, including a data migration plan, a transition time window and a switching checkpoint; executing the transition strategy, completing the sharding adjustment, updating and outputting the adaptive sharding storage strategy, including the updated sharding scheme, dynamic adjustment strategy and performance monitoring indicator definition.
[0046] Step S5: Data consistency assurance and verification mechanism, including:
[0047] Obtain the grid topology and electrical parameters from the power system model library and establish a power flow model; extract the power usage pattern library from historical data and establish an energy balance constraint model; design data verification rules based on the power system physical constraint model and adaptive sharding storage strategy to form a verification rule set, including basic verification rules, physical constraint-based verification rules and inter-shard consistency verification rules; build a hierarchical verification architecture, design verification task allocation algorithms and verification result consensus mechanisms; establish an abnormal pattern library, implement a variety of anomaly detection algorithms, and design an abnormality handling process; execute a distributed verification process, collect the results of all verification nodes, apply the verification result consensus mechanism to obtain the final verification result, trigger the abnormality handling process, and output the verified trusted data and verification report; the specific process is as follows:
[0048] Step S51: Obtain the grid topology and electrical parameters from the power system model library, and establish a power flow model for verifying the physical rationality of the power meter data; extract a power usage pattern library containing typical power usage patterns of various users from historical data; establish an energy balance constraint model that expresses the balance relationship between input power and consumed power; integrate the above models and output a power system physical constraint model;
[0049] Step S52: Receive the power system physical constraint model and the adaptive shard storage strategy, design basic verification rules, including data format verification, timestamp verification, and digital signature verification; design verification rules based on physical constraints, including power balance verification, power flow constraint verification, and usage mode verification; design inter-shard consistency verification rules, including cross-shard data consistency verification and shard boundary verification; set execution conditions and priorities for each verification rule, and output a verification rule set;
[0050] Step S53: Receive the verification rule set and the adaptive shard storage strategy, build a hierarchical verification architecture including intra-node verification, intra-shard verification, and cross-shard verification; design a verification task allocation algorithm that allocates verification tasks according to verification type and node capability; design a verification result consensus mechanism that ensures the consistency of verification results; and output a distributed verification process;
[0051] Step S54: Receive the electric energy meter data and the distributed verification process, establish an abnormal pattern library containing common abnormal patterns; implement anomaly detection algorithms, including rule-based detection, statistical anomaly detection, and machine learning anomaly detection; design an abnormality handling process, including abnormality classification, handling strategy, and recovery mechanism; output anomaly detection and handling mechanism;
[0052] Step S55, receiving the electric energy meter data, the distributed verification process and the anomaly detection and processing mechanism, executing the verification process, including intra-node verification, intra-shard verification and cross-shard verification; collecting the verification results of all verification nodes, and applying the verification result consensus mechanism to obtain the final verification result; triggering the exception handling process when an anomaly is found; marking the verified data as verified trusted data; generating a verification report including the verification process, results and handling of abnormal situations.
[0053] According to one aspect of the present application, step S11 is specifically:
[0054] Step S111: extract the regional real-time load data L(t) of the last 24 hours from the real-time database of the SCADA system, including the timestamp t and the corresponding regional total load value; obtain the substation load data LS(i, t) of each substation from the substation monitoring module of the SCADA system, where i is the substation identifier and t is the corresponding timestamp; perform integrity check on the obtained original data, mark and interpolate missing data points, and output complete regional real-time load data L(t) and substation load data LS(i, t);
[0055] Step S112, receive the complete regional real-time load data L(t), define the sliding window length T=15 minutes, and for the current time t, extract the load data subset within the time range [tT, t]; calculate the load average value L(t)=(1 / T)·∑L(τ) within the time window, where τ∈[tT, t]; repeat the above process, calculate the sliding average for each time point in the past 24 hours, and form a smoothed load data L(t) time series; store the smoothed load data L(t) in a temporary data cache for subsequent calculations and load state determination;
[0056] Step S113, receiving the real-time load data L(t) of the area and the smoothed load data L*(t) generated in step S112, for the current time t, extracting the original load data L(τ) and the corresponding smoothed load value L*(t) within the time range [tT, t]; calculating the square difference between the original load and the smoothed load at each time point (L(τ)-L*(t))²; calculating the mean of the square differences and taking the square root to obtain the load fluctuation index V(t)=√(1 / (T-1)·∑(L(τ)-L*(t))²), τ∈[tT, t]; repeating the above process to calculate the load fluctuation index V(t) at each time point in the past 24 hours; outputting the smoothed load data L*(t) and the load fluctuation index V(t) to step S12 for load state classification and evaluation;
[0057] Step S114: For each key node in the distribution network, obtain node voltage data V(n,t) and node current data I(n,t) from the SCADA system, where n is the node identifier and t is the timestamp; then the node apparent power S(n,t) = V(n,t)·I(n,t), active power P(n,t) = S(n,t)·cosφ(n,t) and reactive power Q(n,t) = S(n,t)·sinφ(n,t), where φ(n,t) is the corresponding power factor angle; apply sliding window averaging to the calculated node power data P(n,t) and node reactive power data Q(n,t) to obtain smoothed node power data P(n,t) and smoothed node reactive power data Q(n,t); associate these power data with the corresponding substation to form enhanced substation load data LS+(i,t), which includes original load and power component information; output the substation load data LS+(i,t) to step S12 to provide more comprehensive load characteristic information.
[0058] In this way, step S11 outputs smoothed load data L*(t), load fluctuation index V(t) and enhanced substation load data LS+(i, t) by acquiring and preprocessing grid load data, providing the necessary data basis for subsequent load status classification and evaluation.
[0059] According to one aspect of the present application, the load perception weight calculation in step S14 is specifically as follows:
[0060] Step S141: Receive the load status S(t), substation load data LS+(i,t), the adjusted pledge amount P'(j) and node area information R(j), and construct a node-substation mapping matrix M(j,i); for each node j, determine its geographic coordinates (x_j, y_j) according to its area information R(j); for each substation i, obtain its geographic coordinates (x_i, y_j) from the power grid topology database y_i); Calculate the geographical distance d(j,i)=√((x_j-x_i)²+(y_j-y_i)²) from each node j to each substation i; Set the threshold d_threshold according to the distance. When d(j,i)≤d_threshold, set M(j,i)=1, indicating that node j is associated with substation i, otherwise set M(j,i)=0; For nodes whose distances to multiple substations are less than the threshold, select the substation closest to it as the primary association and the second closest as the secondary association, and assign M(j,i_primary)=1 and M(j,i_secondary)=0.5 respectively; Output the node-substation mapping matrix M(j,i) for subsequent load state adjustment calculations;
[0061] Step S142, receiving the load state S(t) and the node-substation mapping matrix M(j,i), querying the preset weight adjustment strategy table according to the current load state S(t), and assigning benchmark adjustment factors to different load states; when the load state S(t)=HH (high load and high fluctuation), setting the benchmark adjustment factor α_base=0.7; when the load state S(t)=HL (high load and low fluctuation), setting the benchmark adjustment factor α_base=0.9; when the load state S(t)=LH (low load and high fluctuation), setting the benchmark adjustment factor α_base =0.8; when the load state S(t)=LL (low load and low fluctuation), set the benchmark adjustment factor α_base=1.0; consider the topology of the distribution network and security constraints, use the advanced power system analysis software to calculate the power supply importance index SI(i) of each substation; combine the benchmark adjustment factor and the power supply importance index to calculate the substation weight adjustment factor α(i,S(t))=α_base·(0.8+0.2·SI(i)) for each substation i; output the substation weight adjustment factor α(i,S(t)) for fine adjustment of node weights;
[0062] Step S143, receiving substation load data LS+(i,t), substation weight adjustment factor α(i,S(t)), adjusted pledge amount P'(j) and node-substation mapping matrix M(j,i), for each substation i, calculate its load proportional factor LP(i,t)=LS+(i,t) / max(LS+(t)), normalized to the interval [0,1]; calculate deviation factor LD(i,t)=|LP(i,t)-0.5| / 0.5, indicating the degree of load deviation from the median; calculate load state adjustment term β(i,t )=1-LD(i,t), so that the substation with load close to the average level gets a higher weight; for each node j, the comprehensive load adjustment coefficient γ(j,t)=∑[M(j,i)·α(i,S(t))·β(i,t)] is used to accumulate the adjustment contributions of all substations associated with it; finally, the node weight after load adjustment W(j,t)=P'(j)·γ(j,t) is calculated, taking into account the influence of node pledge amount and load status; the node weight after load adjustment W(j,t) is output for the subsequent consensus process and adaptive sharding adjustment in S4;
[0063] According to one aspect of the present application, the time characteristic analysis in step S22 is specifically as follows:
[0064] Step S221, receive the regularized meter data M''(k,t), for each meter k, extract the data subset of the last 7 days; for each hour h∈[0,23], calculate the average power consumption of the same hour of each day to form the hourly average load D_avg(k,h); calculate the standard deviation of the load of the same hour of each day to form the hourly load fluctuation D_std(k,h); combine the average value and standard deviation to generate a daily load curve D(k,h)={D_avg(k,h),D_std(k,h)} containing the mean and fluctuation range; apply wavelet transform to the daily load curve D(k ,h) to obtain the smooth daily load curve D_smooth(k,h); calculate the normalized indicators of the daily load curve, including the peak-to-valley ratio PVR(k)=max(D_avg(k,h)) / min(D_avg(k,h)), the load factor LF(k)=avg(D_avg(k,h)) / max(D_avg(k,h)) and the peak PT(k)=argmax_h(D_avg(k,h)); output the daily load curve D(k,h) and the daily load characteristic indicator set DF(k)={PVR(k), LF(k), PT(k)} for subsequent similarity calculation;
[0065] Step S222, receiving the regularized meter data M''(k,t), for each meter k, extracting the data of the latest 4 weeks; for each day of the week d∈[1,7], calculating the total power consumption of the day to form the daily total power consumption W_total(k,d,w), where w represents the number of weeks; calculating the average power consumption on the same day within 4 weeks to form the average daily load W_avg(k,d); calculating the standard deviation of the power consumption on the same day within 4 weeks to form the daily load fluctuation W_std(k,d); combining the average value and the standard deviation to generate a weekly load curve W(k,d)={W_avg(k,d), W_std(k,d)} containing the mean and the fluctuation range; outputting the weekly load curve W(k,d) and the weekly load characteristic index set WF(k)={WWR(k), WCV(k)} for subsequent similarity calculation;
[0066] Step S223, receiving the regularized meter data M''(k,t), for each meter k, applying fast Fourier transform (FFT) to convert the time domain data into frequency domain representation to obtain the original spectrum data F_raw(k,ω); identifying the significant frequency components through power spectrum density analysis to obtain the main spectrum components F_main(k,ω); extracting spectrum feature parameters, including daily cycle intensity DCI(k), weekly cycle intensity WCI(k), monthly cycle intensity MCI(k) and seasonal cycle intensity SCI(k); applying bandpass filter to separate the fluctuation characteristics of different time scales, including short-term fluctuations (hourly level), medium-term fluctuations (daily level) and long-term fluctuations (weekly level); calculating the fluctuation intensity indicators VS_short(k), VS_medium(k) and VS_long(k) of each time scale; integrating the spectrum features to form the meter data spectrum feature vector F(k,ω)={DCI(k), WCI(k), MCI(k), SCI(k),VS_short(k), VS_medium(k), VS_long(k)}; Output the meter data spectrum feature F(k,ω) for subsequent similarity calculation.
[0067] In one embodiment of the present application, the time characteristic analysis (correction) in step S22 further includes:
[0068] Step S224, receiving the daily load curve D(k,h), the daily load characteristic index set DF(k), the weekly load curve W(k,d), the weekly load characteristic index set WF(k) and the meter data spectrum feature F(k,ω), and calculating the similarity of each dimension for the meter pair (k1,k2); calculating the daily load curve similarity D_sim(k1,k2)=cos(D_smooth(k1,h), D_smooth(k2,h)), which represents the cosine similarity of the daily load curves of the two meters; calculating the weekly load curve similarity W_sim(k1,k2)=cos(W_avg(k1,d), W_avg(k2,d)), that is, the cosine similarity of the weekly load curves of the two meters; calculate the daily load similarity DF_sim(k1,k2) based on the Euclidean distance of the characteristic index; calculate the weekly load feature similarity WF_sim(k1,k2) based on the Euclidean distance of the characteristic index; calculate the spectrum feature similarity F_sim(k1,k2)=cos(F(k1,ω), F(k2,ω)), based on the cosine similarity of the spectrum feature vector; combine the similarities of each dimension to calculate the weighted time similarity T_sim(k1,k2); calculate the time similarity for all pairs of meters and construct a complete time similarity matrix T_sim(k1,k2); output T_sim(k1,k2) for subsequent spatiotemporal characteristic model construction.
[0069] According to one aspect of the present application, the construction of the spatiotemporal correlation model in step S24 is specifically as follows:
[0070] Step S241, receive the time similarity matrix T_sim(k1,k2) and the space similarity matrix S_sim(k1,k2), and initially set the time weight w_t=0.5 and the space weight w_s=0.5; evaluate the influence of time characteristics and space characteristics on data distribution through historical data analysis; apply the cross-validation method to calculate the weighted spatiotemporal similarity ST_sim(k1,k2,w_t,w_s)=T_sim(k1,k2)·w_t+S_sim(k1,k2)·w_s under different weight combinations; evaluate the cohesion and separation of the clustering results under each set of weights, and use the silhouette coefficient as the evaluation index; select the weight combination (w_t_opt, w_s_opt) with the highest silhouette coefficient as the optimal weight; use the optimal weight to calculate the final spatiotemporal similarity matrix ST_sim(k1,k2)=T_sim(k1,k2)·w_t+ S_sim(k1,k2)·w_s_opt; For the meter pairs whose similarity is lower than the threshold value θ_sim, the similarity value is set to 0 to form a sparse spatiotemporal similarity matrix ST_sim_sparse(k1,k2); Output the spatiotemporal similarity matrix ST_sim(k1,k2) and the sparse spatiotemporal similarity matrix ST_sim_sparse(k1,k2) for subsequent clustering analysis;
[0071] Step S242, receiving the spatiotemporal similarity matrix ST_sim(k1, k2), constructing a similarity graph G between electric meters, where the electric meters are nodes and the similarities are edge weights; applying a hierarchical clustering algorithm to process the graph G, initially treating each electric meter as an independent cluster; iteratively merging the two most similar clusters, using the Complete Linkage method to calculate the distance between clusters, i.e., the similarity between the most dissimilar pairs of electric meters between clusters; determining the optimal number of clusters C_opt by analyzing the cutting height of the clustering tree; using the silhouette coefficient and the Davies-Bouldin Index to evaluate the effectiveness of different numbers of clusters; fine-tuning the number of clusters within the range of C_opt, taking into account the physical structure of the power grid and the load balancing requirements; finally, dividing the electric meters into C clusters to form an electric meter cluster set CL={CL(1), CL(2), ..., CL(C)}, where CL(c) represents the set of meters belonging to cluster c; assign a cluster label to each meter k, and establish a meter cluster mapping MC(k)=c, indicating that meter k belongs to cluster c; output the meter cluster set CL and meter cluster mapping MC(k) for subsequent feature vector extraction and sharding strategy design;
[0072] Step S243, receiving the meter cluster set CL, for each cluster c∈[1,C], calculating the characteristic vector CV(c) of the cluster; extracting the cluster center meter k_center(c)=argmin_k∈CL(c)∑_k'∈CL(c)(1-ST_sim(k,k')), and selecting the meter with the highest total similarity with other meters in the cluster as the center; extracting the time characteristic subvector CVT(c) of the cluster, including the daily load curve D(k_center(c),h), weekly load curve W(k_center(c),d) and spectrum feature F(k_center(c),ω) of the cluster center; extracting the spatial characteristic subvector C of the cluster VS(c), including the geographical location G(k_center(c)) of the cluster center, the ID of the substation to which it belongs, and the topological location of the power grid; calculate the statistical characteristic subvector CVStat(c) of the cluster, including the cluster size |CL(c)|, the average similarity avg_k,k'∈CL(c)(ST_sim(k,k')) of the electric meters within the cluster, and the cluster radius max_k∈CL(c)(1-ST_sim(k,k_center(c))); calculate the load characteristic subvector CVL(c) of the cluster, including the total average load, peak load and valley load of the cluster; integrate the subvectors to calculate and form a complete cluster characteristic vector CV(c)={CVT(c), CVS(c), CVStat(c), CVL(c)}; output the set of all cluster characteristic vectors CV={CV(1), CV(2), ..., CV(C)} for subsequent model construction and sharding strategy design;
[0073] Step S244, receiving the spatiotemporal similarity matrix ST_sim(k1,k2), the meter clustering set CL, the meter clustering map MC(k) and the feature vector set CV, and constructing a complete spatiotemporal characteristic model STM of the electric energy meter data; designing a multi-layer model structure, including a similarity layer, a clustering layer and a feature layer; storing the spatiotemporal similarity matrix ST_sim(k1,k2) and the sparse spatiotemporal similarity matrix ST_sim_sparse(k1,k2) in the similarity layer; storing the meter clustering set CL, the meter clustering map MC(k) and the similarity matrix CS(c1,c2)=avg_k2∈ in the clustering layer CL(c2),k2∈CL(c2)(ST_sim(k1,k2)); store the feature vector set CV and feature importance weights in the feature layer; analyze the temporal stability of the clustering structure and verify the persistence of the clustering through historical data; establish a clustering evolution prediction model to predict possible changes in the clustering structure in the future; design a clustering maintenance strategy, including regular update timing and incremental update method; integrate all components and output a complete spatiotemporal characteristic model STM of electricity meter data, including data structures and maintenance strategies at all levels; pass the spatiotemporal characteristic model STM of electricity meter data to step S3 for subsequent sharding strategy design.
[0074] According to one aspect of the present application, the spatiotemporal perception slicing in step S32 is specifically as follows:
[0075] Step S321, receiving the spatiotemporal characteristic model STM of electric energy meter data, the node performance index PI(j) and the node geographic location GL(j), extracting the node computing power, storage capacity and network bandwidth data from the node performance index PI(j); extracting the geographic distribution information of the electric energy meter cluster from the spatiotemporal characteristic model STM of electric energy meter data; constructing a node geographic location matrix, where the coordinates of each node j are (x_j, y_j); calculate the geographic distance matrix GD(j1,j2) between nodes; combine ND(j1,j2) and the geographic distance matrix to calculate the comprehensive distance CD(j1,j2)=w_nd·ND(j1,j2) / ND_max+w_gd·GD(j1,j2) / GD_max, where w_nd and w_gd are weight coefficients, and w_nd+w_gd=1; take the comprehensive distance matrix CD(j1,j2) as input, apply the K-means clustering algorithm, divide the network nodes into K node clusters NC(k), k∈[1,K]; output the node cluster NC(k) for subsequent affinity calculation and allocation;
[0076] Step S322: Receive the node cluster NC(k) and the spatiotemporal characteristic model STM of the electric energy meter data, extract the electric energy meter cluster set CL and the feature vector set CV from the STM; for each electric energy meter cluster c and node cluster k, calculate their affinity A(c,k); consider the geographical location factor, calculate the distance d_geo(c,k) between the geographical center of the electric energy meter cluster c and the geographical center of the node cluster k, and convert it into the geographical affinity A_geo(c,k)=1 / (1+d_geo(c,k)); consider the network delay factor, calculate the average network delay d_net(c,k) between the electric energy meter in the electric energy meter cluster c and the node in the node cluster k, and convert it into the network affinity A_net(c,k)=1 / (1+d_ net(c,k)); Considering the load matching factor, calculate the matching degree between the data volume and access frequency of meter cluster c and the computing power and storage capacity of node cluster k, and obtain the load affinity A_load(c,k); Comprehensively consider various factors and calculate the total affinity A(c,k)=w_geo·A_geo(c,k)+w_net·A_net(c,k)+w_load·A_load(c,k), where w_geo, w_net and w_load are weight coefficients, and w_geo+w_net+w_load=1; Construct the affinity matrix A, which contains the affinity values between all meter clusters and node clusters; Output the affinity matrix A for solving the optimal allocation problem;
[0077] Step S323: receiving the affinity matrix A and the set of electric meter clusters CL, modeling the allocation problem of electric meter clusters to node clusters as an optimal allocation problem; defining the objective function as maximizing the total affinity ∑_c,k A(c,k)·X(c,k), where X(c,k) is a 0-1 variable, indicating whether the electric meter cluster c is allocated to the node cluster k; adding constraints: each electric meter cluster can only be allocated to one node cluster ∑_k X(c,k)=1, c; the load of each node cluster does not exceed its capacity limit∑_cLoad(c)·X(c,k)≤Cap(k), k; use the Hungarian algorithm or integer linear programming method to solve the optimal allocation problem; obtain the optimal allocation solution X*(c,k), based on which establish the mapping MCN(c)=k from meter cluster to node cluster, indicating that meter cluster c is assigned to node cluster k; check the load balance, calculate the load ratio of each node cluster, and ensure that the ratio of the maximum load to the minimum load does not exceed the preset threshold; if the load is unbalanced, adjust the weight coefficient and solve again until the balance requirement is met; output the mapping MCN(c) from meter cluster to node cluster for subsequent node responsibility allocation;
[0078] Step S324, receive the node cluster NC(k), the mapping of meter cluster to node cluster MCN(c) and the node performance index PI(j), and assign responsibilities to the nodes in each node cluster; for each node cluster k, obtain all meter clusters {c|MCN(c)=k} that the cluster is responsible for; for each meter cluster c, based on the node performance index, select the node with the best performance in the node cluster NC(MCN(c)) as the primary shard node P(c,k), which is responsible for the main storage and processing of the cluster data; select N_b nodes with suboptimal performance from the remaining nodes as the backup node set B(c,k) for data backup and fault recovery Complex; select N_v nodes with moderate performance from the remaining nodes as the verification node set V(c,k), which are responsible for data verification; ensure that the total load of each node is balanced to avoid a single node from taking too many responsibilities; consider the quality of network connection between nodes to ensure that the network delay between the primary sharding node and the backup node is minimized; generate a node responsibility allocation table, including all primary sharding nodes P(c,k), backup node set B(c,k) and verification node set V(c,k); integrate all the above results to output a complete spatiotemporal optimized sharding scheme SP, including node cluster NC(k), meter clustering to node cluster mapping MCN(c) and node responsibility allocation.
[0079] According to one aspect of the present application, the data distribution optimization in step S34 is specifically as follows:
[0080] Step S341, receive the spatiotemporal optimized sharding scheme SP and the spatiotemporal characteristic model STM of the electric energy meter data, obtain the access logs of the electric energy meter data for the past 90 days from the historical database; analyze the access logs, extract the access frequency AF(k,t) of each electric energy meter k at different time points t; divide the time axis into typical time periods, such as working hours on weekdays, non-working hours on weekdays, weekends, etc.; calculate the average access frequency of each electric energy meter in each time period; consider periodic patterns, such as daily cycles, weekly cycles, and monthly cycles, and apply time series decomposition to extract trends, seasonality, and random components; combine the above analysis results , design the data heat evaluation function H(k,t)=w_af·AF(k,t)+w_trend·Trend(k,t)+w_season·Season(k,t), where w_af, w_trend and w_season are weight coefficients; apply the data heat evaluation function H(k,t) to all electricity meters, calculate the data heat of the current period and the predicted future period; sort the electricity meters by heat value, identify the hot data set HD={k|H(k,t)>θ_hot} and the cold data set CD={k|H(k,t <θ_cold}, where θ_hot and θ_cold are the hot data and cold data thresholds; output the data heat evaluation function H(k,t), the hot data set HD and the cold data set CD for the subsequent hot data replication strategy design;
[0081] Step S342, receiving the hot data set HD, the cold data set CD, the spatiotemporal optimized sharding scheme SP and the spatiotemporal characteristic model STM of the electric energy meter data, and determining the master node and backup node of each hot data electric energy meter k according to the node allocation in the spatiotemporal optimized sharding scheme SP; for each electric energy meter k in the hot data set HD, calculating its access geographical distribution GD(k), indicating the access proportion from different regions; analyzing the matching degree between the access geographical distribution and the node geographical distribution, and identifying the high access and low latency area HLR(k); selecting the best performing node in each high access and low latency area HLR(k) as the additional replication node of the hot data; designing the hot data update strategy according to the data consistency requirements, including synchronous replication or asynchronous replication; considering the network bandwidth limitation, designing the replication scheduling algorithm to avoid the replication operation occupying too many network resources; generating the hot data replication strategy HDR according to the replication node selection and update strategy, including the replication node set, replication mode and synchronization frequency; outputting the hot data replication strategy HDR for realizing efficient data access and load balancing;
[0082] Step S343, receiving the hot data set HD, the cold data set CD and the spatiotemporal characteristic model STM of the electric energy meter data, analyzing the time characteristics of the electric energy meter data, including the data generation rate, the change of access frequency over time and the decay of data value over time; determining the retention period of different types of data according to regulatory requirements and business needs; designing a data tiered storage strategy, dividing the data into hot layer, warm layer and cold layer according to time and access frequency; for the hot layer data, keeping the original format and storing it on a high-performance storage node; for the warm layer data, applying moderate compression and optionally storing it on a medium-performance node; for the cold layer data, applying a high compression ratio algorithm And store it on a large-capacity storage node; design an automatic data migration mechanism to automatically migrate data between different levels according to data age and access mode; consider the spatiotemporal characteristics of meter data, design an aggregate storage strategy, and appropriately aggregate data in the same area, for the same type of users or during the same period to reduce storage space; design a data cleansing strategy to automatically delete data that has exceeded the retention period and is no longer needed; integrate the above strategies to form a complete data lifecycle management strategy DLM; combine the hot data replication strategy HDR and the data lifecycle management strategy DLM to update the spatiotemporal optimized sharding scheme SP, and output the final spatiotemporal optimized sharding scheme SP'.
[0083] According to one aspect of the present application, the power grid load status monitoring and prediction in step S41 is specifically as follows:
[0084] Step S411, access the latest regional real-time load data L(t) and substation load data LS(i, t) from the SCADA system in real time, and set the data collection frequency to 5 minutes / time; perform data quality checks on the newly collected load data, including range checks, continuity checks, and rationality checks; detect and mark abnormal values, such as sudden load jumps, sensor failure values, or communication interruption values; for minor abnormalities, apply moving median filtering for correction; for serious abnormalities, mark them as invalid and exclude them from subsequent analysis; store the processed regional real-time load data L(t) and substation load data LS(i, t) in the real-time data buffer, and retain the historical data of the last 24 hours; at the same time, obtain current and forecasted weather data W(t) from the meteorological service, including temperature, humidity, and weather conditions, as auxiliary variables for load prediction; output the processed regional real-time load data L(t), substation load data LS(i, t) and weather data W(t) for subsequent load state calculation and prediction;
[0085] Step S412: Receive the processed regional real-time load data L(t) and substation load data LS(i, t), apply the method described in steps S11 and S12, calculate the smoothed load data L*(t) and the load fluctuation index V(t); read the load threshold θL and the fluctuation threshold θV from the system configuration. If the configuration value does not exist, use the default values θL=0.8·L_max and θV=0.15·V_max; based on the threshold, judge the current load state S(t): if L*(t) > θL and V(t) > θV, then S(t) =HH (high load and high fluctuation); if L*(t) > θL and V(t) ≤ θV, then S(t) = HL (high load and low fluctuation); if L*(t) ≤ θL and V(t) > θV, then S(t) = LH (low load and high fluctuation); if L*(t) ≤ θL and V(t) ≤ θV, then S(t) =LL (low load and low fluctuation); compare the current load state S(t) with the historical state records of the past 24 hours, calculate the state change frequency and duration; determine the stability of the current load state. If the state changes frequently within 5 minutes, use the majority voting method to determine the final state; output the current load state S(t) and state stability index for subsequent load forecasting and adaptive adjustment;
[0086] Step S413: Receive the regional real-time load data L(t), substation load data LS(i,t), weather data W(t) and current load status S(t) for the past 24 hours, and load the historical load data under similar dates and weather conditions from the historical database as a reference; for the regional total load, establish a combination of short-term prediction models, including time series model ARIMA, regression model and neural network model; for each substation load, establish an independent prediction model, considering its specific load characteristics; use a rolling time window to train the model, with a window length of 7 days and update it every day First-time model parameters; Based on the data at the current moment, use the trained model to predict the predicted load data L'(t+Δt) and the predicted substation load data LS'(i,t+Δt) every 5 minutes in the next hour, Δt∈[5,60], with a step length of 5 minutes; Apply the method in step S412 to calculate the predicted load state S'(t+Δt) at each future time point based on the predicted load data; Evaluate the confidence interval of the prediction and mark the prediction points with lower confidence; Output the predicted load state sequence S'(t+Δt) and its confidence for adaptive adjustment decision.
[0087] According to one aspect of the present application, the dynamic adjustment of the shard structure in step S44 is specifically performed as follows:
[0088] Step S441, receiving the shard adjustment flag SAF, the performance index SPI, the pre-adjustment plan PAP, the spatiotemporal optimized sharding scheme SP' and the spatiotemporal characteristic model STM of the electric energy meter data, and checking the value of the shard adjustment flag SAF; if SAF=1, it means that the shard adjustment needs to be performed immediately; if there is an expired pre-adjustment plan PAP, the adjustment also needs to be performed; when the shard adjustment needs to be performed, the latest meter clustering and similarity information is extracted from the spatiotemporal characteristic model STM of the electric energy meter data; the current network load state NLS is obtained from the load monitoring system, including the CPU usage, memory usage, disk I / O and network traffic of each node; the current system pressure level is evaluated by combining the load state S(t) and the network load state NLS; based on the system pressure level, the shard adjustment parameters are set, including the adjustment intensity, adjustment range and adjustment priority; determine whether to perform global adjustment or local adjustment, the global adjustment involves all shards, and the local adjustment involves only the shards with poor performance indicators; output the adjustment type AT (global / local), the adjustment range AR (the set of shards involved) and the adjustment parameter AP for subsequent sharding scheme generation;
[0089] Step S442, receiving the adjustment type AT, the adjustment range AR, the adjustment parameter AP, the spatiotemporal characteristic model STM of the electric energy meter data and the load state S(t), and selecting the corresponding slicing reconstruction method according to the adjustment type AT; if it is a local adjustment, only the slicing within the adjustment range AR is executed with steps S32 to S34; if it is a global adjustment, all slicings are re-executed with steps S32 to S34; in the process of executing the slicing reconstruction, the adjustment parameter AP is considered to be optimized specifically, such as reducing the redistribution ratio, keeping the key nodes unchanged, etc.; the latest data of the spatiotemporal characteristic model STM of the electric energy meter data is applied, Combined with the current load status S(t), recalculate the affinity of the node cluster and the meter cluster; solve the optimal allocation problem and generate a new mapping of the meter cluster to the node cluster; reallocate node responsibilities and determine new primary sharding nodes, backup nodes, and verification nodes; make corresponding adjustments to the hot data replication strategy and data lifecycle management strategy; integrate all adjustment results to generate a new sharding scheme SP_new, including a new node cluster, mapping relationship, and node responsibility allocation; output the new sharding scheme SP_new and the current spatiotemporal optimized sharding scheme SP' for subsequent data migration plan formulation;
[0090] Step S443, receiving the new sharding scheme SP_new and the current spatiotemporal optimized sharding scheme SP', comparing the differences between the two schemes, and identifying the data sets that need to be migrated; for each changed meter cluster c, determining its node allocation in the old scheme and the new scheme; calculating the amount of data that needs to be migrated based on the historical data size and growth rate of each meter; evaluating the network link status, selecting the optimal migration path, and avoiding congested links; assigning migration priorities to different data sets based on data importance and access frequency; designing a migration schedule, and arranging high-impact migrations during periods of low system load; considering node storage capacity and processing power to ensure that the migration process does not cause node overload; generating a detailed data migration plan DMP, including source nodes, target nodes, data sets, migration paths, priorities, and planned times; evaluating the overall impact of the migration plan, including migration duration, network overhead, and service quality impact; outputting the data migration plan DMP for subsequent transition time window design;
[0091] Step S444: Receive the data migration plan DMP, the new sharding plan SP_new, and the current spatiotemporal optimized sharding plan SP', design an appropriate transition time window TTW, during which the old and new sharding plans coexist; calculate the shortest required transition time based on the total data volume in the data migration plan DMP and the available network bandwidth; consider the system safety margin and set the transition window to 1.5 to 2 times the shortest required time; define a switching checkpoint SCP, which includes the conditions that must be met to complete the final switching, such as the migration completion ratio, data consistency verification, and system stability indicators; design a rollback mechanism so that the original plan can be restored if serious problems occur during the transition process; design a double-write mechanism to During the transition, write operations are sent to the new and old nodes at the same time to ensure data consistency; a read strategy is designed to clarify when to read data from the new node and when to read from the old node; all the above components are integrated to form a complete smooth transition strategy STS, including the data migration plan DMP, the transition time window TTW, the switching checkpoint SCP and the rollback mechanism; the smooth transition strategy STS is executed to monitor the migration progress and system status; after the switching checkpoint conditions are met, the final switching is completed, the system metadata is updated, and the new sharding scheme takes effect; the adaptive sharding storage strategy ASP is updated and output, including the updated spatiotemporal optimization sharding scheme SP_updated, the dynamic adjustment strategy DAS and the performance monitoring indicator definition PMI.
[0092] According to one aspect of the present application, the distributed verification process in step S53 is specifically implemented as follows:
[0093] Step S531, receiving the verification rule set VRS and the adaptive shard storage strategy ASP, designing a three-layer verification architecture, including intra-node verification, intra-shard verification and cross-shard verification; in the intra-node verification layer, defining the basic verification tasks that each node independently completes, including data format verification, timestamp verification and digital signature verification; clarifying the verification input data format, verification algorithm and verification result format; designing a parallel processing mechanism for the verification process to improve the single-node verification efficiency; in the intra-shard verification layer, defining the verification tasks that require multi-node collaboration within the shard, including power balance verification and usage mode verification; Design the verification task allocation mechanism and intermediate result delivery mechanism between nodes within the shard; design the coordination node selection algorithm for verification within the shard, based on node performance and load conditions; define verification tasks involving multiple shard collaborations in the cross-shard verification layer, including cross-shard data consistency verification and shard boundary verification; design a coordination mechanism for cross-shard verification, and clarify the division of responsibilities of each shard; design a scheduling mechanism for layered verification, and determine the triggering conditions and execution order of verification at each layer; output a complete layered verification architecture HVA, including verification tasks, coordination mechanisms, and scheduling strategies for each layer, for subsequent verification task allocation;
[0094] Step S532, receiving the hierarchical verification architecture HVA and the adaptive sharding storage strategy ASP, extracting the performance indicators and current load status of each node from the adaptive sharding storage strategy ASP; defining resource requirement models for different types of verification tasks, including computational complexity, memory requirements, and network communication volume; designing a verification task allocation algorithm based on resource requirements and node capabilities; for intra-node verification tasks, balancing the verification work according to the current data distribution and node load; for intra-shard verification tasks, considering the data location and network topology, minimizing the data transmission during the verification process; for cross-shard verification tasks, selecting nodes with good network connections and sufficient computing resources as coordination nodes; considering the priority of verification tasks to ensure that key verification tasks obtain sufficient resources; designing a dynamic task adjustment mechanism to reallocate tasks according to changes in node load during execution; considering fault tolerance, when the assigned node fails, the task can be automatically reallocated; combining the task allocation algorithm and the dynamic adjustment mechanism to form a complete verification task allocation algorithm VTA; outputting the verification task allocation algorithm VTA for the subsequent verification result consensus mechanism design;
[0095] Step S533: Receive the verification task assignment algorithm VTA and the hierarchical verification architecture HVA, design a verification result consensus mechanism to ensure the consistency of the results when multiple nodes participate in the verification; for intra-node verification, no consensus is required, and the single-node verification result is used directly; for intra-shard verification, design a consensus mechanism based on majority voting, and reach a consensus when more than 2 / 3 of the verification nodes have the same results; calculate the credibility weight of each verification node based on the historical verification accuracy and node reputation; use a weighted voting method and use the node credibility as the voting weight; for cross-shard verification, design a two-phase commit protocol to ensure that all participating shards The verification results are consistent; in the first stage, each shard independently verifies and submits preliminary results; in the second stage, the coordination node collects all shard results, and submits the final results after confirming the consistency; design a timeout handling mechanism, how to make decisions when some nodes fail to return results in time; design a conflict resolution mechanism, how to determine the final result when there are significant differences in the verification results; integrate the above mechanisms to form a complete verification result consensus mechanism VRC; output a distributed verification process DVP, including a hierarchical verification architecture HVA, a verification task allocation algorithm VTA and a verification result consensus mechanism VRC, for subsequent data verification execution.
[0096] According to one aspect of the present application, the data verification execution and result confirmation in step S55 are specifically as follows:
[0097] Step S551, receiving the electric energy meter data, the distributed verification process DVP and the anomaly detection and handling mechanism ADM, and planning the verification execution process according to the hierarchical verification architecture HVA in the distributed verification process DVP; firstly, performing the basic verification in the node at the data entry point, including data format verification, timestamp verification and digital signature verification; using the preset data format template to check the format compliance of the electric energy meter data; verifying whether the timestamp is within a reasonable range, and the timestamp that is too early or too late will be marked; using the public key cryptography system to verify the digital signature of the data to ensure that the data source is authentic and has not been tampered with; for the data that passes the basic verification, it is marked as preliminary verification data IVD; for the data that fails the verification, the error type and reason are recorded and marked as verification failure data FVD; the preliminary verification data IVD is passed to the subsequent intra-slice verification process, and the verification failure data FVD is passed to the exception handling component; the preliminary verification data IVD and the verification failure data FVD are output for subsequent verification and exception handling;
[0098] Step S552, receiving the preliminary verification data IVD and the distributed verification process DVP, assigning the verification task within the shard to the corresponding node according to the verification task allocation algorithm VTA in the distributed verification process DVP; organizing the nodes within the shard to perform power balance verification to check whether the power production and consumption in a given area are balanced; applying the power balance constraint model in the power system physical constraint model PCM for verification; organizing the nodes within the shard to perform usage pattern verification to check whether the power meter data conforms to the historical usage pattern; extracting the power usage pattern library from the power system physical constraint model PCM for pattern matching; marking the data that passes the verification as the in-shard verification data SVD; marking the data that has doubts about the verification and recording the detailed information to form suspected abnormal data SAD; collecting the verification results of all verification nodes, applying the in-shard consensus method in the verification result consensus mechanism VRC to determine the final verification result; passing the in-shard verification data SVD to the subsequent cross-shard verification process, and passing the suspected abnormal data SAD to the abnormal detection component; outputting the in-shard verification data SVD and the suspected abnormal data SAD for subsequent verification and abnormal detection;
[0099] Step S553, receiving the intra-shard verification data SVD and the distributed verification process DVP, coordinating and organizing cross-shard verification for data involving multiple shards; determining the data sets that need to be cross-shard verified according to the cross-shard verification rules in the distributed verification process DVP; performing cross-shard data consistency verification for these data sets to ensure the consistency between related data stored in different shards; performing shard boundary verification to check the data consistency in the shard boundary area; applying a two-stage verification protocol: in the first stage, each shard independently verifies the data stored in itself; in the second stage, exchanging verification results and necessary proof data to perform cross-shard consistency checks; marking the data that passes the verification as cross-shard verification data CVD; for data with inconsistent verification, recording the inconsistency details to form inconsistent data ICD; applying the cross-shard consensus method in the verification result consensus mechanism VRC to summarize the verification results of each shard and reach a final consensus; merging the data that passes all verification levels into verified trusted data VTD; passing the inconsistent data ICD to the exception handling component; outputting the verified trusted data VTD and inconsistent data ICD for subsequent result confirmation and exception handling;
[0100] Step S554, receiving the verified trusted data VTD, the verification failed data FVD, the suspected abnormal data SAD, the inconsistent data ICD and the abnormal detection and processing mechanism ADM, and applying the abnormal detection and processing mechanism ADM to process the verification failed data FVD, the suspected abnormal data SAD and the inconsistent data ICD; according to the abnormal classification strategy in the abnormal detection and processing mechanism ADM, the abnormal data is classified into different severity levels; for minor abnormalities, the automatic repair rules are applied to correct them to form the corrected data CD; for medium abnormalities, the data is marked and recorded in the log, but the data is still retained to form the marked abnormal data FAD; for severe abnormalities, the alarm mechanism is triggered The system is used to isolate and quarantine data to form isolated abnormal data IAD; the corrected data CD is re-incorporated into the verified trusted data VTD; the statistical information of the verification process is summarized, including the total verification volume, pass rate, abnormal type distribution and processing method; a detailed verification report VRep is generated, including the verification process, result summary and processed abnormal situations; the verification report VRep is stored on the blockchain to ensure its non-tamperability; the verified trusted data VTD is provided to the business application system for use; at the same time, the system's abnormal pattern library is updated to include the newly discovered abnormal patterns; the final verified trusted data VTD and verification report VRep are output to complete the entire data verification process.
[0101] In another embodiment of the present application, a distributed storage method for electric energy meter data based on improved PoS consensus further includes:
[0102] Periodically obtain the latest regional real-time load data and substation load data, calculate the current load status, and predict the load status sequence for a period of time in the future;
[0103] Adjust consensus parameters and update validator selection probabilities based on load status, predicted load status sequence, and node weights;
[0104] Evaluate the performance indicators of the current spatiotemporal optimized sharding solution. When the performance indicators exceed the threshold, trigger sharding adjustment.
[0105] Redesign the sharding scheme based on the latest spatiotemporal characteristic model of electric energy meter data and load status, formulate a smooth transition strategy, complete sharding adjustment, and output an adaptive sharding storage strategy;
[0106] The steps of predicting the load state sequence for a period of time in the future include:
[0107] Periodically receive the latest regional real-time load data and substation load data; apply preprocessing methods to calculate the current load status; use the time series prediction model to process historical load data and predict the predicted load status sequence in the future.
[0108] The steps of evaluating the performance indicators of the current spatiotemporal optimized sharding scheme include:
[0109] Receive the spatiotemporally optimized sharding scheme, load status, and predicted load status sequence; Calculate the performance indicators of the current sharding scheme, including the cross-shard transaction ratio, node load balance, and data access latency; Design a sharding adjustment threshold function based on the load status; When the performance indicator exceeds the threshold, trigger sharding adjustment; When the predicted load status shows that there will be significant changes in the future, formulate a pre-adjustment plan;
[0110] The steps to complete the sharding adjustment include:
[0111] Receive sharding adjustment flags, performance indicators, pre-adjustment plans, spatiotemporal optimized sharding schemes, and spatiotemporal characteristic models of electricity meter data; when sharding adjustment is required, redesign the sharding scheme based on the latest status; formulate a smooth transition strategy, including data migration plan, transition time window, and switching checkpoints; execute the transition strategy, complete sharding adjustment, and update and output the adaptive sharding storage strategy.
[0112] In another embodiment of the present application, the improvement of the PoS consensus mechanism of power grid load perception in step S1 includes:
[0113] Step S11: Grid load data acquisition and preprocessing:
[0114] Obtain regional real-time load data L(t) and substation load data LS(i,t) (i is the substation ID, t is the timestamp) from the SCADA system; apply sliding window averaging to the regional real-time load data L(t), with a window length of T=15 minutes, and calculate the smoothed load data L(t); obtain the load fluctuation index V(t) by calculating V(t) = √(1 / (T-1)·∑(L(τ)-L*(t))²), τ∈[tT,t]; output the smoothed load data L*(t) and the load fluctuation index V(t) for subsequent load state classification;
[0115] S12. Classification and evaluation of load status:
[0116] Input smoothed load data L*(t) and load fluctuation index V(t); Based on the preset thresholds θL and θV, define the load state matrix: if L*(t) > θL and V(t) > θV, then the load state S(t) = high load and high fluctuation (HH); if L*(t) > θL and V(t) ≤ θV, then the load state S(t) = high load and low fluctuation (HL); if L*(t) ≤ θL and V(t)> θV, then the load state S(t) = low load and high fluctuation (LH); if L*(t) ≤ θL and V(t) ≤ θV, then the load state S(t) = low load and low fluctuation (LL); Output the current load state S(t) and substation load data LS(i, t) for subsequent weight adjustment;
[0117] S13. Node pledge information processing:
[0118] Obtain the original pledge amount P(j) of each node j from the blockchain network; obtain the region information R(j) and historical reliability index H(j) to which each node j belongs; calculate the adjusted pledge amount P'(j) according to the formula P'(j)=P(j) · (0.8 + 0.2·H(j)); output the adjusted pledge amount P'(j) and node region information R(j) for load-aware weight calculation;
[0119] S14. Load perception weight calculation:
[0120] Input load status S(t), substation load data LS(i,t), adjusted pledge amount P'(j) and node area information R(j); associate the node with the corresponding substation i according to the node area information R(j); design weight adjustment factor α(S(t)) based on different load states: if S(t)=HH, then α(S(t))=0.7, if S(t)=HL, then α(S(t))=0.9, if S(t)=LH, then α(S(t))=0.8, if S(t)=LL, then α(S(t))=1.0;
[0121] Calculate the load state adjustment term β(j,t)=(1 - |LS(i,t) / max(LS(*,t)) - 0.5| / 0.5); finally calculate the load-adjusted node weight W(j,t)=P'(j) · α(S(t)) · β(j,t); output the load-adjusted node weight W(j,t) for subsequent consensus process and adaptive sharding adjustment in S4.
[0122] According to one aspect of the present application, the spatiotemporal characteristics analysis and model construction of S2 electric energy meter data includes:
[0123] S21. Electricity meter data collection and preprocessing:
[0124] Obtain the historical raw data M(k, t) of the past 30 days from the electric energy meter database (k is the meter ID, t is the timestamp); perform data cleaning, detect and remove abnormal values, and obtain the cleaned electric energy meter data M'(k, t); perform time regularization on the cleaned electric energy meter data M'(k, t), unify the sampling interval to 15 minutes, and obtain the regularized electric energy meter data M''(k, t); output the regularized electric energy meter data M''(k, t) for time characteristic analysis;
[0125] S22, time characteristics analysis:
[0126] Input the regularized meter data M''(k,t); for each meter k, extract the daily load curve D(k,h) (h∈[0,23]), which represents the electricity consumption pattern within 24 hours a day; for each meter k, extract the weekly load curve W(k,d) (d∈[1,7]), which represents the electricity consumption pattern for 7 days a week; use Fourier transform to extract the spectrum feature F(k,ω) of the meter data; calculate the time similarity matrix T_sim(k1,k2)=cos(D(k1),D(k2)) · 0.7+cos(W(k1),W(k2)) · 0.3; output the time similarity matrix T_sim(k1,k2) for subsequent spatiotemporal characteristic model construction;
[0127] S23, spatial characteristic analysis: obtain the meter geographic location information G(k) and the grid topology structure T from the grid topology database; calculate the electrical distance E(k1, k2) between the meters based on the grid topology structure T; calculate the geographical distance GD(k1, k2) between the meters based on the meter geographic location information G(k); calculate the spatial similarity matrix S_sim(k1, k2) = 1 / (1 + 0.6·E(k1, k2) + 0.4·GD(k1, k2) / GD_max) by integrating the electrical distance and the geographical distance; output the spatial similarity matrix S_sim(k1, k2) for subsequent spatiotemporal characteristic model construction;
[0128] S24. Construction of spatiotemporal correlation model:
[0129] Input the temporal similarity matrix T_sim(k1,k2) and the spatial similarity matrix S_sim(k1,k2); calculate the comprehensive spatiotemporal similarity ST_sim(k1,k2)=T_sim(k1,k2) · w_t + S_sim(k1,k2) · w_s where w_t and w_s are the temporal and spatial weights, initially set to w_t= 0.5, w_s= 0.5; apply the hierarchical clustering algorithm, based on the spatiotemporal similarity ST_sim(k1,k2), divide the meters into C clusters; extract the eigenvector CV(c) of each cluster (c∈[1,C]), including the time and space characteristics of the cluster center; construct the spatiotemporal characteristic model STM of the electric energy meter data, including: the spatiotemporal similarity matrix ST_sim(k1,k2), the electric energy meter cluster C and its characteristic vector CV(c), the electric energy meter spatiotemporal cluster mapping relationship MC(k), indicating which cluster the electric energy meter k belongs to; output the spatiotemporal characteristic model STM of the electric energy meter data for subsequent sharding strategy design.
[0130] According to one aspect of the present application, the S3 time-space aware sharding strategy design includes:
[0131] S31. Network node status acquisition:
[0132] Obtain the currently active network node list N and the computing power CP(j), storage capacity SC(j) and network bandwidth NB(j) of each node j from the blockchain network monitoring module; calculate the comprehensive performance indicators of each node
[0133] PI(j)=w_cp·CP(j) / CP_max + w_sc·SC(j) / SC_max + w_nb·NB(j) / NB_max; where w_cp, w_sc, and w_nb are the weights of computing power, storage capacity, and network bandwidth, respectively, and satisfy w_cp+w_sc+w_nb=1; obtain the geographic location information GL(j) and network delay matrix ND(j1,j2) of each node j; output the node performance index PI(j), node geographic location GL(j), and network delay matrix ND(j1,j2) for subsequent sharding;
[0134] S32, time-space perception slicing division:
[0135] Input the spatiotemporal characteristic model STM of electric energy meter data, node performance index PI(j), node geographic location GL(j) and network delay matrix ND(j1,j2); cluster the active nodes N based on the geographic location GL(j) and network delay matrix ND(j1,j2) using the K-means algorithm to obtain K node clusters NC(k) (k∈[1,K]);
[0136] Assign a meter cluster to each node cluster. The optimization principle is to minimize the network delay of meter data access and balance the load of each node cluster. The specific algorithm is as follows:
[0137] Calculate the affinity A(c,k) between each meter cluster c and each node cluster k; solve the optimal allocation problem based on the affinity matrix A and obtain the mapping MCN(c)=k from meter cluster to node cluster; subdivide the node responsibilities within each node cluster, including the primary shard node P(c,k), backup node B(c,k) and verification node V(c,k);
[0138] The spatiotemporal optimized sharding scheme SP includes: node cluster NC(k), mapping of meter cluster to node cluster MCN(c), node responsibility allocation P(c,k), B(c,k), V(c,k) in each node cluster;
[0139] S33. Inter-shard communication protocol design:
[0140] Input the time-space optimized sharding scheme SP; design the intra-shard communication protocol, including the data synchronization message format DM (internal) and the consensus message format CM (internal); design the inter-shard communication protocol, including the cross-shard query message format QM (cross-shard) and the cross-shard transaction message format TM (cross-shard); design the shard routing table SRT, including the responsibility scope and communication address of each shard; design the inter-shard data consistency protocol SICP to handle data update operations involving multiple shards; output the shard communication protocol set SCP, including all the above communication protocols and routing tables;
[0141] S34. Data distribution optimization:
[0142] Input the spatiotemporal optimized sharding scheme SP and the spatiotemporal characteristic model STM of the electric energy meter data; according to the access mode of the electric energy meter data, design the data heat evaluation function H(k,t) to evaluate the access frequency of the electric energy meter k at time t; according to the data heat evaluation function H(k,t), copy the frequently accessed data between nodes to form the hot data replication strategy HDR; based on the time characteristics of the electric energy meter data, design the data lifecycle management strategy DLM, including data compression, archiving and cleaning strategies; output the final spatiotemporal optimized sharding scheme SP',
[0143] Updates include: the original time-space optimized sharding solution SP, hot data replication strategy HDR, and data lifecycle management strategy DLM.
[0144] According to one aspect of the present application, the S4 adaptive consensus and sharding dynamic adjustment mechanism includes:
[0145] S41. Grid load status monitoring and prediction:
[0146] Periodically (every 5 minutes) input the latest regional real-time load data L(t) and substation load data LS(i,t); apply the methods of S11 and S12 to calculate the current load state S(t); use the time series forecasting model (such as ARIMA) to process the historical load data and predict the load state S'(t+Δt) for the next hour, Δt∈[5,60], with a step length of 5 minutes; output the current load state S(t) and the predicted load state sequence S'(t+Δt) for adaptive adjustment decisions;
[0147] S42. Consensus parameter adaptive adjustment:
[0148] Input load state S(t), predicted load state sequence S'(t+Δt) and load-adjusted node weight W(j,t); design consensus parameter adjustment strategy CAP according to load state: For high load and high volatility (HH) state: increase the number of verification nodes and reduce the block generation speed; for high load and low volatility (HL) state: maintain the standard number of verification nodes and standard block generation speed; for low load and high volatility (LH) state: slightly increase the number of verification nodes and standard block generation speed; for low load and low volatility (LL) state: reduce the number of verification nodes and increase the block generation speed; specifically calculate the adjusted number of verification nodes VN(t)=VN_base · f_vn(S(t)), where f_vn is an adjustment function based on load state; calculate the adjusted block time interval BT(t)=BT_base · f_bt(S(t)), where f_bt is an adjustment function based on load state; update consensus validator selection probability VS(j,t)=W(j,t) / ∑W(j,t); Output the adjusted consensus parameters CP(t), including: number of verification nodes VN(t), block time interval BT(t), and verifier selection probability VS(j,t);
[0149] S43. Dynamic adjustment evaluation of sharding structure:
[0150] Input the spatiotemporally optimized sharding scheme SP', load status S(t) and predicted load status sequence S'(t+Δt); calculate the performance index SPI of the current sharding scheme, including: cross-shard transaction ratio CTP, node load balance NLB, data access delay DAL; design the sharding adjustment threshold function SAT(S(t)), and set different adjustment thresholds based on the load status; when the performance index exceeds the threshold (i.e. SPI > SAT(S(t))), trigger sharding adjustment and set the sharding adjustment flag SAF=1; when the predicted load status indicates that there will be significant changes in the future, plan sharding adjustment in advance and set the pre-adjustment plan PAP; output the sharding adjustment flag SAF, performance index SPI and pre-adjustment plan PAP (if any);
[0151] S44, dynamic adjustment of sharding structure execution:
[0152] Input the sharding adjustment flag SAF, performance index SPI, pre-adjustment plan PAP (if any), spatiotemporal optimized sharding scheme SP' and spatiotemporal characteristic model STM of electric energy meter data; if SAF=1 or there is an expired PAP, perform sharding adjustment: based on the latest spatiotemporal characteristic model STM of electric energy meter data and load status S(t), re-execute steps S32 to S34; generate a new sharding scheme SP_new; design a smooth transition strategy STS, including: data migration plan DMP, to determine which data needs to be migrated to the new node; transition time window TTW, during which the old and new sharding schemes coexist; switching checkpoint SCP, to complete the switching after meeting specific conditions; execute the smooth transition strategy STS to complete the sharding adjustment; update and output the adaptive sharding storage strategy ASP, including: the updated spatiotemporal optimized sharding scheme SP_updated; dynamic adjustment strategy DAS, including trigger conditions and adjustment rules; performance monitoring indicator definition PMI.
[0153] According to one aspect of the present application, the S5 data consistency assurance and verification mechanism includes:
[0154] S51. Modeling of physical constraints of power systems:
[0155] Obtain the grid topology NT and electrical parameters EP from the power system model library; establish a power flow model PFM to verify the physical rationality of the power meter data; extract the power usage pattern library EPL from historical data, which contains the typical power usage patterns of various users; establish an energy balance constraint model EBM to express the balance relationship between input power and consumed power; output the power system physical constraint model PCM, which contains all the above models, for subsequent data verification;
[0156] S52. Blockchain data verification rule design:
[0157] Input the power system physical constraint model PCM and the adaptive shard storage strategy ASP; design basic verification rules, including data format verification DFV, timestamp verification TSV and digital signature verification DSV; design verification rules based on physical constraints: Electric energy balance verification EBV: check whether the electricity production and consumption in a given area are balanced; Power flow constraint verification PFV: verify whether the electric energy meter data complies with the power flow constraint; Usage mode verification UPV: verify whether the power consumption mode is consistent with the historical mode; design inter-shard consistency verification rules: Cross-shard data consistency verification CDCV: verify whether the data involving multiple shards is consistent; Shard boundary verification SBV: verify the data consistency of the shard boundary area; output verification rule set VRS, which contains all verification rules and their execution conditions and priorities;
[0158] S53, distributed verification process implementation:
[0159] Input verification rule set VRS and adaptive shard storage strategy ASP; design hierarchical verification architecture HVA: intra-node verification NIV: basic verification completed by a single node; intra-shard verification SIV: verification completed by collaboration of nodes within a shard; cross-shard verification CSV: verification involving collaboration of multiple shards; design verification task allocation algorithm VTA to allocate verification tasks according to verification type and node capabilities; design verification result consensus mechanism VRC to ensure consistency of verification results; output distributed verification process DVP, including verification architecture, task allocation and result consensus mechanism;
[0160] S54, Abnormal detection and processing:
[0161] Input the electric energy meter data and the distributed verification process DVP; design the abnormal pattern library APL, which contains common abnormal patterns, such as data tampering, equipment failure, etc.; implement the abnormal detection algorithm ADA, including: rule-based detection RBD: detect obvious abnormalities based on predefined rules; statistical anomaly detection SAD: detect data deviating from the normal distribution based on statistical methods; machine learning anomaly detection MLD: use anomaly detection models to identify complex abnormal patterns; design the abnormality handling process AHP: abnormality classification AC: classify abnormalities into different severity levels; processing strategy HS: processing methods for abnormalities of different levels; recovery mechanism RM: mechanism for recovering from abnormal states; output anomaly detection and processing mechanism ADM, including detection algorithms and processing procedures;
[0162] S55, data verification execution and result confirmation: input electricity meter data, distributed verification process DVP and anomaly detection and handling mechanism ADM; execute verification process: apply node intra-verification NIV for basic verification; organize nodes within the shard to perform intra-shard verification SIV; coordinate multiple shards to perform cross-shard verification CSV when necessary; collect verification results VR(j) of all verification nodes; apply verification result consensus mechanism VRC, integrate the results of each node, and obtain the final verification result FVR; if anomalies are found, trigger the anomaly handling process AHP; mark the verified data as verified trusted data VTD; generate a verification report VRep, which includes the verification process, results and handled anomalies; output the verified trusted data VTD and verification report VRep.
[0163] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.
Claims
1. A distributed storage method for electric energy meter data based on improved PoS consensus, characterized in that: Methods include: Obtain the electric energy meter data, perform spatiotemporal characteristic analysis, form electric energy meter clusters, and construct a spatiotemporal characteristic model of the electric energy meter data; Obtain blockchain network node information, calculate node performance indicators and network delay between nodes; Based on the spatiotemporal characteristic model of electric energy meter data, node performance indicators and network delay, nodes are grouped into node clusters, and the affinity between meter clusters and node clusters is calculated; Assign meters to node clusters based on affinity and assign responsibilities to nodes; When working, it obtains and formulates hot data replication strategy and data lifecycle management strategy based on the data access characteristics of each meter cluster and the designed data heat evaluation function, and outputs a time-space optimized sharding solution.
2. According to claim 1, a distributed storage method for electric energy meter data based on improved PoS consensus is characterized in that: The steps of analyzing the spatiotemporal characteristics of the electric energy meter data, forming electric energy meter clusters, and constructing the spatiotemporal characteristic model of the electric energy meter data include: Obtain the original data of historical electric energy meters, perform data cleaning and time regularization processing, and obtain regularized electric energy meter data; Extract daily load curve and weekly load curve from the regularized meter data and calculate the time similarity matrix; Obtain the geographical location information of the electric meters and the topological structure of the electric grid from the electric grid topology database, calculate the electrical distance and geographical distance between the electric meters, and generate a spatial similarity matrix; The temporal similarity matrix and the spatial similarity matrix are combined to calculate the spatiotemporal similarity. The hierarchical clustering algorithm is applied to form meter clusters, the cluster feature vectors are extracted, and the spatiotemporal characteristic model of the meter data is constructed.
3. According to claim 2, a distributed storage method for electric energy meter data based on improved PoS consensus is characterized in that: The step of calculating the time similarity matrix comprises: Receive the regularized meter data and extract the daily load curve and weekly load curve of each meter; Use Fourier transform to extract the spectrum characteristics of meter data; Based on the daily load curve, weekly load curve and spectrum characteristics, the time similarity matrix between electricity meters is calculated.
4. According to claim 3, a distributed storage method for electric energy meter data based on improved PoS consensus is characterized in that: The method of extracting the spectrum characteristics of the meter data using Fourier transform is specifically as follows: Receive the regularized meter data, and for each meter, apply fast Fourier transform to convert the time domain data into frequency domain representation to obtain the original spectrum data; Through power spectral density analysis, significant frequency components are identified from the original spectrum data to obtain the main spectrum components; Extracting spectrum characteristic parameters, including daily cycle intensity, weekly cycle intensity, monthly cycle intensity and seasonal cycle intensity; Apply bandpass filters to separate the fluctuation characteristics of different time scales, including short-term fluctuations, medium-term fluctuations, and long-term fluctuations; The fluctuation intensity index of each time scale is calculated, and the spectrum characteristic parameters and the fluctuation intensity index are integrated to form the spectrum feature vector of the meter data.
5. The method for distributed storage of electric energy meter data based on improved PoS consensus according to claim 2 is characterized in that: The specific method of combining the temporal similarity matrix and the spatial similarity matrix to calculate the temporal and spatial similarity is: Receive the temporal similarity matrix and the spatial similarity matrix, and set the initial temporal weight and spatial weight; The cross-validation method was applied to try different combinations of time weights and space weights, calculate the weighted spatiotemporal similarity, and evaluate the cohesion and separation of the clustering results under each set of weights, using the silhouette coefficient as the evaluation index; Select the weight combination with the highest silhouette coefficient as the optimal weight; Calculate the final spatiotemporal similarity matrix using the optimal weights; For meter pairs whose similarity is lower than the threshold, their similarity values are reset to 0 to form a sparse spatiotemporal similarity matrix.
6. The method for distributed storage of electric energy meter data based on improved PoS consensus according to claim 1 is characterized in that: The steps of grouping nodes to form node clusters and calculating the affinity between the meter clusters and the node clusters include: Receive the spatiotemporal characteristic model of electric energy meter data, node performance indicators, node geographic location and network delay matrix; Based on the node geographic location and network delay matrix, a clustering algorithm is applied to cluster the nodes into node clusters; The affinity between the meter cluster and the node cluster is calculated, and the affinity takes into account the geographical location factor, network delay factor and load matching factor.
7. The method for distributed storage of electric energy meter data based on improved PoS consensus according to claim 6 is characterized in that: The specific method for calculating the affinity between the meter cluster and the node cluster is: Receive the node cluster and the spatiotemporal characteristic model of the electric energy meter data, and extract the electric energy meter cluster set and the feature vector set therefrom; For each meter cluster and node cluster, calculate: The distance between the geographic center of the meter cluster and the geographic center of the node cluster is converted into geographic affinity; The average network delay between the meters in the meter cluster and the nodes in the node cluster is converted into network affinity; The matching degree between the data volume and access frequency of the meter cluster and the computing power and storage capacity of the node cluster is used to obtain the load affinity; Based on geographic affinity, network affinity and load affinity, a total affinity is formed; Based on the affinity values between all meter clusters and node clusters, an affinity matrix is constructed and output.
8. The method for distributed storage of electric energy meter data based on improved PoS consensus according to claim 1 is characterized in that: The steps to design a data heat evaluation function and formulate a hot data replication strategy and a data lifecycle management strategy include: Receive the spatiotemporal optimized sharding scheme and spatiotemporal characteristic model of electric energy meter data of the previous cycle; Analyze meter data access logs, design data heat evaluation functions, and evaluate meter data access frequency; Based on the data heat evaluation function, identify the hot data set and the cold data set; Select additional replication nodes and formulate a hot data replication strategy based on the geographic distribution of access to the hot data set; Analyze the time characteristics of meter data and form a data lifecycle management strategy based on the constructed data hierarchical storage strategy and data automatic migration mechanism; Update the spatiotemporal optimized sharding scheme and output the final spatiotemporal optimized sharding scheme.
9. The method for distributed storage of electric energy meter data based on improved PoS consensus according to claim 1 is characterized in that: The method also includes: Obtain regional real-time load data and substation load data, and calculate load fluctuation indicators; Determine the current load status based on regional real-time, substation load data and load fluctuation indicators combined with preset thresholds; Obtain the original staked amount, regional information, and historical reliability indicators of the node, and calculate the adjusted staked amount; Calculate the load-adjusted node weight based on the load status, substation load data, adjusted pledge amount and node area information; Wherein, the step of calculating the load fluctuation index comprises: Obtain regional real-time load data and substation load data from the SCADA system; Apply sliding window averaging to the regional real-time load data to obtain smoothed load data; The load fluctuation index is obtained by calculating the square root of the mean of the squares of the differences between the regional real-time load data and the smoothed load data.
10. The method for distributed storage of electric energy meter data based on improved PoS consensus according to claim 6, characterized in that: The step of determining the current load state comprises: receiving smoothed load data and load fluctuation indicators, and classifying the grid load status into high load and high fluctuation, high load and low fluctuation, low load and high fluctuation, or low load and low fluctuation according to preset load thresholds and fluctuation thresholds; Output current load status and substation load data; The step of calculating the load-adjusted node weights comprises: Receive load status, substation load data, adjusted stake amount, and node area information; According to the node area information, a mapping matrix between nodes and substations is constructed to associate the nodes with the corresponding substations; Set weight adjustment factors according to different load states and calculate load state adjustment items; Based on the adjusted stake amount and load status adjustment item, the load-adjusted node weight is calculated.
Citation Information
Patent Citations
Safe storage method and system for electric energy data
CN112203247A
Business data management method and device of electric power internet of things
CN112560098A
Household intelligent electric meter data storage system and method based on alliance block chain
CN113468551A
Cloud data placement strategy management system introducing SaaS features
CN116319815A
Method and system for processing power utilization data of power supply transfer users based on alliance chain
CN116680753A
Cited By
Power centralized control center data verification and backup method and device
CN120540903A
A method and apparatus for data verification and backup in a power control center
CN120540903B
Data security sharing method and system
CN121356850A
