CN116934344B - Micro-grid transaction method and system based on blockchain - Google Patents

Micro-grid transaction method and system based on blockchain Download PDF

Info

Publication number
CN116934344B
CN116934344B CN202311197565.9A CN202311197565A CN116934344B CN 116934344 B CN116934344 B CN 116934344B CN 202311197565 A CN202311197565 A CN 202311197565A CN 116934344 B CN116934344 B CN 116934344B
Authority
CN
China
Prior art keywords
user
transaction
qualified
value
micro
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311197565.9A
Other languages
Chinese (zh)
Other versions
CN116934344A (en
Inventor
李志�
李保民
陈皓勇
胡赫男
符号
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN202311197565.9A priority Critical patent/CN116934344B/en
Publication of CN116934344A publication Critical patent/CN116934344A/en
Application granted granted Critical
Publication of CN116934344B publication Critical patent/CN116934344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Finance (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Public Health (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Tourism & Hospitality (AREA)
  • Computer Security & Cryptography (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Water Supply & Treatment (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a micro-grid transaction method and system based on a blockchain, and belongs to the field of micro-grid transaction. According to the method, firstly, qualified users are screened out from users applying for micro-grid market trading according to preset micro-grid market admittance conditions. Then, the matching users are determined according to the time of the application transaction, the transaction quotation, the trust value and the benefit value of the qualified users. And then, generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user. Finally, intelligent contracts are dynamically generated according to the workflow network, and broadcast and executed in the blockchain network, so that transaction settlement is realized. The method fully utilizes transparency, non-tamper property of the blockchain and automatic execution of the intelligent contract, and can improve efficiency and safety of micro-grid transaction.

Description

Micro-grid transaction method and system based on blockchain
Technical Field
The invention relates to the field of micro-grid trading, in particular to a micro-grid trading method and system based on blockchain.
Background
A micro grid is a new type of power system that can be operated with connection or disconnection to a main grid. The advent of micro-grids has enabled power consumers to choose to purchase sources of power, creating a new power market. However, the operation of the micro-grid trading market needs to solve many problems, such as how to fairly and equitably perform trade matching, how to guarantee transparency and security of trade, etc.
Conventional microgrid trading methods typically rely on centralized market operators for trade matching and settlement, which presents some problems. First, a centralized market operator may risk misuse of market predominance, affecting fairness of transactions. Second, transparency and security of transaction information are difficult to be ensured, and there may be a risk that transaction data is tampered with or leaked. Finally, conventional transaction methods generally require manual transaction matching and settlement, which is inefficient.
The blockchain technology provides new possibility for solving the problems in micro-grid transaction by the characteristics of decentralization, high transparency, non-tampering, intelligent contract and the like. However, how to apply the blockchain technology to the micro-grid transaction, designing a fair, efficient and safe micro-grid transaction method is a current urgent problem to be solved.
Disclosure of Invention
The utility model provides a micro-grid transaction method and a micro-grid transaction system based on a blockchain, which are used for improving efficiency and safety of micro-grid transaction.
The micro-grid transaction method based on the blockchain comprises the following steps: screening qualified users from users applying for micro-grid market trading according to preset micro-grid market admittance conditions; determining a matched user according to the time of the qualified user applying for transaction, the transaction quotation, the trust value and the benefit value; generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user; and dynamically generating an intelligent contract according to the workflow network, broadcasting and executing the intelligent contract in a blockchain network, and further realizing transaction settlement.
Still further, the screening qualified users from users applying for the market trade of the micro grid according to the preset market admittance conditions of the micro grid includes: verifying the identity information of the user applying for the micro-grid market transaction, and determining the qualified identity information user; checking the access voltage of the identity information qualified user, and confirming that the user meeting the voltage requirement of the micro-grid is satisfied; verifying the users meeting the voltage requirements of the micro-grid, and confirming the users with the installed intelligent electric meters; and confirming the installed intelligent ammeter user as a qualified user.
Further, the verifying the user meeting the voltage requirement of the micro-grid, and confirming the user with the smart meter installed, includes: and verifying the users meeting the voltage requirements of the micro-grid, judging whether the users meeting the voltage requirements of the micro-grid correspond to intelligent electric meters, and confirming the installed intelligent electric meter users, wherein the intelligent electric meters are connected with a blockchain client, and the blockchain client predicts the power generation and energy consumption data corresponding to the users meeting the voltage requirements of the micro-grid through the connected intelligent electric meters.
Further, the determining the matching user according to the time of the qualified user applying for the transaction, the transaction quotation, the comprehensive trust value and the benefit value comprises the following steps: determining a corresponding sequencing queue set according to the time of the qualified user applying for the transaction, the transaction quotation, the comprehensive trust value and the benefit value, wherein the sequencing queue set comprises a time sequencing queue, a price sequencing queue, a trust value sequencing queue and a benefit value sequencing queue; for each qualified user, calculating a ranking mean value corresponding to the qualified user based on the ranking queue set, wherein the ranking mean value is an average number of ranking results of the qualified user in the time ranking queue, the price ranking queue, the comprehensive trust value ranking queue and the benefit value ranking queue; and sorting the qualified users according to the sorting mean value, and determining matched users, wherein the qualified users with small sorting mean value are preferentially matched, and if the sorting mean values of the plurality of qualified users are the same, the qualified users with high benefit values are preferentially matched.
Further, the integrated trust value of the qualified user is calculated by the following formula:wherein->Is the integrated trust value of the ith said qualified user,/->Is the ith saidTransaction score trust value of qualified user, +.>Is a weight factor, ++>,/>,/>Is the trust value of the ith qualified user.
Further, the benefit value of the qualified user is calculated by the following formula:wherein->Benefit value for the ith said qualified user, < > and>for the i-th said trusted value of qualified user, -/->Is a risk factor>User power for the ith said qualified user, +.>Scoring the user behavior of the ith said qualified user,/-for>And (5) satisfaction degree of the ith qualified user.
Still further, the generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user includes: and generating a corresponding workflow network according to the access conditions, behavior auditing and transaction information of the matched user, wherein the workflow network is stored and expressed in a PNML file form, and comprises a transaction publisher, a auction player, settlement after successful transaction and conditions for executing the transaction.
Further, the dynamically generating the intelligent contract according to the workflow network, broadcasting and executing the intelligent contract in the blockchain network, and further realizing transaction settlement, includes: dynamically generating corresponding access contracts, auditing contracts and transaction contracts based on a Hyperledger Fabric blockchain platform according to the corresponding workflow network, wherein the chain codes of the access contracts, auditing contracts and transaction contracts at least comprise main () functions, workflow functions and transition functions; broadcasting the generated admission contracts, auditing contracts and transaction contracts to all network nodes in the blockchain network; verifying the identity of the matched user by using the admission contract to generate a verification result, and analyzing the trust value and the benefit value of the matched user by using the auditing contract to generate an analysis result; and executing the transaction contract according to the verification result and the analysis result to finish transaction settlement.
Still further, the method further comprises: after transaction settlement is completed, acquiring a settlement contract of the matched user; and updating the trust value of the matched user according to the feedback of the matched user on the settlement contract and the score of the transaction.
The application provides a micro-grid transaction system based on a blockchain, comprising: the screening unit is used for screening qualified users from users applying for micro-grid market trading according to preset micro-grid market admittance conditions; the determining unit is used for determining the matched user according to the time of the qualified user applying for the transaction, the transaction quotation, the trust value and the benefit value; the generating unit is used for generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user; and the realization unit is used for dynamically generating intelligent contracts according to the workflow network, broadcasting and executing the intelligent contracts in the blockchain network, and further realizing transaction settlement.
The beneficial technical effects of the invention are mainly embodied in the following aspects:
(1) When determining matching users, not only the time of applying for the transaction and the transaction quotation are considered, but also the trust value and benefit value of the users are considered. The method comprehensively considers a plurality of factors, can more accurately find the most suitable transaction matching, can ensure the fairness of the transaction, and avoids unfairness of the transaction caused by the advantage of a certain party.
(2) Through the blockchain technology, the automation of the transaction can be realized, and the transaction efficiency is greatly improved.
(3) The decentralization characteristic of the blockchain technology and the automatic execution characteristic of the intelligent contract can effectively prevent fraudulent conduct in the transaction process, and the transaction safety is improved.
(4) The method for dynamically generating the intelligent contracts enables the contracts to be more flexible and can adapt to various different transaction conditions.
Drawings
Fig. 1 is a flowchart of a micro-grid transaction method based on blockchain according to a first embodiment of the present application.
Fig. 2 is a schematic diagram of a micro-grid transaction system based on blockchain according to a second embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other ways than those herein described and similar generalizations can be made by those skilled in the art without departing from the spirit of the application and the application is therefore not limited to the specific embodiments disclosed below.
The first embodiment of the application provides a micro-grid transaction method based on a blockchain. Referring to fig. 1, a schematic diagram of a first embodiment of the present application is shown. A detailed description of a blockchain-based micro-grid transaction method is provided in the first embodiment of the present application with reference to fig. 1.
Step S101: and screening qualified users from users applying for micro-grid market trading according to preset micro-grid market admittance conditions.
In this embodiment, screening qualified users from users applying for market trading of the micro grid according to preset market admittance conditions of the micro grid may include:
verifying identity information of a user applying for micro-grid market transaction to obtain an identity information qualified user;
checking access voltage of the user with qualified identity information to confirm that the user meeting the voltage requirement of the micro-grid is met;
verifying the users meeting the voltage requirement of the micro-grid, and confirming that the users are provided with the intelligent electric meter;
and confirming the user of the installed intelligent electric meter as a qualified user.
For verification of the user meeting the voltage requirement of the micro-grid, confirming the user with the smart meter installed can comprise:
and verifying the user meeting the voltage requirement of the micro-grid, judging whether the user installs the intelligent electric meter, and confirming that the user of the intelligent electric meter is installed, wherein the intelligent electric meter is required to be connected with the blockchain client, and the blockchain client can predict the power generation and energy consumption data corresponding to the user meeting the voltage requirement of the micro-grid through the connected intelligent electric meter.
In the micro-grid trading method provided in this embodiment, a micro-grid market admission mechanism needs to be established. The implementation steps of this mechanism include the following:
first, the microgrid user needs to submit an application material to the microgrid market supervision authority. For example, the user needs to provide identification, power demand reports, installation certification for smart meters, etc. The supervision organization can verify the identity information of the user and also check whether the access voltage of the user meets the requirements of the micro-grid. For example, if the voltage requirement of the microgrid is 220V, then the access voltage of the user must also be 220V. In addition, the supervising mechanism verifies whether the user installs the smart meter. The intelligent ammeter needs to be connected with a blockchain client so as to monitor and record the power generation and utilization data of a user, predict the power generation and energy consumption of the user and realize information exchange with other nodes.
If the user passes the verification described above, the user may be admitted to the microgrid market. The regulatory agency records the user information and broadcasts the user information to the whole network. For example, a regulatory agency may issue a message on the blockchain network stating that the user has been authenticated and admitted to the marketplace. After all nodes in the whole network reach consensus, the supervision organization returns a digital certificate to the user, and the success of the user registration is marked. At this time, the trust value of the user is initialized, and the user must pay a certain amount of deposit to be deposited into the account when logging in the blockchain client for the first time, so as to formally enter the market. For example, the user may need to pay a 1000 yuan deposit. If the user fails the above-described authentication, the user's registration fails and such user cannot be admitted to the microgrid market.
When a user applies to exit the micro-grid market, the supervising mechanism examines the trade behavior of the user in the micro-grid market. For example, a supervising authority may check the transaction records of the user to see if there is an illegal activity, such as malicious manipulation of market prices, etc. If the user passes the audit, i.e., there is no transaction violation, the supervising entity will broadcast an exit notification over the network. When other nodes reach consensus, the supervision organization can immediately cancel the registration information and the digital certificate of the user, and the user can extract deposit in the account at the moment. For example, the user may extract a 1000-ary deposit previously paid. If the user fails the audit, i.e., there is a transaction violation, the supervising authority deducts the deposit from the user's account and prohibits the user from entering the marketplace.
Step S102: and determining the matched user according to the time of the qualified user applying for the transaction, the transaction quotation, the trust value and the benefit value.
The method specifically comprises the following steps:
determining a corresponding sorting queue set according to the time of the qualified user applying for the transaction, the transaction quotation, the comprehensive trust value and the benefit value, wherein the sorting queue set can comprise a time sorting queue, a price sorting queue, a trust value sorting queue and a benefit value sorting queue, for example, the qualified user ranks fifth in the time sorting queue, third in the price sorting queue, first in the trust value sorting queue and tenth in the benefit value sorting queue;
for each qualified user, calculating a sequencing mean value corresponding to the qualified user based on a sequencing queue set, wherein the sequencing mean value is the average number of sequencing results of the qualified user in a time sequencing queue, a price sequencing queue, a comprehensive trust value sequencing queue and a benefit value sequencing queue;
and sorting the qualified users according to the calculated average value, and determining the matched users, wherein the average value is small in priority matching, and if the average values of the plurality of qualified users are the same, sorting according to the benefit values of the qualified users, and the benefit values are high in priority matching.
In the micro-grid trading method, the corresponding sorting result can be determined according to the time of the qualified user applying for trading, the trading quotation, the comprehensive trust value and the benefit value. For example, if the time of the application transaction of qualified user A is earlier than that of qualified user B, then the position of qualified user A in the time-ordered queue is better than that of qualified user B, e.g., the position of qualified user A in the time-ordered queue is the second bit and the position of qualified user B in the time-ordered queue is the third bit. Similarly, the price ordering queue, the trust value ordering queue and the benefit value ordering queue can be determined according to the transaction quotation, the comprehensive trust value and the benefit value of the qualified user.
Then, a ranking mean corresponding to the qualified user may be calculated based on ranking results of the qualified user in the time ranking queue, the price ranking queue, the comprehensive trust value ranking queue, and the benefit value ranking queue. This ranking average is, for example, the average number of ranking results of the user in the time ranking queue, price ranking queue, integrated trust value ranking queue, and benefit value ranking queue. For example only, if the ranking results of qualified user a in the time ranking queue, price ranking queue, trust value ranking queue, and benefit value ranking queue are bits 1, 2, 3, and 4, respectively, then the ranking mean of qualified user a is (1+2+3+4)/4=2.5.
For another example, the ranking mean corresponding to the qualified users is a weighted average of ranking results of the qualified users in a time ranking queue, a price ranking queue, a comprehensive trust value ranking queue, and a benefit value ranking queue.
For example only, the ranking mean corresponding to a qualified user may be calculated based on the following formula:
wherein,for the sorting mean value corresponding to the ith qualified user, < ->Ordering result in time ordering queue for ith qualified user, +.>Ordering result in price ordering queue for ith qualified user, +.>Ordering result in the comprehensive trust value ordering queue for the ith qualified user,/th qualified user>Ranking results in the benefit value ranking queue for the ith qualified user, < >>、/>、/>Is->All are preset weights.
Finally, the users can be ranked according to the computed ranking mean to determine matching users. For example, if the ranked average of user a is less than the ranked average of user B, then user a will be preferentially matched. If the ranking means of the plurality of users are the same, the users are ranked according to their benefit values, and users with high benefit values are preferentially matched. Time and price queues are ordered from small to large, as earlier times and lower prices are generally considered to be more optimal. While the confidence value queue and benefit value queue are ordered from large to small, as higher confidence values and benefit values are generally considered to be more optimal. Thus, when calculating the ranking mean, a smaller ranking mean represents an earlier time, a lower price, a higher trust value, and a higher benefit value, which is generally considered a better transaction requirement. So in this case, the rank average is a small priority match.
The comprehensive trust value of the qualified user is calculated by the following formula:
in the above formula, the meaning of each parameter is as follows:
: the comprehensive trust value of the ith qualified user is obtained by taking the trust value of the user and the transaction scoring trust value of the user into consideration and then carrying out weighted average through a weight factor. The integrated trust value is a more comprehensive trust level assessment that considers not only the user's basic trust value, but also the user's transaction behavior.
: the trust value of the i-th qualified user is an evaluation value obtained based on the past behavior, reputation and other factors of the user. This value is typically initialized upon registration of the user and updated upon transaction or other activity by the user based on their behavior.
: the i-th qualified user's transaction score trust value, which is an evaluation value derived based on the user's transaction behavior. For example, if a user appears to be very reliable in past transactions, his transaction score trust value may be high.
: this is the weighting factor, +.>,/>It determines the importance of each of the user's trust value and the user's transaction scoring trust value in calculating the integrated trust value. />The value of (2) is between 0 and 1, if +.>The closer the value of (2) is to 1, the greater the weight of the user's trust value in calculating the integrated trust value; on the contrary, if->The closer the value of 0, the greater the weight of the user's transaction score trust value in calculating the integrated trust value.
The benefit value of the qualified user is calculated by the following formula:
wherein,the benefit value of the ith qualified user is obtained by considering the trust value, risk factor, user power, user behavior score and user satisfaction of the user, and then by specialAnd (5) obtaining the result by a fixed calculation mode. The benefit value is a comprehensive evaluation index, which can help us understand the benefits that users may obtain in micro-grid transactions. />The trust value of the ith qualified user is an evaluation value obtained based on the past behavior, reputation and other factors of the user. This value is typically initialized upon registration of the user and updated upon transaction or other activity by the user based on their behavior. />As a risk factor, it reflects the degree of risk of conducting a transaction. The risk factors may be affected by a variety of factors, such as the market environment, the reputation of the user, etc. />The user power for the ith qualified user, which may be the amount of power that the user may provide or require during a particular time. />The i-th qualified user is scored for user behavior, which is an evaluation value derived based on the user's transaction behavior. For example, if a user appears to be very reliable in past transactions, his behavioral score may be high. />The satisfaction degree of the ith qualified user is reflected by the satisfaction degree of the user on the micro-grid transaction. Satisfaction may be affected by a variety of factors, such as efficiency of the transaction, fairness of the transaction, etc.
Step S103: and generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user.
The method specifically comprises the following steps:
and generating a corresponding workflow network according to the access condition, behavior audit and transaction information of the matched user, wherein the workflow network is stored and expressed in a PNML file form, and comprises a transaction publisher and a auction player, and conditions for settlement and execution of the transaction after the transaction is successful.
In this process, a corresponding workflow network is first generated based on the admission conditions, behavioral audits, and transaction information of the matching users. The workflow net is a graphical representation that can help understand and track the overall process of a transaction. This workflow net is stored and expressed in the form of PNML (Petri Net Markup Language) files. PNML is an XML-based markup language designed to represent Petri nets, a mathematical model used to describe and analyze the behavior of a system.
In PNML files, different labels are used to represent different parts of the workflow network:
< place > tag: this tag represents the transaction publisher and the bidder. In a workflow network, a "place" may be considered a state or condition, such as "the user has submitted a transaction application" or "the user's offer has been accepted".
< transition > tag: this tag represents the settlement after the transaction is successful. In a workflow network, a "transition" may be considered an event or action, such as "the user paid a bid" or "the transaction was confirmed".
< arc > tag: this tag defines the conditions under which different transactions are performed. In a workflow network, an "arc" can be seen as a connection from a state (place) to an event (transition) or from an event to a state.
And then dynamically generating corresponding admission contracts, audit contracts and transaction contracts according to the workflow network. These contracts are intelligent contracts for the Hyperledger Fabric blockchain platform. Hyperledger Fabric is an open source blockchain platform that supports smart contracts, a computer program that can automatically execute and enforce contract terms.
In the smart contract of Hyperledger Fabric, there are typically several main parts:
main () function: this is the entry point for the smart contract, which defines the initialization and transaction processing logic for the smart contract.
Workflow function: this is an external function that can be invoked by the client. This function describes conditions for performing transitions (transitions), such as "if the user's offer is accepted, then payment is performed".
Transition function: this is an internal function that can only be called by workflow functions or other transition functions in the same chain code. This function encapsulates business logic within the transition, such as "deduct payment from user's account".
By the method, the intelligent contract can be dynamically generated and executed according to the access conditions, the behavior audit and the transaction information of the user, so that the transaction process of the micro-grid is realized.
Step S104: and dynamically generating intelligent contracts according to the workflow network, broadcasting and executing the intelligent contracts in the blockchain network, and further realizing transaction settlement.
The method specifically comprises the following steps:
dynamically generating corresponding admission contracts, auditing contracts and transaction contracts based on a Hyperledger Fabric blockchain platform according to a corresponding workflow network, wherein the main content of the chain code comprises main () functions, workflow functions and transition functions;
broadcasting the generated admission contracts, auditing contracts and transactions to all network nodes in a blockchain network;
verifying the identity of the matched user by using the admission contract to generate a verification result, and analyzing the trust value and the benefit value of the matched user by using the auditing contract to generate an analysis result;
and executing the transaction contract according to the verification result and the analysis result to finish transaction settlement.
After transaction settlement is completed, obtaining a settlement contract matched with the user;
and updating the trust value of the matched user according to the feedback of the matched user on the settlement contract and the grading of the transaction.
Firstly, corresponding admission contracts, auditing contracts and transaction contracts are dynamically generated according to a workflow network. These contracts are all intelligent contracts for the Hyperledger Fabric blockchain platform. Hyperledger Fabric is an open source blockchain platform that supports smart contracts, a computer program that can automatically execute and enforce contract terms.
Next, the generated smart contracts (including admission contracts, audit contracts, trade contracts) are broadcast in the blockchain network to the full network nodes. This means that all nodes will receive the smart contract and can execute it.
The identity of the matching user is then verified using the admission contract. This process may include checking the user's identification, such as a digital signature or public key. Meanwhile, the trust value and the benefit value of the user are analyzed by using the auditing contract. This process may include calculating trust and benefit values for the users and comparing whether they meet the criteria of the transaction.
And executing the transaction contract according to the verification and analysis results to finish transaction settlement. This process may include deducting a payment amount from the buyer's account and then transferring this amount to the seller's account.
After completion of the transaction settlement, a settlement contract matching the user is obtained. This contract may include details of the transaction, such as the amount of the transaction, the time, and the identity of both parties.
And finally, updating the trust value of the matched user according to the feedback of the matched user on the settlement contract and the grading of the transaction. This process may include calculating a new trust value and then updating this value into the user's account. Thus, the whole micro-grid transaction process is completed.
In the above embodiment, a micro-grid transaction method based on a blockchain is provided, and correspondingly, the application also provides a micro-grid transaction system based on the blockchain. Referring to fig. 2, a schematic diagram of an embodiment of a blockchain-based micro grid trading system according to the present application is shown. Since this embodiment, i.e. the second embodiment, is substantially similar to the method embodiment, the description is relatively simple, and reference should be made to the description of the method embodiment for relevant points. The device embodiments described below are merely illustrative.
A second embodiment of the present application provides a blockchain-based micro-grid trading system, comprising:
a screening unit 201, configured to screen qualified users from users applying for market trading of the micro grid according to preset market admittance conditions of the micro grid;
a determining unit 202, configured to determine a matching user according to the time of the qualified user applying for the transaction, the transaction quotation, the trust value and the benefit value;
a generating unit 203, configured to generate a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user;
the implementation unit 204 is configured to dynamically generate an intelligent contract according to the workflow network, and broadcast and execute the intelligent contract in the blockchain network, thereby implementing transaction settlement.
While the preferred embodiment has been described, it is not intended to limit the invention thereto, and any person skilled in the art may make variations and modifications without departing from the spirit and scope of the present invention, so that the scope of the present invention shall be defined by the claims of the present application.

Claims (2)

1. A blockchain-based micro-grid trading method, comprising:
screening qualified users from users applying for micro-grid market trading according to preset micro-grid market admittance conditions;
determining a matched user according to the time of the qualified user applying for transaction, the transaction quotation, the trust value and the benefit value;
generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user;
dynamically generating an intelligent contract according to the workflow network, broadcasting and executing the intelligent contract in a blockchain network, and further realizing transaction settlement;
screening qualified users from users applying for micro-grid market trade according to preset micro-grid market admittance conditions, including:
verifying the identity information of the user applying for the micro-grid market transaction, and determining the qualified identity information user;
checking the access voltage of the identity information qualified user, and confirming that the user meeting the voltage requirement of the micro-grid is satisfied;
verifying the users meeting the voltage requirements of the micro-grid, and confirming the users with the installed intelligent electric meters;
the user of the installed intelligent electric meter is confirmed to be a qualified user;
the verifying the user meeting the voltage requirement of the micro-grid, and confirming the user with the intelligent electric meter installed comprises the following steps:
verifying the users meeting the micro-grid voltage requirements, judging whether the users meeting the micro-grid voltage requirements correspond to intelligent electric meters, and confirming the installed intelligent electric meter users, wherein the intelligent electric meters are connected with a blockchain client, and the blockchain client predicts power generation and energy consumption data corresponding to the users meeting the micro-grid voltage requirements through the connected intelligent electric meters;
establishing a micro-grid market admission mechanism, wherein the implementation steps comprise the following steps:
firstly, a micro-grid user needs to submit application materials to a micro-grid market supervision mechanism, the user needs to provide identification, a power demand report and installation identification of an intelligent electric meter, the supervision mechanism verifies the identity information of the user, checks whether the access voltage of the user meets the requirements of the micro-grid, the supervision mechanism verifies whether the intelligent electric meter is installed or not, and the intelligent electric meter needs to be connected with a blockchain client so as to monitor and record the power generation data of the user, predict the power generation and the energy consumption of the user and realize information exchange with other nodes;
if the user passes the verification, the user is admitted to the micro-grid market, the supervision organization records the user information and broadcasts the information to the whole network, a message is issued on the blockchain network, the user is declared to pass the verification and admitted to the market, after all nodes of the whole network reach consensus, the supervision organization returns a digital certificate to the user, the user registration success is marked, at the moment, the trust value of the user is initialized, and the user must pay a certain amount of deposit to be deposited into an account when logging in the blockchain client for the first time, so that the user can formally enter the market, if the user does not pass the verification, the registration of the user fails, and the user cannot be admitted to the micro-grid market;
when a user applies to exit the micro-grid market, a supervision mechanism examines the transaction behavior of the user in the micro-grid market, checks the transaction record of the user to see whether illegal behavior exists, if the user passes the examination, the supervision mechanism broadcasts exit notification in the whole network, after other nodes reach consensus, the supervision mechanism immediately cancels the registration information and the digital certificate of the user, the user can extract deposit in the account at the moment, and if the user does not pass the examination, the supervision mechanism deducts the deposit in the account of the user and prohibits the user from entering the market;
the determining the matching user according to the time of the qualified user applying for transaction, the transaction quotation, the comprehensive trust value and the benefit value comprises the following steps:
determining a corresponding sequencing queue set according to the time of the qualified user applying for the transaction, the transaction quotation, the comprehensive trust value and the benefit value, wherein the sequencing queue set comprises a time sequencing queue, a price sequencing queue, a trust value sequencing queue and a benefit value sequencing queue;
for each qualified user, calculating a sequencing mean value corresponding to the qualified user based on a sequencing queue set, wherein the sequencing mean value is the average number of sequencing results of the qualified user in a time sequencing queue, a price sequencing queue, a comprehensive trust value sequencing queue and a benefit value sequencing queue;
sorting qualified users according to the calculated average value, determining matched users, wherein small preferential matching is performed, sorting according to benefit values of the qualified users if the average values of the qualified users are the same, and preferential matching with high benefit values is performed;
in the micro-grid trading method, corresponding sorting results are determined according to the time of applying for trading, the trading quotation, the comprehensive trust value and the benefit value of qualified users; if the application transaction time of the qualified user A is earlier than that of the qualified user B, the position of the qualified user A in the time sequencing queue is better than that of the qualified user B;
likewise, determining a price ordering queue, a trust value ordering queue and a benefit value ordering queue according to the transaction quotes, the comprehensive trust values and the benefit values of the qualified users;
then, based on the sorting results of the qualified users in the time sorting queue, the price sorting queue, the comprehensive trust value sorting queue and the benefit value sorting queue, sorting means corresponding to the qualified users are calculated; the sorting mean is the average number of sorting results of the user in a time sorting queue, a price sorting queue, a comprehensive trust value sorting queue and a benefit value sorting queue; if the sorting results of the qualified user A in the time sorting queue, the price sorting queue, the trust value sorting queue and the benefit value sorting queue are respectively 1 st, 2 nd, 3 rd and 4 th bits, the sorting mean value of the qualified user A is (1+2+3+4)/4=2.5;
the sorting mean value corresponding to the qualified user is a weighted average of sorting results of the qualified user in a time sorting queue, a price sorting queue, a comprehensive trust value sorting queue and a benefit value sorting queue;
and calculating the sorting mean value corresponding to the qualified user based on the following formula:
wherein,for the sorting mean value corresponding to the ith qualified user, < ->Ordering result in time ordering queue for ith qualified user, +.>Ordering result in price ordering queue for ith qualified user, +.>Ordering result in the comprehensive trust value ordering queue for the ith qualified user,/th qualified user>Ranking results in the benefit value ranking queue for the ith qualified user, < >>、/>、/>Is->All are preset weights;
finally, sorting the users according to the calculated sorting mean value to determine matched users; if the sorting mean value of the user A is smaller than the sorting mean value of the user B, the user A is preferentially matched; if the sorting mean values of the plurality of users are the same, sorting is performed according to the benefit values of the users, and the users with high benefit values are preferentially matched; the time queues and the price queues are ordered from small to large, and earlier time and lower price are regarded as better; the trust value queue and the benefit value queue are ordered from big to small, and higher trust values and benefit values are regarded as better; thus, when calculating the ranking mean, a smaller ranking mean represents an earlier time, a lower price, a higher trust value, and a higher benefit value, which is considered a better transaction requirement; so in this case, the rank average is a small priority match;
the comprehensive trust value of the qualified user is calculated by the following formula:
in the above formula, the meaning of each parameter is as follows:
: the comprehensive trust value of the ith qualified user is obtained by taking the trust value of the user and the transaction scoring trust value of the user into consideration and then carrying out weighted average through a weight factor; the comprehensive trust value is a more comprehensive trust evaluation, which considers not only the basic trust value of the user, but also the transaction behavior of the user;
: the trust value of the ith qualified user is an evaluation value obtained based on the past behavior and reputation factors of the user; this value is typically initialized upon registration of the user and updated upon transaction or other activity by the user;
: the transaction score trust value of the ith qualified user is an evaluation value obtained based on the transaction behavior of the user;
: this is the weighting factor, +.>,/>It determines the importance of each of the user's trust value and the user's transaction scoring trust value when calculating the integrated trust value; />The value of (2) is between 0 and 1, if +.>The closer the value of (2) is to 1, the greater the weight of the user's trust value in calculating the integrated trust value; on the contrary, if->The closer the value of (2) is to 0, the greater the weight of the user's transaction score trust value in calculating the integrated trust value;
the benefit value of the qualified user is calculated by the following formula:
wherein delta i The benefit value of the ith qualified user is obtained by considering the trust value, risk factor, user power, user behavior score and user satisfaction of the user and then by a specific calculation mode;is a risk factor that reflects the degree of risk of conducting a transaction; the risk factors are influenced by market environment and the reputation of the user; />User power, which is the amount of power that a user can provide or require in a particular time, is the i-th qualified user; />Scoring the user behavior of the ith qualified user, which is an evaluation value obtained based on the transaction behavior of the user; />The satisfaction degree of the ith qualified user is reflected by the satisfaction degree of the user on the micro-grid transaction;
the generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user comprises the following steps:
generating a corresponding workflow network according to the admission condition, behavior audit and transaction information of the matched user, wherein the workflow network is stored and expressed in a PNML file form, and comprises a transaction publisher, a auction player, settlement after successful transaction and conditions for executing the transaction;
in PNML files, different labels are used to represent different parts of the workflow network:
< place > tag: this tag represents the transaction publisher and the bidder, and a "place" is considered a state or condition in the workflow network;
< transition > tag: this tag represents the settlement after the transaction is successful, and in the workflow network, a "transition" is considered an event or action;
< arc > tag: this tag defines the conditions under which different transactions are performed, in the workflow network an "arc" is considered as a connection from a state place to an event transition or from an event to a state;
then, dynamically generating corresponding admission contracts, audit contracts and transaction contracts according to the workflow network; these contracts are intelligent contracts for the Hyperledger Fabric blockchain platform;
hyperledger Fabric is an open source blockchain platform that supports smart contracts, which are computer programs that automatically execute and enforce contract terms;
the smart contract at Hyperledger Fabric has the following parts:
main () function: this is the entry point of the smart contract, which defines the initialization and transaction processing logic of the smart contract;
workflow function: this is an external function that can be invoked by the client; this function describes the conditions under which transition is performed;
transition function: this is an internal function that can only be called by workflow functions or other transition functions in the same chain code; this function encapsulates the business logic inside the transition;
in this way, intelligent contracts are dynamically generated and executed according to the access conditions, behavior auditing and transaction information of the user, so that the transaction process of the micro-grid is realized;
the dynamic generation of intelligent contracts according to the workflow network, broadcasting and executing the intelligent contracts in a blockchain network, and further realizing transaction settlement, comprising:
dynamically generating corresponding access contracts, auditing contracts and transaction contracts based on a Hyperledger Fabric blockchain platform according to the corresponding workflow network, wherein the chain codes of the access contracts, auditing contracts and transaction contracts at least comprise main () functions, workflow functions and transition functions;
broadcasting the generated admission contracts, auditing contracts and transaction contracts to all network nodes in the blockchain network; this means that all nodes will receive the smart contract and execute it;
verifying the identity of the matched user by using the admission contract to generate a verification result, and analyzing the trust value and the benefit value of the matched user by using the auditing contract to generate an analysis result; this process includes checking the user's identification, in particular a digital signature or public key; meanwhile, analyzing trust values and benefit values of the users by utilizing audit contracts; this process includes calculating trust and benefit values for the users and comparing whether they meet the conditions of the transaction;
executing the transaction contract according to the verification result and the analysis result to finish transaction settlement; the process includes deducting a payment amount from the buyer's account and then transferring the amount to the seller's account;
after transaction settlement is completed, obtaining a settlement contract matched with the user; this contract includes details of the transaction, in particular the amount of the transaction, the time and the identity of both parties;
and updating the trust value of the matched user according to the feedback of the matched user on the settlement contract and the grading of the transaction.
2. A blockchain-based microgrid trading system applying the blockchain-based microgrid trading method of claim 1, comprising:
the screening unit is used for screening qualified users from users applying for micro-grid market trading according to preset micro-grid market admittance conditions;
the determining unit is used for determining the matched user according to the time of the qualified user applying for the transaction, the transaction quotation, the trust value and the benefit value;
the generating unit is used for generating a workflow network according to the admission condition, the behavior audit and the transaction information of the matched user;
and the realization unit is used for dynamically generating intelligent contracts according to the workflow network, broadcasting and executing the intelligent contracts in the blockchain network, and further realizing transaction settlement.
CN202311197565.9A 2023-09-18 2023-09-18 Micro-grid transaction method and system based on blockchain Active CN116934344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311197565.9A CN116934344B (en) 2023-09-18 2023-09-18 Micro-grid transaction method and system based on blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311197565.9A CN116934344B (en) 2023-09-18 2023-09-18 Micro-grid transaction method and system based on blockchain

Publications (2)

Publication Number Publication Date
CN116934344A CN116934344A (en) 2023-10-24
CN116934344B true CN116934344B (en) 2024-01-05

Family

ID=88381131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311197565.9A Active CN116934344B (en) 2023-09-18 2023-09-18 Micro-grid transaction method and system based on blockchain

Country Status (1)

Country Link
CN (1) CN116934344B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416696A (en) * 2018-02-28 2018-08-17 国网江苏省电力有限公司淮安供电分公司 Region electric power free transaction method based on block chain technology
CN110288307A (en) * 2019-05-13 2019-09-27 西安电子科技大学 Intelligent contract co-development system and data processing method based on Fabric block chain
CN111932253A (en) * 2020-08-11 2020-11-13 华北电力大学(保定) Electric energy transaction method based on credit consensus mechanism
CN115829744A (en) * 2022-11-25 2023-03-21 西安电子科技大学广州研究院 Microgrid transaction method, storage medium, equipment and system based on block chain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050256818A1 (en) * 2004-04-30 2005-11-17 Xerox Corporation Workflow auto generation from user constraints and hierarchical dependence graphs for workflows

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416696A (en) * 2018-02-28 2018-08-17 国网江苏省电力有限公司淮安供电分公司 Region electric power free transaction method based on block chain technology
CN110288307A (en) * 2019-05-13 2019-09-27 西安电子科技大学 Intelligent contract co-development system and data processing method based on Fabric block chain
CN111932253A (en) * 2020-08-11 2020-11-13 华北电力大学(保定) Electric energy transaction method based on credit consensus mechanism
CN115829744A (en) * 2022-11-25 2023-03-21 西安电子科技大学广州研究院 Microgrid transaction method, storage medium, equipment and system based on block chain

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"基于区块链技术的多微网共享储能能源交易研究";孙童;《中国优秀硕士学位论文全文数据库工程科技Ⅱ辑》;C042-2714 *
基于区块链技术的异构微电网交易系统设计;郭策;;电子世界(05);全文 *

Also Published As

Publication number Publication date
CN116934344A (en) 2023-10-24

Similar Documents

Publication Publication Date Title
Liu et al. Electric vehicle power trading mechanism based on blockchain and smart contract in V2G network
Rozario et al. Auditing with Smart Contracts.
Kirli et al. Smart contracts in energy systems: A systematic review of fundamental approaches and implementations
Oyediran et al. A Survey of the State of the Art of E-Tendering in Nigeria
CA2744547C (en) Financial gadgets
US11521290B2 (en) Systems and methods for storing contract information on multiple blockchain ledgers
Debe et al. Blockchain-based decentralized reverse bidding in fog computing
EP1618455A2 (en) Safe transaction guaranty
Dzobo et al. Proposed framework for blockchain technology in a decentralised energy network
CN112016788A (en) Risk control strategy generation and risk control method and device and electronic equipment
CN116385164B (en) Block chain-based carbon asset transaction system and method
Lee et al. Stochastic project financing analysis system for construction
CN115605893A (en) System, apparatus and method for tracking certified clean energy using blockchains
KR20160017630A (en) Predictive fraud screening
CN114118875A (en) Model full life cycle management system and method
CN106920168A (en) Futures point valency exchange information processing method and device
Rastegar et al. Stochastic programming model for bidding price decision in construction projects
Chen et al. Fair auctioning and trading framework for cloud virtual machines based on blockchain
Solaiman et al. Model checking correctness properties of electronic contracts
Akcay An analytic network process based risk assessment model for PPP hydropower investments
Franco et al. SaCI: A blockchain-based cyber insurance approach for the deployment and management of a contract coverage
Lin et al. A review of market power‐mitigation mechanisms in electricity markets
Zhao et al. Emission trading innovation mechanism based on blockchain
Regner et al. Utilizing non-fungible tokens for an event ticketing system
CN116934344B (en) Micro-grid transaction method and system based on blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant