CN111614658A - Calculation force contract generation method based on block chain network, electronic device and medium - Google Patents

Calculation force contract generation method based on block chain network, electronic device and medium Download PDF

Info

Publication number
CN111614658A
CN111614658A CN202010423365.0A CN202010423365A CN111614658A CN 111614658 A CN111614658 A CN 111614658A CN 202010423365 A CN202010423365 A CN 202010423365A CN 111614658 A CN111614658 A CN 111614658A
Authority
CN
China
Prior art keywords
contract
user
calculation
request
computing power
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
CN202010423365.0A
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.)
Shenzhen Jiemicrochip Technology Co ltd
Original Assignee
Shenzhen Jiemicrochip Technology 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 Shenzhen Jiemicrochip Technology Co ltd filed Critical Shenzhen Jiemicrochip Technology Co ltd
Priority to CN202010423365.0A priority Critical patent/CN111614658A/en
Publication of CN111614658A publication Critical patent/CN111614658A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/302Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • H04L9/3249Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures using RSA or related signature schemes, e.g. Rabin scheme

Abstract

The invention discloses a block chain network-based computing power contract generation method, an electronic device and a medium, belonging to the technical field of block chains, wherein the method comprises the following steps: the method comprises the steps of receiving a calculation force request sent by a user in a block chain network, verifying the user public key and the user ciphertext by using an asymmetric encryption algorithm, recording the calculation force request information into a distributed book if the verification is passed, acquiring a calculation force contract template corresponding to the calculation force request information from a preset contract template library according to the recorded distributed book, generating a calculation force contract corresponding to the user request according to the acquired calculation force contract template, and sending the calculation force contract to a user side. The invention checks that the calculation power request of the user is not falsified through the asymmetric encryption algorithm, and automatically generates the calculation power contract corresponding to the user request by using the block chain technology, thereby improving the reliability of the calculation power contract.

Description

Calculation force contract generation method based on block chain network, electronic device and medium
Technical Field
The invention belongs to the technical field of block chains, and particularly relates to a block chain network-based computing power contract generation method, an electronic device and a medium.
Background
With the development of artificial intelligence, the demand for computing power is increasing. Currently, a third party gives a corresponding computing power contract according to the computing power requirement of a user. However, the computing power contract depends on data provided by a third party, so that the passive acceptance of the computing power contract limits the application of the computing power contract, and the introduced third party and the provided data can not be further verified and can be directly used, thereby reducing the credibility of the computing power contract.
Disclosure of Invention
The invention provides a block chain network-based calculation power contract generation method, an electronic device and a medium, which solve the problem that calculation power contracts required by existing users are directly used without being checked, so that the reliability of the calculation power contracts is low.
In order to achieve the above object, the present invention provides a method for generating a computation power contract based on a block chain network, the method comprising:
a receiving step: receiving a calculation force request sent by a user in a block chain network, wherein the calculation force request comprises calculation force demand information, a user public key and a ciphertext;
a verification step: verifying the user public key and the ciphertext through an asymmetric encryption algorithm, and recording the calculation force demand information into a distributed account book if the verification is passed;
an acquisition step: acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library according to the recorded distributed account book; and
a generation step: and generating a calculation contract corresponding to the user request according to the acquired calculation contract template, and sending the calculation contract to a user side.
Preferably, the asymmetric encryption algorithm decrypts a ciphertext corresponding to the user public key according to an RSA algorithm of an encryption and decryption rule.
Preferably, the generating of the computing power contract corresponding to the user request according to the obtained computing power contract template includes:
extracting a character string of the computing power demand information contained in the user request;
extracting a field corresponding to the character string according to the acquired calculation force contract template;
and filling the acquired character strings into corresponding fields to generate a calculation force contract corresponding to the user request.
Preferably, the verifying step comprises:
and if the user public key and the ciphertext verified by the asymmetric encryption algorithm do not pass, generating unmatched information of the calculation force request and feeding the unmatched information back to the user side.
Preferably, after the generating step, the method further comprises:
and (3) packaging: and receiving the calculation contract confirmed and returned by the user side, encapsulating the confirmed calculation contract into a block in a block chain network of preset time, and recording the block into the distributed account book.
Further, to achieve the above object, the present invention also provides an electronic apparatus including a memory and a processor, the memory having stored therein a contract generating program executable on the processor, the contract generating program realizing the following steps when executed by the processor:
a receiving step: receiving a calculation force request sent by a user in a block chain network, wherein the calculation force request comprises calculation force demand information, a user public key and a ciphertext;
a verification step: verifying the user public key and the ciphertext through an asymmetric encryption algorithm, and recording the calculation force demand information into a distributed account book if the verification is passed;
an acquisition step: acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library according to the recorded distributed account book; and
a generation step: and generating a calculation contract corresponding to the user request according to the acquired calculation contract template, and sending the calculation contract to a user side.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, which includes a contract generating program, and when the contract generating program is executed by a processor, the method may implement the steps of the computational contract generating method based on a blockchain network as described in any one of the above.
The invention provides a calculation power contract generation method based on a block chain network, an electronic device and a medium, wherein a calculation power request sent by a user in the block chain network is received, the calculation power request comprises calculation power demand information, a user public key and a ciphertext, the user public key is verified by using an asymmetric encryption algorithm, if the verification is passed, the calculation power demand information is recorded into a distributed account book, a calculation power contract template corresponding to the calculation power demand information is obtained from a preset contract template library according to the recorded distributed account book, and finally, a calculation power contract corresponding to the user request is generated according to the obtained calculation power contract template and is sent to a user side. The invention checks that the calculation power request of the user is not falsified through the asymmetric encryption algorithm, and automatically generates the calculation power contract corresponding to the user request by using the block chain technology, thereby improving the reliability of the calculation power contract.
To more clearly illustrate the structural features and effects of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
Drawings
FIG. 1 is a flow chart of a method for generating a computation power contract based on a block chain network according to the present invention;
FIG. 2 is another flow chart of a method for generating a computation power contract based on a block chain network according to the present invention;
FIG. 3 is a diagram of an electronic device according to a preferred embodiment of the present invention;
FIG. 4 is a program module diagram of a preferred embodiment of a contract generation program;
FIG. 5 is a block diagram of another preferred embodiment of a contract generation program.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
An embodiment of the present invention provides a block chain network-based computational power contract generation method, which is a flowchart of a block chain network-based computational power contract generation method according to the present invention, as shown in fig. 1, and the method includes:
and S1, receiving a calculation force request sent by a user in the block chain network, wherein the calculation force request comprises calculation force demand information, a user public key and a ciphertext.
In this embodiment, the calculation force requirement may include information such as a calculation force type, a calculation force size, and a calculation force usage time.
The calculation power types include buy calculation power and sell calculation power.
The calculation force magnitude includes T numbers of different calculation rates, for example, 110T for a high calculation rate, 65T for a medium calculation rate, and 12T for a low calculation rate, where 1T (H/s) is 1000G (H/s), and 1T (H/s) means that 1 trillion hash collisions are performed per second, and the more hash collisions are performed, the faster the calculation efficiency is.
The user public key is a public key, belongs to the user, and is input with the user public key and the ciphertext when the computing power request is sent out in the blockchain network, so that the user public key and the ciphertext are used for verifying that the request comes from the operation of the user and is not a request submitted by artificial tampering, the user directly initiates the computing power request in the blockchain network, a third party (such as an enterprise or a service provider) is not required to provide data corresponding to the computing power request of the user, the reliability of the user request is ensured, and the user experience is improved.
For example, in one embodiment, a computing power request issued by a user in a blockchain network requests to buy 110T computing power for 2 years, which includes an input user public key and a ciphertext, wherein the ciphertext is generated by a user private key and a text entered by the user through an asymmetric encryption algorithm and is a series of character strings, for example, the ciphertext is:
“MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDC7kw8r6tq43pwApYvkJ5laljaN9BZb21TAIfT/vexbobzH7Q8SUdP5uDPXEBKzOjx2L28y7Xs1d9v3tdPfKI2LR7PAzWBmDMn8riHrDDNpUpJnlAGUqJG9ooPn8j7YNpcxCa1iybOlc2kEhmJn5uwoanQq+CA6agNkqly2H4j6wIDAQAB”。
and S2, verifying the user public key and the ciphertext through an asymmetric encryption algorithm, and recording the calculation force demand information into the distributed account book if the verification is passed.
In this embodiment, the asymmetric encryption algorithm is verified based on the received user public key and ciphertext, and the user public key and ciphertext are decrypted according to the RSA algorithm of the encryption and decryption rule, that is, the calculation power request submitted by the user in the block chain network conforms to the authenticity of the user, and the verification is passed, at this time, the calculation power requirement information requested by the user is recorded in the distributed account book.
For example, the words entered by the user in the above example are decrypted by the asymmetric encryption algorithm as follows: and if the Chinese is the 'I' person, the verification is passed.
Asymmetric encryption algorithms require two keys: public key (publickey) and private key (privatekey). If the public key is used for encrypting data, the data can be decrypted only by using a corresponding private key; if the data is encrypted with a private key, it can only be decrypted with the corresponding public key. Because two different keys are used for encryption and decryption, the communication data can be effectively prevented from being tampered, and the safety of the security data is improved.
The distributed ledger is a duplicate consensus, namely, an asset database that can be shared at multiple sites, at different geographic locations, or across a network of multiple organizations. Participants in a network may obtain a copy of a unique and real ledger. Any changes in the ledger will be reflected in all copies, with reaction times in minutes or even seconds. The security and accuracy of the assets stored in the ledger are maintained on a cryptology basis by controlling the access rights of the ledger through the use of public and private keys and signatures.
And S3, acquiring a calculation force contract template corresponding to the calculation force demand information from a preset contract template library according to the recorded distributed ledger.
In this embodiment, the calculation power demand information requested by the user is described in the distributed book, and the calculation power demand information includes information such as the T number of calculation power, the purchase calculation power, and the usage time limit of calculation power. And acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library based on the distributed ledger recorded with the computing power demand information.
The preset contract template library is composed of a plurality of contract templates with various types and different computing power requirements, and a contract template library is formed and used for matching the distributed account book recorded with the computing power requirement information.
And S4, generating a calculation contract corresponding to the user request according to the acquired calculation contract template, and sending the calculation contract to a user side.
In this embodiment, a character string is extracted from the calculation demand information according to the user request; extracting fields corresponding to the character strings from the calculation force contract template corresponding to the distributed account book recorded with the calculation force demand information; and finally, filling the extracted character strings into the corresponding fields to generate a calculation force contract corresponding to the user request for user verification and signing.
Further, the step S2 includes:
and if the user public key and the ciphertext verified by the asymmetric encryption algorithm do not pass, generating unmatched information of the calculation force request and feeding the unmatched information back to the user side.
In one embodiment, based on the user public key provided by the user request, when the user public key verified by the asymmetric encryption algorithm fails, the user request provided by the user side may not be the user himself or the provided public key is wrong, and mismatch information corresponding to the computing force request is generated, the mismatch information indicates a node which may appear and is fed back to the user side, and the user can further operate according to a prompt in the mismatch information when receiving the feedback, for example, the user request is sent to the user side for resending once.
In summary, the invention verifies whether the computation power request sent by the user is tampered by the asymmetric encryption algorithm, automatically generates the computation power contract corresponding to the user request by using the blockchain technology, avoids providing data by an unverified third party (such as an enterprise or a service provider), ensures that the computation power request comes from the operation of the user itself instead of the request submitted by human tampering, further ensures the credibility of the user request in the block chain forgetting based on the non-tampering and reliability of the blockchain technology, and improves the user experience.
Further, referring to fig. 2, another flowchart of the method for generating a computation power contract based on a block chain network according to the present invention is shown, and after the step S4, the method further includes:
and S5, receiving the calculation contract confirmed and returned by the user side, packaging the confirmed calculation contract into a block in a block chain network of preset time, and recording the block into the distributed book.
And after the user checks and signs the calculation power contract, packaging the signed calculation power contract into a block, broadcasting the block in a block network at preset time for the public to know the block, for example, broadcasting the block once in a block chain network every 2 seconds, and recording the broadcast information of the block to the distributed account book.
Fig. 3 is a schematic view of an electronic device according to a preferred embodiment of the invention. The electronic apparatus 1 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set or stored in advance. The electronic device 1 may be a computer, or may be a single network server, a server group composed of a plurality of network servers, or a cloud composed of a large number of hosts or network servers based on cloud computing, where cloud computing is one of distributed computing and is a super virtual computer composed of a group of loosely coupled computers.
In the present embodiment, the electronic device 1 may include, but is not limited to, a memory 11, a processor 12, and a network interface 13, which may be communicatively connected to each other through a system bus, and the memory 11 stores a contract generating program 10 that may be executed on the processor 12. It is noted that fig. 3 only shows the electronic device 1 with components 11-13, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
The storage 11 includes a memory and at least one type of readable storage medium. The memory provides cache for the operation of the electronic device 1; the readable storage medium may be a non-volatile storage medium such as flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic apparatus 1, such as a hard disk of the electronic apparatus 1; in other embodiments, the non-volatile storage medium may also be an external storage device of the electronic apparatus 1, such as a plug-in hard disk provided on the electronic apparatus 1, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. In this embodiment, the readable storage medium of the memory 11 is generally used for storing an operating system and various application software installed in the electronic device 1, for example, storing the contract generating program 10 in an embodiment of the present invention. Further, the memory 11 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 12 is generally used for controlling the overall operation of the electronic apparatus 1, such as performing control and processing related to data interaction or communication with the other devices. In this embodiment, the processor 12 is configured to run the program code or the processing data stored in the memory 11, for example, run the contract generating program 10.
The contract generation program 10 is stored in memory 11 and includes computer readable instructions stored in memory 11 that are executable by processor 12 to implement the methods of the embodiments of the present application.
In one embodiment, the contract generating program 10 implements the following steps when executed by the processor 12:
a receiving step: and receiving a computing power request sent by a user in the block chain network, wherein the computing power request comprises computing power demand information, a user public key and a ciphertext.
In this embodiment, the calculation force requirement may include information such as a calculation force type, a calculation force size, and a calculation force usage time.
The calculation power types include buy calculation power and sell calculation power.
The calculation force magnitude includes T numbers of different calculation rates, for example, 110T for a high calculation rate, 65T for a medium calculation rate, and 12T for a low calculation rate, where 1T (H/s) is 1000G (H/s), and 1T (H/s) means that 1 trillion hash collisions are performed per second, and the more hash collisions are performed, the faster the calculation efficiency is.
The user public key is a public key, belongs to the user, is input when sending the computing power request in the blockchain network, is used for verifying that the request comes from the operation of the user and is not a request submitted by artificial tampering, and directly sends the computing power request in the blockchain network without a third party (such as an enterprise or a service provider) providing data corresponding to the computing power request of the user, so that the reliability of the user request is ensured, and the user experience is improved.
For example, in one embodiment, a computing power request issued by a user in a blockchain network requests to buy 110T computing power for 2 years, which includes an input user public key and a ciphertext, wherein the ciphertext is generated by a user private key and a text entered by the user through an asymmetric encryption algorithm and is a series of character strings, for example, the ciphertext is:
“MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDC7kw8r6tq43pwApYvkJ5laljaN9BZb21TAIfT/vexbobzH7Q8SUdP5uDPXEBKzOjx2L28y7Xs1d9v3tdPfKI2LR7PAzWBmDMn8riHrDDNpUpJnlAGUqJG9ooPn8j7YNpcxCa1iybOlc2kEhmJn5uwoanQq+CA6agNkqly2H4j6wIDAQAB”。
a verification step: and verifying the user public key and the ciphertext through an asymmetric encryption algorithm, and recording the calculation force demand information into a distributed account book if the verification is passed.
In this embodiment, the asymmetric encryption algorithm is verified based on the received user public key and ciphertext, and the user public key and ciphertext are decrypted according to the RSA algorithm of the encryption and decryption rule, that is, the calculation power request submitted by the user in the block chain network conforms to the authenticity of the user, and the verification is passed, at this time, the calculation power requirement information requested by the user is recorded in the distributed account book.
For example, the words entered by the user in the above example are decrypted by the asymmetric encryption algorithm as follows: and if the Chinese is the 'I' person, the verification is passed.
Asymmetric encryption algorithms require two keys: public key (publickey) and private key (privatekey). If the public key is used for encrypting data, the data can be decrypted only by using a corresponding private key; if the data is encrypted with a private key, it can only be decrypted with the corresponding public key. Because two different keys are used for encryption and decryption, the communication data can be effectively prevented from being tampered, and the safety of the security data is improved.
The distributed ledger is a duplicate consensus, namely, an asset database that can be shared at multiple sites, at different geographic locations, or across a network of multiple organizations. Participants in a network may obtain a copy of a unique and real ledger. Any changes in the ledger will be reflected in all copies, with reaction times in minutes or even seconds. The security and accuracy of the assets stored in the ledger are maintained on a cryptology basis by controlling the access rights of the ledger through the use of public and private keys and signatures.
An acquisition step: and acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library according to the recorded distributed account book.
In this embodiment, the calculation power demand information requested by the user is described in the distributed book, and the calculation power demand information includes information such as the T number of calculation power, the purchase calculation power, and the usage time limit of calculation power. And acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library based on the distributed ledger recorded with the computing power demand information.
The preset contract template library is composed of a plurality of contract templates with various types and different computing power requirements, and a contract template library is formed and used for matching the distributed account book recorded with the computing power requirement information.
A generation step: and generating a calculation contract corresponding to the user request according to the acquired calculation contract template, and sending the calculation contract to a user side.
In this embodiment, a character string is extracted from the calculation demand information according to the user request; extracting fields corresponding to the character strings from the calculation force contract template corresponding to the distributed account book recorded with the calculation force demand information; and finally, filling the extracted character strings into the corresponding fields to generate a calculation force contract corresponding to the user request for user verification and signing.
Further, the verifying step includes:
and if the user public key and the ciphertext verified by the asymmetric encryption algorithm do not pass, generating unmatched information of the calculation force request and feeding the unmatched information back to the user side.
In one embodiment, based on the user public key provided by the user request, when the user public key verified by the asymmetric encryption algorithm fails, the user request provided by the user side may not be the user himself or the provided public key is wrong, and mismatch information corresponding to the computing force request is generated, the mismatch information indicates a node which may appear and is fed back to the user side, and the user can further operate according to a prompt in the mismatch information when receiving the feedback, for example, the user request is sent to the user side for resending once.
In summary, the invention verifies whether the computation power request sent by the user is tampered by the asymmetric encryption algorithm, automatically generates the computation power contract corresponding to the user request by using the blockchain technology, avoids providing data by an unverified third party (such as an enterprise or a service provider), ensures that the computation power request comes from the operation of the user itself instead of the request submitted by human tampering, further ensures the credibility of the user request in the block chain forgetting based on the non-tampering and reliability of the blockchain technology, and improves the user experience.
Referring to FIG. 4, a program module diagram of a preferred embodiment of a contract generation program is shown. In one embodiment, the computational contract generation program 10 includes: the system comprises a receiving module 101, a verifying module 102, an obtaining module 103 and a generating module 104. The functions or operation steps implemented by the modules 101 and 104 are similar to the above-mentioned computing power contract generation method based on the block chain network, and are not detailed here, for example, where:
the system comprises a receiving module 101, a calculating power request sending by a user in a block chain network, wherein the calculating power request comprises calculating power demand information, a user public key and a ciphertext;
the verification module 102 is configured to verify the user public key and the ciphertext through an asymmetric encryption algorithm, and if the user public key and the ciphertext pass the verification, record the calculation power requirement information into a distributed account book;
the obtaining module 103 is configured to obtain, according to the recorded distributed ledger, a calculation force contract template corresponding to the calculation force demand information from a preset contract template library; and
and the generating module 104 is configured to generate a power contract corresponding to the user request according to the acquired power contract template, and send the power contract to the user side.
Further, referring to fig. 5, a program module diagram of another preferred embodiment of the contract generation program is shown, which further includes after the generation module 104:
the encapsulation module 105 is configured to receive the calculation contract that is confirmed and returned by the user side, encapsulate the confirmed calculation contract into a block in a block chain network at a preset time, and record the block in the distributed ledger.
Furthermore, the present invention also provides a computer-readable storage medium including a contract generation program, which when executed by a processor, implements operations of:
a receiving step: receiving a calculation force request sent by a user in a block chain network, wherein the calculation force request comprises calculation force demand information, a user public key and a ciphertext;
a verification step: verifying the user public key and the ciphertext through an asymmetric encryption algorithm, and recording the calculation force demand information into a distributed account book if the verification is passed;
an acquisition step: acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library according to the recorded distributed account book; and
a generation step: and generating a calculation contract corresponding to the user request according to the acquired calculation contract template, and sending the calculation contract to a user side.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the above-mentioned method and electronic device for quickly locating a bug, and will not be described herein again.
The technical principle of the present invention has been described above with reference to specific embodiments, which are merely preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. Other embodiments of the invention will occur to those skilled in the art without the exercise of inventive faculty, and such will fall within the scope of the invention.

Claims (10)

1. A block chain network-based computing power contract generation method is characterized by comprising the following steps:
a receiving step: receiving a calculation force request sent by a user in a block chain network, wherein the calculation force request comprises calculation force demand information, a user public key and a ciphertext;
a verification step: verifying the user public key and the ciphertext through an asymmetric encryption algorithm, and recording the calculation force demand information into a distributed account book if the verification is passed;
an acquisition step: acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library according to the recorded distributed account book; and
a generation step: and generating a calculation contract corresponding to the user request according to the acquired calculation contract template, and sending the calculation contract to a user side.
2. The block chain network-based computing power contract generation method according to claim 1, wherein the asymmetric encryption algorithm decrypts a ciphertext corresponding to the user public key according to an RSA algorithm of an encryption and decryption rule.
3. The block chain network-based computing power contract generating method according to claim 1, wherein the generating of the computing power contract corresponding to the user request according to the obtained computing power contract template includes:
extracting a character string of the computing power demand information contained in the user request;
extracting a field corresponding to the character string according to the acquired calculation force contract template;
and filling the acquired character strings into corresponding fields to generate a calculation force contract corresponding to the user request.
4. The blockchain network-based computing power contract generating method according to claim 1, wherein the verifying step includes:
and if the user public key and the ciphertext verified by the asymmetric encryption algorithm do not pass, generating unmatched information of the calculation force request and feeding the unmatched information back to the user side.
5. The block chain network-based computation power contract generating method according to claim 1, further comprising, after the generating step:
and (3) packaging: and receiving the calculation contract confirmed and returned by the user side, encapsulating the confirmed calculation contract into a block in a block chain network of preset time, and recording the block into the distributed account book.
6. An electronic device comprising a memory and a processor, the memory having stored therein a contract-generating program executable on the processor, the contract-generating program when executed by the processor implementing the steps of:
a receiving step: receiving a calculation force request sent by a user in a block chain network, wherein the calculation force request comprises calculation force demand information, a user public key and a ciphertext;
a verification step: verifying the user public key and the ciphertext through an asymmetric encryption algorithm, and recording the calculation force demand information into a distributed account book if the verification is passed;
an acquisition step: acquiring an computing power contract template corresponding to the computing power demand information from a preset contract template library according to the recorded distributed account book; and
a generation step: and generating a calculation contract corresponding to the user request according to the acquired calculation contract template, and sending the calculation contract to a user side.
7. The electronic device of claim 6, wherein the asymmetric encryption algorithm decrypts a ciphertext corresponding to the user public key according to an RSA algorithm of an encryption and decryption rule.
8. The electronic device according to claim 6, wherein the generating of the computing power contract corresponding to the user request according to the obtained computing power contract template includes:
extracting a character string of the computing power demand information contained in the user request;
extracting a field corresponding to the character string according to the acquired calculation force contract template;
and filling the acquired character strings into corresponding fields to generate a calculation force contract corresponding to the user request.
9. The electronic device of claim 6, wherein the verifying step comprises:
and if the user public key and the ciphertext verified by the asymmetric encryption algorithm do not pass, generating unmatched information of the calculation force request and feeding the unmatched information back to the user side.
10. A computer-readable storage medium, wherein the computer-readable storage medium includes a contract generation program, and the contract generation program, when executed by a processor, can implement the steps of the block chain network-based computational contract generation method according to any one of claims 1 to 5.
CN202010423365.0A 2020-05-19 2020-05-19 Calculation force contract generation method based on block chain network, electronic device and medium Pending CN111614658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010423365.0A CN111614658A (en) 2020-05-19 2020-05-19 Calculation force contract generation method based on block chain network, electronic device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010423365.0A CN111614658A (en) 2020-05-19 2020-05-19 Calculation force contract generation method based on block chain network, electronic device and medium

Publications (1)

Publication Number Publication Date
CN111614658A true CN111614658A (en) 2020-09-01

Family

ID=72196060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010423365.0A Pending CN111614658A (en) 2020-05-19 2020-05-19 Calculation force contract generation method based on block chain network, electronic device and medium

Country Status (1)

Country Link
CN (1) CN111614658A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113553192A (en) * 2021-09-18 2021-10-26 深圳时空云科技有限公司 Calculation power allocation method and device for calculation power equipment based on block chain
CN115378829A (en) * 2021-05-17 2022-11-22 中国移动通信有限公司研究院 Resource request method and device, computational power network element node and terminal equipment
CN117435349A (en) * 2023-12-14 2024-01-23 之江实验室 Method and device for generating computing power transaction contract and computing power resource management platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036880A (en) * 2012-12-12 2013-04-10 华为技术有限公司 Network information transmission method, transmission equipment and transmission system
US20170177898A1 (en) * 2015-12-16 2017-06-22 International Business Machines Corporation Personal ledger blockchain
CN109360088A (en) * 2018-11-13 2019-02-19 平安科技(深圳)有限公司 Processing method, device and the computer equipment of loan transaction
CN110149322A (en) * 2019-05-06 2019-08-20 山东公链信息科技有限公司 A kind of block chain encryption method that irreversible dynamic failure re-examination is rebuild
CN110782343A (en) * 2018-07-30 2020-02-11 中移(苏州)软件技术有限公司 Calculation power circulation method and system based on block chain in distributed network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036880A (en) * 2012-12-12 2013-04-10 华为技术有限公司 Network information transmission method, transmission equipment and transmission system
US20170177898A1 (en) * 2015-12-16 2017-06-22 International Business Machines Corporation Personal ledger blockchain
CN110782343A (en) * 2018-07-30 2020-02-11 中移(苏州)软件技术有限公司 Calculation power circulation method and system based on block chain in distributed network
CN109360088A (en) * 2018-11-13 2019-02-19 平安科技(深圳)有限公司 Processing method, device and the computer equipment of loan transaction
CN110149322A (en) * 2019-05-06 2019-08-20 山东公链信息科技有限公司 A kind of block chain encryption method that irreversible dynamic failure re-examination is rebuild

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115378829A (en) * 2021-05-17 2022-11-22 中国移动通信有限公司研究院 Resource request method and device, computational power network element node and terminal equipment
CN113553192A (en) * 2021-09-18 2021-10-26 深圳时空云科技有限公司 Calculation power allocation method and device for calculation power equipment based on block chain
CN113553192B (en) * 2021-09-18 2022-03-15 深圳时空云科技有限公司 Calculation power allocation method and device for calculation power equipment based on block chain
CN117435349A (en) * 2023-12-14 2024-01-23 之江实验室 Method and device for generating computing power transaction contract and computing power resource management platform
CN117435349B (en) * 2023-12-14 2024-04-30 之江实验室 Method and device for generating computing power transaction contract and computing power resource management platform

Similar Documents

Publication Publication Date Title
US10685099B2 (en) System and method for mapping decentralized identifiers to real-world entities
CN111373400B (en) System and method for implementing a resolver service for decentralizing identity
CN111066020B (en) System and method for creating a decentralised identity
CN111095327B (en) System and method for verifying verifiable claims
KR101974060B1 (en) Method and system for validating ownership of digital assets using distributed hash tables and peer-to-peer distributed decoys
WO2019237570A1 (en) Electronic contract signing method, device and server
US20100115260A1 (en) Universal secure token for obfuscation and tamper resistance
CN111614658A (en) Calculation force contract generation method based on block chain network, electronic device and medium
CN112671720B (en) Token construction method, device and equipment for cloud platform resource access control
JPH0816104A (en) Method and device for verifying information security with dispersed collator
CN111314172B (en) Block chain-based data processing method, device, equipment and storage medium
CN111476573B (en) Account data processing method, device, equipment and storage medium
CN110708162B (en) Resource acquisition method and device, computer readable medium and electronic equipment
CN111131336B (en) Resource access method, device, equipment and storage medium under multi-party authorization scene
CN113704357A (en) Smart city data sharing method and system based on block chain
CN115840787B (en) Block chain-based supply chain data sharing method, device, equipment and medium
CN116226289A (en) Electronic certificate management method, device, equipment and storage medium based on blockchain
CN113315745A (en) Data processing method, device, equipment and medium
CN111859431A (en) Electronic file signature method and device, electronic equipment and storage medium
CN108900472B (en) Information transmission method and device
CN107918739B (en) Data protection method and device and storage medium
CN110890979A (en) Automatic deploying method, device, equipment and medium for fortress machine
CN115085934A (en) Contract management method based on block chain and combined key and related equipment
CN113869901A (en) Key generation method, key generation device, computer-readable storage medium and computer equipment
CN109688158B (en) Financial execution chain authentication method, electronic device and storage medium

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200901

WD01 Invention patent application deemed withdrawn after publication