Trade data processing method based on block chain
By realizing real-time data upload of power production nodes and user nodes on blockchain technology, combining the power market demand prediction model and multi-chain interoperability protocol, the random difficulty blocks on the chain are dynamically adjusted, and the timeliness of supply and demand relationships in the power market and the flexibility in multi-supplier and multi-user scenarios are solved, and efficient and reliable power data trade processing is achieved.
Patent Information
- Application Number
- CN202510190879.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-06-06
AI Technical Summary
In the trade data processing of power data, the existing technology fails to effectively consider the timeliness of the supply and demand relationship of the power market, and performs poorly in multi-supplier and multi-user scenarios, making it difficult to adapt to the rapidly changing demand of the power market.
By real-time data upload of power production nodes and user nodes on blockchain technology, combining the power market demand forecast model, the random difficulty blocks on the chain are dynamically adjusted, and multi-chain interoperability protocols and encryption mechanisms are adopted to ensure data privacy protection and identity verification.
Effectively meet the high requirements of the power market for data processing timeliness and system flexibility, ensure that the power data trade processing can flexibly respond to rapidly changing market demands, improve data accuracy and reliability, and prevent unauthorized access and data leakage.
Smart Images

Figure CN120106789A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a trade data processing method based on blockchain. Background Art
[0002] In the traditional trade process, data processing involves multiple intermediaries and complex audit processes, which is time-consuming and prone to errors. The distributed ledger feature of blockchain enables all transactions to be recorded on the same unalterable platform, reducing manual intervention and greatly shortening processing time, which makes blockchain technology widely used in the processing of trade data.
[0003] For example, a Chinese patent with announcement number CN116614317B discloses a trade data processing method based on blockchain. Before the data to be put on the chain provided by the source data node forms a block that can be put on the chain, a third sequence is obtained by random sorting, first placeholder data, and encryption. The data to be put on the chain on the third sequence is in an unknown state. Afterwards, based on the interaction between the system and the source data node, only the source data node that provides the data to be put on the chain knows where the data to be put on the chain provided by it is located on the third sequence, and other nodes do not know where the data to be put on the chain is located in the third sequence. After that, if it is necessary to query the data on the block, the source data node needs to provide the system with the position of the data to be put on the chain in the third sequence in the block to realize the identity authentication of the source data node.
[0004] However, in the process of implementing relevant technical solutions, it was found that at least the following technical problems exist:
[0005] 1. Unlike ordinary trade data, the timeliness of the supply and demand relationship in the power market needs to be considered in the processing of trade data of power data, which is a problem not considered in the above scheme;
[0006] 2. In the multi-supplier and multi-user scenario, the above-mentioned technology performs poorly in terms of dynamically adjusting the difficulty of chain-up and the flexibility of processing multi-chain data. The trade data of electricity data is extremely volatile, which requires that the overall elasticity and scalability of the electricity market be considered in the processing of the trade data of electricity data. Otherwise, it will be difficult to adapt to the rapidly changing needs of the electricity market. Summary of the invention
[0007] In order to solve the above problems, an embodiment of the present invention provides a trade data processing method based on blockchain, the method comprising:
[0008] For the next transaction cycle, the power production node uploads the power production data to be uploaded to the chain, records the power production data and determines the power production node as the target node;
[0009] User nodes upload power demand data in real time through smart meters, integrate power demand data with power production data, and obtain power data;
[0010] Automatically review power data; after the review is completed, introduce the pre-built power market demand forecasting model based on historical data and user behavior analysis data to obtain the power demand for the next trading cycle;
[0011] If the target node is unique, the power production data corresponding to the target node will be recorded directly. If the target node is not unique, the random difficulty block on the chain will be dynamically determined based on the amount of data to be uploaded, the current market situation, and the power demand in the next trading cycle.
[0012] Randomly sort the power data to be uploaded to the chain to form a first structure, randomly generate N virtual data, insert them into the first structure, package the first structure to generate a second structure, and generate a multi-chain interoperability protocol according to the second structure;
[0013] The multi-chain interoperability protocol encrypts the second structure to generate a third structure and seeks verification from the power production node and the user node;
[0014] Generate a blockchain framework. During the generation of the blockchain framework, if verification information returned by the power production node and the user node is successfully received, the third structure is chained to the blockchain framework based on the generated random difficulty block.
[0015] Furthermore, the method for acquiring power data includes:
[0016] The power demand data and power production data are represented as two time series in array form;
[0017] Construct a two-dimensional matrix to store the distance between two time series. The size of the matrix is (m+1)x(n+1), where m and n are the lengths of the two time series respectively.
[0018] Initialize the first row and first column of a two-dimensional matrix to the cumulative distances:
[0019] Calculate the distance of each data point; after the distance calculation of all data points is completed, fill and update the DTW matrix;
[0020] After the DTW matrix is filled, starting from (m, n), the previous data point that leads to the minimum current alignment cost is iteratively selected until it traces back to (0, 0), that is, the alignment is completed; the two aligned time series are integrated and a data table is created, namely the power data.
[0021] Furthermore, the automatic audit method of power data includes:
[0022] Sort the power data with M data points in ascending order, calculate the first quartile, calculate the third quartile, and calculate the interquartile range based on the first quartile and the third quartile;
[0023] Determine lower and upper limits for outliers;
[0024] Values less than the lower limit of the abnormal value are marked as abnormal, and values greater than the upper limit of the abnormal value are marked as abnormal; if an abnormality occurs, the abnormal value is returned to the user node and the power production node.
[0025] Furthermore, the training method of the power market demand forecasting model includes:
[0026] The historical data and user behavior analysis data are used as the input of the electricity market demand forecasting model. The electricity market demand forecasting model takes the electricity demand corresponding to each set of historical data and user behavior analysis data as the output, takes the actual electricity demand corresponding to each set of historical data and user behavior analysis data as the forecasting target, and takes minimizing the sum of the first prediction accuracies of all predicted electricity demands as the training target; the electricity market demand forecasting model is trained until the sum of the first prediction accuracies reaches convergence and the training is stopped; the electricity market demand forecasting model is a seasonal autoregressive moving average model.
[0027] Furthermore, the random difficulty block generation method includes:
[0028] The amount of on-chain data, the current market situation, and the electricity demand for the next trading cycle are integrated into a market dynamic factor table, which is input into a pre-built on-chain difficulty prediction model to output a random difficulty block.
[0029] Furthermore, the training method of the on-chain difficulty prediction model includes:
[0030] The market dynamic factor table is used as the input of the on-chain difficulty prediction model. The on-chain difficulty prediction model takes the random difficulty block corresponding to the prediction of each group of market dynamic factor tables as the output, and the actual random difficulty block corresponding to each group of market dynamic factor tables as the prediction target. The training target is to minimize the sum of the second prediction accuracies of all predicted random difficulty blocks. The on-chain difficulty prediction model is trained until the sum of the second prediction accuracies reaches convergence and the training is stopped. The power market demand prediction model is a decision tree model.
[0031] Furthermore, the method for generating the second structure includes:
[0032] Add a data header to the first structure;
[0033] After the data header is added, natural language processing technology is used to identify the sensitive information of the first structure, and a rule model is used to select the target chain based on the sensitive information. The rule model is a decision tree.
[0034] Furthermore, the multi-chain interoperability protocol includes an upper layer, a middle layer and a lower layer; the upper layer is the user interface; the middle layer includes the interaction protocol, consensus mechanism, security layer, state management and interoperability interface; the lower layer is the basic protocol layer.
[0035] Furthermore, the blockchain framework includes a blockchain module and a DAG module, and the on-chain method of the third structure includes:
[0036] The user request starts, and the blockchain framework receives the verification information and sends it to the blockchain module and the DAG module according to the transaction type. The transaction type includes real-time transactions and non-real-time transactions. The blockchain module packages the non-real-time transactions and adds them to the blockchain, while the DAG module fills in the real-time transactions and updates the DAG module, and then updates the status tree to end the chain.
[0037] The technical effects and advantages of a blockchain-based trade data processing system provided by the present invention are as follows:
[0038] This solution can effectively meet the high requirements of the power market for data processing timeliness and system flexibility by strengthening data privacy protection, improving real-time processing capabilities, dynamically adjusting the chain mechanism, automated review and multi-chain interoperability, thereby ensuring that power data trade processing can flexibly respond to rapidly changing market demands; introduce encryption mechanisms and strict identity authentication processes to ensure that only authorized data providing nodes can accurately access the data they provide, thereby effectively preventing unauthorized access and data leakage; adopt a real-time data upload mechanism for power production nodes and user nodes, combined with a power market demand forecasting model, it can quickly and accurately analyze and predict power supply and demand conditions, and improve the immediate response of the market. Timeliness and flexibility; by setting random difficulty blocks and combining the real-time data situation in the market to dynamically adjust the difficulty of data processing on the chain, the fairness of opportunities for all participating nodes when uploading data is improved, and some nodes are prevented from dominating the data on the chain due to their abundant resources; through the automatic review mechanism, outliers in the data can be effectively identified and corrected, the accuracy and reliability of the data can be improved, the need for manual review can be reduced, and the possibility of human error can be reduced; support for multi-chain interoperability: by designing multi-chain interoperability protocols and flexible chain-up methods, it can effectively process and adapt to different types of target chains, realize flexible flow and sharing of data, and enhance the overall elasticity and scalability of the power market. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flowchart of a trade data processing method based on blockchain in an embodiment;
[0040] Figure 2 A diagram showing the structure of a multi-chain interoperability protocol in an embodiment;
[0041] Figure 3 This is a flow chart of the uplink method of the third structure in the embodiment. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Example:
[0044] See also Figure 1 As shown, the trade data processing method based on blockchain described in this embodiment includes:
[0045] For the next transaction cycle, the power production node uploads the power production data to be uploaded to the chain, records the power production data and determines the power production node as the target node;
[0046] User nodes upload power demand data in real time through smart meters, integrate power demand data with power production data, and obtain power data;
[0047] Automatically review power data; after the review is completed, introduce the pre-built power market demand forecasting model based on historical data and user behavior analysis data to obtain the power demand for the next trading cycle;
[0048] If the target node is unique, the power production data corresponding to the target node will be recorded directly. If the target node is not unique, the random difficulty block on the chain will be dynamically determined based on the amount of data to be uploaded, the current market situation, and the power demand in the next trading cycle.
[0049] Randomly sort the power data to be uploaded to the chain to form a first structure, randomly generate N virtual data, insert them into the first structure, package the first structure to generate a second structure, and generate a multi-chain interoperability protocol according to the second structure;
[0050] The multi-chain interoperability protocol encrypts the second structure to generate a third structure and seeks verification from the power production node and the user node;
[0051] Generate a blockchain framework. During the generation of the blockchain framework, if verification information returned by the power production node and the user node is successfully received, the third structure is chained to the blockchain framework based on the generated random difficulty block.
[0052] Power production nodes include entities or equipment responsible for the production and supply of electricity in the power network. These power production nodes can be power plants, renewable energy facilities (such as wind farms and solar power stations) and small distributed power generation units. By uploading their power production data, they can make corresponding power dispatch and supply decisions based on market demand and their own production capacity.
[0053] A trading cycle is a time unit for transactions and data exchange in the electricity market. It can be hours, days or other specific time periods. The specific length of time is determined by market rules or trading agreements. During each trading cycle, power production nodes and user nodes will upload and investigate data to ensure the balance of electricity supply and demand. The information and behavior within the trading cycle will affect the market's electricity prices, supply capacity and demand forecasts.
[0054] Power production data refers to all relevant production information of power production nodes within a specific time period, including but not limited to power generation capacity, power generation, power generation method and operating status.
[0055] User nodes are end users of electricity in the power network, including but not limited to households, enterprises, industrial users, etc. Any entity that uses electricity can be regarded as a user node. In the power market, the information of user nodes is crucial for power balance and market demand forecasting.
[0056] Electricity demand refers to the electricity demand information of user nodes in a specific time period, including but not limited to the required amount of electricity, usage time and load type, etc.; it reflects the user's demand for electricity in real time and helps power production nodes and market participants to make supply and demand forecasts.
[0057] Methods for obtaining power data include:
[0058] The power demand data and power production data are represented as two time series in array form;
[0059] Construct a two-dimensional matrix to store the distance between two time series. The size of the matrix is (m+1)x(n+1), where m and n are the lengths of the two time series respectively.
[0060] Initialize the first row and first column of a two-dimensional matrix to the cumulative distances:
[0061] DTW(0,j)=∞(for all j>0); DTW(i,0)=∞(for all i>0); DTW(0,0)=0(the distance from the starting point is 0);
[0062] The distance of each data point is calculated. Each data point represents a measurement value at a specific time. The calculation method includes:
[0063] cost = distance(A[i], B[j]);
[0064] In the formula, cost is the distance between two data points, distance is the Manhattan distance, i is the number of the time series data point corresponding to the power demand data, A represents the time series corresponding to the power demand data, j is the number of the time series data point corresponding to the power production data, and B represents the time series corresponding to the power production data.
[0065] After the distances of all data points are calculated, the DTW matrix is filled and updated; the updating method includes:
[0066]
[0067] Where DTW(i,j) is the minimum cumulative distance between the first i points of time series A and the first j points of time series B, that is, the alignment cost;
[0068] After the DTW matrix is filled, starting from (m, n), iteratively select the previous data point that causes the current DTW (i, j) to be the smallest, until backtracking to (0, 0), that is, the alignment is completed; the two aligned time series are integrated and a data table is created, namely, power data, which includes power demand data, power production data and power supply and demand difference.
[0069] Exemplary:
[0070] time Aligned power demand (MW) Aligned power production (MW) 00:00 200 210 00:30 250 240 01:00 230 220
[0071] Table of power data:
[0072] time Aligned power demand (MW) Aligned power production (MW) Electricity supply and demand difference (MW) 00:00 200 210 10 00:30 250 240 -10 01:00 230 220 -10
[0073] Since electricity demand and production are different from ordinary trade data and are highly time-sensitive, the supply and demand status at any point in time has a direct impact on the safety, stability and economic operation of the power grid. Although ordinary trade data also has a time dimension, generally speaking, the timeliness of trade data has relatively little impact on overall market fluctuations and has higher flexibility in adjustment. At the same time, the relationship between electricity demand and production is usually nonlinear, and there are complex supply and demand dynamics. Therefore, the electricity demand and electricity production data are accurately aligned to make the correspondence of the time series data on the time axis clear, thereby improving the reliability of subsequent analysis.
[0074] The automatic audit methods for power data include:
[0075] Sort the power data with M data points from small to large and calculate the first quartile IQ 1 , that is, in the order Q 1 Calculate the third quartile IQ3 , that is, in the order Q 3 The interquartile range (IQR) is calculated based on the first and third quartiles.
[0076]
[0077] Determine lower and upper limits for outliers;
[0078] Lower limit of outliers = IQ 1 -1.5 × IQR;
[0079] Upper limit of outliers = IQ 3 +1.5×IQR;
[0080] Values less than the lower limit of the abnormal value are marked as abnormal, and values greater than the upper limit of the abnormal value are marked as abnormal; if an abnormality occurs, the abnormal value is returned to the user node and the power production node.
[0081] Exemplary:
[0082] There is a set of power demand data: [100,120,130,150,150,160,200,250,600];
[0083] Calculate quartiles:
[0084] Sorting data: [100,120,130,150,150,160,200,250,600]
[0085] IQ 1 is the average of the third number (the median of 130 and 150), and we get IQ 1 =130.
[0086] IQ 3 is the average of the 7th number (the median of 200 and 250), and we get IQ 3 =200.
[0087] Calculate the interquartile range:
[0088] IQR=IQ 3 -IQ 1 =70.
[0089] Determine lower and upper bounds for outliers:
[0090] The lower limit is 25 and the upper limit is 305, so 600 is marked as abnormal and returned to the user node.
[0091] Through automatic review, outliers in the data can be effectively identified and corrected, the accuracy and reliability of power data can be improved, the need for manual review can be reduced, review efficiency can be improved, and the possibility of human error can be reduced. When outliers are marked and returned to relevant nodes, the transparency of data processing is enhanced, which helps all parties to jointly maintain the accuracy and integrity of the data.
[0092] Historical data refers to data on electricity demand, production, supply-demand gap, and related external factors (such as weather, economic indicators, etc.) collected over a certain period of time in the past. By analyzing historical data, we can extract patterns that are instructive for future electricity demand, such as electricity usage habits during specific time periods (such as weekdays, holidays) or under climatic conditions. User behavior analysis data involves the study of user electricity usage habits and behaviors, including analysis of user electricity usage, response time, load changes, and changes in user preferences in different time periods. Smart meters have a recording function that can be collected and stored. By analyzing user behavior, we can deeply understand the factors that affect their electricity demand, such as daily living habits, specific activities (such as holidays, promotions), or the use of new equipment, thereby improving the accuracy of demand forecasts.
[0093] The training method of the power market demand forecasting model includes:
[0094] Historical data and user behavior analysis data are used as input of the electricity market demand forecasting model. The electricity market demand forecasting model takes the electricity demand corresponding to the prediction of each set of historical data and user behavior analysis data as output, the actual electricity demand corresponding to each set of historical data and user behavior analysis data as the forecasting target, and minimizing the sum of the first prediction accuracies of all predicted electricity demands as the training target.
[0095] Among them, the calculation formula for the first prediction accuracy is: GI u =(GC u -GS u ) 2 , where u is the number of each set of historical data and user behavior analysis data, GI u is the first prediction accuracy, GC u is the predicted power demand corresponding to the u-th set of historical data and user behavior analysis data, GS u is the actual power demand corresponding to the u-th group of historical data and user behavior analysis data; the power market demand forecasting model is trained until the sum of the first prediction accuracy reaches convergence and the training is stopped; the power market demand forecasting model is a seasonal autoregressive moving average model.
[0096] The amount of data to be uploaded to the chain is combined with the current market demand to calculate the scale of data to be uploaded. If the amount of data to be uploaded to the chain is large, it may mean that the market is highly active. At this time, the difficulty block can be increased to control the frequency of uploading to the chain; the current market situation includes the market power supply and demand relationship, price fluctuations, the activities of market participants, etc. If the current market situation is tense (imbalance between supply and demand), the difficulty block can be lowered to encourage more nodes to upload to the chain; conversely, if the market is stable or overheated, the difficulty block can be increased to reduce the burden of on-chain data; if it is predicted that demand will increase in the next period, it may be necessary to upload more data to the chain in advance, so the difficulty block can be appropriately lowered to promote timely updating of information.
[0097] The random difficulty block is a dynamically adjusted on-chain difficulty that affects the degree of competition among participating nodes to upload data. The setting of the random difficulty block can prevent some nodes from continuously occupying the ability to record on-chain data due to their abundant resources, ensuring that all nodes in the network have a fair chance when uploading data.
[0098] Random difficulty block generation methods include:
[0099] The amount of on-chain data, current market conditions, and electricity demand for the next trading cycle are integrated into a market dynamic factor table, which is input into a pre-built on-chain difficulty prediction model to output a random difficulty block;
[0100] The training method of the on-chain difficulty prediction model includes:
[0101] The market dynamic factor table is used as the input of the on-chain difficulty prediction model. The on-chain difficulty prediction model uses the random difficulty block corresponding to each set of market dynamic factor tables as the output, the actual random difficulty block corresponding to each set of market dynamic factor tables as the prediction target, and minimizing the sum of the second prediction accuracies of all predicted random difficulty blocks as the training target.
[0102] Among them, the calculation formula for the second prediction accuracy is: VP z =(VR z -VA z ) 2 , where z is the number of each group of market dynamic factor tables, VP z For the second prediction accuracy, VR z is the predicted random difficulty block corresponding to the market dynamic factor table of group z, VA z is the actual random difficulty block corresponding to the zth group of market dynamic factor tables; the on-chain difficulty prediction model is trained until the sum of the second prediction accuracy reaches convergence; the power market demand prediction model is a decision tree model.
[0103] The decision tree model is easy to understand and explain, and can intuitively show how to generate the decision logic of the random difficulty block based on input features (such as the amount of data to be uploaded to the chain, market conditions, and electricity demand, etc.). At the same time, the decision tree is relatively fast in training and prediction, and is suitable for real-time dynamic adjustment of the random difficulty block.
[0104] The method for generating the second structure includes:
[0105] Add a data header to the first structure. The data header is a string representing a data type (such as power production data, user demand data, market transaction data, etc.) to help receive and understand the nature of the data so as to take appropriate processing methods.
[0106] After the data header is added, natural language processing (NLP) technology is used to identify the sensitive information of the first structure, and the target chain is selected using a rule model based on the sensitive information. The rule model is a decision tree, and the target chains include private chains, public chains, and consortium chains.
[0107] Exemplary:
[0108] If the data type is "power consumption data" and the sensitivity of the sensitive information is "high", the private chain is selected; the sensitivity is classified and labeled by the rule model.
[0109] If the data type is "market transaction data" and the sensitivity of sensitive information is "low", choose the public chain.
[0110] If the data type is "user demand data" and the business model is alliance cooperation, choose the alliance chain.
[0111] like Figure 2As shown in the figure, the multi-chain interoperability protocol includes the upper layer, the middle layer and the lower layer; the upper layer is the user interface for data input; the middle layer includes the interaction protocol, consensus mechanism, security layer, state management and interoperability interface; the interaction protocol includes the asset transfer protocol and the atomic exchange protocol. The asset transfer protocol adopts the cross-chain bridge technology to transfer assets between different chains to ensure the security and integrity of the assets. The atomic exchange protocol adopts the atomic exchange technology to ensure that the two chains can exchange assets safely without intermediaries without worrying about trust issues; the consensus mechanism includes the cross-chain consensus protocol and the intermediary chain. The cross-chain consensus protocol (such as Po l The consensus mechanism used by platforms such as Kadot and Cosmos ensures that when conducting cross-chain transactions, the consensus of each chain on the transaction is avoided to avoid double payment or inconsistent status. The intermediary chain is used to coordinate the consensus and information interaction between multiple chains. The security layer includes encryption mechanism, audit mechanism and identity authentication mechanism. The encryption mechanism adopts symmetric encryption algorithm to ensure the confidentiality and integrity of data and transactions in the cross-chain communication process. The audit mechanism provides transaction traceability and audit functions to prevent potential fraud and security threats. The identity authentication mechanism verifies the identity of participants (power production nodes and user nodes) to prevent unauthorized access and operation. State management includes state synchronization and historical record maintenance. State synchronization ensures that the states related to transactions on each chain remain consistent after execution. Historical record maintenance is used to save the historical records of cross-chain transactions for subsequent audit and query. The interoperability interface includes API interface and energy contract interface. The API interface is used to call and execute cross-chain operation interfaces to ensure that different chains can request and respond to information from each other. The smart contract interface is used to execute smart contracts between chains and ensure that the state of smart contracts can be verified by other chains. The lower layer is the basic protocol layer, which provides basic communication and protocol standards to ensure that each chain can interact effectively.
[0112] like Figure 3 As shown, the chain-up method of the third structure includes:
[0113] The user request starts, and the blockchain framework receives the verification information. According to the transaction type, it is sent to the blockchain module and the DAG module. The transaction types include real-time transactions and non-real-time transactions. Real-time transactions include electricity trade between individual users and enterprises, and non-real-time transactions include joint trade between enterprises. The blockchain module packages the non-real-time transactions and adds them to the blockchain, while the DAG module fills the real-time transactions and updates the DAG module, and the status tree is updated to end the chain.
[0114] The blockchain framework includes blockchain module and DAG module. The DAG module includes nodes, transactions, state tree and directed edges. Nodes are power production nodes and user nodes. Transactions are the basic operation units in the blockchain framework, involving the generation, transfer and consumption of electricity. Each transaction contains the identity information of the initiator and the receiver, the transaction amount, timestamp and digital signature, etc., which is where the third structure is filled on the chain. The state tree is a data structure that organizes the status of the account (such as asset balance) through hash fork to record the status and assets of the current blockchain framework, which can help track the transfer and ownership of assets and improve efficiency. Directed edges are dependencies expressed by each transaction by pointing to (referencing) the previous transaction, ensuring that the data flow is unidirectional and there is no circular dependency.
[0115] The blockchain framework is a combination of blockchain and DAG, which is used to adapt to multi-chain interoperability protocols and treat the types of target chains differently, thereby realizing a flexible, efficient and scalable distributed data processing system.
[0116] Verification information includes digital signature and transaction hash value; the digital signature is an identifier generated by encrypting the transaction data with the initiator's private key, confirming that the transaction was initiated by a specific account, ensuring that the source of the transaction cannot be forged; the transaction hash value is a fixed-length string obtained by calculating the third structure through a hash function, which is used to verify the integrity of the data during storage and transmission.
[0117] If the verification information returned by the power production node and the user node is not successfully received, a rollback is performed.
[0118] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0119] What has been described above is only a preferred specific implementation manner of the embodiments of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent substitutions or changes according to the technical scheme and concept of the present application within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A trade data processing method based on blockchain, characterized in that: Methods include: For the next transaction cycle, the power production node uploads the power production data to be uploaded to the chain, records the power production data and determines the power production node as the target node; User nodes upload power demand data in real time through smart meters, integrate power demand data with power production data, and obtain power data; Automatically review power data; After the review is completed, the pre-built power market demand forecasting model is introduced based on historical data and user behavior analysis data to obtain the power demand for the next trading cycle; If the target node is unique, the power production data corresponding to the target node will be recorded directly. If the target node is not unique, the random difficulty block on the chain will be dynamically determined based on the amount of data to be uploaded, the current market situation, and the power demand in the next trading cycle. Randomly sort the power data to be uploaded to the chain to form a first structure, randomly generate N virtual data, insert them into the first structure, package the first structure to generate a second structure, and generate a multi-chain interoperability protocol according to the second structure; The multi-chain interoperability protocol encrypts the second structure to generate a third structure and seeks verification from the power production node and the user node; Generate a blockchain framework. During the generation of the blockchain framework, if verification information returned by the power production node and the user node is successfully received, the third structure is chained to the blockchain framework based on the generated random difficulty block.
2. The method according to claim 1, characterized in that Methods for obtaining power data include: The power demand data and power production data are represented as two time series in array form; Construct a two-dimensional matrix to store the distance between two time series. The size of the matrix is (m+1)x(n+1), where m and n are the lengths of the two time series respectively. Initialize the first row and first column of a two-dimensional matrix to the cumulative distances: Calculate the distance of each data point; after the distance calculation of all data points is completed, fill and update the DTW matrix; After the DTW matrix is filled, starting from (m, n), the previous data point that leads to the minimum current alignment cost is iteratively selected until it traces back to (0, 0), that is, the alignment is completed; the two aligned time series are integrated and a data table is created, namely the power data.
3. The method according to claim 1, characterized in that The automatic audit methods for power data include: Sort the power data with M data points in ascending order, calculate the first quartile, calculate the third quartile, and calculate the interquartile range based on the first quartile and the third quartile; Determine lower and upper limits for outliers; Values less than the lower limit of the abnormal value are marked as abnormal, and values greater than the upper limit of the abnormal value are marked as abnormal; if an abnormality occurs, the abnormal value is returned to the user node and the power production node.
4. The method according to claim 1, characterized in that The training method of the power market demand forecasting model includes: The historical data and user behavior analysis data are used as the input of the electricity market demand forecasting model. The electricity market demand forecasting model takes the electricity demand corresponding to each set of historical data and user behavior analysis data as the output, takes the actual electricity demand corresponding to each set of historical data and user behavior analysis data as the forecasting target, and takes minimizing the sum of the first prediction accuracies of all predicted electricity demands as the training target; the electricity market demand forecasting model is trained until the sum of the first prediction accuracies reaches convergence and the training is stopped; the electricity market demand forecasting model is a seasonal autoregressive moving average model.
5. The method according to claim 1, characterized in that Random difficulty block generation methods include: The amount of on-chain data, the current market situation, and the electricity demand for the next trading cycle are integrated into a market dynamic factor table, which is input into a pre-built on-chain difficulty prediction model to output a random difficulty block.
6. The method according to claim 5, characterized in that The training method of the on-chain difficulty prediction model includes: The market dynamic factor table is used as the input of the on-chain difficulty prediction model. The on-chain difficulty prediction model takes the random difficulty block corresponding to the prediction of each group of market dynamic factor tables as the output, and the actual random difficulty block corresponding to each group of market dynamic factor tables as the prediction target. The training target is to minimize the sum of the second prediction accuracies of all predicted random difficulty blocks. The on-chain difficulty prediction model is trained until the sum of the second prediction accuracies reaches convergence and the training is stopped. The power market demand prediction model is a decision tree model.
7. The method according to claim 1, characterized in that The method for generating the second structure includes: Add a data header to the first structure; After the data header is added, natural language processing technology is used to identify the sensitive information of the first structure, and a rule model is used to select the target chain based on the sensitive information. The rule model is a decision tree.
8. The method according to claim 1, characterized in that The multi-chain interoperability protocol includes the upper layer, the middle layer and the lower layer; the upper layer is the user interface; the middle layer includes the interaction protocol, consensus mechanism, security layer, state management and interoperability interface; The lower layer is the basic protocol layer.
9. The method according to claim 1, characterized in that The blockchain framework includes a blockchain module and a DAG module, and the on-chain method of the third structure includes: The user request starts, and the blockchain framework receives the verification information and sends it to the blockchain module and the DAG module according to the transaction type. The transaction type includes real-time transactions and non-real-time transactions. The blockchain module packages the non-real-time transactions and adds them to the blockchain, while the DAG module fills in the real-time transactions and updates the DAG module, and then updates the status tree to end the chain.
Citation Information
Patent Citations
A blockchain-based trade data processing method and system
CN116614317B