CN113222596A - Electric power data storage method and system based on block chain intelligent contract - Google Patents

Electric power data storage method and system based on block chain intelligent contract Download PDF

Info

Publication number
CN113222596A
CN113222596A CN202110444525.4A CN202110444525A CN113222596A CN 113222596 A CN113222596 A CN 113222596A CN 202110444525 A CN202110444525 A CN 202110444525A CN 113222596 A CN113222596 A CN 113222596A
Authority
CN
China
Prior art keywords
contract
intelligent
power data
block chain
intelligent contract
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.)
Pending
Application number
CN202110444525.4A
Other languages
Chinese (zh)
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.)
Gcl Diangang Energy Technology Dongtai Co ltd
Suzhou Heshu Blockchain Application Research Institute Co ltd
Shanghai Heshu Software Co ltd
Original Assignee
Gcl Diangang Energy Technology Dongtai Co ltd
Suzhou Heshu Blockchain Application Research Institute Co ltd
Shanghai Heshu Software Co ltd
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 Gcl Diangang Energy Technology Dongtai Co ltd, Suzhou Heshu Blockchain Application Research Institute Co ltd, Shanghai Heshu Software Co ltd filed Critical Gcl Diangang Energy Technology Dongtai Co ltd
Priority to CN202110444525.4A priority Critical patent/CN113222596A/en
Publication of CN113222596A publication Critical patent/CN113222596A/en
Pending legal-status Critical Current

Links

Images

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/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • Software Systems (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Primary Health Care (AREA)
  • Tourism & Hospitality (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a power data storage method and a system based on a block chain intelligent contract, which relate to the technical field of block chain intelligent contracts, and are characterized in that power data are compiled into contract codes through a Solidity programming language and reach an intelligent contract compiler through web3.js, and the intelligent contract compiler generates EVM byte codes and contract binary executable codes; after the contract is successfully deployed, feeding back a contract account address to the front end; the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce. According to the method, the contracts are written into the block chain in a digital mode, due to the characteristics of the block chain, data cannot be deleted or modified and can only be newly added, the whole process is transparent and trackable, and the historical traceability is guaranteed; because the behavior is permanently recorded, the interference of malicious behavior on the normal execution of the agreement can be greatly avoided; the nonce is the number of trades and is automatically incremented after each contract invocation to prevent duplication of trades.

Description

Electric power data storage method and system based on block chain intelligent contract
Technical Field
The invention relates to the technical field of intelligent block chain contracts, in particular to a power data storage method and system based on intelligent block chain contracts.
Background
In the prior art, no matter new energy, electric power or gas, the following pain points often occur when companies and customers transmit energy and services:
1. data collected by electric meters, gas meters, energy quantization equipment and the like are lost, so that very large economic loss is caused;
2. the energy quantitative data is not updated timely and lost, and the practical data used by the user has deviation from the quantitative data collected by the company, so that divergence is generated;
3. when information fee transaction is involved, both the user and the company may have doubts about the authenticity of the data of the other party, and both parties cannot determine the authenticity of the data content and the source.
Disclosure of Invention
To overcome the above problems or at least partially solve the above problems, embodiments of the present invention provide a power data storage method and system based on a blockchain smart contract.
The embodiment of the invention is realized by the following steps:
in a first aspect, an embodiment of the present invention provides a power data storage method based on a block chain intelligent contract, including the following steps:
acquiring power data;
compiling the power data into contract codes through a Solidity programming language, and reaching an intelligent contract compiler through web3.js, wherein the intelligent contract compiler generates EVM byte codes and contract binary executable codes;
feeding back EVM byte codes and contract binary executable codes to a front end;
deploying the compilation content of the contract on the established node cluster, and packaging the transaction hash and the application program binary interface on the block chain;
after the contract is successfully deployed, feeding back a contract account address to the front end;
the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after each contract call.
According to the method, the contracts are written into the block chain in a digital mode, due to the characteristics of the block chain, data cannot be deleted or modified and can only be newly added, the whole process is transparent and trackable, and the historical traceability is guaranteed; because the behavior is permanently recorded, the interference of malicious behavior on the normal execution of the agreement can be greatly avoided; decentralization avoids the influence of centralization factors and improves the advantages of intelligent contracts in the aspect of cost efficiency; when the contract content is met, the code of the intelligent contract is automatically started, so that the manual process is avoided, and meanwhile, the condition that the issuer cannot default is guaranteed; a set of state machine system is constructed by a block chain self-contained consensus algorithm, so that the intelligent contract can run efficiently. The nonce is the number of trades and is automatically incremented after each contract invocation to prevent duplication of trades.
Based on the first aspect, in some embodiments of the present invention, the method further includes: the contract account address is added to the access rights list for the contract.
Based on the first aspect, in some embodiments of the present invention, when a contract is called, an access permission list is retrieved first, and if a contract account address is located in the list, a contract logic may be executed according to a trigger condition and a response rule, and a distributed evidence storage function is executed; if the set condition of the list is not satisfied, the contract invocation fails.
Based on the first aspect, in some embodiments of the invention, the access rights list is updated in real time.
In a second aspect, an embodiment of the present invention provides an electric power data storage system based on a block chain intelligent contract, including:
an acquisition module: for obtaining power data;
a compiling module: the intelligent contract compiling device is used for compiling the power data into contract codes through a Solidity programming language and reaching the intelligent contract compiling device through web3.js, and the intelligent contract compiling device generates EVM byte codes and contract binary executable codes;
a contract feedback module: the system is used for feeding back EVM byte codes and contract binary executable codes to a front end;
a contract deployment module: the system comprises a node cluster, a transaction hash module, an application program binary interface and a server, wherein the node cluster is used for deploying the compiled content of a contract on the established node cluster and packaging the compiled content of the contract to the transaction hash and the application program binary interface on a block chain;
an address feedback module: after the contract is successfully deployed, feeding back a contract account address to the front end;
the intelligent contract calling module: the intelligent contract processing system is used for calling an intelligent contract at the front end and realizing interaction with the intelligent contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after the intelligent contract is called each time.
Based on the second aspect, in some embodiments of the invention, further comprising:
and the adding authority module is used for adding the contract account address to an access authority list of the contract.
Based on the second aspect, in some embodiments of the invention, further comprising:
a retrieval permission module: the contract management system is used for searching the access authority list when a contract is called, and executing contract logic and running a distributed evidence storing function according to a trigger condition and a response rule if a contract account address is in the list; if the set condition of the list is not satisfied, the contract invocation fails.
Based on the second aspect, in some embodiments of the invention, further comprising:
an update module: for updating the access rights list in real time.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
a memory for storing one or more programs;
a processor;
when the one or more programs are executed by the processor, the power data storage method based on the intelligent contract of the block chain is realized.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a power data storage method based on a block chain intelligent contract.
The embodiment of the invention at least has the following advantages or beneficial effects:
in a first aspect, an embodiment of the present invention provides a power data storage method based on a block chain intelligent contract, including the following steps: acquiring power data; compiling the power data into contract codes through a Solidity programming language, and reaching an intelligent contract compiler through web3.js, wherein the intelligent contract compiler generates EVM byte codes and contract binary executable codes; feeding back EVM byte codes and contract binary executable codes to a front end; deploying the compilation content of the contract on the established node cluster, and packaging the transaction hash and the application program binary interface on the block chain; after the contract is successfully deployed, feeding back a contract account address to the front end; the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after each contract call.
In a second aspect, an embodiment of the present invention provides an electric power data storage system based on a block chain intelligent contract, including: an acquisition module: for obtaining power data; a compiling module: the intelligent contract compiling device is used for compiling the power data into contract codes through a Solidity programming language and reaching the intelligent contract compiling device through web3.js, and the intelligent contract compiling device generates EVM byte codes and contract binary executable codes; a contract feedback module: the system is used for feeding back EVM byte codes and contract binary executable codes to a front end; a contract deployment module: the system comprises a node cluster, a transaction hash module, an application program binary interface and a server, wherein the node cluster is used for deploying the compiled content of a contract on the established node cluster and packaging the compiled content of the contract to the transaction hash and the application program binary interface on a block chain; an address feedback module: after the contract is successfully deployed, feeding back a contract account address to the front end; the intelligent contract calling module: the intelligent contract processing system is used for calling an intelligent contract at the front end and realizing interaction with the intelligent contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after the intelligent contract is called each time.
According to the method and the system, the contract is written into the block chain in a digital form, data cannot be deleted or modified due to the characteristics of the block chain, only new data can be added, the whole process is transparent and trackable, and the historical traceability is guaranteed; because the behavior is permanently recorded, the interference of malicious behavior on the normal execution of the agreement can be greatly avoided; decentralization avoids the influence of centralization factors and improves the advantages of intelligent contracts in the aspect of cost efficiency; when the contract content is met, the code of the intelligent contract is automatically started, so that the manual process is avoided, and meanwhile, the condition that the issuer cannot default is guaranteed; a set of state machine system is constructed by a block chain self-contained consensus algorithm, so that the intelligent contract can run efficiently. The nonce is the number of trades and is automatically incremented after each contract invocation to prevent duplication of trades. The manual process is avoided, and meanwhile, the condition that the issuer cannot violate is guaranteed; a set of state machine system is constructed by a block chain self-contained consensus algorithm, so that the intelligent contract can run efficiently. The nonce is the number of trades and is automatically incremented after each contract invocation to prevent duplication of trades.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart of a method for storing power data based on a block chain intelligent contract according to the present invention;
FIG. 2 is a flow chart of a power data storage method based on a block chain intelligent contract according to the present invention;
FIG. 3 is a schematic structural diagram of an electric power data storage system based on a block chain intelligent contract according to the present invention;
fig. 4 is a schematic structural diagram of an electric power data storage system based on a block chain intelligent contract according to the present invention.
Icon: 1. an acquisition module; 2. a compiling module; 3. a contract feedback module; 4. a contract deployment module; 5. an address feedback module; 6. an intelligent contract calling module; 7. adding a permission module; 8. a retrieval permission module; 9. and updating the module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the embodiments provided in the present application, it should be understood that the disclosed method and system can be implemented in other ways. The system embodiments are merely illustrative, and for example, the block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and computer program products according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device, which may be a personal computer, a server, or a network device, to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the embodiments of the present invention, it should be further noted that unless otherwise explicitly stated or limited, the terms "mounted" and "connected" should be interpreted broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
Examples
Referring to fig. 1 and fig. 2, in a first aspect, an embodiment of the present invention provides a power data storage method based on a blockchain intelligent contract, including the following steps:
s10: acquiring power data;
s20: compiling the power data into contract codes through a Solidity programming language, and reaching an intelligent contract compiler through web3.js, wherein the intelligent contract compiler generates EVM byte codes and contract binary executable codes;
s30: feeding back EVM byte codes and contract binary executable codes to a front end;
s40: deploying the compilation content of the contract on the established node cluster, and packaging the transaction hash and the application program binary interface on the block chain;
s50: after the contract is successfully deployed, feeding back a contract account address to the front end;
s60: the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after each contract call.
According to the method, the contracts are written into the block chain in a digital mode, due to the characteristics of the block chain, data cannot be deleted or modified and can only be newly added, the whole process is transparent and trackable, and the historical traceability is guaranteed; because the behavior is permanently recorded, the interference of malicious behavior on the normal execution of the agreement can be greatly avoided; decentralization avoids the influence of centralization factors and improves the advantages of intelligent contracts in the aspect of cost efficiency; when the contract content is met, the code of the intelligent contract is automatically started, so that the manual process is avoided, and meanwhile, the condition that the issuer cannot default is guaranteed; a set of state machine system is constructed by a block chain self-contained consensus algorithm, so that the intelligent contract can run efficiently. The nonce is the number of trades and is automatically incremented after each contract invocation to prevent duplication of trades.
In some embodiments of the invention, further comprising S70: the contract account address is added to the access rights list for the contract.
Specifically, S80: when the contract is called, firstly searching the access authority list, if the contract account address is in the list, executing contract logic according to the triggering condition and the response rule, and operating the distributed evidence storage function; if the set condition of the list is not satisfied, the contract invocation fails.
The purpose of this is to enable a logical separation of roles from permissions. For example: c is an intelligent contract that can run on the Etherhouse platform; u C ser is an authorized legal user in the Taifang network and is a deployer of the contract C; u i ser is the caller of contract C. After the intelligent contract is successfully deployed, the u C ser has control authority over contract data, and account addresses with the length of 20 bits of transaction sending party and receiving party can be added to an access authority list of the contract C according to the content of the power data. When the intelligent contract is called by the u i ser, a preset access authority list is retrieved first, if the u i ser is positioned in the list, contract logic can be executed according to a trigger condition and a response rule, and a distributed evidence storing function is operated; and if the ui ser does not meet the set conditions of the list, the contract calling fails. The method can realize the logical separation of roles and authorities.
Illustratively, in some embodiments of the invention, the access rights list is updated in real-time.
Referring to fig. 3 and fig. 4 in a second aspect, an embodiment of the present invention provides a power data storage system based on a blockchain intelligent contract, including:
the acquisition module 1: for obtaining power data;
and the compiling module 2: the intelligent contract compiling device is used for compiling the power data into contract codes through a Solidity programming language and reaching the intelligent contract compiling device through web3.js, and the intelligent contract compiling device generates EVM byte codes and contract binary executable codes;
the contract feedback module 3: the system is used for feeding back EVM byte codes and contract binary executable codes to a front end;
the contract deployment module 4: the system comprises a node cluster, a transaction hash module, an application program binary interface and a server, wherein the node cluster is used for deploying the compiled content of a contract on the established node cluster and packaging the compiled content of the contract to the transaction hash and the application program binary interface on a block chain;
the address feedback module 5: after the contract is successfully deployed, feeding back a contract account address to the front end;
the intelligent contract calling module 6: the intelligent contract processing system is used for calling an intelligent contract at the front end and realizing interaction with the intelligent contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after the intelligent contract is called each time.
In the system, the contract is written into the block chain in a digital form, and due to the characteristics of the block chain, data cannot be deleted or modified and can only be newly added, so that the whole process is transparent and trackable, and the historical traceability is ensured; because the behavior is permanently recorded, the interference of malicious behavior on the normal execution of the agreement can be greatly avoided; decentralization avoids the influence of centralization factors and improves the advantages of intelligent contracts in the aspect of cost efficiency; when the contract content is met, the code of the intelligent contract is automatically started, so that the manual process is avoided, and meanwhile, the condition that the issuer cannot default is guaranteed; a set of state machine system is constructed by a block chain self-contained consensus algorithm, so that the intelligent contract can run efficiently. The nonce is the number of trades and is automatically incremented after each contract invocation to prevent duplication of trades.
Based on the second aspect, in some embodiments of the invention, further comprising:
and the adding authority module 7 is used for adding the contract account address to the access authority list of the contract.
Based on the second aspect, in some embodiments of the invention, further comprising:
the retrieval authority module 8: the contract management system is used for searching the access authority list when a contract is called, and executing contract logic and running a distributed evidence storing function according to a trigger condition and a response rule if a contract account address is in the list; if the set condition of the list is not satisfied, the contract invocation fails.
The purpose of this is to enable a logical separation of roles from permissions. For example: c is an intelligent contract that can run on the Etherhouse platform; u C ser is an authorized legal user in the Taifang network and is a deployer of the contract C; u i ser is the caller of contract C. After the intelligent contract is successfully deployed, the u C ser has control authority over contract data, and account addresses with the length of 20 bits of transaction sending party and receiving party can be added to an access authority list of the contract C according to the content of the power data. When the intelligent contract is called by the u i ser, a preset access authority list is retrieved first, if the u i ser is positioned in the list, contract logic can be executed according to a trigger condition and a response rule, and a distributed evidence storing function is operated; and if the ui ser does not meet the set conditions of the list, the contract calling fails. The method can realize the logical separation of roles and authorities.
Illustratively, in some embodiments of the invention, further comprising:
the updating module 9: for updating the access rights list in real time.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
a memory for storing one or more programs;
a processor;
when the one or more programs are executed by the processor, the power data storage method based on the intelligent contract of the block chain is realized. For example, to implement S10: acquiring power data; s20: compiling the power data into contract codes through a Solidity programming language, and reaching an intelligent contract compiler through web3.js, wherein the intelligent contract compiler generates EVM byte codes and contract binary executable codes; s30: feeding back EVM byte codes and contract binary executable codes to a front end; s40: deploying the compilation content of the contract on the established node cluster, and packaging the transaction hash and the application program binary interface on the block chain; s50: after the contract is successfully deployed, feeding back a contract account address to the front end; s60: the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after each contract call.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a power data storage method based on a block chain intelligent contract. For example, to implement S10: acquiring power data; s20: compiling the power data into contract codes through a Solidity programming language, and reaching an intelligent contract compiler through web3.js, wherein the intelligent contract compiler generates EVM byte codes and contract binary executable codes; s30: feeding back EVM byte codes and contract binary executable codes to a front end; s40: deploying the compilation content of the contract on the established node cluster, and packaging the transaction hash and the application program binary interface on the block chain; s50: after the contract is successfully deployed, feeding back a contract account address to the front end; s60: the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after each contract call.
In summary, in a first aspect of the embodiments of the present invention, an embodiment of the present invention provides a power data storage method based on a block chain intelligent contract, including the following steps: acquiring power data; compiling the power data into contract codes through a Solidity programming language, and reaching an intelligent contract compiler through web3.js, wherein the intelligent contract compiler generates EVM byte codes and contract binary executable codes; feeding back EVM byte codes and contract binary executable codes to a front end; deploying the compilation content of the contract on the established node cluster, and packaging the transaction hash and the application program binary interface on the block chain; after the contract is successfully deployed, feeding back a contract account address to the front end; the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after each contract call.
In a second aspect, an embodiment of the present invention provides an electric power data storage system based on a block chain intelligent contract, including: the acquisition module 1: for obtaining power data; and the compiling module 2: the intelligent contract compiling device is used for compiling the power data into contract codes through a Solidity programming language and reaching the intelligent contract compiling device through web3.js, and the intelligent contract compiling device generates EVM byte codes and contract binary executable codes; the contract feedback module 3: the system is used for feeding back EVM byte codes and contract binary executable codes to a front end; the contract deployment module 4: the system comprises a node cluster, a transaction hash module, an application program binary interface and a server, wherein the node cluster is used for deploying the compiled content of a contract on the established node cluster and packaging the compiled content of the contract to the transaction hash and the application program binary interface on a block chain; the address feedback module 5: after the contract is successfully deployed, feeding back a contract account address to the front end; the intelligent contract calling module 6: the intelligent contract processing system is used for calling an intelligent contract at the front end and realizing interaction with the intelligent contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after the intelligent contract is called each time.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (10)

1. A power data storage method based on a block chain intelligent contract is characterized by comprising the following steps:
acquiring power data;
compiling the power data into contract codes through a Solidity programming language, and reaching an intelligent contract compiler through web3.js, wherein the intelligent contract compiler generates EVM byte codes and contract binary executable codes;
feeding back EVM byte codes and contract binary executable codes to a front end;
deploying the compilation content of the contract on the established node cluster, and packaging the transaction hash and the application program binary interface on the block chain;
after the contract is successfully deployed, feeding back a contract account address to the front end;
the front end calls an intelligent contract and realizes the interaction with the contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after each contract call.
2. The method for power data storage based on the block chain intelligent contracts according to claim 1, further comprising:
the contract account address is added to the access rights list for the contract.
3. The method for power data storage based on the intelligent block chain contract as claimed in claim 2,
when the contract is called, firstly searching the access authority list, if the contract account address is in the list, executing contract logic according to the triggering condition and the response rule, and operating the distributed evidence storage function; if the set condition of the list is not satisfied, the contract invocation fails.
4. The method for storing electric power data based on the intelligent block chain contract as claimed in claim 3, wherein the access authority list is updated in real time.
5. A power data storage system based on blockchain intelligent contracts, comprising:
an acquisition module: for obtaining power data;
a compiling module: the intelligent contract compiling device is used for compiling the power data into contract codes through a Solidity programming language and reaching the intelligent contract compiling device through web3.js, and the intelligent contract compiling device generates EVM byte codes and contract binary executable codes;
a contract feedback module: the system is used for feeding back EVM byte codes and contract binary executable codes to a front end;
a contract deployment module: the system comprises a node cluster, a transaction hash module, an application program binary interface and a server, wherein the node cluster is used for deploying the compiled content of a contract on the established node cluster and packaging the compiled content of the contract to the transaction hash and the application program binary interface on a block chain;
an address feedback module: after the contract is successfully deployed, feeding back a contract account address to the front end;
the intelligent contract calling module: the intelligent contract processing system is used for calling an intelligent contract at the front end and realizing interaction with the intelligent contract through a contract account address, an application program binary interface and a nonce, wherein the nonce refers to a transaction number, and an automatic numerical value is increased by one after the intelligent contract is called each time.
6. The power data storage system based on the blockchain intelligent contracts according to claim 5, further comprising:
and the adding authority module is used for adding the contract account address to an access authority list of the contract.
7. The power data storage system based on the blockchain intelligent contracts according to claim 6, further comprising:
a retrieval permission module: the contract management system is used for searching the access authority list when a contract is called, and executing contract logic and running a distributed evidence storing function according to a trigger condition and a response rule if a contract account address is in the list; if the set condition of the list is not satisfied, the contract invocation fails.
8. The power data storage system based on the blockchain intelligent contracts according to claim 6, further comprising:
an update module: for updating the access rights list in real time.
9. An electronic device, comprising:
a memory for storing one or more programs;
a processor;
the one or more programs, when executed by the processor, implement the method of any of claims 1-4.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN202110444525.4A 2021-04-23 2021-04-23 Electric power data storage method and system based on block chain intelligent contract Pending CN113222596A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110444525.4A CN113222596A (en) 2021-04-23 2021-04-23 Electric power data storage method and system based on block chain intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110444525.4A CN113222596A (en) 2021-04-23 2021-04-23 Electric power data storage method and system based on block chain intelligent contract

Publications (1)

Publication Number Publication Date
CN113222596A true CN113222596A (en) 2021-08-06

Family

ID=77088583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110444525.4A Pending CN113222596A (en) 2021-04-23 2021-04-23 Electric power data storage method and system based on block chain intelligent contract

Country Status (1)

Country Link
CN (1) CN113222596A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778564A (en) * 2021-09-03 2021-12-10 杭州复杂美科技有限公司 Method, equipment and storage medium for efficiently executing EVM intelligent contract

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064171A (en) * 2018-07-26 2018-12-21 杭州秘猿科技有限公司 A kind of method, apparatus and electronic system of block chain parallel transaction
CN109493042A (en) * 2018-10-24 2019-03-19 南京邮电大学 A kind of intelligent contract possessing access control function is credible to deposit card method and system
CN109840429A (en) * 2019-01-08 2019-06-04 北京众享比特科技有限公司 Intelligent contract deployment, call method and device
CN110278193A (en) * 2019-05-20 2019-09-24 阿里巴巴集团控股有限公司 It is marked and transaction, the receipt storage method of event type and node in conjunction with code
CN110599169A (en) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 Data processing method, device, terminal and medium
CN112202563A (en) * 2020-09-09 2021-01-08 毛泽龙 Block chain based secure transaction system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064171A (en) * 2018-07-26 2018-12-21 杭州秘猿科技有限公司 A kind of method, apparatus and electronic system of block chain parallel transaction
CN109493042A (en) * 2018-10-24 2019-03-19 南京邮电大学 A kind of intelligent contract possessing access control function is credible to deposit card method and system
CN109840429A (en) * 2019-01-08 2019-06-04 北京众享比特科技有限公司 Intelligent contract deployment, call method and device
CN110278193A (en) * 2019-05-20 2019-09-24 阿里巴巴集团控股有限公司 It is marked and transaction, the receipt storage method of event type and node in conjunction with code
CN110599169A (en) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 Data processing method, device, terminal and medium
CN112202563A (en) * 2020-09-09 2021-01-08 毛泽龙 Block chain based secure transaction system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778564A (en) * 2021-09-03 2021-12-10 杭州复杂美科技有限公司 Method, equipment and storage medium for efficiently executing EVM intelligent contract
CN113778564B (en) * 2021-09-03 2023-05-30 杭州复杂美科技有限公司 Method, equipment and storage medium for efficiently executing EVM intelligent contract

Similar Documents

Publication Publication Date Title
CN107147704B (en) block chain-oriented universal service middleware system
CN107038242B (en) Block chain-oriented global intelligent contract service data analysis method
CN110032568B (en) Data structure reading and updating method and device, and electronic equipment
CN112214802B (en) Block chain intelligent contract message publishing and subscribing method
CN102360389A (en) Method for implementing data set specific management policies with respect to data
CN103235918B (en) The collection method of trusted file and system
CN112527781A (en) Intelligent contract data migration method and system
CN113222596A (en) Electric power data storage method and system based on block chain intelligent contract
CN113961226B (en) Software development kit repairing method, terminal, server and equipment
US8224933B2 (en) Method and apparatus for case-based service composition
CN113077260A (en) Data access method and device based on block chain and electronic equipment
CN110795674B (en) Configuration updating method and device
CN111131474A (en) Method, device and medium for managing user protocol based on block chain
CN111200584B (en) System and method for optimizing black-and-white list mechanism based on blockchain technology
CN116645061A (en) Customs clearance data processing method based on block chain system and consensus node
KR101930056B1 (en) Method and apparatus for mobile terminal management supporting security policy
CN113296987B (en) Interface calling method and device for calling module, computer equipment and storage medium
CN112398908B (en) Block chain network node deleting method, system, storage medium and device
CN111428209B (en) Application program confusion method, device and storage medium
CN114493493A (en) Decision engine and decision engine implementation method
CN113469811A (en) Block chain transaction processing method and device
CN112906057A (en) Calculation method for transaction on privacy chain on trusted construction chain
TWI620134B (en) Integration device and integration method thereof
CN111901339A (en) Block chain credible evidence storing method based on extensible distributed system
CN105446718B (en) Method of managing software and system based on red cap software package manager

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210806

RJ01 Rejection of invention patent application after publication