A method and device for collaborative verification of power transactions, and an electronic device

CN122596948APending Publication Date: 2026-08-18GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610739433.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]本发明实施例提供一种电力交易的协同验证方法、装置及电子设备,能够解决现有技术中电力交易的协同验证不够准确的问题

Benefits of technology

本发明实施例提供一种电力交易的协同验证方法、装置及电子设备。所述方法获取电力系统各节点的交易频次数据、电力交易请求及节点设备数据;对交易频次数据进行聚类分析,划分多个分布式网络分片;在各分片内,根据节点交易请求确定叶子节点,并基于预设哈希函数计算叶子节点哈希值,进而构建分片中间层根节点哈希值;再根据各分片的中间层根节点哈希值生成全局根节点哈希值;结合节点交易请求、设备数据及预设权重系数,对各交易请求进行验证判定,最终依据验证结果及全局根节点哈希值,实现各分布式网络分片的协同验证。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122596948A_ABST
    Figure CN122596948A_ABST
Patent Text Reader

Abstract

The application discloses a kind of collaborative verification method, device and electronic equipment of electric power transaction, belong to electric power system data processing technical field, the method includes: obtaining the transaction frequency data of each node of electric power system, electric power transaction request and node device data;Transaction frequency data is carried out clustering analysis, and multiple distributed network fragments are divided;Determine leaf node according to node transaction request, calculate leaf node hash value based on hash function, construct fragment middle layer root node hash value;According to the middle layer root node hash value of each fragment, generate global root node hash value;In combination with node transaction request, equipment data and preset weight coefficient, each transaction request is verified and judged, according to verification result and global root node hash value, the collaborative verification of each distributed network fragment is realized.Through implementation of the present application, the problem that collaborative verification of electric power transaction is not accurate in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system data processing technology, and specifically to a collaborative verification method, apparatus, and electronic device for power transactions. Background Technology

[0002] With the rapid evolution of the energy internet and the continuous expansion of distributed energy access, electricity trading plays a crucial role in optimizing local and global energy allocation and improving the overall operational efficiency of the power grid. As a core business link that promotes multi-source coordinated consumption and achieves dynamic balance between power supply and demand, electricity trading provides fundamental technical support for ensuring the stable operation of modern heterogeneous power grids and improving asset utilization.

[0003] Current power trading collaborative verification methods are often inaccurate during business processing. The reasons for these technical deficiencies are as follows: First, existing distributed network sharding typically uses random allocation or static rules for node classification, failing to utilize transaction frequency data for cluster analysis, resulting in unreasonable distributed network sharding. Second, existing verification processes usually rely solely on the power trading request itself, without considering the underlying real-world data from each node and preset weighting coefficients. Finally, existing data processing is largely limited to independent verification within each distributed network shard, failing to establish a unified global data verification benchmark. Summary of the Invention

[0004] This invention provides a collaborative verification method, apparatus, and electronic device for power transactions, which can solve the problem of insufficient accuracy in the collaborative verification of power transactions in the prior art.

[0005] One embodiment of the present invention provides a collaborative verification method for electricity trading, comprising: Acquire transaction frequency data, power transaction requests, and node equipment data of each node in the power system. Cluster analysis is performed on the transaction frequency data of each node to determine the shards of each distributed network; For each distributed network shard, determine each leaf node in the current distributed network shard based on the power trading requests of each node in the current distributed network shard; determine the hash value of each leaf node in the current distributed network shard based on a preset hash function; and determine the hash value of the root node of the shard intermediate layer in the current distributed network shard based on the hash value of each leaf node in the current distributed network shard. The global root node hash value is determined based on the hash value of the root node of the intermediate layer of each distributed network shard. Based on the power trading requests of each node, the equipment data of each node, and the preset weighting coefficients, the transaction verification result of each power trading request is determined. Based on the transaction verification results of each power transaction request, the hash values ​​of each power transaction request and the global root node, collaborative verification is performed on each distributed network shard.

[0006] Furthermore, cluster analysis is performed on the transaction frequency data of each node to determine the shards of each distributed network, including: Based on the transaction frequency data of each node, determine the frequency characteristic components of each node under multiple preset time dimensions. The frequency feature components of each node under multiple preset time dimensions are combined to determine the transaction feature vector of each node. Based on a preset distance metric function, the feature distribution distance between nodes is determined according to the transaction feature vector of each node; Based on a pre-defined clustering algorithm, nodes are divided according to the feature distribution distance between each node, and several sets of power nodes are determined. For each set of power nodes, establish communication links between the nodes in the current set of power nodes to generate the network topology of the current set of power nodes; Based on the network topology of each power node set, generate each distributed network shard.

[0007] Furthermore, for each distributed network shard, based on the power trading requests of each node in the current distributed network shard, the leaf nodes within the current distributed network shard are determined, including: For each distributed network shard, the power trading requests of each node in the current distributed network shard are parsed to generate the request feature parameters of each node in the current distributed network shard. Based on the request characteristic parameters of each node in the current distributed network shard, calculate and generate the node processing weight corresponding to each node in the current distributed network shard. For each node in the current distributed network shard, if the node's processing weight is lower than the preset processing weight threshold, the current node is determined as a leaf node in the current distributed network shard.

[0008] Furthermore, based on a preset hash function, the hash value of each leaf node within the current distributed network shard is determined, including: Convert the power transaction requests of each leaf node in the current distributed network shard into the byte sequence corresponding to each leaf node; Each leaf node's corresponding byte sequence is input into a preset hash function for hash operation, generating the hash value of each leaf node within the current distributed network shard.

[0009] Furthermore, based on the hash values ​​of each leaf node within the current distributed network shard, the hash value of the root node of the intermediate layer of the current distributed network shard is determined, including: Based on the preset tree structure, determine the level corresponding to each leaf node in the current distributed network shard; The maximum level of the preset tree structure is used as the initial processing level, and the hash values ​​of each leaf node at the maximum level of the preset tree structure are used as the hash values ​​to be processed in the initial processing level. Repeat the hierarchical upward aggregation operation until the number of intermediate node hash values ​​of the previous level of the current processing level is 1, and generate the root node hash value of the sharded intermediate layer; The hierarchical upward aggregation operation includes: If the number of unprocessed hash values ​​in the current processing level is even, concatenate each unprocessed hash value in the current processing level in pairs to generate a concatenated data block for the current processing level. If the number of unprocessed hash values ​​in the current processing level is odd and not 1, based on a preset arrangement order, each unprocessed hash value in the current processing level is concatenated in pairs to generate at least one first concatenated data block; unprocessed hash values ​​that are not concatenated in pairs are treated as independent unprocessed hash values; independent unprocessed hash values ​​are concatenated with other independent unprocessed hash values ​​to generate a second concatenated data block; the second concatenated data block and the first concatenated data block are used as the concatenated data block of the current processing level. Perform a hash operation on the concatenated data block at the current processing level to generate the hash value of the intermediate node at the next higher level. Determine if the number of intermediate node hash values ​​of the previous level of the current processing level is 1. If so, use the intermediate node hash value of the previous level of the current processing level as the root node hash value of the intermediate layer of the current distributed network shard. If not, update the hash values ​​of the intermediate nodes of the previous level and the leaf nodes of the previous level to the unprocessed hash value of the current processing level.

[0010] Furthermore, based on the hash values ​​of the intermediate root nodes of each distributed network shard, the global root node hash value is determined, including: Each distributed network fragment is uniquely encoded to generate a fragment identifier for each distributed network fragment. Based on each shard identifier, the hash values ​​of the root nodes of the intermediate layer of each distributed network shard are sorted to generate an initial global hash sequence to be merged, and the hash values ​​of the root nodes of the intermediate layer of each distributed network shard are used as the global hash values ​​to be merged in the initial global hash sequence to be merged. Repeat the global iterative merge operation until the number of current global transition hash values ​​is 1, then generate the global root node hash value; The global iterative merging operation includes: If the number of global hash values ​​to be merged in the current global hash sequence is even, combine each global hash value to be merged in the current global hash sequence in pairs to generate the current global combined data item. If the number of global hash values ​​to be merged in the current global hash sequence is odd and not 1, based on the current global hash sequence, each global hash value to be merged in the current global hash sequence is combined in pairs to generate at least one first global combined data item; the global hash values ​​that are not combined in pairs are taken as the last isolated hash values; the last isolated hash values ​​are combined with the last isolated hash values ​​to generate a second global combined data item; the first global combined data item and the second global combined data item are taken as the current global combined data item. Perform a hash operation on the current global combined data item to generate the current global transition hash value; Check if the current number of global transition hash values ​​is 1. If it is, use the global transition hash value as the global root node hash value. If not, update the current global transition hash value to the global hash value to be merged contained in the current global hash sequence to be merged.

[0011] Furthermore, based on the power trading requests from each node, the equipment data of each node, and the preset weighting coefficients, the transaction verification results for each power trading request are determined, including: Based on the preset power trading data structure, the power trading requests of each node are parsed to extract the trading feature data of each node. The device data of each node is decoded according to the protocol, and the device operation characteristic data of each node is extracted. Based on the transaction characteristic data of each node, the equipment operation characteristic data of each node, and the preset weight coefficients, a comprehensive verification score for each power transaction request is calculated and generated. If the overall verification score of a power transaction request exceeds a preset verification threshold, the power transaction request is determined to have passed verification. If the overall verification score of a power transaction request does not exceed the preset verification threshold, the transaction verification result of the power transaction request is determined to be verification failure.

[0012] Furthermore, based on the transaction verification results of each power transaction request, the hash values ​​of each power transaction request and the global root node, collaborative verification is performed on each distributed network shard, including: If there is a power transaction request that has passed the verification, at least one power transaction request that has passed the verification will be used as the target power transaction request. In the event that a power transaction request fails to pass verification, at least one power transaction request that fails verification will be treated as an abnormal power transaction request. For abnormal power trading requests, generate transaction rejection information corresponding to the abnormal power trading request, and feed back the transaction rejection information to the node corresponding to the abnormal power trading request; For a target power transaction request, the target power transaction request is combined and encapsulated with the global root node hash value to generate a global synchronization record; The global synchronization record is distributed to each distributed network shard so that each distributed network shard can perform data integrity verification on the global synchronization record based on the global root node hash value in the global synchronization record, generate data integrity verification results for each distributed network shard, update the local transaction ledger of the distributed network shard according to the global synchronization record if the data integrity verification result of the distributed network shard is successful, and generate a verification failure alarm message containing the shard identifier of the distributed network shard if the data integrity verification result of the distributed network shard is unsuccessful.

[0013] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.

[0014] One embodiment of the present invention provides a collaborative verification device for power trading, comprising: a data acquisition module, a clustering and sharding module, a local hash determination module, a global hash determination module, and a collaborative verification module; The data acquisition module is used to acquire transaction frequency data, power transaction requests of each node, and node equipment data of each node in the power system. The clustering and sharding module is used to perform clustering analysis on the transaction frequency data of each node to determine each distributed network shard. The local hash determination module is used to determine each leaf node in the current distributed network shard based on the power trading requests of each node in the current distributed network shard; determine the hash value of each leaf node in the current distributed network shard based on a preset hash function; and determine the hash value of the root node of the shard intermediate layer in the current distributed network shard based on the hash value of each leaf node in the current distributed network shard. The global hash determination module is used to determine the global root node hash value based on the hash value of the root node of the intermediate layer of each distributed network shard. The collaborative verification module is used to determine the transaction verification result of each power transaction request based on the power transaction request of each node, the device data of each node, and the preset weight coefficient; and to perform collaborative verification on each distributed network shard based on the transaction verification result of each power transaction request, each power transaction request, and the hash value of the global root node.

[0015] Based on the above method embodiments, the present invention provides corresponding electronic device embodiments.

[0016] One embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the collaborative verification method for power trading as described in any of the above-described method embodiments.

[0017] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a collaborative verification method, apparatus, and electronic device for power transactions. The method acquires transaction frequency data, power transaction requests, and node device data for each node in a power system; performs cluster analysis on the transaction frequency data to divide the system into multiple distributed network shards; within each shard, leaf nodes are determined based on node transaction requests, and their hash values ​​are calculated using a preset hash function to construct the hash value of the intermediate root node of each shard; a global root node hash value is generated based on the hash values ​​of the intermediate root nodes of each shard; and each transaction request is verified and judged by combining node transaction requests, device data, and preset weight coefficients. Finally, based on the verification results and the global root node hash value, collaborative verification of each distributed network shard is achieved.

[0018] This invention determines the distributed network shards by clustering the transaction frequency data of each node, directly solving the problem of unreasonable sharding caused by random allocation or static rules in existing technologies. Furthermore, this invention not only comprehensively determines the transaction verification results by combining power transaction requests, node device data, and preset weight coefficients, but also determines the global root node hash value by calculating the hash values ​​of leaf nodes and the root nodes of the intermediate shard layers layer by layer. This overcomes the shortcomings of existing verification methods that rely solely on the request itself and are limited to independent verification within a shard. Finally, based on the above verification results and the newly established global root node hash value, this scheme performs collaborative verification of each distributed network shard, constructing a unified global data verification benchmark and improving the accuracy of the power transaction collaborative verification method. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating a collaborative verification method for power trading provided in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the structure of a collaborative verification device for power trading provided in an embodiment of the present invention. Detailed Implementation

[0021] 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.

[0022] like Figure 1 As shown, to address the problem of insufficient accuracy in collaborative verification of electricity transactions in existing technologies, an embodiment of the present invention provides a collaborative verification method for electricity transactions, comprising at least the following steps: Step S1: Obtain transaction frequency data, power transaction requests, and node equipment data of each node in the power system.

[0023] Specifically, for each node within the power system, transaction frequency data is collected for each node within a preset historical time period. To comprehensively reflect the actual business participation of each node, the acquired transaction frequency data specifically covers average daily transaction frequency, transaction object concentration, average transaction amount, node type identification, and node online time percentage. By collecting multi-dimensional transaction frequency data indicators, a comprehensive and objective data foundation is provided for subsequent distributed network sharding.

[0024] The system synchronously receives real-time power trading requests from various nodes. Each power trading request carries a clear business interaction intention and authentication credentials. Specific request content includes unique identifiers for both the initiating and receiving nodes, a request timestamp, the transaction target, the source distribution area identifier, the target distribution area identifier, and the initiator's digital signature. The transaction target further clarifies the specific business flow values, covering the transferred electricity volume, transfer amount, and energy storage equipment lease duration. The acquired power trading requests will be integrated according to a standardized data format to meet the objective requirements of subsequent processing flows for data field parsing.

[0025] Further extraction of node device data corresponding to each underlying physical hardware component is conducted. Since the physical operating condition of the underlying hardware directly affects the reliability of the overall business flow, the extracted node device data includes multiple fundamental metrics reflecting the health and operational compliance of the physical hardware. Specific node device data includes device online stability, hardware failure rate, business transaction compliance rate, malicious behavior records, transaction feedback scores, and the number of CPU cores and bandwidth capacity thresholds at the node's underlying level. The structured extraction of these underlying physical parameters aims to provide a true physical-level basis for comprehensively assessing business security.

[0026] By comprehensively collecting historical frequency parameters from multiple dimensions, real-time business interaction intentions, and the physical operating status of underlying hardware, a comprehensive data set covering historical characteristics, current business needs, and equipment physical status is constructed. This effectively avoids information omissions caused by a single data collection dimension and fundamentally improves the completeness and objectivity of information in the front-end data acquisition process.

[0027] Step S2: Perform cluster analysis on the transaction frequency data of each node to determine the distributed network shards.

[0028] In a preferred embodiment, cluster analysis is performed on the transaction frequency data of each node to determine each distributed network shard, including: Based on the transaction frequency data of each node, determine the frequency characteristic components of each node under multiple preset time dimensions. The frequency feature components of each node under multiple preset time dimensions are combined to determine the transaction feature vector of each node. Based on a preset distance metric function, the feature distribution distance between nodes is determined according to the transaction feature vector of each node; Based on a pre-defined clustering algorithm, nodes are divided according to the feature distribution distance between each node, and several sets of power nodes are determined. For each set of power nodes, establish communication links between the nodes in the current set of power nodes to generate the network topology of the current set of power nodes; Based on the network topology of each power node set, generate each distributed network shard.

[0029] Specifically, based on the transaction frequency data of each node, the frequency characteristic components of each node are determined across multiple preset time dimensions. In practice, the numerical performance of each node at different time scales, such as daily, weekly, and monthly, is extracted from the collected transaction frequency data. The extracted frequency characteristic components cover daily average transaction frequency, concentration of transaction objects, average transaction amount, node type identifier, and the percentage of online time for each node. To eliminate the interference of different units of measurement on numerical calculations, a standardized score algorithm is used to standardize the frequency characteristic components of each node across all preset time dimensions, generating standardized characteristic components for each node.

[0030] The frequency feature components of each node under multiple preset time dimensions are combined to determine the transaction feature vector of each node. The analytic hierarchy process (AHP) is used to determine the preset weights corresponding to each feature dimension, and the sum of the preset weights for all feature dimensions is strictly limited to a value of one. The standardized feature components of each node are multiplied by their corresponding preset weights, and the product results under different feature dimensions are arranged and integrated in an ordered manner to construct a transaction feature vector that comprehensively represents the transaction behavior attributes of the nodes.

[0031] Based on a pre-defined distance metric function, the feature distribution distance between nodes is determined according to their transaction feature vectors. Here, a weighted Euclidean distance metric is used as the pre-defined distance metric function; the smaller the distance value, the more similar the transaction behavior characteristics of the two nodes, and the stronger the rationality of classifying them into the same network shard. The specific formula for calculating the feature distribution distance is as follows: in, The feature distribution distance between the first node and the second node. The total number of feature dimensions. For the first Preset weights corresponding to each feature dimension For the first node in the Standardized feature components under each feature dimension For the second node at the Standardized feature components under each feature dimension.

[0032] Based on a pre-defined clustering algorithm, nodes are partitioned according to the characteristic distribution distance between each node to determine several power node sets. K-means clustering is used as the pre-defined clustering algorithm. To objectively determine the optimal number of cluster centers, elbow evaluation logic is introduced. Specifically, the sum of squared errors within clusters is calculated for different numbers of candidates, and an evaluation curve showing the correspondence between the number of candidates and the sum of squared errors within clusters is plotted. The critical inflection point value where the sum of squared errors within clusters changes from a rapid decrease to a slow decrease in the evaluation curve is found, and this critical inflection point value is determined as the optimal number of centers for the pre-defined clustering algorithm. Based on the calculated characteristic distribution distance between each node, each node is assigned to the nearest cluster center, and all nodes belonging to the same cluster center constitute an independent power node set.

[0033] For each power node cluster, communication links are established between all nodes in the current power node cluster, generating the network topology of the current power node cluster. After completing the physical partitioning of nodes, an underlying message interaction channel is configured for each independent cluster of power nodes, enabling direct data transmission and reception between any two nodes within the current power node cluster. By deploying verification nodes and consensus nodes within the current power node cluster, a network topology with decentralized characteristics is constructed.

[0034] Based on the network topology of each power node set, distributed network shards are generated. The entire power node set with the constructed network topology is then encapsulated as an independent distributed network shard. Each distributed network shard is independently configured with a Byzantine fault-tolerant consensus protocol to ensure consistency of data interaction within the shard and underlying tamper-proof capabilities.

[0035] By introducing frequency features of multi-dimensional time dimension and objective distance metric function for network clustering, it is ensured that nodes with close historical transaction relationships are accurately divided into the same network area, effectively reducing the frequent interaction of cross-regional data communication and greatly improving the concurrent processing capability and throughput verification efficiency of the overall business architecture.

[0036] Step S3: For each distributed network shard, determine each leaf node in the current distributed network shard based on the power trading requests of each node in the current distributed network shard; determine the hash value of each leaf node in the current distributed network shard based on a preset hash function; and determine the hash value of the root node of the shard intermediate layer in the current distributed network shard based on the hash value of each leaf node in the current distributed network shard.

[0037] In a preferred embodiment, for each distributed network shard, the leaf nodes within the current distributed network shard are determined based on the power trading requests of each node in the current distributed network shard, including: For each distributed network shard, the power trading requests of each node in the current distributed network shard are parsed to generate the request feature parameters of each node in the current distributed network shard. Based on the request characteristic parameters of each node in the current distributed network shard, calculate and generate the node processing weight corresponding to each node in the current distributed network shard. For each node in the current distributed network shard, if the node's processing weight is lower than the preset processing weight threshold, the current node is determined as a leaf node in the current distributed network shard.

[0038] In a preferred embodiment, determining the hash value of each leaf node within the current distributed network shard based on a preset hash function includes: Convert the power transaction requests of each leaf node in the current distributed network shard into the byte sequence corresponding to each leaf node; Each leaf node's corresponding byte sequence is input into a preset hash function for hash operation, generating the hash value of each leaf node within the current distributed network shard.

[0039] In a preferred embodiment, determining the hash value of the root node of the intermediate layer of the current distributed network shard based on the hash values ​​of each leaf node within the current distributed network shard includes: Based on the preset tree structure, determine the level corresponding to each leaf node in the current distributed network shard; The maximum level of the preset tree structure is used as the initial processing level, and the hash values ​​of each leaf node at the maximum level of the preset tree structure are used as the hash values ​​to be processed in the initial processing level. Repeat the hierarchical upward aggregation operation until the number of intermediate node hash values ​​of the previous level of the current processing level is 1, and generate the root node hash value of the sharded intermediate layer; The hierarchical upward aggregation operation includes: If the number of unprocessed hash values ​​in the current processing level is even, concatenate each unprocessed hash value in the current processing level in pairs to generate a concatenated data block for the current processing level. If the number of unprocessed hash values ​​in the current processing level is odd and not 1, based on a preset arrangement order, each unprocessed hash value in the current processing level is concatenated in pairs to generate at least one first concatenated data block; unprocessed hash values ​​that are not concatenated in pairs are treated as independent unprocessed hash values; independent unprocessed hash values ​​are concatenated with other independent unprocessed hash values ​​to generate a second concatenated data block; the second concatenated data block and the first concatenated data block are used as the concatenated data block of the current processing level. Perform a hash operation on the concatenated data block at the current processing level to generate the hash value of the intermediate node at the next higher level. Determine if the number of intermediate node hash values ​​of the previous level of the current processing level is 1. If so, use the intermediate node hash value of the previous level of the current processing level as the root node hash value of the intermediate layer of the current distributed network shard. If not, update the hash values ​​of the intermediate nodes of the previous level and the leaf nodes of the previous level to the unprocessed hash value of the current processing level.

[0040] Specifically, for each distributed network shard, based on the power trading requests of each node in the current distributed network shard, the leaf nodes within the current distributed network shard are determined, including: For each pre-defined distributed network shard, a deep analysis of the power trading requests from each node within that shard is required. By extracting key attribute fields from the request messages, request characteristic parameters for each node within the current distributed network shard are generated. These request characteristic parameters encompass quantitative indicators such as the transaction amount per transaction, data transmission scale, and business processing complexity.

[0041] Next, based on the request characteristic parameters of each node within the current distributed network shard, a pre-configured computing power allocation model is introduced to calculate and generate the node processing weight corresponding to each node within the current distributed network shard. Specifically, the process of calculating the node processing weight using the aforementioned computing power allocation model includes: First, the flow allowance and data transmission scale values ​​are extracted from the aforementioned request feature parameters. These values ​​are then smoothed using a preset logarithmic function (e.g., the ln function with the natural constant as its base) to obtain smoothed feature values. Next, the number of CPU cores and bandwidth capacity thresholds are obtained from the aforementioned node device data. The smoothed feature values, the number of CPU cores, and the bandwidth capacity thresholds are then summed using a weighted average. Finally, a preset normalization function (e.g., the Min-Max linear normalization function) is used to map the weighted sum to a closed interval between 0 and 1, thereby outputting the node processing weights corresponding to each node within the current distributed network shard.

[0042] Subsequently, for each node within the current distributed network shard, a numerical comparison relationship is established between the node's processing weight and a preset processing weight threshold. The preset processing weight threshold is dynamically and adaptively set based on the average processing weight of all nodes within the current distributed network shard. If the current node's processing weight is lower than the preset processing weight threshold, it indicates that the business carried by the current node belongs to basic lightweight transactions. Therefore, the current node is identified as a leaf node within the current distributed network shard, serving as the original data carrier for subsequently building the underlying data verification structure. Conversely, if the current node's processing weight is greater than or equal to the preset processing weight threshold, the current node is identified as an aggregation verification node within the current distributed network shard. The aggregation verification node not only connects its own initiated power transaction requests as independent leaf nodes to the tree structure but also receives and verifies the hash data reported by surrounding leaf nodes, thereby constructing a clear hierarchical network division of labor.

[0043] In one specific embodiment, the hash value of each leaf node within the current distributed network shard is determined based on a preset hash function, including: The power transaction requests of each leaf node within the current distributed network shard are converted into the corresponding byte sequence for each leaf node according to a unified encoding standard. This serialization operation can completely eliminate data format differences caused by different network transmission protocols.

[0044] The byte sequence corresponding to each leaf node is input into a preset hash function for hash operation to generate the hash value of each leaf node within the current distributed network shard. A secure hash cryptography algorithm is used as the preset hash function. The specific formula for calculating the one-way mapping of leaf nodes is as follows: in, This represents the hash value of the leaf node within the current distributed network shard. For the preset hash function, This represents the byte sequence corresponding to the leaf node. Through one-way hash calculation, business content of arbitrary length can be compressed and mapped into a fixed-length feature string, providing a standardized computational foundation for subsequent hierarchical anti-tampering aggregation.

[0045] In a specific embodiment, the hash value of the root node of the intermediate layer of the current distributed network shard is determined based on the hash values ​​of each leaf node within the current distributed network shard, including: To construct a robust data aggregation architecture within a distributed network shard, it is necessary to determine the hierarchy of each leaf node within the current distributed network shard based on a pre-defined tree structure. This pre-defined tree structure is a bottom-up, hierarchical, recursive cryptographic association topology.

[0046] The maximum level of the preset tree structure is used as the initial processing level, and the hash values ​​of each leaf node at the maximum level of the preset tree structure are used as the unprocessed hash values ​​of the initial processing level. The maximum level is also the lowest boundary of the entire associated topology.

[0047] Next, repeat the hierarchical upward aggregation operation until the number of intermediate node hash values ​​of the current processing level's previous level is 1, and generate the root node hash value of the sharded intermediate layer.

[0048] The hierarchical upward aggregation operation includes the following specific cryptographic derivation logic: If the number of unprocessed hash values ​​in the current processing level is even, each unprocessed hash value in the current processing level is concatenated in pairs to generate a concatenated data block for the current processing level.

[0049] When the number of unprocessed hash values ​​at the current processing level is odd and not equal to 1, each unprocessed hash value at the current processing level is concatenated in pairs according to a preset order to generate at least one first concatenated data block. The preset order is specifically set to ascending order based on the hexadecimal value of each unprocessed hash value, or lexicographical order based on the node identity identifier corresponding to each unprocessed hash value, to ensure absolute determinism and consistency among nodes in the distributed network sharding when performing hash concatenation. Simultaneously, unprocessed hash values ​​that have not been concatenated are treated as independent unprocessed hash values. These independent unprocessed hash values ​​are then self-replicated and merged with each other to generate a second concatenated data block. Finally, the second concatenated data block and the first concatenated data block are combined as the concatenated data block for the current processing level. The introduction of a self-replicating concatenation mechanism in odd-numbered states ensures that the underlying hash nodes can always form complete paired combinations upwards.

[0050] After the splicing and combination are completed, a hash operation is performed on the spliced ​​data block of the current processing level to generate the hash value of the intermediate node of the next higher level.

[0051] Next, it checks if the number of intermediate node hash values ​​in the previous level of the current processing layer is one. If so, it means that the aggregation process has reached the top of the current distributed network shard, and the hash value of the intermediate node in the previous level of the current processing layer is directly used as the hash value of the root node of the intermediate layer of the current distributed network shard.

[0052] If the judgment result is negative, it means that the top vertex has not yet been reached. In this judgment phase, the hash values ​​of the intermediate nodes of the previous level and the leaf nodes of the previous level are combined to update the unprocessed hash value of the current processing level. By continuously advancing the processing levels and iteratively calling the concatenation and cryptographic calculation process, the upward convergence of all underlying state data is steadily completed.

[0053] By introducing a dynamically adaptable leaf node filtering mechanism and a hierarchical tree-structured hash aggregation calculation logic, not only is the invalid verification calculation loss of overweight nodes effectively filtered out, but a rigorous cryptographically tamper-proof data structure is also successfully constructed within the distributed network sharding, which greatly improves the overall security of local business verification and the efficiency of data traceability.

[0054] Step S4: Determine the global root node hash value based on the hash value of the root node of the intermediate layer of each distributed network shard.

[0055] In a preferred embodiment, the global root node hash value is determined based on the hash values ​​of the intermediate root nodes of each distributed network shard, including: Each distributed network fragment is uniquely encoded to generate a fragment identifier for each distributed network fragment. Based on each shard identifier, the hash values ​​of the root nodes of the intermediate layer of each distributed network shard are sorted to generate an initial global hash sequence to be merged, and the hash values ​​of the root nodes of the intermediate layer of each distributed network shard are used as the global hash values ​​to be merged in the initial global hash sequence to be merged. Repeat the global iterative merge operation until the number of current global transition hash values ​​is 1, then generate the global root node hash value; The global iterative merging operation includes: If the number of global hash values ​​to be merged in the current global hash sequence is even, combine each global hash value to be merged in the current global hash sequence in pairs to generate the current global combined data item. If the number of global hash values ​​to be merged in the current global hash sequence is odd and not 1, based on the current global hash sequence, each global hash value to be merged in the current global hash sequence is combined in pairs to generate at least one first global combined data item; the global hash values ​​that are not combined in pairs are taken as the last isolated hash values; the last isolated hash values ​​are combined with the last isolated hash values ​​to generate a second global combined data item; the first global combined data item and the second global combined data item are taken as the current global combined data item. Perform a hash operation on the current global combined data item to generate the current global transition hash value; Check if the current number of global transition hash values ​​is 1. If it is, use the global transition hash value as the global root node hash value. If not, update the current global transition hash value to the global hash value to be merged contained in the current global hash sequence to be merged.

[0056] Specifically, the global root node hash value is determined based on the hash value of the root node in the intermediate layer of each distributed network shard, including: In the initial stage of establishing a global cryptographic association, each distributed network fragment needs to be uniquely encoded to generate a fragment identifier. The fragment identifier is a numerically encoded sequence used to accurately address and distinguish a specific network fragment within the overall network topology. After obtaining the identifiers, the hash values ​​of the root nodes of the intermediate layers of each distributed network fragment are strictly sorted according to the numerical value of the fragment identifiers or a preset dictionary arrangement rule, generating an initial global hash sequence to be merged. This standardized sorting mechanism ensures that state data distributed across different network regions can be arranged in a fixed and reproducible order. Then, the hash values ​​of the root nodes of the intermediate layers of each distributed network fragment are used as the global hash values ​​to be merged in the initial global hash sequence, serving as the underlying input for constructing a globally tamper-proof data structure.

[0057] Subsequently, the global iterative merge operation is repeated until the number of current global transitional hash values ​​is 1, generating the global root node hash value. The specific global iterative merge operation encompasses detailed branch combination logic. If the number of global hash values ​​to be merged in the current global hash sequence is even, it means that all nodes can be perfectly paired. When the even condition is met, the global hash values ​​to be merged in the current global hash sequence are combined pairwise; that is, adjacent global hash values ​​are directly concatenated according to their permutation order to generate the current global combined data item.

[0058] When the number of global hash values ​​to be merged in the current global hash sequence is odd and not equal to 1, there will inevitably be a lone feature value that cannot be paired normally. Faced with this lone feature value, based on the current global hash sequence, each global hash value to be merged is sequentially paired to generate at least one first global combined data item. Simultaneously, the global hash values ​​that are not paired are designated as the last isolated hash value. To maintain the upward aggregation balance of the structure and the rigor of the cryptographic derivation, the last isolated hash value is concatenated with itself to generate a second global combined data item. Finally, the first and second global combined data items are unified as the current global combined data item at the current processing level.

[0059] After obtaining the pairing and concatenation results, a hash operation is performed on the current global combined data item to generate the current global transitional hash value. The specific formula for cross-shard data aggregation hash calculation is as follows: in, Represents the current global combined data item. This represents either the first global hash value to be merged in a pairwise combination or the last isolated hash value that has undergone self-replication. This represents the second global hash value to be merged in the pairwise combination, or the last isolated hash value after replication. Represents a data concatenation operator for byte sequences. This represents the calculated current global transition hash value. Through the above cryptographic hash calculation, the underlying discrete fragmented state data is gradually compressed and merged upwards.

[0060] After completing one round of computation, check if the current number of global transition hash values ​​is 1. If yes, it means that the state data of all fragments has completely converged to a single top-level feature point, and the unique global transition hash value is directly used as the final global root node hash value. If not, it means that the current aggregation level has not yet reached the top. In the state where the top has not yet been reached, update the current global transition hash value to the global hash value to be merged contained in the current global hash sequence to be merged in the next iteration. Continuously advance the merging level upwards and repeatedly call the above global iterative merging operation until a single cryptographic feature value representing the unified state of the entire macroscopic network is calculated.

[0061] By implementing the above data processing steps and constructing a tree-like hash aggregation path that converges from each discrete network shard to the global top, the data silos caused by local verification are completely eliminated, laying an absolutely consistent and tamper-proof unified global data benchmark for subsequent collaborative verification of cross-regional business.

[0062] Step S5: Determine the transaction verification result of each power transaction request based on the power transaction requests of each node, the equipment data of each node, and the preset weight coefficients.

[0063] In a preferred embodiment, the transaction verification result of each power transaction request is determined based on the power transaction request of each node, the device data of each node, and a preset weighting coefficient, including: Based on the preset power trading data structure, the power trading requests of each node are parsed to extract the trading feature data of each node. The device data of each node is decoded according to the protocol, and the device operation characteristic data of each node is extracted. Based on the transaction characteristic data of each node, the equipment operation characteristic data of each node, and the preset weight coefficients, a comprehensive verification score for each power transaction request is calculated and generated. If the overall verification score of a power transaction request exceeds a preset verification threshold, the power transaction request is determined to have passed verification. If the overall verification score of a power transaction request does not exceed the preset verification threshold, the transaction verification result of the power transaction request is determined to be verification failure.

[0064] Specifically, based on the power trading requests from each node, the equipment data of each node, and the preset weighting coefficients, the transaction verification results for each power trading request are determined, including: Based on a pre-defined power transaction data structure, the power transaction requests from each node are parsed to extract transaction feature data. Entering the cross-validation phase, the business data stream from the front end needs to be standardized. Each acquired power transaction request is unpacked and its underlying fields are separated. Time zone calibration of the timestamp is performed, and basic legality checks are conducted on the attached digital signature. After verification, metrics closely related to the business timeline are extracted from the parsed message body, specifically including timestamp deviation, transaction time reasonableness, and timestamp on-chain delay parameters. These extracted multi-dimensional parameters are then integrated to form standardized output transaction feature data.

[0065] The protocol is decoded synchronously on the device data of each node to extract the device operation characteristic data of each node. Considering the complexity and diversity of the underlying physical hardware, the aggregated raw device messages need to be structurally extracted and processed according to a unified format template. Multi-dimensional parameters reflecting the reliability of nodes are extracted from the physical hardware status level, specifically covering device online stability, device failure rate, transaction compliance rate, malicious behavior records, and transaction feedback scores. The integrated multi-dimensional parameters are used as the output device operation characteristic data.

[0066] Based on the transaction characteristic data and equipment operation characteristic data of each node, and preset weighting coefficients, a comprehensive verification score for each power transaction request is calculated. To balance the consideration of the business initiation status and physical equipment condition, independent calculation and weighted fusion of the two indicators are required. First, a transaction time characteristic score is calculated using the extracted transaction characteristic data, and an equipment operation reputation score is calculated using the equipment operation characteristic data. The two independent scores are then normalized. Next, pre-allocated weighting coefficients according to the business application scenario are introduced. The time characteristic weighting coefficient and the equipment characteristic weighting coefficient are multiplied by the corresponding normalized independent scores, and then summed. The specific cross-validation comprehensive calculation formula is expressed as follows: in, To comprehensively verify the score, These are preset time feature weighting coefficients. Score the characteristics of transaction time. These are preset equipment feature weighting coefficients. Equipment operational reputation is scored. The sum of the preset time feature weighting coefficient and the preset equipment feature weighting coefficient is strictly limited to a value of 1. To adapt to complex power grid conditions, the aforementioned time feature weighting coefficient and the aforementioned equipment feature weighting coefficient are dynamically adjusted and allocated based on pre-set scenario mapping rules; specifically, in conventional power trading scenarios, The value is 0.4. The value is 0.6; in high-value cross-network transactions, to strengthen the underlying hardware verification layer, The value is 0.3. The value is 0.7; in the scenario of peak-valley-peak trading in the power grid, in order to ensure the timeliness of business flow, The value is 0.7. The value is set to 0.3. By executing the aforementioned scenario mapping rules, the dynamic adjustment and allocation of various weight coefficients are completed.

[0067] After the fusion calculation is completed, the resulting numerical values ​​are compared with the set benchmark requirements. The preset verification threshold represents the minimum security baseline for allowing business transactions to proceed downwards, specifically set as an 80-point baseline in a percentage-based scoring system. If the comprehensive verification score of a power transaction request exceeds the preset verification threshold, the transaction verification result is determined to be verified successfully. Once the comprehensive verification score reaches or exceeds the preset verification threshold, it indicates that the initiating end has a high degree of credibility in both business logic and underlying device health, thus directly generating a positive judgment result of verification success. Conversely, if the comprehensive verification score of a power transaction request does not exceed the preset verification threshold, the transaction verification result is determined to be verified unsuccessfully. If the comprehensive verification score is found to be below the set security baseline, it indicates that the current business request has potential security risks or that the device status of the initiating node is extremely unstable, and a rejection judgment result of verification failure is immediately generated.

[0068] By implementing a two-dimensional cross-validation mechanism and combining it with a dynamically adjusted weighted fusion strategy, not only are abnormal transaction interferences caused by underlying device physical failures effectively filtered out, but the ability to identify and intercept malicious forged requests in real time is also greatly improved.

[0069] Step S6: Based on the transaction verification results of each power transaction request, the hash value of each power transaction request and the global root node, perform collaborative verification on each distributed network shard.

[0070] In a preferred embodiment, collaborative verification is performed on each distributed network shard based on the transaction verification results of each power transaction request, each power transaction request, and the hash value of the global root node, including: If there is a power transaction request that has passed the verification, at least one power transaction request that has passed the verification will be used as the target power transaction request. In the event that a power transaction request fails to pass verification, at least one power transaction request that fails verification will be treated as an abnormal power transaction request. For abnormal power trading requests, generate transaction rejection information corresponding to the abnormal power trading request, and feed back the transaction rejection information to the node corresponding to the abnormal power trading request; For a target power transaction request, the target power transaction request is combined and encapsulated with the global root node hash value to generate a global synchronization record; The global synchronization record is distributed to each distributed network shard so that each distributed network shard can perform data integrity verification on the global synchronization record based on the global root node hash value in the global synchronization record, generate data integrity verification results for each distributed network shard, update the local transaction ledger of the distributed network shard according to the global synchronization record if the data integrity verification result of the distributed network shard is successful, and generate a verification failure alarm message containing the shard identifier of the distributed network shard if the data integrity verification result of the distributed network shard is unsuccessful.

[0071] Specifically, based on the transaction verification results of each power transaction request, the hash values ​​of each power transaction request and the global root node, collaborative verification is performed on each distributed network shard, including: After comprehensively scoring and verifying each power transaction request, it is necessary to process them separately based on the differences in the judgment results. If a power transaction request passes verification, it indicates that the corresponding business flow action possesses a high degree of physical device security and logical interaction compliance. At least one of these verified power transaction requests will then be designated as the target power transaction request to facilitate smooth entry into the cross-network area global confirmation and recording synchronization process.

[0072] Conversely, if a power transaction request fails verification, it exposes potential equipment malfunctions or operational irregularities. To mitigate security risks, at least one power transaction request that fails verification is classified as an abnormal power transaction request and removed from the normal data processing queue.

[0073] For any abnormal power trading requests identified during the screening process, a reverse blocking and feedback mechanism must be triggered immediately. Based on the abnormal power trading request, a corresponding transaction rejection message is generated. This message clearly records the reason for rejection and the corresponding details of the underlying abnormal indicators. Subsequently, the rejection message is fed back to the node corresponding to the abnormal power trading request, thereby triggering a fund lock-up rollback operation in the underlying business state to ensure that malicious behavior or erroneous call instructions do not spread and escalate within the distributed network.

[0074] For successfully completed target power transaction requests, the core cross-shard data synchronization and collaborative linkage phase begins. First, the target power transaction request is combined and encapsulated with the previously derived global root node hash value to generate a global synchronization record containing the complete business payload and a globally unified cryptographic identifier. To control the timing of synchronization record distribution and balance the load on the underlying communication network, a dynamic threshold triggering rule based on the underlying network's operational status is introduced to control the data synchronization frequency. The specific dynamic distribution triggering formula is expressed as follows: In the formula, This represents the actual trigger threshold. This represents a fixed threshold set based on the efficiency of the underlying consensus verification. This represents a dynamic adjustment coefficient that is dynamically adjusted in real time based on the current transaction concurrency and node online rate.

[0075] When the accumulated data discrepancies exceed the calculated actual trigger threshold, the global synchronization record is officially distributed to each distributed network shard. Upon receiving cross-network data, each shard extracts the global root node hash value from the global synchronization record and compares it locally with the cryptographic calculation results derived from its own underlying data. Based on this comparison, each distributed network shard performs data integrity verification on the global synchronization record using the global root node hash value, thereby generating its own data integrity verification result.

[0076] If the data integrity verification result of the distributed network shards passes, it indicates that the received cross-shard business data has not been tampered with during transmission. It should be noted that the global root node hash value in the global synchronization record is used to verify the data integrity of all power transaction requests within the current batch. After confirming the aforementioned data integrity, each distributed network shard then filters the data based on the transaction verification result determined in step S5. Specifically, each distributed network shard removes abnormal power transaction requests from the global synchronization record, retaining only the verified target power transaction requests, and synchronously updates its local transaction ledger according to the target power transaction requests, thereby completing the persistent storage of target power transaction data at the underlying level of each node and cross-shard state synchronization. The aforementioned execution logic decouples the underlying data anti-tampering verification from the upper-layer transaction state interception data processing.

[0077] If a mismatch in signature values ​​is found during the cryptographic comparison process, meaning the data integrity verification result for the distributed network shards fails, it indicates a serious risk of data tampering or a cross-network state breach. In response to this abnormal verification result, local ledger writing is immediately halted to prevent contamination of the underlying data. Simultaneously, a verification failure alarm message containing the shard identifier of the distributed network shard is generated, alerting the upper-layer region to the abnormal state and triggering a global rollback.

[0078] Implementing cross-network area cryptographic binding and two-way state verification mechanisms not only completely blocks cross-domain penetration of illegal tampering instructions and double-spending attacks, but also powerfully guarantees the absolute consistency and collaborative processing efficiency of the underlying distributed ledger in complex heterogeneous network scenarios through dynamic frequency adjustment and strict atomic reconciliation confirmation.

[0079] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.

[0080] like Figure 2 As shown, an embodiment of the present invention provides a collaborative verification device for power trading, comprising: a data acquisition module, a clustering and sharding module, a local hash determination module, a global hash determination module, and a collaborative verification module; The data acquisition module is used to acquire transaction frequency data, power transaction requests of each node, and node equipment data of each node in the power system. The clustering and sharding module is used to perform clustering analysis on the transaction frequency data of each node to determine each distributed network shard. The local hash determination module is used to determine each leaf node in the current distributed network shard based on the power trading requests of each node in the current distributed network shard; determine the hash value of each leaf node in the current distributed network shard based on a preset hash function; and determine the hash value of the root node of the shard intermediate layer in the current distributed network shard based on the hash value of each leaf node in the current distributed network shard. The global hash determination module is used to determine the global root node hash value based on the hash value of the root node of the intermediate layer of each distributed network shard. The collaborative verification module is used to determine the transaction verification result of each power transaction request based on the power transaction request of each node, the device data of each node, and the preset weight coefficient; and to perform collaborative verification on each distributed network shard based on the transaction verification result of each power transaction request, each power transaction request, and the hash value of the global root node.

[0081] It should be noted that the embodiments of the apparatus described above correspond to the embodiments of the present invention described above, and can realize the collaborative verification method for power trading described in any one of the above embodiments of the present invention. Furthermore, the embodiments of the apparatus described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Additionally, in the accompanying drawings of the apparatus embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without creative effort.

[0082] Based on the above-described method embodiments of the present invention, a corresponding embodiment of an electronic device is provided.

[0083] An embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the collaborative verification method for power trading according to any one of the present invention, or, when the processor executes the computer program, it implements the functions of each module in the above-described device embodiments.

[0084] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the terminal device.

[0085] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0086] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0087] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0088] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0089] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A collaborative verification method for electricity trading, characterized in that, include: Acquire transaction frequency data, power transaction requests, and node equipment data of each node in the power system. Cluster analysis is performed on the transaction frequency data of each node to determine the shards of each distributed network; For each distributed network shard, determine each leaf node in the current distributed network shard based on the power trading requests of each node in the current distributed network shard; determine the hash value of each leaf node in the current distributed network shard based on a preset hash function. Based on the hash values ​​of each leaf node in the current distributed network shard, determine the hash value of the root node of the intermediate layer of the current distributed network shard. The global root node hash value is determined based on the hash value of the root node of the intermediate layer of each distributed network shard. Based on the power trading requests of each node, the equipment data of each node, and the preset weighting coefficients, the transaction verification result of each power trading request is determined. Based on the transaction verification results of each power transaction request, the hash values ​​of each power transaction request and the global root node, collaborative verification is performed on each distributed network shard.

2. The collaborative verification method for power trading as described in claim 1, characterized in that, Cluster analysis is performed on the transaction frequency data of each node to determine the shards of each distributed network, including: Based on the transaction frequency data of each node, determine the frequency characteristic components of each node under multiple preset time dimensions. The frequency feature components of each node under multiple preset time dimensions are combined to determine the transaction feature vector of each node. Based on a preset distance metric function, the feature distribution distance between nodes is determined according to the transaction feature vector of each node; Based on a pre-defined clustering algorithm, nodes are divided according to the feature distribution distance between each node, and several sets of power nodes are determined. For each set of power nodes, establish communication links between the nodes in the current set of power nodes to generate the network topology of the current set of power nodes; Based on the network topology of each power node set, generate each distributed network shard.

3. The collaborative verification method for power trading as described in claim 2, characterized in that, For each distributed network shard, based on the power trading requests of each node in the current distributed network shard, determine the leaf nodes within the current distributed network shard, including: For each distributed network shard, the power trading requests of each node in the current distributed network shard are parsed to generate the request feature parameters of each node in the current distributed network shard. Based on the request characteristic parameters of each node in the current distributed network shard, calculate and generate the node processing weight corresponding to each node in the current distributed network shard. For each node in the current distributed network shard, if the node's processing weight is lower than the preset processing weight threshold, the current node is determined as a leaf node in the current distributed network shard.

4. The collaborative verification method for power trading as described in claim 3, characterized in that, Based on a preset hash function, determine the hash value of each leaf node within the current distributed network shard, including: Convert the power transaction requests of each leaf node in the current distributed network shard into the byte sequence corresponding to each leaf node; Each leaf node's corresponding byte sequence is input into a preset hash function for hash operation, generating the hash value of each leaf node within the current distributed network shard.

5. The collaborative verification method for power trading as described in claim 4, characterized in that, Based on the hash values ​​of each leaf node within the current distributed network shard, determine the hash value of the root node of the intermediate layer of the current distributed network shard, including: Based on the preset tree structure, determine the level corresponding to each leaf node in the current distributed network shard; The maximum level of the preset tree structure is used as the initial processing level, and the hash values ​​of each leaf node at the maximum level of the preset tree structure are used as the hash values ​​to be processed in the initial processing level. Repeat the hierarchical upward aggregation operation until the number of intermediate node hash values ​​of the previous level of the current processing level is 1, and generate the root node hash value of the sharded intermediate layer; The hierarchical upward aggregation operation includes: If the number of unprocessed hash values ​​in the current processing level is even, concatenate each unprocessed hash value in the current processing level in pairs to generate a concatenated data block for the current processing level. If the number of unprocessed hash values ​​in the current processing level is odd and not 1, based on a preset arrangement order, each unprocessed hash value in the current processing level is concatenated in pairs to generate at least one first concatenated data block; unprocessed hash values ​​that are not concatenated in pairs are treated as independent unprocessed hash values; independent unprocessed hash values ​​are concatenated with other independent unprocessed hash values ​​to generate a second concatenated data block; the second concatenated data block and the first concatenated data block are used as the concatenated data block of the current processing level. Perform a hash operation on the concatenated data block at the current processing level to generate the hash value of the intermediate node at the next higher level. Determine if the number of intermediate node hash values ​​of the previous level of the current processing level is 1. If so, use the intermediate node hash value of the previous level of the current processing level as the root node hash value of the intermediate layer of the current distributed network shard. If not, update the hash values ​​of the intermediate nodes of the previous level and the leaf nodes of the previous level to the unprocessed hash value of the current processing level.

6. The collaborative verification method for power trading as described in claim 5, characterized in that, The global root node hash value is determined based on the hash value of the root node in the intermediate layer of each distributed network shard, including: Each distributed network fragment is uniquely encoded to generate a fragment identifier for each distributed network fragment. Based on each shard identifier, the hash values ​​of the root nodes of the intermediate layer of each distributed network shard are sorted to generate an initial global hash sequence to be merged, and the hash values ​​of the root nodes of the intermediate layer of each distributed network shard are used as the global hash values ​​to be merged in the initial global hash sequence to be merged. Repeat the global iterative merge operation until the number of current global transition hash values ​​is 1, then generate the global root node hash value; The global iterative merging operation includes: If the number of global hash values ​​to be merged in the current global hash sequence is even, combine each global hash value to be merged in the current global hash sequence in pairs to generate the current global combined data item. If the number of global hash values ​​to be merged in the current global hash sequence is odd and not 1, based on the current global hash sequence, each global hash value to be merged in the current global hash sequence is combined in pairs to generate at least one first global combined data item; the global hash values ​​that are not combined in pairs are taken as the last isolated hash values; the last isolated hash values ​​are combined with the last isolated hash values ​​to generate a second global combined data item; the first global combined data item and the second global combined data item are taken as the current global combined data item. Perform a hash operation on the current global combined data item to generate the current global transition hash value; Check if the current number of global transition hash values ​​is 1. If it is, use the global transition hash value as the global root node hash value. If not, update the current global transition hash value to the global hash value to be merged contained in the current global hash sequence to be merged.

7. The collaborative verification method for power trading as described in claim 6, characterized in that, Based on the power trading requests from each node, the equipment data of each node, and the preset weighting coefficients, the transaction verification results for each power trading request are determined, including: Based on the preset power trading data structure, the power trading requests of each node are parsed to extract the trading feature data of each node. The device data of each node is decoded according to the protocol, and the device operation characteristic data of each node is extracted. Based on the transaction characteristic data of each node, the equipment operation characteristic data of each node, and the preset weight coefficients, a comprehensive verification score for each power transaction request is calculated and generated. If the overall verification score of a power transaction request exceeds a preset verification threshold, the power transaction request is determined to have passed verification. If the overall verification score of a power transaction request does not exceed the preset verification threshold, the transaction verification result of the power transaction request is determined to be verification failure.

8. The collaborative verification method for electricity trading as described in claim 7, characterized in that, Based on the transaction verification results of each power transaction request, the hash values ​​of each power transaction request and the global root node, collaborative verification is performed on each distributed network shard, including: If there is a power transaction request that has passed the verification, at least one power transaction request that has passed the verification will be used as the target power transaction request. In the event that a power transaction request fails to pass verification, at least one power transaction request that fails verification will be treated as an abnormal power transaction request. For abnormal power trading requests, generate transaction rejection information corresponding to the abnormal power trading request, and feed back the transaction rejection information to the node corresponding to the abnormal power trading request; For a target power transaction request, the target power transaction request is combined and encapsulated with the global root node hash value to generate a global synchronization record; The global synchronization record is distributed to each distributed network shard so that each distributed network shard can perform data integrity verification on the global synchronization record based on the global root node hash value in the global synchronization record, generate data integrity verification results for each distributed network shard, update the local transaction ledger of the distributed network shard according to the global synchronization record if the data integrity verification result of the distributed network shard is successful, and generate a verification failure alarm message containing the shard identifier of the distributed network shard if the data integrity verification result of the distributed network shard is unsuccessful.

9. A collaborative verification device for electricity trading, characterized in that, include: The module includes a data acquisition module, a clustering and sharding module, a local hash determination module, a global hash determination module, and a collaborative verification module. The data acquisition module is used to acquire transaction frequency data, power transaction requests of each node, and node equipment data of each node in the power system. The clustering and sharding module is used to perform clustering analysis on the transaction frequency data of each node to determine each distributed network shard. The local hash determination module is used to determine each leaf node in the current distributed network shard based on the power trading requests of each node in the current distributed network shard; determine the hash value of each leaf node in the current distributed network shard based on a preset hash function; and determine the hash value of the root node of the shard intermediate layer in the current distributed network shard based on the hash value of each leaf node in the current distributed network shard. The global hash determination module is used to determine the global root node hash value based on the hash value of the root node of the intermediate layer of each distributed network shard. The collaborative verification module is used to determine the transaction verification result of each power transaction request based on the power transaction request of each node, the equipment data of each node, and the preset weight coefficient. Based on the transaction verification results of each power transaction request, the hash values ​​of each power transaction request and the global root node, collaborative verification is performed on each distributed network shard.

10. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the collaborative verification method for power trading as described in any one of claims 1 to 8.