A method, device, equipment and storage medium for confirming power market transaction status
By abstracting the power transaction process into a directed acyclic graph and storing transaction information on the blockchain, the problem of low confirmation efficiency of power transaction status under high concurrency is solved, and transaction efficiency is improved without reducing the credibility of the blockchain.
Patent Information
- Application Number
- CN202211152887.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-09-21
AI Technical Summary
Under high concurrency, existing blockchain-based power trading technology is difficult to improve transaction status confirmation efficiency without reducing the credibility of the blockchain.
By abstracting the power transaction process into a directed acyclic graph and storing the information of each transaction on the blockchain, we can determine whether the processing object of the new power transaction is a historical transaction or a recent transaction, and use historical replay or directly reading the transaction information to complete the transaction, and update the latest transaction status after each transaction.
It has achieved the improvement of the transaction status confirmation efficiency of power transactions under high concurrency without reducing the credibility of blockchain, reduced the transaction status confirmation time, and improved the efficiency of power transaction business.
Smart Images

Figure CN115456630B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system automation, and in particular to a method, device, equipment and storage medium for confirming power market transaction status. Background Art
[0002] As a new distributed infrastructure accounting technology, blockchain technology, with its ingenious technical design and data governance methods, can provide a trust basis for multi-party collaboration. The collision of blockchain technology and power trading can build a credible, transparent and efficient platform in the field of power trading, providing market members with a trustworthy, autonomous and flexible trading model and experience, and enhancing the value creation ability of the energy Internet.
[0003] In the existing blockchain-based power trading technology, there are two ways to realize the confirmation of trading status. The first is to use the native smart contract on the blockchain to implement a trading contract, and all users call it through the contract. However, due to the limitations of the blockchain formula algorithm, in the case of high-concurrency transactions, it may lead to slow confirmation of trading status; the second is to use the application layer as the middleware between the blockchain and the power trader, and coordinate and forward the power transactions of the traders through the application layer, which can achieve the effect of speeding up, but this reduces the credibility of the blockchain itself and reduces the transparency of operations. Therefore, how to improve the efficiency of trading status confirmation of power transactions under high concurrency without reducing the credibility of the blockchain itself is a technical problem that needs to be solved urgently by technicians in this field. Summary of the invention
[0004] The present invention provides a method, device, equipment and storage medium for confirming transaction status in an electricity market, which are used to improve the efficiency of confirming transaction status in electricity transactions under high concurrency without reducing the credibility of the blockchain itself.
[0005] In view of this, a first aspect of the present invention provides a method for confirming a power market transaction status, comprising:
[0006] Abstract the power transaction process into a directed acyclic graph and store it on the blockchain. The nodes in the directed acyclic graph are transaction process nodes, and the edges are the directions of process transfer.
[0007] The transaction information occurring at each node of the power transaction process is stored on the blockchain with each transaction as the storage unit;
[0008] When a new power transaction occurs, it is determined whether the new power transaction is a power transaction that occurred before a preset time or the most recent k transactions, where k is the number of transactions that the trader needs to process;
[0009] If the object of the new power transaction is a power transaction that occurred before the preset time, all on-chain transactions are read through the blockchain network, and the completed power transactions are replayed through the new power transaction information to form the current transaction global state. The latest transaction sequence number is read, and the transaction is completed based on the current transaction global state;
[0010] If the object of the new power transaction is the last k transactions, the latest power transaction information is directly read. According to the valid transaction range of the power transaction, the power transaction information within the valid transaction range is obtained, and the transaction is completed based on the power transaction information within the valid transaction range, where k < K, and K is the number of valid power market transaction states in the last transaction process;
[0011] After each transaction is completed, according to the directed acyclic graph and the latest transaction sequence number, the last K valid power market transaction states in the transaction process on the chain are updated and stored in the blockchain.
[0012] Optionally, the form of storage of each power transaction in the blockchain is:
[0013] extra i =(Index i ,State i ,tradeinfo i )
[0014] where extra i is the additional information of the i-th power transaction, Index i is the transaction sequence number of the i-th power transaction, State i is the last K valid power market transaction states corresponding to the i-th power transaction, and tradeinfo i is the business information of the i-th power transaction.
[0015] Optionally, the valid transaction range of the power transaction is:
[0016] F i =[Index i -K + 1,Index i ,K≥0
[0017] where F i is the valid transaction range of the i-th power transaction.
[0018] Optionally, the last K valid power market transaction states State i corresponding to the i-th power transaction are stored in the form of a bitmap in the blockchain, and the storage form is:
[0019] State i =[byte1 , byte 2 , byte 3 , …, byte K
[0020] Among them, byte K is the latest transaction status, byte 1 is the earliest transaction status, byte 2 is the next transaction status of byte 1 , and byte 3 is the next transaction status of byte 2 .
[0021] The second aspect of the present invention provides a power market transaction status confirmation device, including:
[0022] A process abstraction module for abstracting the power trading process into a directed acyclic graph and storing it on the blockchain. Among them, the nodes in the directed acyclic graph are transaction process nodes, and the edges are the directions of process transfer;
[0023] A transaction information storage module for storing the transaction information occurring at each power trading process node on the blockchain with each transaction as a storage unit;
[0024] A new transaction judgment module for, when a new power transaction occurs, judging whether the processing object of the new power transaction is a power transaction that occurred before a preset time or the most recent k transactions, where k is the number of transaction requirements processed by the trader;
[0025] A first transaction processing module for, if the processing object of the new power transaction is a power transaction that occurred before a preset time, reading all the on-chain transactions through the blockchain network, replaying the completed power transactions through the new power transaction information to form the current transaction global state, reading the latest transaction serial number, and completing the transaction according to the current transaction global state;
[0026] A second transaction processing module for, if the processing object of the new power transaction is the most recent k transactions, directly reading the latest power transaction information, obtaining the power transaction information within the valid transaction range according to the valid transaction range of the power transaction, and completing the transaction according to the power transaction information within the valid transaction range, where k < K and K is the number of valid power market transaction statuses of the most recent transaction process;
[0027] A transaction update module for, after each transaction is completed, updating the valid power market transaction status of the most recent K transaction processes on the chain according to the directed acyclic graph and the latest transaction serial number, and storing it in the blockchain.
[0028] Optionally, each electricity transaction is stored in the blockchain in the form of:
[0029] extra i =(Index i ,State i ,tradeinfo i )
[0030] Among them, extra i is the additional information of the ith electricity transaction, Index i is the transaction number of the ith electricity transaction, State i is the effective power market transaction status of the most recent K trading processes corresponding to the i-th power transaction, tradeinfo i is the business information of the ith electricity transaction.
[0031] Optionally, the effective trading range for power trading is:
[0032] F i =[Index i -K+1,Index i ],K≥0
[0033] Among them, F i is the effective trading interval of the i-th electricity transaction.
[0034] Optionally, the effective power market transaction state State of the most recent K transaction processes corresponding to the i-th power transaction i In the blockchain, it is stored in the form of a bitmap in the following format:
[0035] State i =[byte 1 ,byte 2 ,byte 3 ,…,byte K ]
[0036] Among them, byte K The latest transaction status, byte 1 The earliest transaction status, byte 2 byte 1 The next transaction status, byte 3 byte 2 The next transaction status.
[0037] A third aspect of the present invention provides a device for confirming a power market transaction status, the device comprising a processor and a memory:
[0038] The memory is used to store program codes and transmit the program codes to the processor;
[0039] The processor is used to execute the method for confirming the power market transaction status as described in any one of the first aspects according to the instructions in the program code.
[0040] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the method for confirming the power market transaction status as described in any one of the first aspects.
[0041] It can be seen from the above technical solutions that the method for confirming the power market transaction status provided by the present invention has the following advantages:
[0042] The power market transaction status confirmation method provided by the present invention abstracts the complex power transaction process into several different phased processes in the form of a directed acyclic graph, writes the transaction information of each power transaction into the blockchain, and when a new power transaction occurs, determines whether the processing object of the new power transaction is the power transaction that occurred before a preset time or the most recent k transactions. In the case where the processing object of the new power transaction is the power transaction that occurred before a preset time, the latest transaction sequence number is read in a historical playback manner, and the transaction is completed according to the current global transaction state. When the processing object of the new power transaction is the most recent k transactions, the latest power transaction information is directly read, and the transaction is completed according to the power transaction information within the effective transaction interval. After each transaction is completed, the effective power market transaction status of the most recent K transaction processes on the chain is updated and stored in the blockchain, thereby improving the transaction status confirmation efficiency of power transactions under high concurrency without reducing the credibility of the blockchain itself.
[0043] The power market transaction status confirmation method provided by the present invention is only based on the blockchain transaction itself, which can avoid the performance problem caused by the implementation of the smart contract layer of the blockchain. It has obvious advantages when the transaction is concurrent, effectively reduces the transaction status confirmation time, and is conducive to the development and implementation of power trading business on the blockchain. At the same time, at the power trading application layer, the method has low implementation complexity, convenient data verification, and significantly improved power trading efficiency.
[0044] The method for confirming the power market transaction status provided by the present invention can be applied to existing power market transaction modes, such as real-time transaction, listing transaction, collective auction transaction or user-defined transaction type.
[0045] The power market transaction status confirmation device, equipment and storage medium provided by the present invention are used to execute the power market transaction status confirmation method provided by the present invention. The principles and technical effects achieved are the same as those of the power market transaction status confirmation method provided by the present invention, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A schematic diagram of a flow chart of a method for confirming a power market transaction status provided in the present invention;
[0048] Figure 2 A schematic diagram of abstracting the transaction process of the method for confirming the transaction status of the power market provided in the present invention into a directed acyclic graph;
[0049] Figure 3 It is a structural schematic diagram of a device for confirming power market transaction status provided in the present invention. DETAILED DESCRIPTION
[0050] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0051] For easier understanding, see Figure 1 The present invention provides an embodiment of a method for confirming a power market transaction status, comprising:
[0052] Step 101: abstract the power transaction process into a directed acyclic graph and store it on the blockchain, wherein the nodes in the directed acyclic graph are transaction process nodes and the edges are the directions of process transfer.
[0053] It should be noted that in the embodiment of the present invention, the processes of different power transaction types are first divided into two types. For example, the power transaction type is real-time power transaction, and the core process includes several state processes such as seller quotation, buyer bid, seller withdrawal bid and transaction end. The state process of power transaction is defined as P i In the transaction process, these state processes will flow, such as P i →P j ,j>i. Because the transaction process must have an end state, and there can be no loop transaction state transfer (such as P i →Pj →…→P k →P i ), can be abstracted into DAG (Directed Acyclic Graph) based on these state processes, i.e. directed acyclic graph, such as Figure 1 Therefore, we can get a flow chart showing the electricity trading process:
[0054] G(V, E)
[0055] Among them, V is an abstract transaction process, V∈[1,n], which represents 1 to n transaction processes, represented by graph nodes, and E is the edge of the graph, indicating the direction of process transfer. The process itself is stored on the blockchain in the form of a graph, so that traders can use it as a basis for the flow of transaction processes on the blockchain. For each electricity transaction, it corresponds to a certain electricity transaction t i The corresponding transaction state transfer, each transfer must be an edge E in the DAG, that is, all are legal P i →P j ,j>i transfer.
[0056] Step 102: Store the transaction information occurring at each power transaction process node on the blockchain with each transaction as a storage unit.
[0057] It should be noted that in the embodiment of the present invention, when storing the transaction information of power transactions, each power transaction t i As storage unit, electricity trading t i The transaction information is stored on the blockchain. i When the transaction information is available, in addition to the power transaction t i In addition to the information required by itself (i.e. business information), it is also necessary to i The transaction sequence number and the effective power market transaction status of the most recent K transaction processes are stored together in the extra information extra i On, that is:
[0058] extra i =(Index i ,State i ,tradeinfo i )
[0059] Among them, extra i is the additional information of the ith electricity transaction, Index i is the transaction number of the ith electricity transaction, State i is the effective power market transaction status of the most recent K trading processes corresponding to the i-th power transaction. The value of K can be set according to the actual application scenario. tradeinfoi is the business information of the ith electricity transaction.
[0060] For transaction sequence number Index i , that is, the logical transaction sequence number in the blockchain, is a monotonically increasing function. In order to maintain the correctness of the transaction, before and after two blockchain transactions occur, the transaction initiator itself needs to ensure that:
[0061] Index i -Index i-1 =1
[0062] Transactions that do not meet the above conditions will be deemed invalid.
[0063] State in each electricity transaction i They are all summaries of the previous K transaction states. i In extra i It can be stored in the form of a bitmap. For example, the most recent k-th transaction can be represented by a byte of binary form to represent its position in G, because many transaction processes require very few processes, that is, the interval represented by V∈[1,n] is very small. Therefore, State i It can be represented by a byte array:
[0064] State i =[byte 1 ,byte 2 ,byte 3 ,…,byte K ]
[0065] Among them, byte K The latest transaction status, byte 1 The earliest transaction status, byte 2 byte 1 The next transaction status, byte 3 byte 2 The next transaction status.
[0066] Because a byte can represent 256 integers, when the total state of the transaction process is relatively small, binary compression can be used, such as dividing a byte into 4 parts according to binary, and each part can represent 4 transaction states. This can greatly reduce the space consumed by storing transaction information, expand the range that the most recent valid transaction size K can cover, and thus increase the range of confirmed transaction states. For example, if K = 4, i = 10, State i=[1,2,3,4], it means that the 10th transaction is a transfer to state 4, and the first three transactions, i.e. the 7th, 8th and 9th transactions are transfers to states 1, 2 and 3 respectively.
[0067] tradeinfo i is the business information of the i-th power transaction, corresponding to the necessary power transaction business information in this transaction process, such as the buyer buying type b power resources with a bid price of a.
[0068] Step 103: When a new power transaction occurs, determine whether the new power transaction is a power transaction that occurred before a preset time or the most recent k transactions, where k is the number of transactions required to be processed by the trader.
[0069] It should be noted that when a new power transaction occurs, there may be two ways to process the transaction. The first is to process power transactions that occurred a long time ago (i.e., before a preset time, such as one month ago or one year ago), and the second is to quickly process the most recent k transactions. Therefore, when a new power transaction occurs, it is necessary to determine whether the processing object of the new power transaction is a power transaction that occurred before a preset time or the most recent k transactions. If it is the first method, execute step 104, and if it is the second method, execute step 105.
[0070] Step 104: If the processing object of the new power transaction is a power transaction that occurred before the preset time, all on-chain transactions are read through the blockchain network, and the completed power transactions are replayed through the new power transaction information to form the current global state of the transaction, read the latest transaction sequence number, and complete the transaction according to the current global state of the transaction.
[0071] It should be noted that if you need to process transactions that occurred a long time ago, you need to read all on-chain transactions through the blockchain network before the transaction occurs. i Transaction information, through tradeinfo i To accurately replay completed transactions, this part is mainly through Index i -Index i-1 = 1 to ensure that the current transaction global state LocalTradeState is formed. For example, from the initial transaction sequence tradeinfo i The price of Class A electricity is quoted as B quantity to C seller D, buyer E buys Class A electricity with serial number 1, the price of Class X electricity is quoted as Z quantity to Y buyer F, etc., and such information can be replayed to know the electricity transaction situation of the whole market. When a new electricity transaction occurs, the latest t iIt will definitely occur in the latest blockchain block latestBlock, and read the latest transaction serial number Index from the blockchain block latestBlock. i And complete the required transactions according to the current global transaction state LocalTradeState.
[0072] Step 105: If the processing object of the new power transaction is the recent k transactions, directly read the latest power transaction information, obtain the power transaction information within the valid transaction range according to the valid transaction range of the power transaction, and complete the transaction according to the power transaction information within the valid transaction range, where k < K, and K is the number of valid power market transaction states in the recent transaction process.
[0073] It should be noted that if it is necessary to quickly process the recent k transactions, directly read the latest power transaction information, determine the valid transaction range F of the power transaction through the latest power transaction information i information, quickly process the quotation, find the interested underlying assets and suitable prices for transactions. It can greatly accelerate the trading speed of traders without being restricted by the playback of historical transaction information.
[0074] For the valid transaction range F of the power transaction i There is:
[0075] F i =[Index i -K + 1, Index i , K ≥ 0.
[0076] Step 106: After each transaction is completed, update the valid power market transaction states of the recent K transactions on the chain according to the directed acyclic graph and the latest transaction serial number, and store them in the blockchain.
[0077] It should be noted that after each transaction is completed, the trading application needs to update the state of the latest t i extra i state, that is, the state transition of the interval F i ←F i-1 For State i it can be seen that the difference between the intervals represented by F i and F i-1 is that F i has one more power transaction t i-1 than F i while F i has one less power transaction t i-1 than F i-k So, in the State of t i i In the update of State i The array is shifted left by one unit and becomes:
[0078] State i =[byte 2 ,byte 3 ,…,byte K ,newbyte]
[0079] Then the last element newbyte is set to the latest state. If the latest state is a business transfer, the last element is set to a non-transaction state, which is:
[0080] State i =[byte 2 ,byte 3 ,…,byte K ,notATrade].
[0081] Then update the State i Stored in the blockchain.
[0082] The power market transaction status confirmation method provided by the present invention abstracts the complex power transaction process into several different phased processes in the form of a directed acyclic graph, writes the transaction information of each power transaction into the blockchain, and when a new power transaction occurs, determines whether the processing object of the new power transaction is the power transaction that occurred before a preset time or the most recent k transactions. In the case where the processing object of the new power transaction is the power transaction that occurred before a preset time, the latest transaction sequence number is read in a historical playback manner, and the transaction is completed according to the current global transaction state. When the processing object of the new power transaction is the most recent k transactions, the latest power transaction information is directly read, and the transaction is completed according to the power transaction information within the effective transaction interval. After each transaction is completed, the effective power market transaction status of the most recent K transaction processes on the chain is updated and stored in the blockchain, thereby improving the transaction status confirmation efficiency of power transactions under high concurrency without reducing the credibility of the blockchain itself.
[0083] The power market transaction status confirmation method provided by the present invention is only based on the blockchain transaction itself, which can avoid the performance problem caused by the implementation of the smart contract layer of the blockchain. It has obvious advantages when the transaction is concurrent, effectively reduces the transaction status confirmation time, and is conducive to the development and implementation of power trading business on the blockchain. At the same time, at the power trading application layer, the method has low implementation complexity, convenient data verification, and significantly improved power trading efficiency.
[0084] The power market transaction status confirmation method provided by the present invention can be applied to existing power market transaction modes, such as real-time transactions, listing transactions, call auction transactions, or custom transaction types, etc.
[0085] An embodiment of a power market transaction status confirmation device is further provided in the present invention, including:
[0086] A process abstraction module, which is used to abstract the power transaction process, abstract the power transaction process into a directed acyclic graph, and store it on the blockchain. Among them, the nodes in the directed acyclic graph are transaction process nodes, and the edges are the directions of process transfer;
[0087] A transaction information storage module, which is used to store the transaction information occurring at each power transaction process node on the blockchain with each transaction as the storage unit;
[0088] A new transaction judgment module, which is used to judge whether the processing object of a new power transaction is a power transaction that occurred before a preset time or the last k transactions when a new power transaction occurs, where k is the number of transaction requirements processed by the trader;
[0089] A first transaction processing module, which is used to, if the processing object of the new power transaction is a power transaction that occurred before the preset time, read all the transactions on the chain through the blockchain network, replay the completed power transactions through the new power transaction information to form the current transaction global state, read the latest transaction serial number, and complete the transaction according to the current transaction global state;
[0090] A second transaction processing module, which is used to, if the processing object of the new power transaction is the last k transactions, directly read the latest power transaction information, obtain the power transaction information within the valid transaction range according to the valid transaction range of the power transaction, and complete the transaction according to the power transaction information within the valid transaction range, where k < K, and K is the number of valid power market transaction statuses of the last transaction process;
[0091] A transaction update module, which is used to update the valid power market transaction status of the last K transaction processes on the chain according to the directed acyclic graph and the latest transaction serial number after each transaction is completed, and store it in the blockchain.
[0092] The representation form of each power transaction stored in the blockchain is:
[0093] extra i =(Index i ,State i ,tradeinfo i )
[0094] Among them, extra iis the additional information of the ith electricity transaction, Index i is the transaction number of the ith electricity transaction, State i is the effective power market transaction status of the most recent K trading processes corresponding to the i-th power transaction, tradeinfo i is the business information of the ith electricity transaction.
[0095] The effective trading range for electricity trading is:
[0096] F i =[Index i -K+1,Index i ],K≥0
[0097] Among them, F i is the effective trading interval of the i-th electricity transaction.
[0098] The effective power market transaction state State of the most recent K transaction processes corresponding to the i-th power transaction i In the blockchain, it is stored in the form of a bitmap in the following format:
[0099] State i =[byte 1 ,byte 2 ,byte 3 ,…,byte K ]
[0100] Among them, byte K The latest transaction status, byte 1 The earliest transaction status, byte 2 byte 1 The next transaction status, byte 3 byte 2 The next transaction status.
[0101] The present invention also provides an embodiment of a device for confirming a power market transaction status, the device comprising a processor and a memory:
[0102] The memory is used to store program codes and transmit the program codes to the processor;
[0103] The processor is used to execute the power market transaction status confirmation method in the aforementioned power market transaction status confirmation method embodiment according to the instructions in the program code.
[0104] The present invention also provides an embodiment of a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the power market transaction status confirmation method in the aforementioned power market transaction status confirmation method embodiment.
[0105] The power market transaction status confirmation device, equipment and storage medium provided by the present invention are used to execute the power market transaction status confirmation method provided by the present invention. The principle and technical effect achieved are the same as the power market transaction status confirmation method provided by the present invention, and will not be repeated here.
[0106] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for confirming the trading status in the electricity market, characterized in that, it includes: Abstract the electricity trading process, abstract the electricity trading process into a directed acyclic graph, and store it on the blockchain. Among them, the nodes in the directed acyclic graph are trading process nodes, and the edges are the directions of process transfer; Store the trading information that occurs at each electricity trading process node on the blockchain with each transaction as the storage unit; When a new electricity transaction occurs, determine whether the processing object of the new electricity transaction is an electricity transaction that occurred before the preset time or the last k transactions, where k is the number of transaction demands processed by the trader; If the processing object of the new electricity transaction is an electricity transaction that occurred before the preset time, read all the transactions on the chain through the blockchain network, replay the completed electricity transactions with the new electricity transaction information, form the current transaction global state, read the latest transaction serial number, and complete the transaction according to the current transaction global state; If the processing object of the new electricity transaction is the last k transactions, directly read the latest electricity transaction information, obtain the electricity transaction information within the valid trading range according to the valid trading range of the electricity transaction, and complete the transaction according to the electricity transaction information within the valid trading range, where k < K, and K is the number of valid electricity market trading statuses in the last transaction process; After each transaction is completed, update the valid electricity market trading status of the last K transaction processes on the chain according to the directed acyclic graph and the latest transaction serial number, and store it in the blockchain; The form of storage of each electricity transaction in the blockchain is: ; in, is the additional information of the ith electricity transaction, is the transaction number of the i-th electricity transaction, is the effective power market transaction status of the most recent K transaction processes corresponding to the i-th power transaction, is the business information of the ith electricity transaction; The effective power market transaction status of the most recent K transaction processes corresponding to the i-th power transaction In the blockchain, it is stored in the form of a bitmap in the following format: ; in, The latest transaction status. is the earliest transaction status, for The next transaction status, for The next transaction status.
2. The method for confirming the trading status in the electricity market according to claim 1, characterized in that, The valid trading range of the electricity transaction is: ; in, is the effective trading interval of the i-th electricity transaction.
3. An apparatus for confirming the trading status in the electricity market, characterized in that, it includes: A process abstraction module, which is used to abstract the electricity trading process, abstract the electricity trading process into a directed acyclic graph, and store it on the blockchain. Among them, the nodes in the directed acyclic graph are trading process nodes, and the edges are the directions of process transfer; A trading information storage module, which is used to store the trading information that occurs at each electricity trading process node on the blockchain with each transaction as the storage unit; A new transaction judgment module, which is used to judge whether the processing object of the new electricity transaction is an electricity transaction that occurred before the preset time or the last k transactions when a new electricity transaction occurs, where k is the number of transaction demands processed by the trader; A first transaction processing module, which is used to, if the processing object of the new electricity transaction is an electricity transaction that occurred before the preset time, read all the transactions on the chain through the blockchain network, replay the completed electricity transactions with the new electricity transaction information, form the current transaction global state, read the latest transaction serial number, and complete the transaction according to the current transaction global state; The second transaction processing module is used to directly read the latest power transaction information if the processing object of the new power transaction is the most recent k transactions. According to the valid transaction range of the power transaction, obtain the power transaction information within the valid transaction range, and complete the transaction based on the power transaction information within the valid transaction range, where k < K, and K is the number of valid power market transaction states in the most recent transaction process; The transaction update module is used to update the valid power market transaction states of the most recent K transactions on the chain according to the directed acyclic graph and the latest transaction serial number after each transaction is completed, and store them in the blockchain; The representation form of each power transaction stored in the blockchain is: ; in, is the additional information of the ith electricity transaction, is the transaction number of the i-th electricity transaction, is the effective power market transaction status of the most recent K transaction processes corresponding to the i-th power transaction, is the business information of the ith electricity transaction; The effective power market transaction status of the most recent K transaction processes corresponding to the i-th power transaction In the blockchain, it is stored in the form of a bitmap in the following format: ; in, The latest transaction status. is the earliest transaction status, for The next transaction status, for The next transaction status.
4. The power market transaction state confirmation device according to claim 3, characterized in that The valid transaction range of the power transaction is: ; in, is the effective trading interval of the i-th electricity transaction.
5. A power market transaction state confirmation device, characterized in that The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the power market transaction state confirmation method according to any one of claims 1-2 according to the instructions in the program code.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store program code, and the program code is used to execute the power market transaction state confirmation method according to any one of claims 1-2.
Citation Information
Patent Citations
Synchronously replicating datasets and other managed objects to cloud-based storage systems
CN110392876A
Block chain-based digital asset transaction method and system, equipment and storage medium
CN112862469A