Contract processing method and device based on blockchain public chain
By allocating block nodes to contract data in the blockchain public chain and encrypting it, the problem of low contract modification flexibility is solved, and the contract modifiability and storage flexibility are achieved.
Patent Information
- Application Number
- CN202111334109.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-11-11
AI Technical Summary
Contract modification based on blockchain technology is low in flexibility, resulting in cumbersome operations and cannot be modified without regenerating the contract.
By allocating block nodes to the data information in the contract in the blockchain public chain, and storing and modifying it according to the contract identification and encrypted version identification, the modified contract data is ensured to be traceable and reliable in the blockchain public chain.
The contract is modifiable, avoiding the high cost and cumbersome operation caused by regenerating the contract, and improving the flexibility and diversity of contract storage.
Smart Images

Figure CN113986940B_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments relate to the field of blockchain technology, and more particularly to a contract processing method and device based on a blockchain public chain. Background Art
[0002] A contract, also known as a contract, refers to a unanimous agreement reached by multiple parties. With the development of science and technology, the processing of contracts has gradually evolved from offline processing to online processing, such as from offline manual storage to online cloud storage.
[0003] Blockchain technology can be understood as a shared database technology. The data information stored in it has security features such as "unchangeable" and "leaving traces throughout the process". Therefore, blockchain technology is widely used.
[0004] However, when contracts are stored and processed based on blockchain technology, the "unmodifiable" feature of blockchain technology means that the stored contracts cannot be modified. Therefore, when the contract needs to be modified, it is necessary to modify it to obtain a new contract, and then store the new contract again, resulting in cumbersome operations and low flexibility. Summary of the invention
[0005] The disclosed embodiments provide a contract processing method and device based on a blockchain public chain to solve the problem of low flexibility in contract modification.
[0006] In a first aspect, the present disclosure provides a contract processing method based on a blockchain public chain, including:
[0007] In response to a modification request for modifying a contract, the contract includes a plurality of data information, each of which is stored in a corresponding block node in a preset blockchain public chain, and the modification request is used to instruct to modify the first data information in the contract to the second data information, and obtain a contract identifier of the first data information and an encrypted version identifier of the first data information;
[0008] Determine a block node for storing the second data information according to the contract identifier, and store the second data information in the determined block node according to the encrypted version identifier of the first data information; wherein the determined block node and the block node in the blockchain public chain except the block node corresponding to the first data information are used to determine the modified contract.
[0009] In some embodiments, storing the second data information in the determined block node according to the encrypted version identifier of the first data information includes:
[0010] Decrypting the encrypted version identifier of the first data information to obtain a decrypted version identifier of the first data information;
[0011] The encrypted version identifier of the second data information is generated according to the decrypted version identifier of the first data information, and the second data information carrying the encrypted version identifier of the second data information is stored in the determined block node.
[0012] In some embodiments, obtaining the contract identifier of the first data information and the encrypted version identifier of the first data information includes:
[0013] In response to the modification request, obtaining a network protocol address from which an initiator initiates the modification request, a private key of the initiator, and at least a portion of a private key of a counterparty;
[0014] Based on the network protocol address, the initiator's private key, and at least part of the counterparty's private key, the initiator's modification authority is authenticated. If the authentication passes, the contract identifier of the first data information and the encrypted version identifier of the first data information are obtained.
[0015] In some embodiments, it also includes:
[0016] In response to a request to view a contract, determine, according to the request, each block node in the public blockchain for storing the contract;
[0017] Extract the data information stored in each block node. If any two data information have the same contract identifier, determine the data information before modification and the data information after modification in the two data information with the same contract identifier.
[0018] A contract is generated and fed back based on the modified data information and the unmodified data information.
[0019] In some embodiments, each data message carries an encrypted version identifier; determining the data message before modification and the data message after modification in two data messages having the same contract identifier includes:
[0020] Decrypting the encrypted version identifiers of two data information with the same contract identifier to obtain the decrypted version identifiers corresponding to the two data information with the same contract identifier;
[0021] According to the decrypted version identifiers respectively corresponding to the two data information with the same contract identifier, the data information before modification and the data information after modification in the two data information with the same contract identifier are determined.
[0022] In some embodiments, the method further comprises:
[0023] In response to a storage request for a storage contract, a contract identifier is assigned to each data information in the contract, and each data information is stored in a block node in a preset blockchain public chain according to the contract identifier of each data information.
[0024] In some embodiments, each data information is stored in a block node in a preset blockchain public chain according to the contract identifier of each data information, including:
[0025] According to the contract identifier of each data information, determine the block node used to store each data information;
[0026] A block for storing each data information is constructed in a block node storing each data information, wherein the block for storing each data information includes a block body, and the block body for storing each data information is used to store a portion of each data information representing the contract content.
[0027] In some embodiments, the block for storing each data information includes a block header, and the block header for storing each data information is used to store content representing account information and user information in each data information.
[0028] In a second aspect, the present disclosure provides a contract processing device based on a blockchain public chain, including:
[0029] An acquisition unit is used to respond to a modification request for modifying a contract, wherein the contract includes a plurality of data information, each of which is stored in a corresponding block node in a preset blockchain public chain, and the modification request is used to instruct to modify the first data information in the contract to the second data information, and obtain a contract identifier of the first data information and an encrypted version identifier of the first data information;
[0030] A first determining unit, configured to determine a block node for storing the second data information according to the contract identifier;
[0031] A first storage unit is used to store the second data information in a determined block node according to an encrypted version identifier of the first data information; wherein the determined block node and the block node in the blockchain public chain except the block node corresponding to the first data information are used to determine the modified contract.
[0032] In some embodiments, the first storage unit includes:
[0033] A first decryption subunit is used to decrypt the encrypted version identifier of the first data information to obtain a decrypted version identifier of the first data information;
[0034] a generating subunit, configured to generate an encrypted version identifier of the second data information according to the decrypted version identifier of the first data information;
[0035] The storage subunit is used to store the second data information carrying the encrypted version identifier of the second data information in the determined block node.
[0036] In some embodiments, the acquisition unit includes:
[0037] A first acquisition subunit is used to obtain, in response to the modification request, a network protocol address from which the initiator initiates the modification request, a private key of the initiator, and at least part of a private key of a counterparty;
[0038] An authentication subunit, configured to authenticate the modification authority of the initiator based on the networking protocol address, the private key of the initiator, and at least part of the private key of the counterparty;
[0039] The second acquisition subunit is used to obtain the contract identifier of the first data information and the encrypted version identifier of the first data information if the authentication is passed.
[0040] In some embodiments, it also includes:
[0041] A second determination unit is used to respond to a request for viewing a contract and determine, according to the request, each block node in the blockchain public chain for storing the contract;
[0042] An extraction unit, used to extract data information stored in each block node;
[0043] A third determining unit, configured to determine the data information before modification and the data information after modification in the two data information with the same contract identifier if any two data information have the same contract identifier;
[0044] A generating unit, configured to generate a contract according to the modified data information and the unmodified data information;
[0045] Feedback unit, used to provide feedback to the generated contract.
[0046] In some embodiments, each data message carries an encryption version identifier; the third determination unit includes:
[0047] The second decryption subunit is used to decrypt the encrypted version identifiers of the two data information with the same contract identifier to obtain the decrypted version identifiers corresponding to the two data information with the same contract identifier;
[0048] The first determining subunit is used to determine the data information before modification and the data information after modification in the two data information with the same contract identifier according to the decrypted version identifiers respectively corresponding to the two data information with the same contract identifier.
[0049] In some embodiments, the method further comprises:
[0050] an allocating unit, configured to allocate a contract identifier to each data information in the contract in response to a storage request of the storage contract;
[0051] The second storage unit is used to store each data information in a block node in a preset blockchain public chain according to the contract identifier of each data information.
[0052] In some embodiments, the second storage unit includes:
[0053] A second determination subunit is used to determine a block node for storing each piece of data information according to a contract identifier of each piece of data information;
[0054] A construction subunit is used to construct a block for storing each data information in a block node storing each data information, wherein the block for storing each data information includes a block body, and the block body for storing each data information is used to store a part of each data information representing the contract content.
[0055] In some embodiments, the block for storing each data information includes a block header, and the block header for storing each data information is used to store content representing account information and user information in each data information.
[0056] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a memory, a processor;
[0057] A memory, configured to store instructions executable by the processor;
[0058] The processor is configured to execute the method as described in the first aspect.
[0059] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0060] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0062] Figure 1 A schematic diagram of a contract processing method based on a blockchain public chain according to an embodiment of the present disclosure;
[0063] Figure 2 A schematic diagram of modifying data information in a contract processing method based on a blockchain public chain according to an embodiment of the present disclosure;
[0064] Figure 3 A schematic diagram of a contract processing method based on a blockchain public chain according to another embodiment of the present disclosure;
[0065] Figure 4 A schematic diagram of a contract processing method based on a blockchain public chain according to another embodiment of the present disclosure;
[0066] Figure 5 A schematic diagram of a contract processing device based on a blockchain public chain according to an embodiment of the present disclosure;
[0067] Figure 6 It is a schematic diagram of a contract processing device based on a blockchain public chain according to another embodiment of the present disclosure;
[0068] Figure 7 A block diagram of an electronic device for a contract processing method based on a blockchain public chain according to an embodiment of the present disclosure.
[0069] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0070] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0071] As the demand for computer networks grows, when parties (which can be two parties, three parties or more, and the parties can be enterprises, companies, individuals, etc.) enter into a contract, they usually save the contract content on paper or store it in an independent system in the computer in the form of electronic content, which is inconvenient. Moreover, as time goes by, historical data becomes redundant, and it is easy for the parties to have problems such as inconsistent contract synchronization.
[0072] Since blockchain technology has security features such as "unchangeable" and "leaving traces throughout the process" when storing data information, blockchain technology can be used to store contracts.
[0073] However, when contracts are stored and processed based on blockchain technology, the "unmodifiable" feature of blockchain technology means that the stored contracts cannot be modified. Therefore, when the contract needs to be modified, it is necessary to modify it to obtain a new contract, and then store the new contract again, resulting in cumbersome operations and low flexibility.
[0074] In order to avoid at least one of the above-mentioned technical problems, the inventors of the present disclosure, through creative work, obtained the inventive concept of the present disclosure: for the data information required in the contract, a block node is allocated to the data information, and the data information is stored based on the block node, so that the contract is determined by the data information in the block node and the data information stored in other block nodes.
[0075] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0076] See also Figure 1 , Figure 1 This is a schematic diagram of a contract processing method based on a blockchain public chain according to an embodiment of the present disclosure.
[0077] like Figure 1 As shown, the method includes:
[0078] S101: Responding to a modification request for modifying a contract, the contract includes multiple data information, each data information is stored in a corresponding block node in a preset blockchain public chain, and the modification request is used to indicate that the first data information in the contract is modified to the second data information, and obtain the contract identifier of the first data information and the encrypted version identifier of the first data information.
[0079] Exemplarily, the executor of this embodiment may be a contract processing device based on a blockchain public chain (hereinafter referred to as the contract processing device). The contract processing device may be a server (such as a local server or a cloud server), a computer, a terminal device, a processor, a chip, etc., which is not limited in this embodiment.
[0080] The modification request may be initiated by one of the parties to the contract. The "first" in the first data information is used to distinguish it from the second data information, and cannot be understood as a limitation on the content of the data information, and vice versa.
[0081] The contract identifier of the first data information is used to represent that the first data information is part of the data information in the contract corresponding to the contract identifier.
[0082] The encrypted version identifier of the first data information is used to represent the version of the first data information and is used to distinguish different versions of data information.
[0083] S102: Determine a block node for storing the second data information according to the contract identifier, and store the second data information in the determined block node according to the encrypted version identifier of the first data information. The determined block node and the block node in the blockchain public chain other than the block node corresponding to the first data information are used to determine the modified contract.
[0084] For example, Figure 2 As shown, the four data information in the contract are stored in block node A, block node B, block node C, and block node D, and the first data information is stored in block node B.
[0085] The contract processing device determines the block node E for storing the second data information, and stores the second data information in the block node E, so that the modified contract is determined by the data information in the block node A, the data information in the block node E (i.e., the second data information), the data information in the block node C, and the data information in the block node D.
[0086] Based on the above analysis, it can be seen that in this embodiment, a contract processing method based on a blockchain public chain is provided, the method comprising: responding to a modification request for modifying a contract, the contract includes multiple data information, each data information is stored in a corresponding block node in a preset blockchain public chain, the modification request is used to indicate that the first data information in the contract is modified to the second data information, the contract identifier of the first data information and the encrypted version identifier of the first data information are obtained, the block node for storing the second data information is determined according to the contract identifier, and the second data information is stored in the determined block node according to the encrypted version identifier of the first data information, wherein the determined block node and the block node in the blockchain public chain except the block node corresponding to the first data information are used to determine the modified contract, in this embodiment, the following is introduced: determining a block node for the second data information, and storing the second data information in the determined block node, so as to determine the technical features of the modified contract based on the data information in the block node (i.e., the second data information) and the data information in each block node except the block node corresponding to the first data information, thereby realizing the modifiability of the contract, avoiding the high cost and cumbersome operation process caused by regenerating the contract, and improving the flexibility and diversity of contract storage.
[0087] See also Figure 3 , Figure 3 This is a schematic diagram of a contract processing method based on a blockchain public chain according to another embodiment of the present invention.
[0088] like Figure 3 As shown, the method includes:
[0089] S301: In response to a storage request of a storage contract, a contract identifier is assigned to each data information in the contract, and each data information is stored in a block node in a preset blockchain public chain according to the contract identifier of each data information.
[0090] This embodiment does not limit the method for generating the contract identifier. For example, a snowflake algorithm may be used to determine the contract identifier of each data information.
[0091] Exemplarily, the method for determining the public blockchain can refer to the following steps:
[0092] Step 1: Construct a virtual ring.
[0093] For example, a modulo process may be performed on a preset number of virtual nodes to obtain a hash space, and a virtual ring may be generated from the hash space based on a preset hash algorithm.
[0094] The second step: determine the position of each server in the preset server cluster in the virtual ring, and obtain each block node in the blockchain public chain.
[0095] For example, the Internet Protocol (IP) address of each server may be obtained, and the IP address of each server may be hashed according to a hash algorithm (the hash algorithm described in the previous step) to obtain the position of each server in the virtual ring.
[0096] In some embodiments, according to the contract identifier of each data information, each data information is stored in a block node in a preset blockchain public chain, including the following steps:
[0097] The first step: determine the block node used to store each data information based on the contract identifier of each data information.
[0098] For example, a hash calculation is performed on the contract identifier of each data information according to the hash algorithm (the hash algorithm described in S301) to obtain a block node for storing each data information, and each data information is stored in a corresponding block node.
[0099] The second step: construct a block for storing each data information in the block node storing each data information. The block for storing each data information includes a block body, and the block body for storing each data information is used to store the part of each data information that represents the contract content.
[0100] Exemplarily, a block includes a block header and a block body. The block header stores the block's meta information, such as a pointer to an uncle block (UncleHash), which is used to point to the block content; the block header also includes root data (Root), such as the attribute information of the contract party, such as the hash value of the state number root node, which is used to represent the party's account information; the block header also includes information such as Coinbas.
[0101] The block body includes data information, that is, the specific content of the contract. For example, if the contract is a mortgage repurchase contract, the repurchase contract may include information such as the repurchase bond code, repurchase days, days of funds occupied, and counterparty. Correspondingly, a piece of data information may include one or more of the above information.
[0102] In this embodiment, by storing different information based on the block header and the block body, such as storing the contract content based on the block body and storing the user information such as account information based on the block header, the technical effect of flexibility and reliability of data information storage is achieved.
[0103] S302: Responding to a modification request for modifying a contract, the contract includes multiple data information, each data information is stored in a corresponding block node in a preset blockchain public chain, and the modification request is used to indicate that the first data information in the contract is modified to the second data information, and obtain the contract identifier of the first data information and the encrypted version identifier of the first data information.
[0104] For the implementation principle of S302, please refer to S101, which will not be repeated here.
[0105] In some embodiments, obtaining the contract identifier of the first data information and the encrypted version identifier of the first data information may include the following steps:
[0106] The first step: in response to a modification request, obtaining a network protocol address where an initiator initiates the modification request, a private key of the initiator, and at least a portion of a private key of a counterparty.
[0107] The second step: based on the network protocol address, the initiator's private key, and at least part of the counterparty's private key, the initiator's modification authority is authenticated. If the authentication is passed, the contract identifier of the first data information and the encrypted version identifier of the first data information are obtained.
[0108] That is to say, in this embodiment, it is proposed to authenticate the modification authority of the initiator by combining information of three dimensions. If the authentication is successful, it means that the initiator has the modification authority. Accordingly, the contract processing device obtains the contract identifier of the first data information and the encrypted version identifier of the first data information to modify the first data information. On the contrary, if the authentication fails, it means that the initiator does not have the modification authority, and the contract identifier of the first data information and the encrypted version identifier of the first data information are refused to be obtained, thereby avoiding erroneous modification of the first data information, that is, avoiding erroneous modification of the contract and modification by non-parties.
[0109] Among them, the three dimensions of information are: the network protocol address, the initiator's private key, and at least part of the counterparty's private key. By combining the network protocol address for authentication, it is possible to track the server, that is, to track the initiator, so as to improve the traceability of contract modifications; by combining the initiator's private key for authentication, it is possible to control the initiator's authority, prevent tampering by others, and improve the accuracy of the contract; by combining at least part of the counterparty's private key for authentication, the initiator's authority can be further locked, thereby further preventing tampering by others and improving the accuracy and reliability of the contract.
[0110] Among them, at least part of the private key of the counterparty can be part of the private key of the counterparty, for example, it can be the last two private key digits in the private key of the counterparty, and of course, it can also be the entire private key.
[0111] In some embodiments, a threshold of the number of times a contract can be modified can be preset, and when a modification request is received, the current number of modifications can be determined, and if the current number of modifications has reached the threshold, the modification request can be rejected.
[0112] S303: Decrypt the encrypted version identifier of the first data information to obtain a decrypted version identifier of the first data information.
[0113] For example, before storing the first data information, a random value, such as 123456, is assigned to the first data information, and the random value 123456 is encrypted to obtain an encrypted version identifier of the first data information, such as OLJSIJ.
[0114] S304: Generate an encrypted version identifier of the second data information according to the decrypted version identifier of the first data information, and store the second data information carrying the encrypted version identifier of the second data information in the determined block node.
[0115] For example, in combination with the above analysis, the encrypted version identifier OLJSIJ of the first data information is decrypted to obtain the decrypted version identifier 123456 of the first data information, the preset step length such as 1 is increased to the decrypted version identifier 123456 of the first data information to obtain the decrypted version identifier 123457 of the second data information, and the decrypted version identifier 123457 of the second data information is encrypted (using the same encryption method as that used to encrypt the decrypted version identifier of the first data information) to obtain the decrypted version identifier of the second data information such as IKHDKL.
[0116] In this embodiment, an encrypted version identifier of the second data information is generated based on a decrypted version identifier of the first data information, so that the data information of the modified contract can be subsequently determined based on the decrypted version identifier of the first data information and the decrypted version identifier of the second data information. There is no need for the parties to the contract to modify it offline or to re-enter the contract, which saves costs, improves efficiency, and meets the technical effects of flexibility and reliability of contract modification.
[0117] See also Figure 4 , Figure 4 This is a schematic diagram of a contract processing method based on a blockchain public chain according to another embodiment of the present invention.
[0118] like Figure 4 As shown, the method includes:
[0119] S401: In response to a request for viewing a contract, determine each block node in the blockchain public chain for storing the contract according to the request.
[0120] Among them, any party to the contract (such as the initiator or the counterparty in the above embodiment) can initiate a query request to query the contract.
[0121] Regarding the method of determining each block node, please refer to the method of determining each block node of the storage contract in the above embodiment, which will not be repeated here.
[0122] S402: extracting the data information stored in each block node, and if any two data information have the same contract identifier, determining the data information before modification and the data information after modification in the two data information with the same contract identifier.
[0123] Based on the above analysis, if a certain data information of a contract is modified, and the contract identifiers of at least two data information are the same, the data information before the modification and the data information after the modification can be determined from the at least two data information. For example, the first data information is determined to be the data information before the modification, and the second data information is determined to be the data information after the modification.
[0124] In some embodiments, each data message carries an encrypted version identifier, and determining the data message before modification and the data message after modification in two data messages having the same contract identifier may include the following steps:
[0125] The first step: decrypting the encrypted version identifiers of two data information with the same contract identifier to obtain the decrypted version identifiers corresponding to the two data information with the same contract identifier.
[0126] Step 2: Determine the data information before modification and the data information after modification in the two data information with the same contract identifier according to the decrypted version identifiers respectively corresponding to the two data information with the same contract identifier.
[0127] For example, in combination with the above embodiment, if two data information with the same contract identifier have a decrypted version identifier of 123456 for one data information and a decrypted version identifier of 123457 for the other data information, the decrypted version identifier 123456 is the data information before modification, and the decrypted version identifier 123457 is the data information after modification.
[0128] Among them, the decryption process can be referred to the above embodiment, which will not be repeated here.
[0129] S403: Generate and feedback a contract based on the modified data information and the unmodified data information.
[0130] For example, combining the above embodiments and Figure 2, based on the data information stored in block node A, block node E, block node C, and block node D, a contract can be generated and fed back, so that the contract is the latest version of the contract, thereby improving the reliability and accuracy of contract review.
[0131] It should be understood that this embodiment can be combined with any of the above embodiments to obtain a new embodiment. For example, this embodiment can be combined with the first embodiment, the second embodiment, or the first embodiment and the second embodiment. This embodiment is not limited to this.
[0132] See also Figure 5 , Figure 5 This is a schematic diagram of a contract processing device based on a blockchain public chain according to an embodiment of the present disclosure.
[0133] like Figure 5 As shown, the contract processing device 500 based on the blockchain public chain includes:
[0134] The acquisition unit 501 is used to respond to a modification request for modifying a contract, where the contract includes multiple data information, and each data information is stored in a corresponding block node in a preset blockchain public chain. The modification request is used to indicate that the first data information in the contract is modified to the second data information, and obtain the contract identifier of the first data information and the encrypted version identifier of the first data information.
[0135] The first determining unit 502 is used to determine a block node for storing the second data information according to the contract identifier.
[0136] The first storage unit 503 is used to store the second data information in a determined block node according to the encrypted version identifier of the first data information; wherein the determined block node and the block node in the blockchain public chain except the block node corresponding to the first data information are used to determine the modified contract.
[0137] See also Figure 6 , Figure 6 This is a schematic diagram of a contract processing device based on a blockchain public chain according to another embodiment of the present disclosure.
[0138] like Figure 6 As shown, the contract processing device 600 based on the blockchain public chain includes:
[0139] The allocation unit 601 is used to allocate a contract identifier to each data information in the contract in response to a storage request of the storage contract.
[0140] The second storage unit 602 is used to store each data information in a block node in a preset blockchain public chain according to the contract identifier of each data information.
[0141] Combination Figure 6 It can be seen that, in some embodiments, the second storage unit 602 includes:
[0142] The second determination subunit 6021 is used to determine the block node used to store each data information according to the contract identifier of each data information.
[0143] The construction subunit 6022 is used to construct a block for storing each data information in the block node storing each data information, wherein the block for storing each data information includes a block body, and the block body for storing each data information is used to store the part of each data information that represents the contract content.
[0144] In some embodiments, the block for storing each data information includes a block header, and the block header for storing each data information is used to store content representing account information and user information in each data information.
[0145] The acquisition unit 603 is used to respond to a modification request for modifying a contract, where the contract includes multiple data information, and each data information is stored in a corresponding block node in a preset blockchain public chain. The modification request is used to indicate that the first data information in the contract is modified to the second data information, and obtain the contract identifier of the first data information and the encrypted version identifier of the first data information.
[0146] Combination Figure 6 It can be seen that, in some embodiments, the acquisition unit 603 includes:
[0147] The first acquisition subunit 6031 is used to obtain, in response to the modification request, the network protocol address from which the initiator initiates the modification request, the private key of the initiator, and at least part of the private key of the counterparty;
[0148] An authentication subunit 6032 is used to authenticate the modification authority of the initiator based on the networking protocol address, the private key of the initiator, and at least part of the private key of the counterparty;
[0149] The second acquisition subunit 6033 is used to acquire the contract identifier of the first data information and the encrypted version identifier of the first data information if the authentication is passed.
[0150] The first determining unit 604 is used to determine the block node for storing the second data information according to the contract identifier.
[0151] The first storage unit 605 is used to store the second data information in a determined block node according to the encrypted version identifier of the first data information; wherein the determined block node and the block node in the blockchain public chain except the block node corresponding to the first data information are used to determine the modified contract.
[0152] Combination Figure 6 It can be seen that, in some embodiments, the first storage unit 605 includes:
[0153] The first decryption subunit 6051 is used to decrypt the encrypted version identifier of the first data information to obtain the decrypted version identifier of the first data information.
[0154] The generating subunit 6052 is used to generate the encrypted version identifier of the second data information according to the decrypted version identifier of the first data information.
[0155] The storage subunit 6053 is used to store the second data information carrying the encrypted version identifier of the second data information in the determined block node.
[0156] The second determination unit 606 is used to respond to a request for viewing a contract and determine, according to the request, each block node in the blockchain public chain for storing the contract.
[0157] The extraction unit 607 is used to extract the data information stored in each block node.
[0158] The third determining unit 608 is configured to determine the data information before modification and the data information after modification in the two data information with the same contract identifier if any two data information have the same contract identifier.
[0159] In some embodiments, each data message carries an encrypted version identifier; Figure 6 It can be seen that the third determining unit 608 includes:
[0160] The second decryption subunit 6081 is used to decrypt the encrypted version identifiers of two data information with the same contract identifier to obtain the decrypted version identifiers corresponding to the two data information with the same contract identifier;
[0161] The first determining subunit 6082 is used to determine the data information before modification and the data information after modification in the two data information with the same contract identifier according to the decrypted version identifiers respectively corresponding to the two data information with the same contract identifier.
[0162] The generating unit 609 is used to generate a contract according to the modified data information and the unmodified data information.
[0163] The feedback unit 610 is used to provide feedback on the generated contract.
[0164] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0165] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, the program product includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0166] like Figure 7 As shown, it is a block diagram of an electronic device according to a contract processing method based on a blockchain public chain according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0167] like Figure 7 As shown, the electronic device includes: one or more processors 701, a memory 702, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 701 is taken as an example.
[0168] The memory 702 is a non-transient computer-readable storage medium provided by the present disclosure. The memory stores instructions executable by at least one processor to enable the at least one processor to execute the blockchain-based public chain contract processing method provided by the present disclosure. The non-transient computer-readable storage medium of the present disclosure stores computer instructions, which are used to enable a computer to execute the blockchain-based public chain contract processing method provided by the present disclosure.
[0169] The memory 702 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the blockchain-based public chain contract processing method in the embodiment of the present disclosure. The processor 701 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 702, that is, realizing the blockchain-based public chain contract processing method in the above method embodiment.
[0170] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of an electronic device based on a blockchain public chain contract processing method, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely disposed relative to the processor 701, and these remote memories may be connected to an electronic device based on a blockchain public chain contract processing method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0171] The electronic device of the contract processing method based on the blockchain public chain may also include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0172] The input device 703 can receive input digital or character information, and generate key signal input related to user settings and function control of electronic devices based on the blockchain public chain contract processing method, such as touch screen, keypad, mouse, trackpad, touchpad, indicator rod, one or more mouse buttons, trackball, joystick and other input devices. The output device 704 may include a display device, an auxiliary lighting device (e.g., LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0173] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0174] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0175] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0176] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0177] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0178] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0179] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A contract processing method based on a blockchain public chain, comprising: In response to a modification request for modifying a contract, the contract includes a plurality of data information, each of which is stored in a corresponding block node in a preset blockchain public chain, and the modification request is used to instruct to modify the first data information in the contract to the second data information, and obtain a contract identifier of the first data information and an encrypted version identifier of the first data information; Determine a block node for storing the second data information according to the contract identifier, and store the second data information in the determined block node according to the encrypted version identifier of the first data information; wherein the determined block node and the block node in the blockchain public chain except the block node corresponding to the first data information are used to determine the modified contract; Storing the second data information in the determined block node according to the encrypted version identifier of the first data information includes: Decrypting the encrypted version identifier of the first data information to obtain a decrypted version identifier of the first data information; Generate an encrypted version identifier of the second data information according to the decrypted version identifier of the first data information, and store the second data information carrying the encrypted version identifier of the second data information in the determined block node; wherein obtaining the contract identifier of the first data information and the encrypted version identifier of the first data information includes: In response to the modification request, obtaining a network protocol address from which an initiator initiates the modification request, a private key of the initiator, and at least a portion of a private key of a counterparty; Based on the network protocol address, the initiator's private key, and at least part of the counterparty's private key, the initiator's modification authority is authenticated. If the authentication passes, the contract identifier of the first data information and the encrypted version identifier of the first data information are obtained.
2. The method according to claim 1, further comprising: In response to a request to view a contract, determine, according to the request, each block node in the public blockchain for storing the contract; Extract the data information stored in each block node. If any two data information have the same contract identifier, determine the data information before modification and the data information after modification in the two data information with the same contract identifier. A contract is generated and fed back based on the modified data information and the unmodified data information.
3. The method according to claim 2, wherein: Each data message carries an encrypted version identifier; determining the data message before modification and the data message after modification in two data messages having the same contract identifier includes: Decrypting the encrypted version identifiers of two data information with the same contract identifier to obtain the decrypted version identifiers corresponding to the two data information with the same contract identifier; According to the decrypted version identifiers respectively corresponding to the two data information with the same contract identifier, the data information before modification and the data information after modification in the two data information with the same contract identifier are determined.
4. The method according to any one of claims 1 to 3, further comprising: In response to a storage request for a storage contract, a contract identifier is assigned to each data information in the contract, and each data information is stored in a block node in a preset blockchain public chain according to the contract identifier of each data information.
5. The method according to claim 4, wherein: According to the contract identifier of each data information, each data information is stored in a block node in the preset blockchain public chain, including: According to the contract identifier of each data information, determine the block node used to store each data information; A block for storing each data information is constructed in a block node storing each data information, wherein the block for storing each data information includes a block body, and the block body for storing each data information is used to store a portion of each data information representing the contract content.
6. The method according to claim 5, wherein: The block used to store each piece of data information includes a block header, and the block header used to store each piece of data information is used to store content representing account information and user information in each piece of data information.
7. A contract processing device based on a blockchain public chain, comprising: An acquisition unit, configured to respond to a modification request for modifying a contract, wherein the contract includes a plurality of data information, each of which is stored in a corresponding block node in a preset blockchain public chain, and the modification request is used to instruct to modify the first data information in the contract to the second data information, and to obtain a contract identifier of the first data information and an encrypted version identifier of the first data information; A first determining unit, configured to determine a block node for storing the second data information according to the contract identifier; A first storage unit is used to store the second data information in a determined block node according to the encrypted version identifier of the first data information; wherein the determined block node and the block node in the blockchain public chain except the block node corresponding to the first data information are used to determine the modified contract; The first storage unit is specifically used for: Decrypting the encrypted version identifier of the first data information to obtain a decrypted version identifier of the first data information; Generate an encrypted version identifier of the second data information according to the decrypted version identifier of the first data information, and store the second data information carrying the encrypted version identifier of the second data information in the determined block node; The acquisition unit is specifically used for: In response to the modification request, obtaining a network protocol address from which an initiator initiates the modification request, a private key of the initiator, and at least a portion of a private key of a counterparty; Based on the network protocol address, the initiator's private key, and at least part of the counterparty's private key, the initiator's modification authority is authenticated. If the authentication passes, the contract identifier of the first data information and the encrypted version identifier of the first data information are obtained.
8. An electronic device comprising: Memory, processor; A memory, configured to store instructions executable by the processor; The processor is configured to execute the method as claimed in any one of claims 1 to 6.
9. A computer program product, comprising a computer program, which implements the steps of the method according to any one of claims 1 to 6 when executed by a processor.
Citation Information
Patent Citations
Information processing method and apparatus of a block chain, information processing node, and storage medium
CN109034832A
Data modification method, apparatus, equipment and medium for block chain
CN109213900A
Data storage method and data query method and device
CN109670321A
Blacklist multi-party cross validation and sharing method and system
CN111899019A
Domain name distribution and management method and system based on public blockchain
CN113329106A
