Virtual power plant transaction security guarantee method based on block chain technology

By conducting time-series analysis on the identity information and transaction flow of virtual power plant transactions, anomaly and transaction risk levels are constructed, and the verification strength of smart contracts is dynamically adjusted. This solves the security and efficiency problems in virtual power plant transactions and achieves a more accurate transaction security assessment and a flexible verification mechanism.

CN120996802APending Publication Date: 2025-11-21JIANGSU JUTENG NEW ENERGY CONSTR ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511093490.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Virtual power plant transactions suffer from security issues, including chaotic identity information management, identity theft, fraudulent transactions, difficulty in tracking dynamic changes in transaction flows, insufficient or excessive verification of smart contracts, and a lack of dynamic adjustment in consensus mechanisms, resulting in low transaction security and efficiency.

Method used

By conducting time-series analysis on identity information and transaction flow during virtual power plant transactions, extracting their change cycles, constructing identity anomaly and transaction risk levels, and combining security correlation and risk escalation trend, the verification strength of smart contracts is dynamically adjusted, and consensus mechanisms are used for control and regulation to achieve comprehensive and dynamic transaction security.

Benefits of technology

It achieves comprehensive and dynamic security protection for virtual power plant transactions, accurately captures transaction patterns, promptly identifies risks, dynamically adjusts verification efforts, improves transaction security and reliability, and avoids resource waste and insufficient verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120996802A_ABST
    Figure CN120996802A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of virtual power plants, and discloses a virtual power plant transaction security guarantee method based on a block chain technology. The method comprises the following steps: firstly, acquiring transaction participant identity information and a transaction flow, respectively performing time sequence analysis to extract a change period, and constructing an identity anomaly degree and a transaction risk degree; and combining the correlation and the average level of the two periods before the current moment to obtain the transaction security correlation degree. And the identity stability trend and the transaction flow fluctuation trend at adjacent sampling moments are analyzed, a risk rising trend degree is constructed, a transaction security guarantee coefficient is obtained in combination with the security association degree, and the feedback verification strength is obtained in combination with the smart contract verification strength and the preset adjustment amount. And adjusting the verification strength of the smart contract by using a consensus mechanism according to the feedback verification strength and the actual verification strength. According to the method, through dynamic analysis and adjustment, the transaction security and reliability of the virtual power plant are enhanced, and the method adapts to complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual power plant technology, specifically to a method for ensuring the security of virtual power plant transactions based on blockchain technology. Background Technology

[0002] With the rapid development of distributed energy, virtual power plants, as an important form of integrating distributed energy resources, are seeing increasingly frequent trading activities. Virtual power plants aggregate a large number of distributed energy nodes to achieve optimal energy allocation and trading; however, in this process, transaction security issues are gradually becoming prominent.

[0003] Currently, virtual power plant (VPS) trading primarily relies on a traditional centralized management model. Under this model, the storage and verification of transaction data are concentrated on a few nodes, making it vulnerable to malicious attacks and data tampering. If the central node fails or is attacked, the entire trading system may be paralyzed, leading to trading disruptions and significant economic losses. Furthermore, the participants in VPS trading are numerous and complex, including energy producers, consumers, and operators. The chaotic management of identity information for these entities, coupled with a lack of effective identity verification and monitoring mechanisms, makes identity theft and fraudulent transactions frequent occurrences.

[0004] During the transaction process, the dynamic changes in transaction flow are difficult to track and analyze in real time. Traditional risk assessment methods are often based on static data samples and cannot capture abnormal fluctuations in transactions in a timely manner. In addition, the application of smart contracts in virtual power plant transactions is becoming increasingly common, but the verification strength of smart contracts is mostly fixed and cannot be dynamically adjusted according to the actual risk situation of the transaction. This leads to insufficient verification in high-risk transaction scenarios and excessive verification in low-risk scenarios, which affects transaction efficiency.

[0005] The emergence of blockchain technology has provided a new approach to the security of virtual power plant transactions, but it still faces many challenges in practical applications. Existing blockchain-based security methods for virtual power plant transactions mostly focus on single anomaly detection indicators, such as relying solely on identity verification or transaction flow analysis to assess transaction risk. They lack in-depth consideration of the correlation between identity information and transaction flow, making it difficult to comprehensively and accurately assess the transaction security status. Furthermore, the lack of an effective dynamic adjustment mechanism for controlling the verification strength of smart contracts prevents timely responses to real-time changes in transaction risks, resulting in insufficient flexibility and adaptability in transaction security measures.

[0006] The transaction behaviors of different participants exhibit distinct time characteristics. Traditional methods ignore the time-series features of transaction data, making it difficult to identify abnormal transaction patterns with periodic variations. In the application of consensus mechanisms, the adjustment of smart contract verification strength is often based on empirical values, lacking scientific quantitative basis. This results in verification strength that is either too high, wasting resources, or too low, failing to guarantee transaction security. These problems collectively constrain the safe and stable operation of virtual power plant transactions, necessitating a transaction security guarantee method that can comprehensively consider multiple factors and dynamically adjust the verification mechanism. Summary of the Invention

[0007] The purpose of this invention is to provide a method for ensuring the security of virtual power plant transactions based on blockchain technology, so as to solve the problems mentioned in the background art.

[0008] To achieve the above objectives, the present invention provides a method for ensuring the security of virtual power plant transactions based on blockchain technology, the method comprising:

[0009] Obtain the identity information and transaction records of the participants in the virtual power plant transaction process;

[0010] Time series analysis was performed on identity information and transaction records to extract the change cycles of identity information and transaction records;

[0011] By analyzing the frequency of changes in identity information in blockchain nodes during each change cycle and the fluctuation of transaction flow over time, identity anomaly and transaction risk are constructed respectively.

[0012] Based on the correlation between identity anomaly and transaction risk in previous change cycles, as well as the average level of identity anomaly and the average level of transaction risk, the security correlation of transactions in the blockchain node at the current moment is obtained.

[0013] Analyze the stability trend of identity information and the fluctuation trend of transaction flow at multiple adjacent sampling times at the current moment to construct the risk increase trend degree of the transaction at the current moment. Combine the security correlation degree of transactions in the blockchain node to obtain the transaction security guarantee coefficient of the blockchain node at the current moment. Utilize the difference in the change of the transaction security guarantee coefficient and the verification strength and preset verification strength adjustment amount in the smart contract at the current moment to obtain the feedback verification strength in the smart contract at the current moment.

[0014] Based on the current verification strength within the smart contract and the actual verification strength, the verification strength of the smart contract is controlled and adjusted using a consensus mechanism.

[0015] Preferably, the extraction of the change cycle of the identity information and transaction flow further includes:

[0016] Obtain vectors composed of identity information and transaction records from all historical sampling moments within a preset time period prior to the current moment, arranged in chronological order, and use them as the identity vector and transaction record vector for the current moment.

[0017] Perform time series analysis on the identity vector at the current moment to obtain the feature values ​​of all time points in the sequence. Take the reciprocal of the time interval corresponding to the largest feature value as the identity change cycle in the short period before the current moment. Correspondingly, for the transaction flow vector, use hash value change detection to obtain the transaction change cycle in the short period before the current moment.

[0018] Preferably, the construction of the identity anomaly degree further includes:

[0019] The identity information of each identity change cycle before the current time is arranged in ascending order of time to form the identity cycle vector of each identity change cycle. Correspondingly, for the transaction flow in each transaction cycle, the transaction cycle vector of each transaction change cycle is obtained.

[0020] For each identity cycle vector, obtain the first-order difference sequence of the identity cycle vector, count the number of all non-zero elements in the first-order difference sequence, and record it as the change frequency. Calculate the mean of the absolute values ​​of all non-zero elements in the first-order difference sequence, and record it as the average change amplitude. The product of the change frequency and the average change amplitude is used as the identity anomaly degree in each identity change cycle.

[0021] Preferably, the construction of the transaction risk level further includes:

[0022] For each trading cycle vector, the mean of the absolute values ​​of all elements in the first-order difference sequence of the trading cycle vector is calculated as the trading risk level for each trading cycle.

[0023] Preferably, the calculation logic for the security correlation of transactions in the blockchain node at the current moment is as follows:

[0024] The security correlation is determined by the correlation between the identity anomaly vector and the transaction risk vector at the current moment, the mean of the elements in the identity anomaly vector at the current moment, and the mean of the elements in the transaction risk vector at the current moment. The identity anomaly of all identity change cycles is arranged in ascending order of time to form the identity anomaly vector at the current moment, and the transaction risk of all transaction change cycles is arranged in ascending order of time to form the transaction risk vector at the current moment.

[0025] Preferably, the construction of the upward trend of risk in the current transaction includes:

[0026] The multiple times with the closest time interval to the current time are all taken as the adjacent sampling times of the current time. Based on the changes in identity information and transaction flow at the multiple adjacent sampling times, the identity stability trend and transaction fluctuation trend at the current time are obtained.

[0027] The product of the current stability trend and the current trading volatility trend is determined as the current risk level of trading.

[0028] Preferably, the current identity stability trend and transaction volatility trend further include:

[0029] The identity information and transaction records of the multiple adjacent sampling times are arranged in ascending order of time to form the identity trend vector and transaction trend vector at the current time. The first-order difference vectors of the identity trend vector and transaction trend vector at the current time are calculated respectively.

[0030] The sum of the absolute values ​​of all negative values ​​within the first-order difference vector of the identity trend vector is taken as the identity stability trend quantity at the current moment, and the sum of all positive values ​​within the first-order difference vector of the trading trend vector is taken as the trading fluctuation trend quantity at the current moment.

[0031] Preferably, the calculation process for the transaction security guarantee coefficient of the blockchain node at the current moment is as follows:

[0032] The transaction security guarantee coefficient is jointly determined by the security correlation of transactions in the blockchain node at the current moment and the risk increase trend of transactions at the current moment, and reflects the combined effect of the two through an exponential function relationship.

[0033] Preferably, the calculation process for the feedback verification strength within the smart contract at the current moment is as follows:

[0034] The feedback verification strength is determined by the verification strength within the smart contract at the current moment, the transaction security guarantee coefficient at the current moment, the transaction security guarantee coefficient at the previous sampling moment, and the preset verification strength adjustment amount.

[0035] Preferably, the method of controlling and adjusting the verification strength of smart contracts using a consensus mechanism further includes:

[0036] Obtain the difference between the current verification strength and the actual verification strength within the smart contract. Select a preset consensus algorithm type based on the magnitude of the difference. By adjusting the weight of verification nodes or the verification threshold in the algorithm, achieve hierarchical control and adjustment of the smart contract verification strength.

[0037] Compared with the prior art, the beneficial effects of the present invention are:

[0038] By conducting in-depth analysis of the identity information and transaction flow of the participants in the virtual power plant transaction process, comprehensive and dynamic protection of transaction security has been achieved.

[0039] This method performs time-series analysis on identity information and transaction flows, extracting their change cycles to accurately capture the patterns of change in identity information and transaction flows at different time stages. Based on this, the constructed identity anomaly and transaction risk levels are no longer limited to data analysis at a single point in time, but fully consider the changing characteristics over time, making the assessment of identity anomalies and transaction risks more closely aligned with the dynamic changes in actual transaction scenarios.

[0040] By analyzing the correlation between identity anomaly and transaction risk in each change cycle, as well as their average levels, to obtain the transaction security correlation, we can organically combine the two key factors of identity information and transaction flow. This breaks through the limitations of traditional methods that assess identity or transaction risk separately, making the judgment on transaction security more comprehensive and in-depth. It can discover potential correlation patterns between the two, thereby more accurately grasping the transaction security status.

[0041] The system constructs the risk escalation trend of transactions at the current moment and combines it with the transaction security correlation to obtain the transaction security guarantee coefficient. It fully considers the stability trend of identity information and the fluctuation trend of transaction flow at adjacent sampling moments, so that the assessment of current transaction risk is not only based on historical data, but also pays attention to real-time trend changes. It can promptly detect signs of risk escalation and provide a more timely basis for subsequent verification strength adjustment.

[0042] By leveraging variations in transaction security coefficients and parameters related to verification strength within smart contracts to obtain feedback on verification strength, dynamic adjustments to the smart contract verification strength are achieved. This dynamic adjustment mechanism responds to real-time changes in transaction security, avoiding resource waste or insufficient verification issues associated with fixed verification strengths, and making smart contract verification more aligned with the security needs of actual transactions.

[0043] By controlling and adjusting the verification strength of smart contracts through a consensus mechanism, the opinions of multiple nodes are integrated, making the adjustment of verification strength more fair and reasonable, reducing the bias that may be caused by a single node's decision, further improving the security and reliability of virtual power plant transactions, and effectively addressing the complex and ever-changing security challenges in virtual power plant transactions. Attached Figure Description

[0044] Figure 1 This is a schematic diagram illustrating the working principle of the blockchain-based virtual power plant transaction security assurance method described in this invention.

[0045] Figure 2A flowchart for extracting identity / transaction flow change cycles;

[0046] Figure 3 A flowchart for constructing identity anomaly levels;

[0047] Figure 4 A flowchart for calculating the trend of identity stability / transaction volatility. Detailed Implementation

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

[0049] Please see Figure 1 This invention provides a method for ensuring the security of virtual power plant transactions based on blockchain technology, the method comprising the following steps:

[0050] Step 1: Obtain the identity information and transaction records of the participants in the virtual power plant transaction process. The identity information includes data such as digital certificates, equipment identifiers, and permission levels of the participating entities, including power generation units, power consumption units, and the dispatch center. The transaction records include specific transaction records such as electricity transaction volume, transaction price, transaction time, and settlement status.

[0051] Step 2: Perform time series analysis on identity information and transaction records to extract the change cycles of identity information and transaction records. By analyzing the changes in identity information and transaction records over time in historical data, the periodic characteristics of each are determined, providing a time-dimensional reference for subsequent anomaly detection.

[0052] Step 3: By analyzing the frequency of identity information changes in blockchain nodes and the volatility of transaction flows over time within each change cycle, identity anomaly and transaction risk are constructed respectively. Identity anomaly is used to quantify abnormal changes in identity information during periodic changes, while transaction risk is used to assess the volatility risk of transaction flows within the cycle.

[0053] Step 4: Based on the correlation between identity anomaly and transaction risk levels in previous change cycles, as well as the average level of identity anomaly and transaction risk levels, obtain the security correlation of transactions in the blockchain node at the current moment. Security correlation reflects the intrinsic link between identity anomaly and transaction risk, and is an important indicator for comprehensively assessing transaction security.

[0054] Step 5: Analyze the stability trend of identity information and the fluctuation trend of transaction flow across multiple adjacent sampling times to construct the risk escalation trend of transactions at the current moment. Combine this with the security correlation of transactions within the blockchain node to obtain the transaction security guarantee coefficient of the blockchain node at the current moment. Utilize the differences in the transaction security guarantee coefficient, along with the verification strength within the smart contract at the current moment and the preset verification strength adjustment amount, to obtain the feedback verification strength within the smart contract at the current moment. The risk escalation trend is used to capture the changing trend of transaction risk in the short term, while the transaction security guarantee coefficient integrates the security correlation and risk escalation trend to provide a basis for adjusting the verification strength.

[0055] Step 6: Based on the current verification strength within the smart contract and the actual verification strength, use the consensus mechanism to control and adjust the verification strength of the smart contract. By dynamically adjusting the verification strength, ensure the security and efficiency of virtual power plant transactions in the blockchain environment.

[0056] Example 1:

[0057] Please see Figure 2 The specific operation process for extracting the change cycle of identity information and transaction records is as follows:

[0058] A preset duration needs to be determined. This duration should be set based on the actual situation of virtual power plant transactions, considering factors such as transaction frequency, data accumulation speed, and the validity of historical data. Generally, if transactions within the virtual power plant are frequent, generating a large number of transaction records and identity information changes daily, the preset duration can be set to a shorter period, such as 24 hours. If the transaction frequency is low and data updates are slow, the preset duration can be appropriately extended, such as 72 hours or even longer. After determining the preset duration, collect identity information and transaction records from all historical sampling moments within that preset duration prior to the current moment. The selection interval for historical sampling moments also needs to be determined based on actual needs. If more granular capture of change details is required, the sampling interval can be set to once every 5 minutes; if real-time requirements are not high, it can be set to once every 30 minutes.

[0059] The collected identity information is arranged chronologically to form a vector, known as the identity vector for the current moment. Each element in the identity vector represents identity information corresponding to a historical sampling point. This information includes digital certificate information of the participating entities, such as certificate number, issuing authority, and validity period; device identifiers, such as the unique code of power generation equipment, and the model and serial number of power consumption equipment; and the permission levels of each entity, such as the highest permission of the dispatch center, the operating permissions of the power generation unit, and the access permissions of the power consumption unit. Similarly, the transaction flow is arranged chronologically to form the transaction flow vector for the current moment. The elements in the transaction flow vector contain the specific details of each transaction, such as the specific value of the electricity transaction volume, the price agreed upon by both parties, the time of transaction initiation and completion, and the settlement status of the transaction (completed or pending).

[0060] Time series analysis is performed on identity vectors to extract the periodicity of identity information changes. During time series analysis, relevant algorithms are used to process the identity vectors and identify periodic features in the sequence. Through analysis, feature values ​​at all time points in the sequence can be obtained. These feature values ​​reflect the significance of identity information changes at different time scales. The time interval corresponding to the largest feature value is the length of the most obvious and regular period of identity information change. Taking the reciprocal of this time interval yields the identity change period in the short period before the current moment. For example, if the analysis finds that the time interval corresponding to the largest feature value is 3 hours, then the identity change period is 1 / 3 of an hour, meaning that identity information exhibits a relatively obvious periodic change every 3 hours.

[0061] For transaction flow vectors, a hash value change detection method is used to obtain the transaction change cycle. Specifically, a hash value is calculated for each element in the transaction flow vector. A hash value is a fixed-length string of characters obtained by processing transaction flow information using a specific hash algorithm. Different transaction flow information corresponds to different hash values, and even a small change in the transaction flow will result in a significant change in the hash value. By comparing the hash values ​​of transaction flows at two adjacent historical sampling times, it is possible to detect whether the transaction flow has changed. When the hash values ​​of two adjacent times are different, it indicates that a significant change has occurred in the transaction flow between these two times. All time points where significant changes occur are continuously recorded, and the frequency of the intervals between these time points is counted. The interval with the highest frequency is determined as the transaction change cycle in the short period before the current time. For example, if the hash value of the transaction flow changes significantly every 2 hours within a preset period, and this 2-hour interval occurs most frequently among all change intervals, then the transaction change cycle is 2 hours.

[0062] The above methods can accurately extract the change cycles of identity information and transaction flow, providing a time-cycle-based reference framework for further analysis of identity anomalies and transaction risks. This allows subsequent analysis to be conducted within regular time intervals, thus better reflecting the actual change characteristics of identity information and transaction flow during virtual power plant transactions.

[0063] Example 2:

[0064] Please see Figure 3 The specific steps for constructing the identity anomaly level and transaction risk level are as follows:

[0065] When constructing identity anomaly metrics, the first step is to process the identity information within each identity change cycle prior to the current moment. The identity information within each identity change cycle is arranged chronologically to form an identity cycle vector corresponding to each cycle. The identity information encompasses relevant data from various entities participating in virtual power plant transactions, such as the equipment number and digital certificate status of the power generation unit, the user identifier and permission scope of the power consumption unit, and the operation permission level of the dispatch center. Each identity cycle vector contains the identity information for all sampling moments within the corresponding cycle, arranged in ascending chronological order, clearly reflecting the changes in identity information over time within that cycle. Correspondingly, the transaction logs within each transaction change cycle are also arranged in ascending chronological order to form a transaction cycle vector for each cycle. The transaction logs include the electricity transaction volume, transaction price, transaction initiation time, and settlement progress for each transaction, while the transaction cycle vector comprehensively presents the temporal distribution characteristics of the transaction logs within a transaction change cycle.

[0066] For each identity period vector, its first-order difference sequence needs to be calculated. The first-order difference sequence is obtained by subtracting the identity information from the previous time step in the identity period vector at the next time step, thus obtaining the change in identity information between two adjacent time steps. For example, if the identity information at two adjacent time steps in an identity period vector is A and B, then the corresponding element in the first-order difference sequence is the difference between B and A. In this way, the first-order difference sequence of the entire identity period vector can be obtained, which directly reflects the changes in identity information between adjacent time steps.

[0067] After obtaining the first-order difference sequence, the number of all non-zero elements in the sequence is counted; this number is called the change frequency. The magnitude of the change frequency directly reflects the number of times identity information changes within the identity change cycle. The higher the change frequency, the more frequently the identity information changes within that cycle. Simultaneously, the mean of the absolute values ​​of all non-zero elements in the first-order difference sequence is calculated, i.e., the average change magnitude. The average change magnitude is calculated by adding the absolute values ​​of all non-zero elements and then dividing by the number of non-zero elements; it reflects the average magnitude of each identity information change. For example, if the absolute values ​​of the non-zero elements in the first-order difference sequence are 2, 3, and 5, then the average change magnitude is (2+3+5) divided by 3. Multiplying the change frequency by the average change magnitude yields the identity anomaly degree within that identity change cycle. This value combines the frequency of identity information changes and the magnitude of each change, comprehensively quantifying the anomalies in identity information within that cycle.

[0068] The construction of the trading risk level is also based on the trading cycle vector. For each trading cycle vector, its first-order difference sequence is calculated. This sequence is obtained similarly to the first-order difference sequence of the identity cycle vector, i.e., by subtracting the trading volume of the previous moment from the trading volume of the next moment. Changes in trading volume may be reflected in increases or decreases in trading volume, price fluctuations, etc. The elements in the first-order difference sequence reflect the specific values ​​of these changes. Then, the mean of the absolute values ​​of all elements in the first-order difference sequence is calculated. This mean is the trading risk level of that trading cycle. During the calculation, regardless of whether the element is positive or negative, its absolute value is taken before averaging. This is done to comprehensively consider the rise and fall fluctuations of trading volume. For example, if the elements of the first-order difference sequence of the trading cycle vector are 10, -5, and 8, then their absolute values ​​of 10, 5, and 8 are taken first, and then the average of these three values ​​is calculated. The result is the trading risk level of that trading cycle. This value can effectively reflect the overall volatility of trading volume within that cycle; the greater the volatility, the higher the trading risk level.

[0069] Through the above process, we can construct the identity anomaly level and transaction risk level, respectively. These two indicators quantify the anomalies in identity information and transaction flow in virtual power plant transactions from different perspectives, providing a foundation for further analysis of transaction security. The identity anomaly level focuses on the abnormal changes in identity information during periodic changes, while the transaction risk level focuses on the fluctuations in transaction flow within the period. Together, they constitute important reference indicators for assessing transaction security.

[0070] Example 3:

[0071] The specific calculation process for the security correlation of transactions in the blockchain node at the current moment is as follows:

[0072] It is necessary to organize the identity anomaly scores of all identity change cycles prior to the current moment, and arrange these anomaly scores in ascending chronological order to form a vector. This vector is called the identity anomaly score vector at the current moment. The identity anomaly score is calculated based on the changes in identity information within each identity change cycle, reflecting the degree of anomaly of identity information in different cycles. For example, if there are 6 identity change cycles prior to the current moment, and the identity anomaly scores for each cycle are 3.2, 4.1, 3.8, 5.0, 4.5, and 3.9 respectively, then the identity anomaly score vector, after being arranged in chronological order, is an ordered set containing these 6 values.

[0073] Similarly, regarding transaction risk levels, the transaction risk levels of all transaction change cycles prior to the current moment are arranged in ascending chronological order to form the transaction risk level vector for the current moment. The transaction risk level is calculated based on the fluctuations in transaction flow within each transaction change cycle, reflecting the risk level of transaction flow in different cycles. For example, if the transaction risk levels for the six identity change cycles mentioned above are 2.5, 3.0, 2.8, 3.5, 3.2, and 2.7 respectively, then the transaction risk level vector is an ordered set composed of these six values ​​in chronological order.

[0074] The correlation between the identity anomaly vector and the transaction risk vector is calculated. The correlation measures the degree of linear association between the two vectors, and its calculation involves analyzing the coordinated changes in corresponding elements of the two vectors. By comparing the changing trends of the elements in the two vectors, it is determined whether they exhibit unidirectional, inverse, or no significant correlation. For example, if an element in the identity anomaly vector increases and the corresponding element in the transaction risk vector also increases, it indicates a positive correlation; if an element in one vector increases while the corresponding element in the other vector decreases, it indicates an inverse correlation.

[0075] Calculate the mean of the elements in the identity anomaly vector. The mean is calculated by summing the values ​​of all elements in the identity anomaly vector and then dividing by the number of elements. This mean reflects the overall level of identity anomaly over all identity change cycles prior to the current moment. For example, the mean of the identity anomaly vector containing 6 elements is (3.2+4.1+3.8+5.0+4.5+3.9) divided by 6.

[0076] Simultaneously, the mean of the elements within the transaction risk vector is calculated. The calculation method is the same as for the mean of the identity anomaly vector, i.e., the sum of the values ​​of all elements in the transaction risk vector divided by the number of elements. This mean reflects the overall level of transaction risk across all transaction change cycles prior to the current moment. For example, the mean of the transaction risk vector mentioned above is (2.5+3.0+2.8+3.5+3.2+2.7) divided by 6.

[0077] The calculation of security correlation is jointly determined by the aforementioned correlation degree, the mean of the elements in the identity anomaly vector, and the mean of the elements in the transaction risk vector. The calculation formula is as follows:

[0078]

[0079] Where S represents the security correlation degree, r represents the correlation between the identity anomaly vector and the transaction risk vector, and M... A M represents the mean of the elements in the identity anomaly vector. T This represents the mean of the elements in the transaction risk vector.

[0080] When calculating the degree of correlation, appropriate statistical methods can be used, such as the Pearson correlation coefficient method. This method calculates the correlation coefficient by taking the ratio of the product of the covariance and standard deviation of the elements in two vectors. The specific numerical value of this correlation typically ranges from -1 to 1. The magnitude and sign of the correlation directly affect the magnitude and direction of the security correlation. For example, a large positive correlation indicates a strong positive correlation between the degree of identity anomaly and the degree of transaction risk, thus increasing the security correlation. Conversely, a negative correlation indicates an inverse correlation, negatively impacting the security correlation.

[0081] The arithmetic mean of the elements in the identity anomaly vector and the transaction risk vector is taken as their average to comprehensively reflect the overall level of identity anomaly and transaction risk. This average is multiplied by the correlation degree to obtain the security correlation degree. This indicator comprehensively considers the strength of the correlation between identity anomaly and transaction risk, as well as the overall level of both, and can fully reflect the security correlation status of transactions in the blockchain node at the current moment.

[0082] Through this calculation process, the security correlation degree quantifies and integrates the time-series characteristics of identity anomaly degree and transaction risk degree, as well as the inherent relationship between them, providing an important basic indicator for subsequent assessment of transaction security guarantee coefficient. This process makes full use of identity and transaction data within historical periods, giving the calculation of the security correlation degree solid data support and enabling it to more accurately reflect the correlation characteristics of transaction security.

[0083] Example 4:

[0084] Please see Figure 4 The specific process for constructing the current trading risk upward trend is as follows:

[0085] Determine multiple adjacent sampling times for the current moment. The selection of adjacent sampling times is based on the shortest possible time interval, and the number can be set according to the actual sampling frequency of the virtual power plant transaction. For example, select 6 adjacent times, with an interval of 15 minutes between each time. The identity information and transaction logs of these adjacent sampling times will serve as the basic data for analysis. Identity information includes the digital certificate status of each participating entity, equipment identification change records, and permission level adjustment information, etc. Transaction logs include specific data such as the power transaction volume, transaction price, and settlement progress at each time point.

[0086] The identity information from these adjacent sampling times is arranged in ascending chronological order to form the identity trend vector for the current moment. For example, the identity information from six adjacent moments is as follows: Power generation unit A's digital certificate is valid; Power generation unit A's digital certificate is valid; Power generation unit A's digital certificate is invalid and replaced by power generation unit B; Power generation unit B's digital certificate is valid; Power generation unit B's digital certificate is valid; Power generation unit B's digital certificate is invalid and replaced by power generation unit C. After being arranged in chronological order, the identity trend vector is an ordered set containing these six pieces of information.

[0087] The transaction flows at adjacent sampling times are arranged in ascending order of time to form a transaction trend vector. For example, the transaction flows corresponding to the above 6 times are: 100 MWh, 120 MWh, 110 MWh, 130 MWh, 140 MWh, and 160 MWh, which are arranged in chronological order to form a transaction trend vector.

[0088] Calculate the first-order difference vector of the identity trend vector. The first-order difference vector is obtained by subtracting the identity information from the previous time step from the identity information at the next time step, thus reflecting the change in identity information between adjacent time steps. If the identity information is the same at different time steps, the difference result is recorded as 0; if there is a change, such as a digital certificate expiration or a device identifier change, a corresponding identifier value is assigned according to the type of change, for example, a device change is recorded as 1, and a certificate status change is recorded as 2. The first-order difference vector of the above identity trend vector is calculated as follows:

[0089] The identity information is consistent with that of the first time step in step 2, and the difference result is 0.

[0090] Compared to time 2, at time 3, the power generation unit is changed from A to B, and the differential result is 1;

[0091] The identity information at time 4 is consistent with that at time 3, and the difference result is 0;

[0092] The identity information at time 5 is consistent with that at time 4, and the difference result is 0;

[0093] Compared to time 5, at time 6, the power generation unit is changed from B to C, and the differential result is 1.

[0094] The final first-order difference vector of the identity trend vector is [0,1,0,0,1].

[0095] For the trading trend vector, its first-order difference vector is also calculated, which is to subtract the data from the previous time step from the trading flow data at the next time step to obtain the change in trading flow between adjacent time steps. The first-order difference vector for the above trading trend vector is calculated as follows:

[0096] 120 MWh - 100 MWh = 20 MWh;

[0097] 110 MWh - 120 MWh = -10 MWh;

[0098] 130 MWh - 110 MWh = 20 MWh;

[0099] 140 MWh - 130 MWh = 10 MWh;

[0100] 160 megawatt-hours - 140 megawatt-hours = 20 megawatt-hours.

[0101] The final first-order difference vector of the trading trend vector is [20,-10,20,10,20].

[0102] Calculate the current identity stability trend. The identity stability trend is the sum of the absolute values ​​of all negative values ​​within the first-order difference vector of the identity trend vector. In the first-order difference of identity information, negative values ​​usually indicate a reverse change in identity information, such as changing from device B to device A, which can be recorded as -1. Such changes reflect the unstable state of identity information. The first-order difference vector of the above identity trend vector has no negative values, therefore the identity stability trend is 0. If the first-order difference vector of a certain identity trend vector is [0, -1, 1, -1, 0], where the negative values ​​are -1 and -1, and the sum of their absolute values ​​is 2, then the identity stability trend in this case is 2.

[0103] To calculate the current trading volatility trend, we need to sum all positive values ​​within the first-order difference vector of the trading trend vector. Positive values ​​indicate an upward trend in trading volume, and their sum reflects the increase in trading volume over adjacent time periods. In the first-order difference vector of the trading trend vector mentioned above, the positive values ​​are 20, 20, 10, and 20, with a sum of 70, therefore the trading volatility trend is 70. If the first-order difference vector of a certain trading trend vector is [15, -5, 10, -8, 12], where the positive values ​​are 15, 10, and 12, with a sum of 37, then the trading volatility trend in this case is 37.

[0104] The current risk uptrend is the product of the identity stability trend and the trading volatility trend. In the first example above, the identity stability trend is 0, and the trading volatility trend is 70, so the risk uptrend is 0 × 70 = 0. In another example, if the identity stability trend is 2 and the trading volatility trend is 37, then the risk uptrend is 2 × 37 = 74.

[0105] Through the above process, the risk escalation trend combines the instability trend of identity information with the growth and fluctuation trend of transaction flow, directly reflecting the short-term direction and intensity of transaction risk changes at any given moment. Frequent reverse changes in identity information increase the stability trend of identity, while continuous growth in transaction flow increases the volatility trend of transaction flow. The larger the product of the two, the higher the probability of a short-term increase in transaction risk. The construction of this indicator provides an important trend reference for the subsequent calculation of the transaction security guarantee coefficient, enabling the security guarantee mechanism to respond more promptly to potential risk changes during the transaction process.

[0106] Example 5:

[0107] The calculation process for the transaction security coefficient of a blockchain node at the current moment is as follows: The transaction security coefficient is jointly determined by the security correlation of transactions in the blockchain node at the current moment and the risk upward trend of transactions at the current moment, reflecting the combined impact of the two through an exponential function. The exponential function is chosen based on the characteristics of a natural exponential function, and its curve shape can reflect the non-linear relationship between security correlation and risk upward trend. Security correlation is an indicator obtained by combining the correlation between identity anomaly and transaction risk and their average levels, while risk upward trend reflects the product of the short-term stability trend of identity information and the fluctuation trend of transaction flow. When the security correlation is high and the risk upward trend is low, the result of the exponential function will show a large value, indicating a high transaction security coefficient; when the security correlation is low and the risk upward trend is high, the result of the exponential function will be small, reflecting a low transaction security coefficient. This calculation method can integrate two indicators from different dimensions into a comprehensive coefficient, which facilitates the quantitative basis for subsequent adjustment of the verification strength of smart contracts.

[0108] The calculation process for the feedback verification strength within the smart contract at the current moment is as follows: The feedback verification strength is jointly determined by the verification strength within the smart contract at the current moment, the transaction security guarantee coefficient at the current moment, the transaction security guarantee coefficient at the previous sampling moment, and the preset verification strength adjustment amount. The verification strength within the smart contract at the current moment refers to the strength parameters used in the currently executing verification process, including the number of verification nodes and the level of detail in the verification information. The difference between the transaction security guarantee coefficient at the current moment and the transaction security guarantee coefficient at the previous sampling moment reflects the change in the transaction security status. The preset verification strength adjustment amount is an adjustment parameter pre-set based on historical data and security requirements of virtual power plant transactions, used to control the magnitude of the verification strength adjustment. During calculation, the difference between the transaction security guarantee coefficients at the two moments is first determined, and then the current verification strength is corrected based on the preset verification strength adjustment amount to obtain the feedback verification strength. If the current transaction security guarantee coefficient increases compared to the previous moment, it indicates an improvement in the transaction security status, and the feedback verification strength may decrease accordingly; if the current transaction security guarantee coefficient decreases compared to the previous moment, it indicates a deterioration in the transaction security status, and the feedback verification strength may need to be increased.

[0109] The process of controlling and adjusting the verification strength of smart contracts using a consensus mechanism is as follows: First, obtain the difference between the current feedback verification strength and the actual verification strength within the smart contract. The difference is calculated by subtracting the actual verification strength from the feedback verification strength. Different levels are assigned based on the magnitude of the difference; for example, a difference between 0 and 10 is level one, between 10 and 20 is level two, and above 20 is level three. A corresponding consensus algorithm type is preset for each level. The first level corresponds to a consensus algorithm that might be Proof-of-Work (PoW). This algorithm adjusts the verification strength by changing the mining difficulty threshold. When the difference value is at this level, the mining difficulty is appropriately reduced, decreasing the computational load on verification nodes and thus lowering the verification strength. The second level corresponds to a PoStyle (PoS) algorithm, which adjusts the verification strength by changing the stake weight of verification nodes. Nodes with higher stake weights have greater influence in the verification process. When the difference value is at this level, the number of high-stakes nodes is increased, increasing the verification rigor. The third level corresponds to a Practical Byzantine Fault Tolerance (PBT) algorithm, which enhances verification strength by increasing the number of verification nodes and verification rounds. When the difference value is at this level, the number of participating nodes is increased, and the verification rounds are extended to ensure that each transaction undergoes multiple rigorous verifications. This hierarchical control and adjustment method allows the verification strength of smart contracts to be dynamically adjusted based on the difference between the feedback verification strength and the actual verification strength, adapting to different transaction security states.

[0110] The entire process, from calculating the transaction security coefficient to determining the feedback verification strength, and then adjusting the verification strength using the consensus mechanism, forms a closed-loop control process. This process can respond in real time to security changes in virtual power plant transactions, ensuring the security and efficiency of transactions in the blockchain environment. This adjustment method fully utilizes the distributed nature of blockchain technology and the flexibility of the consensus mechanism, allowing the verification strength to be precisely adjusted according to the actual situation. This avoids both the waste of resources caused by excessive verification strength and the security risks caused by insufficient verification strength.

[0111] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0112] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for ensuring the security of virtual power plant transactions based on blockchain technology, characterized in that, Includes the following steps: Obtain the identity information and transaction records of the participants in the virtual power plant transaction process; Time series analysis was performed on identity information and transaction records to extract the change cycles of identity information and transaction records; By analyzing the frequency of changes in identity information in blockchain nodes during each change cycle and the fluctuation of transaction flow over time, identity anomaly and transaction risk are constructed respectively. Based on the correlation between identity anomaly and transaction risk in previous change cycles, as well as the average level of identity anomaly and the average level of transaction risk, the security correlation of transactions in the blockchain node at the current moment is obtained. Analyze the stability trend of identity information and the fluctuation trend of transaction flow at multiple adjacent sampling times at the current moment to construct the risk increase trend degree of the transaction at the current moment. Combine the security correlation degree of transactions in the blockchain node to obtain the transaction security guarantee coefficient of the blockchain node at the current moment. Utilize the difference in the change of the transaction security guarantee coefficient and the verification strength and preset verification strength adjustment amount in the smart contract at the current moment to obtain the feedback verification strength in the smart contract at the current moment. Based on the current verification strength within the smart contract and the actual verification strength, the verification strength of the smart contract is controlled and adjusted using a consensus mechanism.

2. The method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 1, characterized in that, The extraction of the change cycle of the identity information and transaction records further includes: Obtain vectors composed of identity information and transaction records from all historical sampling moments within a preset time period prior to the current moment, arranged in chronological order, and use them as the identity vector and transaction record vector for the current moment. Perform time series analysis on the identity vector at the current moment to obtain the feature values ​​of all time points in the sequence. Take the reciprocal of the time interval corresponding to the largest feature value as the identity change cycle in the short period before the current moment. Correspondingly, for the transaction flow vector, use hash value change detection to obtain the transaction change cycle in the short period before the current moment.

3. The method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 1, characterized in that, The construction of the identity anomaly degree further includes: The identity information of each identity change cycle before the current time is arranged in ascending order of time to form the identity cycle vector of each identity change cycle. Correspondingly, for the transaction flow in each transaction cycle, the transaction cycle vector of each transaction change cycle is obtained. For each identity cycle vector, obtain the first-order difference sequence of the identity cycle vector, count the number of all non-zero elements in the first-order difference sequence, and record it as the change frequency. Calculate the mean of the absolute values ​​of all non-zero elements in the first-order difference sequence, and record it as the average change amplitude. The product of the change frequency and the average change amplitude is used as the identity anomaly degree in each identity change cycle.

4. The method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 3, characterized in that, The construction of the transaction risk level further includes: For each trading cycle vector, the mean of the absolute values ​​of all elements in the first-order difference sequence of the trading cycle vector is calculated as the trading risk level for each trading cycle.

5. The method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 4, characterized in that, The calculation logic for the security correlation of transactions in the blockchain node at the current moment is as follows: The security correlation is determined by the correlation between the identity anomaly vector and the transaction risk vector at the current moment, the mean of the elements in the identity anomaly vector at the current moment, and the mean of the elements in the transaction risk vector at the current moment. The identity anomaly of all identity change cycles is arranged in ascending order of time to form the identity anomaly vector at the current moment, and the transaction risk of all transaction change cycles is arranged in ascending order of time to form the transaction risk vector at the current moment.

6. The method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 1, characterized in that, The construction of the current moment's trading risk upward trend includes: The multiple times with the closest time interval to the current time are all taken as the adjacent sampling times of the current time. Based on the changes in identity information and transaction flow at the multiple adjacent sampling times, the identity stability trend and transaction fluctuation trend at the current time are obtained. The product of the current stability trend and the current trading volatility trend is determined as the current risk level of trading.

7. A method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 6, characterized in that, The current identity stability trend and trading volatility trend further include: The identity information and transaction records of the multiple adjacent sampling times are arranged in ascending order of time to form the identity trend vector and transaction trend vector at the current time. The first-order difference vectors of the identity trend vector and transaction trend vector at the current time are calculated respectively. The sum of the absolute values ​​of all negative values ​​within the first-order difference vector of the identity trend vector is taken as the identity stability trend quantity at the current moment, and the sum of all positive values ​​within the first-order difference vector of the trading trend vector is taken as the trading fluctuation trend quantity at the current moment.

8. The method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 1, characterized in that, The calculation process for the transaction security guarantee coefficient of the blockchain node at the current moment is as follows: The transaction security guarantee coefficient is jointly determined by the security correlation of transactions in the blockchain node at the current moment and the risk upward trend of transactions at the current moment, and reflects the combined impact of the two through an exponential function relationship.

9. A method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 1, characterized in that, The calculation process for the feedback verification strength within the smart contract at the current moment is as follows: The feedback verification strength is determined by the verification strength within the smart contract at the current moment, the transaction security guarantee coefficient at the current moment, the transaction security guarantee coefficient at the previous sampling moment, and the preset verification strength adjustment amount.

10. A method for ensuring the security of virtual power plant transactions based on blockchain technology as described in claim 1, characterized in that, The method of controlling and adjusting the verification strength of smart contracts using a consensus mechanism further includes: Obtain the difference between the current verification strength and the actual verification strength within the smart contract. Select a preset consensus algorithm type based on the magnitude of the difference. By adjusting the weight of verification nodes or the verification threshold in the algorithm, achieve hierarchical control and adjustment of the smart contract verification strength.