Energy data secure and efficient traceability method and system based on blockchain

By using a blockchain-based method to process the mutation characteristics and frequency domain characteristics of energy data, combined with the Gram angle field algorithm and the blockchain hash algorithm, it solves the problem of abnormal data capture in energy data traceability management and realizes energy data Efficient accuracy and security of traceability.

CN118133202BActive Publication Date: 2024-09-27ECONOMIC TECH RES INST OF STATE GRID HENAN ELECTRIC POWER +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410321303.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-20
Publication Date
2024-09-27
Estimated Expiration
2044-03-20

AI Technical Summary

Technical Problem

In energy project management, the integration of multi-node electronic data sharing of energy data is poor, resulting in inaccurate energy data traceability management, and is easily affected by external environmental interference and natural noise, resulting in abnormal missing and affecting the accuracy of data. The traditional K-Means algorithm cannot effectively capture the frequency domain changes of energy data when processing time-frequency spatial data, resulting in poor abnormal data capture effect.

Method used

Using a blockchain-based method, we obtain the energy data sequence, calculate the mutation trend coefficient and highlighted feature values, perform Fourier transform to obtain the frequency domain sequence, and combine the Gram angle field algorithm and the blockchain hash algorithm to analyze abnormal data Processing and traceability to ensure data accuracy and security.

Benefits of technology

Effectively judge and process abnormal mutation data in energy data, accurately obtain abnormal data through frequency domain analysis and clustering algorithms, ensure the efficiency and accuracy of the energy data traceability process, and improve the credibility and transparency of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118133202B
    Figure CN118133202B
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a safe and efficient energy data tracing method and system based on blockchain, the method comprising: obtaining an energy data sequence, analyzing the numerical anomalies of the energy data sequence, constructing an energy mutation trend coefficient and an energy mutation highlighting characteristic numerical value; obtaining an energy mutation frequency domain sequence in combination with Fourier transform; constructing an energy data frequency index based on the anomalies of the frequency domain numerical value; obtaining energy anomaly significant numerical values; improving the clustering cost function in combination with the Gram angular field algorithm, obtaining abnormal data points, and processing the abnormal data points to obtain an energy data state representation sequence; obtaining an energy data blockchain code in combination with a blockchain hash algorithm, and completing the tracing of energy data. The present invention aims to effectively obtain abnormal data points of energy data and improve the validity and reliability of energy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a blockchain-based method and system for secure and efficient energy data tracing. Background Art

[0002] Energy project management projects involve multi-node electronic data across business processes. The data sources are complex and highly dispersed. The sharing and integration between a large number of multi-source heterogeneous energy data is poor, which makes it difficult to accurately obtain effective information on energy data during energy data traceability management. At the same time, in the process of energy data collection and acquisition, it is very susceptible to external environmental interference and natural random noise, resulting in abnormal missing energy data, which greatly affects the accuracy and effectiveness of energy data traceability.

[0003] The traditional K-Means algorithm is a clustering algorithm based on distance measurement, which can assign data points to the nearest cluster. If some data points are far away from the center point of the cluster to which they belong, it may indicate that these data points are outliers. Therefore, the K-Means algorithm can be used for anomaly detection to help identify and exclude abnormal data. However, when processing time-frequency spatial data such as energy data, the traditional K-Means algorithm may not be able to capture the frequency domain variation characteristics of energy data well, resulting in poor capture of abnormal energy data. Summary of the invention

[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a safe and efficient energy data traceability method and system based on blockchain. The technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present invention provides a safe and efficient energy data traceability method based on blockchain, the method comprising the following steps:

[0006] Obtain the energy data sequence at each time, that is, the sequence composed of energy data at all moments of each time;

[0007] According to the numerical distribution characteristics of the energy data series at each time, the energy mutation trend coefficient at each time is obtained; according to the energy mutation trend coefficient at each time and the energy data distribution at each moment, the energy mutation prominent characteristic value at each moment is obtained;

[0008] The energy mutation highlighting characteristic values ​​of all moments at each time are sorted in chronological order to form the energy mutation highlighting characteristic sequence at each time; the energy mutation frequency domain sequence at each moment is obtained according to the energy mutation highlighting characteristic sequence at each time combined with Fourier transform; the energy data co-frequency index at each moment is obtained according to the data change characteristics of the energy mutation frequency domain sequence at each moment; the energy abnormal significant value at each moment is obtained according to the energy data co-frequency index at each moment and the energy mutation highlighting characteristic value;

[0009] According to the energy anomaly significant values ​​at all moments at each time, combined with the Gram angular field algorithm, the anomaly significant data category at each time is obtained; according to the data position distribution in the anomaly significant data category at each time, the abnormal data in the energy data sequence at each time is processed to obtain the energy data state representation sequence at each time;

[0010] The energy data blockchain code is obtained based on the energy data status representation sequence at all times combined with the blockchain hash algorithm to complete the traceability of the energy data.

[0011] Preferably, the step of obtaining the energy mutation trend coefficient at each time according to the numerical distribution characteristics of the energy data sequence at each time includes:

[0012] For the energy data sequence at each time, obtain the mean and standard deviation of the energy data sequence; calculate the ratio of the mean to the standard deviation; obtain the short time segment sequence at each moment; obtain the range value of the short time segment sequence at each moment; obtain the maximum and minimum values ​​of the range value of the short time segment sequence at each moment and other moments; calculate the result of dividing the maximum value by the minimum value; calculate the sum of the results between all moments of the energy data sequence at each time and other moments; and use the normalized value of the product of the ratio and the sum as the energy mutation trend coefficient at each time.

[0013] Preferably, the obtaining of the short time segment sequence at each moment is specifically as follows:

[0014] Based on the energy data sequence at each time, the energy data at each moment is taken as the starting point, and energy data of a preset length of moments are acquired backward as a short time segment sequence at each moment.

[0015] Preferably, the method of obtaining the energy mutation prominent characteristic value at each moment according to the energy mutation trend coefficient at each time in combination with the energy data distribution at each moment includes:

[0016] For the energy data sequence at each time, calculate the mean of the short-time segment sequence at each moment; calculate the absolute value of the difference between the energy data at each moment and the mean of the corresponding short-time segment sequence; and take the product of the absolute value of the difference and the product of the energy mutation trend coefficient at each time as the energy mutation highlighting feature value at each moment.

[0017] Preferably, the energy mutation frequency domain sequence at each moment is obtained by combining the energy mutation feature sequence at each time with Fourier transform, including:

[0018] Based on the energy mutation highlighting feature sequence at each time, the local mutation highlighting feature sequence at each moment is obtained by using the same method as the short time segment sequence at each moment;

[0019] The local mutation highlighting feature sequence at each moment is taken as the input of the Fourier transform algorithm, and the output frequencies and corresponding amplitudes are recorded as the first dimension and the second dimension of the energy frequency domain binary group respectively; the sequence composed of all energy frequency domain binary groups at each moment is taken as the energy mutation frequency domain sequence at each moment.

[0020] Preferably, the step of obtaining the energy data co-frequency index at each moment according to the data change characteristics of the energy mutation frequency domain sequence at each moment includes:

[0021] For the energy mutation highlighting feature sequence at each time, the spectrum entropy of the energy mutation frequency domain sequence at each moment is calculated; the expression of the energy data frequency index at each moment is:

[0022]

[0023] Where, vF t,k represents the energy data frequency index at the kth moment in time t, exp[] represents the exponential function with natural constant as the base, Nm t represents the number of energy mutation frequency domain sequences at time t, Len represents the preset length, Eud() represents the Euclidean distance function, d t,m,z d t,k,z Respectively represent the zth energy frequency domain binary in the energy mutation frequency domain sequence at the mth and kth moments of time t, En t,m 、En t,k They respectively represent the spectral entropy of the energy mutation frequency domain sequence at the mth and kth moments in the energy mutation highlighting feature sequence at time t.

[0024] Preferably, the energy anomaly significance value at each moment is the ratio of the energy data co-frequency index at each moment to the energy mutation highlighting characteristic value.

[0025] Preferably, the abnormal significant data category at each time is obtained based on the energy abnormal significant values ​​at all moments in each time in combination with the Gram angular field algorithm, specifically:

[0026] Arrange the energy anomaly significance values ​​at all moments in time in chronological order to form an energy anomaly significance sequence at each time;

[0027] The energy anomaly significant sequence is used as the input of the Gram angular field algorithm, and the output of the Gram angular field algorithm is the two-dimensional energy significant data at each time; the maximum data point and the minimum data point of the two-dimensional energy significant data are used as the initial class centers of two different categories of energy anomaly data and normal data respectively;

[0028] The clustering cost function at each time is as follows:

[0029]

[0030] In the formula, J t represents the clustering cost function at time t, Sm p Represents the pth value of the two-dimensional energy significant data, Sm c represents the value at the center point of the cth class of the two-dimensional energy significant data, K represents the number of preset categories, and n represents the length of the energy anomaly significant sequence;

[0031] The two-dimensional energy significant data are clustered using a K-means clustering algorithm according to a clustering cost function, and a data class with the largest sum of all data is used as the abnormal significant data category at each time.

[0032] Preferably, the processing of abnormal data in the energy data sequence at each time according to the data position distribution in the abnormal significant data category at each time to obtain the energy data state representation sequence at each time includes:

[0033] For the energy data sequence at each time, the data point at the corresponding time of the two-dimensional energy significant data in the abnormal significant data category is taken as the abnormal data point in the energy data sequence;

[0034] If there are abnormal data points in M ​​consecutive short time segments, resampling is performed; otherwise, the abnormal data points in the energy data sequence are filled using the mean method; where M is a preset value;

[0035] The processed energy data sequence at each time is used as the energy data state representation sequence at each time.

[0036] In the second aspect, an embodiment of the present invention also provides a safe and efficient energy data traceability system based on blockchain, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of any one of the above methods when executing the computer program.

[0037] The present invention has at least the following beneficial effects:

[0038] The present invention mainly calculates the energy mutation trend coefficient based on the energy data series at different times, constructs the energy mutation prominent characteristic value, and can effectively judge the abnormal mutation data status in the energy data. At the same time, the frequency domain characteristics of the energy mutation prominent characteristic value are analyzed, and the energy data co-frequency index is constructed. The abnormal changes in the energy data are further distinguished and characterized by calculations combined with the numerical change characteristics in the frequency domain. Furthermore, the embodiment of the present invention constructs two-dimensional energy significant data and calculates the clustering cost function of the energy abnormal significant sequence, and combines the clustering cost function to perform clustering to more accurately obtain the abnormal data in the energy data sequence, thereby ensuring high efficiency and accuracy in the energy data traceability process. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 A flowchart of the steps of a blockchain-based secure and efficient energy data traceability method provided for one embodiment of the present invention.

[0041] Figure 2 Flowchart for obtaining energy data state characterization sequence. DETAILED DESCRIPTION

[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the energy data safe and efficient traceability method and system based on blockchain proposed by the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0043] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0044] The specific scheme of the energy data safe and efficient traceability method and system based on blockchain provided by the present invention is described in detail below with reference to the accompanying drawings.

[0045] See also Figure 1 , which shows a flowchart of a method for secure and efficient energy data tracing based on blockchain provided by an embodiment of the present invention, the method comprising the following steps:

[0046] Step S1: Collect energy time series data.

[0047] Energy data traceability is of great significance for ensuring the credibility, quality management and transparency of energy data. This embodiment mainly analyzes and processes the effectiveness of the energy data traceability process. In the new energy network, a variety of electrical sensors will be deployed to collect energy data at different times to monitor the operating status of the energy network in real time.

[0048] Assume that at time t, the energy data sequence obtained is Ev t ={ev t,1 ,ev t,2 ,…,ev t,n}, where ev t,1 ,ev t,2 andev t,n Respectively represent the energy data at the first moment, the second moment and the nth moment in time t. Considering that the energy system has an operational failure at a certain time, resulting in missing data in the energy data sequence obtained at the corresponding time. Therefore, the energy data sequence collected and obtained at different times is used as the input of the cubic spline interpolation algorithm, and the missing data of the energy data sequence at different times are interpolated and filled, so as to reduce or even eliminate the error effect of the missing data in the energy data sequence at different times on the subsequent calculation process as much as possible. The specific calculation process of the cubic spline interpolation algorithm is a well-known technology and will not be repeated here.

[0049] At this point, the energy data sequence at each time is obtained, which contains the energy data at each moment.

[0050] Step S2: Obtain a short-time segment sequence based on the energy data sequence, and analyze the abnormal situation of the energy data in combination with the overall numerical distribution characteristics to construct the energy mutation trend coefficient and the energy mutation highlighting characteristic value.

[0051] Due to the influence of external noise interference, energy data with abnormal values ​​will appear in the energy data sequence at a certain time. Since the external noise interference has strong randomness in value, the fluctuation of the value of the energy data obtained at the corresponding time is more drastic and obvious than the energy data under normal conditions. Considering that the random noise interference of abnormal energy data lasts for a relatively short time, in order to accurately calculate the numerical fluctuation state in the abnormal energy data, in the energy data sequence at each different time, taking the energy data at each moment as the starting point, a short time segment sequence of length Len can be obtained. In this embodiment, the short time segment length Len is 15. In actual applications, the implementer can set it according to the specific situation. Considering that there may be energy data that cannot obtain a short time segment sequence of length Len, the mean interpolation method is used to fill it. The energy mutation trend coefficient at time t is calculated in this way, and the expression is:

[0052]

[0053] Where Fc t represents the energy mutation trend coefficient at time t, Norm[] represents the normalization function, σEv t Represents the standard deviation of the energy data series at time t, μEv t Represents the mean of the energy data series at time t, NL t Represents the total number of short time segment sequences in the energy data sequence at time t, Min() and Max() represent the minimum and maximum value functions respectively, and ExR i 、ExR j They represent the extreme values ​​of the short time segment sequences in the i-th and j-th energy data sequences respectively.

[0054] The above formula can be used to obtain the values ​​of the energy mutation trend coefficient at different times. If the value of the coefficient of variation calculated by the standard deviation and mean of the energy data sequence at time t is larger, and the ratio between the ranges of the short time segment sequence is larger, then the value of the energy mutation trend coefficient of the energy data sequence at the corresponding time will also be relatively large, indicating that the numerical differences of energy data at different times in the energy data sequence at time t are relatively obvious, and there is a greater possibility of abnormal energy data.

[0055] Furthermore, the abnormal characteristics of energy data at each moment are determined, and the energy mutation trend coefficient at time t is used to calculate the energy mutation prominent characteristic value at each moment. The expression is:

[0056] dv t,k =|ev t,k -Mean t,k |×Fc t

[0057] In the formula, dv t,k represents the energy mutation highlighting characteristic value at the kth moment in the energy data sequence at time t, ev t,k Represents the energy data at the kth moment in the energy data sequence at time t, Mean t,k Fc represents the mean of the short time segment sequence at the kth moment in the energy data sequence at time t. t Represents the energy mutation trend coefficient at time t.

[0058] The above formula can be used to obtain the energy mutation highlighting feature values ​​at different time positions in the energy data sequence at different times. If the energy data at time k is abnormal due to interference from factors such as external environmental noise, the energy data at time k will have a large numerical difference from the mean in the short time segment sequence. At the same time, the value of the energy mutation trend coefficient corresponding to time t will also be relatively large. At this time, the energy mutation highlighting feature dv at the kth moment in the energy data sequence at time t is t,k The value of will also be relatively large, indicating that the energy data at the current time is likely to be an abnormal data point.

[0059] Step S3: Analyze the frequency domain characteristics of the energy mutation highlighting characteristic values ​​at all times, construct the energy data frequency index, and construct the energy anomaly significant value in combination with the energy mutation highlighting characteristic values.

[0060] It should be noted that if the operating load trend of the energy system under the current time state is relatively high, the energy mutation highlighting feature value calculated at the corresponding time in the energy mutation highlighting feature sequence will also be relatively large. At this time, it is difficult to effectively distinguish the abnormal energy data in the energy system based on the value of the energy mutation highlighting feature sequence. Therefore, it is necessary to further calculate in combination with the data characteristics in the frequency domain.

[0061] Specifically, the energy mutation highlighting feature values ​​at all moments in the energy data sequence at time t are arranged in order to form an energy mutation highlighting feature sequence at time t. In the energy mutation highlighting feature sequence at time t, first take each moment as the starting point to obtain a local mutation highlighting feature sequence of length Len. The local mutation highlighting feature sequence at each moment is used as the input of the Fourier transform (FFT) algorithm, and the output frequencies and corresponding amplitudes are recorded as the first dimension and the second dimension of the energy frequency domain binary, respectively. All energy frequency domain binary groups are formed into an energy mutation frequency domain sequence at each moment. The specific calculation process of the Fourier transform algorithm is a well-known technology and will not be repeated here. Therefore, the energy data co-frequency index at each moment is calculated according to the energy mutation frequency domain sequence at each moment in time t, and the expression is:

[0062]

[0063] Where, vF t,k represents the energy data frequency index at the kth moment in time t, exp[] represents the exponential function with natural constant as the base, Nm t represents the number of energy mutation frequency domain sequences at time t, Len represents the preset length, Eud() represents the Euclidean distance function, d t,m,z d t,k,z Respectively represent the zth energy frequency domain binary in the energy mutation frequency domain sequence at the mth and kth moments of time t, En t,m 、En t,k They respectively represent the spectral entropy of the energy mutation frequency domain sequence at the mth and kth moments in the energy mutation highlighting feature sequence at time t.

[0064] The above formula can be used to obtain the energy data co-frequency index at different times. If the Euclidean distance of the energy frequency domain binary between two different energy mutation frequency domain sequences in the same energy mutation highlighting feature sequence is smaller, and the difference in the spectral entropy values ​​of the two different energy mutation frequency domain sequences calculated at the same time is also relatively small, then the energy data co-frequency index of the energy mutation frequency domain sequence calculated at this time will be larger, indicating that the current energy mutation frequency domain sequence has a strong co-frequency correlation state with other energy mutation frequency domain sequences at different time positions in the frequency domain. If the energy mutation highlighting feature value in the local mutation highlighting feature sequence in the corresponding time domain is also relatively large.

[0065] It is understandable that if the energy mutation highlighting feature value in the energy mutation highlighting feature sequence is larger, but the energy frequency index of the energy mutation frequency domain sequence in the frequency domain is smaller, it means that the current energy mutation highlighting feature sequence is more likely to reflect the energy abnormal data state caused by external interference noise. Therefore, the abnormal data state of the energy data sequence is further distinguished and calculated by combining the energy data frequency index at different times.

[0066] Specifically, the ratio of the energy mutation highlighting feature value at different moments in the energy mutation highlighting feature sequence at each different time to the energy data isofrequency index of the energy mutation frequency domain sequence at the corresponding moment is recorded as the energy anomaly significance value.

[0067] Step S4: Perform cluster analysis on energy data based on significant energy anomaly values ​​combined with the Gram angular field algorithm.

[0068] It should be noted that the energy anomaly significant sequence is used to distinguish and characterize the state of abnormal data in the energy data sequence. In order to further accurately obtain the abnormal data in the energy data sequence, it is necessary to further calculate and analyze the energy anomaly significant sequence. Since it is difficult to accurately divide the position of abnormal data from the perspective of one-dimensional time series data, the dimension of the energy anomaly significant sequence is expanded by changing to achieve the purpose of accurately dividing the position of abnormal data in the energy data sequence.

[0069] Specifically, the energy anomaly significant values ​​of all moments at each time are arranged in the order of the moments to obtain the energy anomaly significant sequence at each time. The energy anomaly significant sequence at each time is used as the input of the Gramian Angular Field (GAF) algorithm to obtain the two-dimensional energy significant data at each time. In the two-dimensional energy significant data, each data point represents the degree of correlation between the time point in the energy anomaly significant sequence and other time points in the one-dimensional time series. If the degree of correlation between the two different moments before and after the one-dimensional energy anomaly significant sequence is higher, the values ​​at the intersection of the rows and columns in the converted two-dimensional energy significant data at the two different moments will also be correspondingly larger. The specific calculation process of the Gram Angular Field algorithm to convert one-dimensional data into two-dimensional data is a well-known technology and will not be repeated here. The clustering cost function for each time based on the two-dimensional energy significant data is constructed as follows:

[0070]

[0071] In the formula, J t represents the clustering cost function at time t, Sm p Represents the pth value of the two-dimensional energy significant data, Sm c It represents the value at the center point of the cth class of the two-dimensional energy significant data, K represents the number of preset categories, and n represents the length of the energy anomaly significant sequence.

[0072] The above formula can be used to obtain the clustering cost function of the energy anomaly significant sequence at different times. In this embodiment, the preset number of categories K=2 represents two categories of energy anomaly data and normal data. The maximum data point and the minimum data point of the two-dimensional energy significant data are used as the initial class centers of the two different categories of energy anomaly data and normal data, respectively, and the clustering cost function is used as the K-means clustering function. When the clustering cost function takes the minimum value, it is considered that the K-means clustering function converges, the two-dimensional energy significant data is clustered into two different categories, and the category with the largest sum of all data is recorded as the abnormal significant data category of the two-dimensional energy data at time t.

[0073] It can be understood that since the length of each dimension of the two-dimensional energy significant data is n, as is the length of the energy abnormal significant sequence and the length of the energy data sequence. The data points at the corresponding moments of the two-dimensional energy significant data in the abnormal significant data category are used as abnormal data points in the energy data sequence. The abnormal data points in the energy data sequence are replaced and filled with the mean of the two adjacent points on the left and right. In particular, if there are S consecutive short time segment sequences of length Len that all contain abnormal data, it is considered that the current sensor has a serious fault and needs to be resampled after troubleshooting the sensor fault. In this embodiment, the value of S is 3.

[0074] The energy data sequence after the abnormal data is removed is recorded as the energy data state representation sequence. The process of obtaining the energy data state representation sequence is as follows: Figure 2 shown.

[0075] Step S5: further traceability analysis based on the energy data status characterization sequence.

[0076] The energy data and its timestamp at different moments in the energy data state representation sequence are used as the input of the blockchain hash algorithm. After calculation, the energy data blockchain code is formed. The energy data blockchain code is uploaded to the chain and stored in the energy data blockchain, and the energy data is traced safely and efficiently based on the energy data blockchain.

[0077] Based on the same inventive concept as the above method, an embodiment of the present invention also provides a blockchain-based energy data security and efficient traceability system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of any one of the above-mentioned blockchain-based energy data security and efficient traceability methods are implemented.

[0078] In summary, the embodiment of the present invention calculates the energy mutation trend coefficient based on the energy data sequence at different times, constructs the energy mutation prominent characteristic value, and can effectively judge the abnormal mutation data status existing in the energy data. At the same time, the frequency domain characteristics of the energy mutation prominent characteristic value are analyzed, and the energy data co-frequency index is constructed. The abnormal changes in the energy data are further distinguished and characterized by calculations combined with the numerical change characteristics in the frequency domain. Furthermore, this embodiment constructs two-dimensional energy significant data and calculates the clustering cost function of the energy abnormal significant sequence, and combines the clustering cost function for clustering to more accurately obtain the abnormal data in the energy data sequence, thereby ensuring high efficiency and accuracy in the energy data traceability process.

[0079] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0080] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0081] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A secure and efficient energy data traceability method based on blockchain, characterized by: The method comprises the following steps: Obtain the energy data sequence at each time, that is, the sequence composed of energy data at all moments of each time; The energy mutation trend coefficient at each time is obtained based on the numerical distribution characteristics of the energy data series at each time; the energy mutation prominent characteristic value at each time is obtained based on the energy mutation trend coefficient at each time and the energy data distribution at each time; The energy mutation highlighting feature values ​​at all moments of each time are sorted in chronological order to form the energy mutation highlighting feature sequence at each moment; the energy mutation highlighting feature sequence at each moment is combined with Fourier transform to obtain the energy mutation frequency domain sequence at each moment; the energy data co-frequency index at each moment is obtained based on the data change characteristics of the energy mutation frequency domain sequence at each moment; the energy anomaly significance value at each moment is obtained based on the energy data co-frequency index at each moment and the energy mutation highlighting feature value; Obtain the significant abnormal data category at each time based on the significant energy abnormal values ​​at all times combined with the Gram angular field algorithm; process the abnormal data in the energy data sequence at each time based on the data position distribution in the significant abnormal data category at each time to obtain the energy data state representation sequence at each time; The energy data blockchain code is obtained based on the energy data status representation sequence at all times combined with the blockchain hash algorithm to complete the traceability of energy data; The method of obtaining the energy mutation trend coefficient at each time according to the numerical distribution characteristics of the energy data series at each time includes: For the energy data sequence at each time, obtain the mean and standard deviation of the energy data sequence; calculate the ratio of the mean to the standard deviation; obtain the short time segment sequence at each moment; obtain the range value of the short time segment sequence at each moment; obtain the maximum and minimum values ​​of the range values ​​of the short time segment sequence at each moment and other moments; calculate the result of dividing the maximum value by the minimum value; calculate the sum of the results of all moments of the energy data sequence at each time and other moments; and use the normalized value of the product of the ratio and the sum as the energy mutation trend coefficient at each time; The energy mutation trend coefficient at each time is combined with the energy data distribution at each moment to obtain the energy mutation prominent characteristic value at each moment, including: For the energy data sequence at each time, calculate the mean of the short-term segment sequence at each moment; calculate the absolute value of the difference between the energy data at each moment and the mean of the corresponding short-term segment sequence; and take the product of the absolute value of the difference and the energy mutation trend coefficient at each time as the energy mutation prominent characteristic value at each moment; The energy mutation frequency domain sequence at each moment is obtained by combining the energy mutation feature sequence at each time with Fourier transform, including: Based on the energy mutation highlighting feature sequence at each time, the local mutation highlighting feature sequence at each moment is obtained using the same method as the short time segment sequence at each moment; The local mutation highlight feature sequence at each moment is used as the input of the Fourier transform algorithm, and the output frequencies and corresponding amplitudes are recorded as the first dimension and second dimension of the energy frequency domain binary. The sequence composed of all energy frequency domain binary tuples at each moment is used as the energy mutation frequency domain sequence at each moment. The method of obtaining the energy data co-frequency index at each moment according to the data change characteristics of the energy mutation frequency domain sequence at each moment includes: For the energy mutation highlighting feature sequence at each time, the spectrum entropy of the energy mutation frequency domain sequence at each moment is calculated; the expression of the energy data frequency index at each moment is: Where, vF t,k represents the energy data frequency index at the kth moment in time t, exp[] represents the exponential function with a natural constant as the base, Nm t Indicates the number of energy mutation frequency domain sequences at time t, Len indicates the preset length, Eud() indicates the Euclidean distance function, d t,m,z d t,k,z En represents the zth energy frequency domain binary in the energy mutation frequency domain sequence at the mth and kth moments of time t, respectively. t,m 、En t,k They represent the spectral entropy of the energy mutation frequency domain sequence at the mth and kth moments in the energy mutation highlighting feature sequence at time t respectively; The energy anomaly significance value at each moment is the ratio of the energy data frequency index at each moment to the energy mutation prominent characteristic value; The energy anomaly significant values ​​at all moments in time are combined with the Gram angular field algorithm to obtain the anomaly significant data category at each time, specifically: Arrange the significant energy anomaly values ​​at all moments in time in chronological order to form a significant energy anomaly sequence at each time; The energy anomaly significance sequence is used as the input of the Gram's angle field algorithm, and the output of the Gram's angle field algorithm is the two-dimensional energy significance data at each time; the maximum data point and the minimum data point of the two-dimensional energy significance data are used as the initial class centers of two different categories of energy anomaly data and normal data respectively; The clustering cost function at each time is as follows: Where, J t represents the clustering cost function at time t, Sm p Indicates the pth value of the two-dimensional energy significant data, Sm c represents the value at the center point of the cth class of the two-dimensional energy significant data, K represents the number of preset classes, and n represents the length of the energy anomaly significant sequence; The two-dimensional energy significant data are clustered using a K-means clustering algorithm according to a clustering cost function, and a data class with the largest sum of all data is used as the abnormal significant data class at each time; The process of processing abnormal data in the energy data sequence at each time according to the data position distribution in the abnormally significant data category at each time to obtain the energy data state representation sequence at each time includes: For the energy data sequence at each time, the data point at the corresponding moment of the two-dimensional energy significant data in the abnormal significant data category is regarded as the abnormal data point in the energy data sequence; If there are abnormal data points in M ​​consecutive short time segments, resampling is performed; otherwise, the abnormal data points in the energy data sequence are filled using the mean method; where M is a preset value; The processed energy data sequence at each time is used as the energy data state representation sequence at each time; The process of obtaining the energy data blockchain code is as follows: The energy data and corresponding timestamps at different moments in the energy data state representation sequence are used as the input of the blockchain hash algorithm, and the energy data blockchain code is formed after calculation.

2. The blockchain-based energy data secure and efficient traceability method according to claim 1, characterized in that: The short time segment sequence of each moment is obtained as follows: Based on the energy data sequence at each time, the energy data at each moment is taken as the starting point, and energy data of a preset length of moments are obtained backward as a short time segment sequence at each moment.

3. A secure and efficient energy data traceability system based on blockchain, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • Time series data anomaly detection method and device, equipment and storage medium

    CN112732785A

  • Rapid water pollution tracing method based on big data analysis

    CN114358456A

  • Energy system fault diagnosis method based on deep learning and Grubrum angle field image

    CN115187832A

  • Multi-department collaborative transaction data sharing and tracing method

    CN116595499A

  • Mine vertical shaft detection system and method

    CN117421616A