Search

CN-122019497-A - Distributed power transaction data storage method and system based on hybrid database

CN122019497ACN 122019497 ACN122019497 ACN 122019497ACN-122019497-A

Abstract

The invention discloses a distributed power transaction data storage method and system based on a hybrid database, and relates to the technical field of distributed storage; the method comprises the steps of constructing a chain up-link and down-link collaborative storage architecture, generating partition keys based on areas, asset types and time slices, mapping data to corresponding blockchain channels according to the partition keys, processing cross-chain transactions through a business-aware atom submission protocol, classifying the data into hot, warm and cold data based on a dynamic value scoring model, storing the hot, warm and cold data on the chains, under the chains or coding and archiving in a differentiated mode, processing local tasks at network edge deployment nodes, and intelligently scheduling user requests through a load equalizer based on a network state matrix and a reinforcement learning algorithm. The invention improves the system storage efficiency, the inquiry capability and the high concurrency processing capability through the link-up and link-down collaborative storage and the multi-link partition architecture while guaranteeing the data credibility.

Inventors

  • CHEN JINING
  • LIU YUNPENG
  • CHEN MINGMING
  • PEI ZIXIA
  • CAI MINGMING
  • LIU XINPENG
  • LIU LIU
  • XU HAIYANG
  • MA JIKE

Assignees

  • 国网江苏省电力有限公司营销服务中心
  • 江苏方天电力技术有限公司

Dates

Publication Date
20260512
Application Date
20251222

Claims (10)

  1. 1. The distributed power transaction data storage method based on the hybrid database is characterized by comprising the following steps of: Step S1, receiving and preprocessing a distributed power supply transaction request, and extracting key fields; S2, constructing a link-up link-down collaborative storage architecture, wherein a LevelDB and CouchDB mixed state database is adopted on the link, and a storage cluster consisting of a distributed column type database cluster and an archiving storage network is constructed under the link; s3, generating a joint partition key based on physical area codes, asset type codes and time slices of transaction data, and mapping the data to corresponding logic block chain channels for consensus and storage according to the joint partition key; step S4, executing a service-aware atomic commit protocol for a cross-chain transaction involving a plurality of logical blockchain channels; s5, constructing a dynamic value scoring model to classify data into hot data, warm data and cold data, wherein the hot data is stored on a chain, data fingerprints of the warm data are stored on the chain, complete data are stored in an under-chain distributed column database cluster, the cold data is distributed archivally stored in an under-chain archival storage network after being encoded by erasure codes, and encoded metadata for verification and recovery are stored on the chain; Step S6, deploying edge computing nodes at the network edge close to the data source for processing localized computing tasks; And S7, dynamically scheduling the user request through the intelligent load balancer based on the network state matrix and the reinforcement learning algorithm.
  2. 2. The method according to claim 1, wherein said step S1 comprises the steps of: S1.1, receiving an original distributed power supply transaction request; s1.2, verifying the validity of the power supply transaction request format and the identity of the two transaction parties; And S1.3, extracting and standardizing the electric quantity, the electricity price, the time stamp and the asset type key fields of the transaction.
  3. 3. The method according to claim 2, wherein in the step S3, the generating manner of the joint partition key includes: Dividing the area code, the asset type code and the transaction time stamp by a time slice mark obtained by rounding down after the preset time slice length, and performing character string splicing in sequence; And (3) performing cryptographic hash function operation on the spliced character strings, wherein the obtained hash value is the final joint partition key.
  4. 4. The method according to claim 3, wherein in the step S4, the service aware atom submission protocol specifically includes the steps of: S4.1, pre-executing transactions on related logic block chain channels and generating a cross-chain lock containing service dependency relations; S4.2, submitting the cross-chain lock to a special coordination chain for global ordering and verification, and generating a global coordination block by the coordination chain; And S4.3, each logic block chain channel submits transactions in parallel according to the global coordination block, and if the submitting fails, the compensation operation is triggered according to the business dependency relationship.
  5. 5. The method according to claim 4, wherein in the step S5, the scoring value outputted by the dynamic value scoring model is obtained by weighted summation of four dimensions of access frequency, credit association, time decay factor and business association.
  6. 6. The method according to claim 5, wherein in step S5, the data is divided into three levels and stored according to the dynamic value score compared with a preset hot data threshold and a preset cold data threshold, and the method specifically includes: when the dynamic value score is higher than the hot data threshold, the hot data is judged to be directly stored on the chain CouchDB; when the dynamic value score is between the cold data threshold and the hot data threshold, judging the data as warm data, storing warm data fingerprints on a chain, and storing complete data in an under-chain distributed column database cluster; And when the dynamic value score is smaller than or equal to the cold data threshold value, judging that the dynamic value score is cold data, storing the cold data in an archiving network after erasure code coding and slicing, and storing the coding metadata in a chain.
  7. 7. The method of claim 6, wherein the erasure coding encoding process is to encode the original cold data block into n data slices and m check slices and construct a merck tree for all check slices, and wherein the encoded metadata stored on the chain includes at least the encoding parameters, a root hash of the merck tree, and a slice location map.
  8. 8. The method according to claim 7, wherein the localized real-time computing task includes power matching calculation based on edge node local cache data, transaction message format compliance verification, and transaction matching calculation within an area in step S6.
  9. 9. The method according to claim 8, wherein in step S7, each element of the network status matrix is used to characterize the integrated service capability from a certain request source to a certain edge node, and the value is determined by the network delay, the real-time load of the edge node, and the matching degree of the request feature and the node data cache feature.
  10. 10. A hybrid database-based distributed power transaction data storage system for implementing a hybrid database-based distributed power transaction data storage method as claimed in any one of claims 1 to 9, comprising: the data access and preprocessing module is used for receiving and preprocessing the distributed power supply transaction request and extracting key transaction fields; The on-chain and off-chain collaborative storage engine is used for constructing and managing a collaborative storage architecture consisting of an on-chain mixed state database and an off-chain storage cluster, and executing grading and differential storage strategies of data according to a dynamic value grading model; The partition routing and cross-chain coordination module is used for routing transaction data to corresponding logic blockchain channels based on the joint partition key and executing a service-aware atom submission protocol on cross-chain transactions to coordinate the channels; And the edge computing and intelligent scheduling module is used for managing edge computing nodes close to the data source to process localized computing tasks and scheduling user requests to the optimal edge nodes based on the network state matrix and the reinforcement learning algorithm.

Description

Distributed power transaction data storage method and system based on hybrid database Technical Field The invention relates to the technical field of distributed storage, in particular to a distributed power transaction data storage method and system based on a hybrid database. Background With the large-scale access of distributed photovoltaic power sources, wind power sources and the like, the power trading mode is changing from centralized to point-to-point and high-frequency distributed trading. The power transaction generates massive data, which puts high demands on the data storage, processing capacity and credibility guarantee of the system. At present, the electric power transaction mainly adopts the traditional centralized database or the single blockchain technical scheme, and the pure centralized database scheme can utilize the high-performance database to process high concurrency and complex inquiry, but has the problems that data is easy to tamper, the transaction process is opaque and relies on single center authority, and trust is difficult to establish among mutually-untrusted parties. Although the single block chain storage scheme guarantees the data credibility by utilizing the non-tamperable and traceable characteristics of the single block chain storage scheme, the total quantity of all data is uplink, so that the storage cost is high, the writing throughput is limited, and the inquiry function is single. Therefore, a novel data storage and processing method which can give consideration to data credibility, high storage efficiency, flexible inquiry and strong concurrency supporting capability is needed to support stable and efficient operation of future large-scale distributed power supply trading markets. For example, chinese patent publication No. CN116561097a discloses a big data distributed storage incentive method and system based on blockchain and hybrid database to improve transaction throughput, and uses the distributed hybrid database to store data in a distributed manner and provide efficient real-time analysis type inquiry capability, and combines auction algorithm to design an incentive system for exciting numerous users to collect data and share. The application can simultaneously give consideration to the data quality and price of the user, and obtain data with higher cost performance for big data analysis. Disclosure of Invention The invention aims to solve the technical problem of providing a distributed power transaction data storage method and system based on a hybrid database aiming at the defects of the prior art. In order to achieve the above purpose, the invention adopts the following technical scheme: The distributed power transaction data storage method based on the hybrid database comprises the following steps: Step S1, receiving and preprocessing a distributed power supply transaction request, and extracting key fields; S2, constructing a link-up link-down collaborative storage architecture, wherein a LevelDB and CouchDB mixed state database is adopted on the link, and a storage cluster consisting of a distributed column type database cluster and an archiving storage network is constructed under the link; s3, generating a joint partition key based on physical area codes, asset type codes and time slices of transaction data, and mapping the data to corresponding logic block chain channels for consensus and storage according to the joint partition key; step S4, executing a service-aware atomic commit protocol for a cross-chain transaction involving a plurality of logical blockchain channels; s5, constructing a dynamic value scoring model to classify data into hot data, warm data and cold data, wherein the hot data is stored on a chain, data fingerprints of the warm data are stored on the chain, complete data are stored in an under-chain distributed column database cluster, the cold data is distributed archivally stored in an under-chain archival storage network after being encoded by erasure codes, and encoded metadata for verification and recovery are stored on the chain; Step S6, deploying edge computing nodes at the network edge close to the data source for processing localized computing tasks; And S7, dynamically scheduling the user request through the intelligent load balancer based on the network state matrix and the reinforcement learning algorithm. Further, the step S1 specifically includes the following steps: S1.1, receiving an original distributed power supply transaction request; s1.2, verifying the validity of the power supply transaction request format and the identity of the two transaction parties; And S1.3, extracting and standardizing the electric quantity, the electricity price, the time stamp and the asset type key fields of the transaction. Further, in the step S3, the generating manner of the joint partition key includes: Dividing the area code, the asset type code and the transaction time stamp by a time slice mark obtained by rounding down a