CN110602227B - Intelligent contract management method and related device - Google Patents

Intelligent contract management method and related device Download PDF

Info

Publication number
CN110602227B
CN110602227B CN201910888431.9A CN201910888431A CN110602227B CN 110602227 B CN110602227 B CN 110602227B CN 201910888431 A CN201910888431 A CN 201910888431A CN 110602227 B CN110602227 B CN 110602227B
Authority
CN
China
Prior art keywords
intelligent
intelligent contract
contract
target event
contracts
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910888431.9A
Other languages
Chinese (zh)
Other versions
CN110602227A (en
Inventor
王颖涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910888431.9A priority Critical patent/CN110602227B/en
Publication of CN110602227A publication Critical patent/CN110602227A/en
Application granted granted Critical
Publication of CN110602227B publication Critical patent/CN110602227B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • 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
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • 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
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a method for managing an intelligent contract and a related device, which receive an operation instruction of a target event and determine the target event; then acquiring a first intelligent contract corresponding to the target event; traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in incidence relation with the first intelligent contract; and then the first intelligent contract and the plurality of second intelligent contracts are called to cooperatively trigger the operation on the target event, so that the automatic calling process of the intelligent contract is realized, the plurality of intelligent contracts used for judging the target event can be quickly called, and the calling efficiency and operability of the intelligent contract are improved.

Description

Intelligent contract management method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and a related apparatus for intelligent contract management.
Background
The birth of the block chain technology really opens up a channel for enabling digital credit, and the intelligent contract has irreplaceable function as an important asset in the block chain. The intelligent contracts are deployed on the blockchain and are basic units of distributed applications, and the distributed applications can be regarded as a group of interconnected intelligent contracts which can together facilitate the implementation of high-level functions. As a large company is made up of many different departments, the modules together yield a "whole is greater than a partial sum" benefit. The distributed application is realized by deploying a set of intelligent contracts through a blockchain layer and then interacting with the intelligent contracts.
The current conventional blockchain system intelligent contracts include a federation chain represented by a super ledger, in which an intelligent contract is installed and instantiated individually at each node and invoked when a relevant decision process is required to be performed.
However, each node is independently installed and instantiated with an intelligent contract, and the operation is complicated; and when the complexity of the target event is higher, the target event needs to be completed in a mode of cooperation among a plurality of intelligent contracts, and at the moment, a large amount of time needs to be consumed for independent installation, so that the efficiency of calling the intelligent contracts is influenced.
Disclosure of Invention
In view of this, a first aspect of the present application provides an intelligent contract management method, which may be applied in an operation process of a super ledger system or an application of other alliance chain intelligent contract management, and specifically includes: receiving an operation instruction of a target event, and determining the target event, wherein the target event is an operation example in a block link point;
acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event;
traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in incidence relation with the first intelligent contract;
invoking the first intelligent contract and a plurality of the second intelligent contracts to cooperatively trigger an operation on the target event.
Preferably, in some possible implementations of the present application, traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts having an association relationship with the first intelligent contract, includes:
determining a characteristic element in the first intelligent contract, the characteristic element being set based on contract code, the contract code being a stored form of the first intelligent contract in the database;
traversing a contract set which has an association relation with the feature elements in the database according to the feature elements;
and determining a plurality of second intelligent contracts with incidence relations in the contract set according to the first intelligent contracts.
Preferably, in some possible implementations of the present application, the determining the feature element in the first intelligent contract includes:
acquiring a first intelligent contract corresponding to the target event;
determining version information of the first intelligent contract, wherein the version information is identification information indicating the first intelligent contract;
the determining a plurality of second intelligent contracts with incidence relations in the contract set according to the first intelligent contract comprises the following steps:
traversing the database according to the version information of the first intelligent contract to determine a plurality of second intelligent contracts which have an association relation with the first intelligent contract and correspond to the version information.
Preferably, in some possible implementations of the present application, the method further includes:
determining a plurality of version information corresponding to the first intelligent contract, wherein the version information is used for indicating the updated identification information of the first intelligent contract;
and respectively storing the first intelligent contracts according to the version information, and storing the corresponding second intelligent contracts to obtain a plurality of intelligent contract sets, wherein the intelligent contract sets are used for indicating the triggering processes of the target events under different version information.
Preferably, in some possible implementations of the present application, the receiving an operation instruction of a target event and determining the target event includes:
receiving an operation instruction of a target event;
determining the corresponding block chain node according to the operation instruction;
and determining the target event according to the characteristics of the block chain nodes.
Preferably, in some possible implementations of the present application, after determining the corresponding block link point according to the operation command, the method further includes:
determining a corresponding block chain node according to the operation instruction;
and determining a trigger operation corresponding to the block link point, wherein the trigger operation is used for indicating a judgment object after the first intelligent contract and the plurality of second intelligent contracts are called.
Preferably, in some possible implementation manners of the present application, the management method of the intelligent contract is applied to a terminal device, and the terminal device is a block node device in a block chain node.
A second aspect of the present application provides an apparatus for intelligent contract management, comprising: the receiving unit is used for receiving an operation instruction of a target event and determining the target event, wherein the target event is an operation example in a block link point;
the acquisition unit is used for acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event;
the traversing unit is used for traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which have incidence relations with the first intelligent contract;
and the calling unit is used for calling the first intelligent contract and the plurality of second intelligent contracts so as to cooperatively trigger the operation on the target event.
Preferably, in some possible implementations of the present application, the traversal unit is specifically configured to determine a feature element in the first intelligent contract, where the feature element is set based on a contract code, and the contract code is a storage form of the first intelligent contract in the database;
the traversal unit is specifically configured to traverse, according to the feature element, a contract set in the database, where an association relationship exists between the feature element and the contract set;
the traversal unit is specifically configured to determine, according to the first intelligent contract, a plurality of second intelligent contracts in the contract set, where an association exists.
Preferably, in some possible implementation manners of the present application, the traversal unit is specifically configured to obtain a first intelligent contract corresponding to the target event;
the traversal unit is specifically configured to determine version information of the first intelligent contract, where the version information is identification information indicating the first intelligent contract;
the traversal unit is specifically configured to traverse the database according to the version information of the first intelligent contract to determine that the plurality of second intelligent contracts which have an association relationship with the first intelligent contract and correspond to the version information.
Preferably, in some possible implementation manners of the present application, the traversal unit is further configured to determine a plurality of pieces of version information corresponding to the first intelligent contract, where the version information is used to indicate identification information of the updated first intelligent contract;
the traversal unit is further configured to store the first intelligent contract according to the multiple pieces of version information, and store the corresponding multiple pieces of second intelligent contract to obtain multiple intelligent contract sets, where the intelligent contract sets are used to indicate triggering processes of the target events under different pieces of version information.
Preferably, in some possible implementations of the present application, the receiving unit is specifically configured to receive an operation instruction of a target event;
the receiving unit is specifically configured to determine the corresponding block chain node according to the operation instruction;
the receiving unit is specifically configured to determine the target event according to the characteristics of the blockchain node.
Preferably, in some possible implementation manners of the present application, the receiving unit is further configured to determine a corresponding block chain node according to the operation instruction;
the receiving unit is further configured to determine a trigger operation corresponding to the block link point, where the trigger operation is used to indicate a determination object after the first intelligent contract and the plurality of second intelligent contracts are invoked.
Preferably, in some possible implementation manners of the present application, the management method of the intelligent contract is applied to a terminal device, and the terminal device is a block node device in a block chain node.
A third aspect of the present application provides a computer-readable storage medium having stored therein instructions, which, when executed on a computer, cause the computer to perform the method for intelligent contract management according to the first aspect or any one of the first aspects.
A fourth aspect of the present application provides a computer device comprising: a memory, a processor, and a bus system; the memory is used for storing program codes; the processor is configured to execute the method for intelligent contract management according to any one of the first aspect or the first aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
the method comprises the steps that an operation instruction of a target event is received, and the target event is determined, wherein the target event is an operation example in a block link point; then acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event; traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in incidence relation with the first intelligent contract; and then the first intelligent contract and the plurality of second intelligent contracts are called to cooperatively trigger the operation on the target event, so that the automatic calling process of the intelligent contract is realized, the plurality of intelligent contracts used for judging the target event can be quickly called, and the calling efficiency and operability of the intelligent contract are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a diagram of the network architecture for operation of a federation chain system;
FIG. 2 is a system architecture diagram of intelligent contract management;
FIG. 3 is a flow chart of a method for intelligent contract management provided by an embodiment of the present application;
FIG. 4 is a flow chart of another method for intelligent contract management provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of an interface display for intelligent contract management according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an intelligent contract management apparatus provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of another intelligent contract management apparatus provided in an embodiment of the present application;
fig. 8A is a schematic diagram of a data sharing system according to an embodiment of the present application;
fig. 8B is a block composition diagram of a data sharing system according to an embodiment of the present application;
fig. 8C is a schematic diagram of a data transmission response of a blockchain node according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides an intelligent contract management method and a related device, which can be applied to the running process of a super account book system or other intelligent contract management application of a alliance chain, specifically, by receiving an operation instruction of a target event and determining the target event, wherein the target event is an operation example in a block link point; then acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event; traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in incidence relation with the first intelligent contract; and then the first intelligent contract and the plurality of second intelligent contracts are called to cooperatively trigger the operation on the target event, so that the automatic calling process of the intelligent contract is realized, the plurality of intelligent contracts used for judging the target event can be quickly called, and the calling efficiency and operability of the intelligent contract are improved.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "corresponding" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that the intelligent contract management method provided by the present application may be applied to an operation process of a federation chain system in a block chain, specifically, the federation chain system may operate in a network architecture as shown in fig. 1, which is a network architecture diagram of the operation of the federation chain system as shown in fig. 1. And the client submits a transaction proposal to the endorsement node, and when enough endorsements are collected, the transaction is broadcasted to the sequencing service node for sequencing to generate a block. Then the endorsement node executes the transaction and signs the endorsement on the result, namely, the appointed node executes the transaction and returns a yes/no response process to the client application program generating the transaction proposal; the endorsement node is a dynamic role and is bound with specific chain codes, and each chain code can set an endorsement strategy when being instantiated to specify effective transaction endorsements of a specific node. After receiving the response result, the client submits the transaction to the sequencing node, the sequencing service node receives the transaction containing the endorsement signature, sequences the unpacked transaction to generate a block, and broadcasts the block to other nodes, wherein the accounting node also receives the block broadcast, the accounting node is responsible for verifying the transaction in the block received from the sequencing service node, and then submits (writes/appends) the block to a copy of a channel account book of the block, and the accounting node also marks each transaction in each block as valid or invalid.
The intelligent contract management method can be applied to endorsement nodes or checkout nodes and operated as an independent device (plug-in) or program, a user can input YAML configuration through a control console to indicate a specific intelligent contract type, when a calling request of a first intelligent contract is received, a plurality of second intelligent contracts with incidence relations are traversed in an intelligent contract database by analyzing codes of the first intelligent contract, and then the judgment process of target time is completed cooperatively; in addition, the user can also perform installation, instantiation or upgrading operation on the related intelligent contracts according to the requirement, and can edit the related operation through docker.
It can be understood that the federation chain system may run on a personal mobile terminal, may run on a server, and may also run on a third-party device to provide intelligent contract management for determining related events; the specific alliance chain system may be operated in the device in a program form, may also be operated as a system component in the device, and may also be operated as one of cloud service programs, and a specific operation mode is determined according to an actual scene, and is not limited herein.
The birth of the block chain technology really opens up a channel for enabling digital credit, and the intelligent contract has irreplaceable function as an important asset in the block chain. The intelligent contracts are deployed on the blockchain and are basic units of distributed applications, and the distributed applications can be regarded as a group of interconnected intelligent contracts which can together facilitate the implementation of high-level functions. As a large company is made up of many different departments, the modules together yield a "whole is greater than a partial sum" benefit. The distributed application is realized by deploying a set of intelligent contracts through a blockchain layer and then interacting with the intelligent contracts.
The current conventional blockchain system intelligent contracts include a federation chain represented by a super ledger, in which an intelligent contract is installed and instantiated individually at each node and invoked when a relevant decision process is required to be performed.
However, each node is independently installed and instantiated with an intelligent contract, and the operation is complicated; and when the complexity of the target event is higher, the target event needs to be completed in a mode of cooperation among a plurality of intelligent contracts, and at the moment, a large amount of time needs to be consumed for independent installation, so that the efficiency of calling the intelligent contracts is influenced.
In order to solve the above problem, the present application provides a method for intelligent contract management, which is applied to a system framework of intelligent contract management shown in fig. 2, as shown in fig. 2, the method is a system framework diagram of intelligent contract management, and the diagram includes a task layer, an intelligent contract dependent management layer, and a block chain interface layer; the task layer is used for constructing the intelligent contract, upgrading the intelligent contract periodically or regularly, and loading the correlation process of the intelligent contract and the related events; the intelligent contract dependence management layer is used for intelligent contract dependence analysis, namely determining a plurality of second intelligent contracts with incidence relations according to the first intelligent contract, and is also used for importing a new intelligent contract and an upgrading process of the incidence relations of the related intelligent contracts; the block chain interface layer is used for the installation, instantiation and upgrading processes of the intelligent contract, so that the related node can call the intelligent contract conveniently.
It should be understood that, the task layer, the intelligent contract dependency management layer, and the block chain interface layer are used as examples for description, and specifically, the intelligent contract management system may be divided based on other functional division structures, where a specific division form is determined according to an actual scenario and is not limited herein.
It can be understood that the method provided by the present application may be a program written as a processing logic in a hardware system, or may be an intelligent contract management device, and the processing logic is implemented in an integrated or external manner. The intelligent contract management device receives an operation instruction of a target event and determines the target event, wherein the target event is an operation example in a block link point; then acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event; traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in incidence relation with the first intelligent contract; and then the first intelligent contract and the plurality of second intelligent contracts are called to cooperatively trigger the operation on the target event, so that the automatic calling process of the intelligent contracts is realized, the plurality of intelligent contracts used for judging the target event can be quickly called, and the calling efficiency of the intelligent contracts is improved.
With reference to the above flow architecture, the following describes a method for intelligent contract management in the present application, please refer to fig. 3, where fig. 3 is a flow chart of a method for intelligent contract management according to an embodiment of the present application, and the embodiment of the present application at least includes the following steps:
301. receiving an operation instruction of a target event, and determining the target event.
In this embodiment, the target event is an operation instance in a block chain node, specifically, the target event is an event that is determined based on an intelligent contract in a federation chain, and the specific application includes a super ledger.
Optionally, since the corresponding determination process of the target event in different block link points may be different, for example, in the endorsement node, the smart contract is used to determine whether to execute the transaction proposal; in the accounting node, the intelligent contract is used to determine the validity of the transaction event. Specifically, firstly, receiving an operation instruction of a target event; then, the corresponding block chain node is determined according to the operation instruction, for example: an endorsement node or a billing node; and then determining the target event according to the characteristics of the blockchain nodes.
Correspondingly, after the target event is determined, the operation executed by the block chain node corresponding to the target event is used as a judgment object or a trigger object after the intelligent contract is called subsequently.
302. And acquiring a first intelligent contract corresponding to the target event.
In this embodiment, the first intelligent contract is related to triggering the operation on the target event, and since the determination process on the target event generally relates to a cooperation process of a plurality of intelligent contracts, and the plurality of intelligent operations have a logical association in determination, here, the first intelligent contract may be any one of the plurality of intelligent contracts related to the determination process on the target event, or may be a specific intelligent contract input by a user through a console.
303. And traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in association with the first intelligent contract.
In this embodiment, the database is a code set of the intelligent contract, that is, the database includes all code sets of the intelligent contract for determining the target event, so that the association relationship between the intelligent contracts can be obtained by analyzing the relevant codes of the intelligent contracts.
Specifically, the process of determining a plurality of second intelligent contracts may first determine a characteristic element in the first intelligent contract, the characteristic element being set based on a contract code, the contract code being a storage form of the first intelligent contract in the database; then traversing a contract set which has an incidence relation with the characteristic elements in the database according to the characteristic elements; and then determining a plurality of second intelligent contracts with incidence relations in the contract set according to the first intelligent contracts. For example: the intelligent contracts can be registered by binary number columns, the characteristic element of the first intelligent contract is number column 00101, and a plurality of intelligent contracts related to the number column are traversed in the database and determined to be the second intelligent contract.
In a possible scenario, since a user can update an intelligent contract, different versions of the intelligent contract may be generated, and to be suitable for the scenario, a first intelligent contract corresponding to the target event may be obtained first; then determining version information of the first intelligent contract, wherein the version information is identification information indicating the first intelligent contract; and determines a second intelligent contract having the same version information.
It is understood that the version information may be set on a time-to-time basis, i.e., updating the version information in real time; or the method can be based on the root of the trigger condition, namely, new version information is generated when the user revises the trigger condition; or based on the updating process of the fixed time slot, namely the version information is stored in the fixed preset time slot and generates the corresponding version information; in addition, a plurality of intelligent contracts generated by the version information can be installed and instantiated according to the respective version information, so that calling can be conveniently carried out when needed.
304. Invoking the first intelligent contract and a plurality of the second intelligent contracts to cooperatively trigger an operation on the target event.
In this embodiment, the first intelligent contract and the plurality of second intelligent contracts are intelligent contracts installed and instantiated on corresponding nodes, that is, for each blockchain node, an associated intelligent contract set may be automatically imported to cooperatively trigger an operation on the target event.
With reference to the foregoing embodiments, an operation instruction of a target event is received, and the target event is determined, where the target event is an operation instance in a block link point; then acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event; traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in incidence relation with the first intelligent contract; and then the first intelligent contract and the plurality of second intelligent contracts are called to cooperatively trigger the operation on the target event, so that the automatic calling process of the intelligent contract is realized, the plurality of intelligent contracts used for judging the target event can be quickly called, and the calling efficiency and operability of the intelligent contract are improved.
The foregoing embodiment describes a combining process of two granularities, but in practical applications, a more granularity may also be used, which is described below, as shown in fig. 4, where fig. 4 is a flowchart of another method for intelligent contract management provided by the embodiment of the present application, and the embodiment of the present application at least includes the following steps:
401. receiving an operation instruction of a target event, and determining the target event.
402. And acquiring a first intelligent contract corresponding to the target event.
In this embodiment, steps 401-402 are similar to step 301-302 in fig. 3, and specific description may be referred to, which is not repeated herein.
403. Version information for the first smart contract is determined.
In this embodiment, the version information may be set based on time, that is, the version information is updated in real time; or the method can be based on the root of the trigger condition, namely, new version information is generated when the user revises the trigger condition; or an updating process based on a fixed time period, that is, the version information is stored for a fixed preset time period and corresponding version information is generated.
404. And respectively storing the first intelligent contracts according to different versions of information.
In this embodiment, the first intelligent contracts under different versions of information do not interfere with each other, for example: the user upgrades the first intelligent contract, and the first intelligent contracts with different versions are generated at the moment, and are respectively stored before and after the upgrade, and corresponding version information is set.
405. And respectively determining a plurality of second intelligent contracts which have association relations with the first intelligent contract according to the first intelligent contract traversal database under different version information, and storing the second intelligent contracts in a classified manner.
In this embodiment, based on the first intelligent contracts under different version information, the plurality of second intelligent contracts corresponding to the first intelligent contracts are associated and stored in a classified manner.
In a possible scenario, the second intelligent contract is updated, and the first intelligent contract is not updated, and at this time, the corresponding first intelligent contract can be grabbed according to the updated second intelligent contract to be packaged and stored.
It is understood that the updating process of the smart contract includes upgrading, parameter revising, triggering condition modifying, etc., and the specific form depends on the actual scene, which is not limited herein.
406. And calling the first intelligent contract and the plurality of second intelligent contracts which accord with the current version information according to the operation instruction.
In this embodiment, step 406 is similar to step 304 in fig. 3, and the detailed description may be referred to, which is not repeated herein.
The situations of iteration and updating possibly exist in the using process of the intelligent contract are classified and stored, so that refined control conditions such as real-time updating, condition triggering updating, timing updating and the like of the intelligent contract can be realized through all event services by the intelligent contract management device.
In a possible display manner, the display manner as described in fig. 5 may be adopted, and fig. 5 is a schematic view of an interface display of intelligent contract management provided in an embodiment of the present application. The interface may include a decision process for multiple events, and an intelligent divisor for designing a collaborative decision; the user can click on the detail to know the version number of the intelligent contract of each event judged by each user and the type of the specific first intelligent contract, and obtain the association code for associating the second intelligent contract. It should be noted that the form, version form and associated code of the smart contract in the figure are for illustration, and the specific form depends on the actual scenario and is not limited herein.
It is understood that the parameters or steps designed in the above embodiments can be displayed in the interface, and are not limited herein.
In order to better implement the above-mentioned aspects of the embodiments of the present application, the following also provides related apparatuses for implementing the above-mentioned aspects. Referring to fig. 6, fig. 6 is a schematic structural diagram of an intelligent contract management apparatus according to an embodiment of the present application, where the intelligent contract management apparatus 600 includes:
a receiving unit 601, configured to receive an operation instruction of a target event, and determine the target event, where the target event is an operation instance in a block link point;
an obtaining unit 602, configured to obtain a first intelligent contract corresponding to the target event, where the first intelligent contract is related to triggering an operation on the target event;
a traversing unit 603, configured to traverse a database according to the first intelligent contract to determine a plurality of second intelligent contracts having an association relationship with the first intelligent contract;
a calling unit 604, configured to call the first intelligent contract and the plurality of second intelligent contracts to cooperatively trigger an operation on the target event.
Preferably, in some possible implementations of the present application, the traversing unit 603 is specifically configured to determine a feature element in the first intelligent contract, where the feature element is set based on a contract code, and the contract code is a storage form of the first intelligent contract in the database;
the traversing unit 603 is specifically configured to traverse, according to the feature element, a contract set in the database, where an association relationship exists between the contract set and the feature element;
the traversing unit 603 is specifically configured to determine, according to the first intelligent contract, a plurality of second intelligent contracts in the contract set, where the second intelligent contracts have an association relationship.
Preferably, in some possible implementation manners of the present application, the traversing unit 603 is specifically configured to obtain a first intelligent contract corresponding to the target event;
the traversing unit 603 is specifically configured to determine version information of the first intelligent contract, where the version information is identification information indicating the first intelligent contract;
the traversing unit 603 is specifically configured to traverse the database according to the version information of the first intelligent contract, so as to determine a plurality of second intelligent contracts which have an association relationship with the first intelligent contract and correspond to the version information.
Preferably, in some possible implementation manners of the present application, the traversing unit 603 is further configured to determine a plurality of version information corresponding to the first intelligent contract, where the version information is used to indicate identification information of the updated first intelligent contract;
the traversal unit 603 is further configured to store the first intelligent contract according to the multiple pieces of version information, and store the corresponding multiple second intelligent contracts, so as to obtain multiple intelligent contract sets, where the intelligent contract sets are used to indicate triggering processes of the target events under different pieces of version information.
Preferably, in some possible implementations of the present application, the receiving unit 601 is specifically configured to receive an operation instruction of a target event;
the receiving unit 601 is specifically configured to determine the corresponding blockchain node according to the operation instruction;
the receiving unit 601 is specifically configured to determine the target event according to the characteristics of the blockchain node.
Preferably, in some possible implementation manners of the present application, the receiving unit 601 is further configured to determine a corresponding blockchain node according to the operation instruction;
the receiving unit 601 is further configured to determine a trigger operation corresponding to the block link point, where the trigger operation is used to indicate a determination object after the first smart contract and the plurality of second smart contracts are invoked.
Preferably, in some possible implementation manners of the present application, the management method of the intelligent contract is applied to a terminal device, and the terminal device is a block node device in a block chain node.
The method comprises the steps that an operation instruction of a target event is received, and the target event is determined, wherein the target event is an operation example in a block link point; then acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event; traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts which are in incidence relation with the first intelligent contract; and then the first intelligent contract and the plurality of second intelligent contracts are called to cooperatively trigger the operation on the target event, so that the automatic calling process of the intelligent contract is realized, the plurality of intelligent contracts used for judging the target event can be quickly called, and the calling efficiency and operability of the intelligent contract are improved.
Referring to fig. 7, fig. 7 is a schematic structural diagram of another intelligent contract management apparatus provided in this embodiment, where the intelligent contract management apparatus 700 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 722 (e.g., one or more processors) and a memory 732, and one or more storage media 730 (e.g., one or more mass storage devices) storing an application 742 or data 744. Memory 732 and storage medium 730 may be, among other things, transient storage or persistent storage. The program stored in the storage medium 730 may include one or more modules (not shown), each of which may include a series of instructions operating on the intelligent contract management apparatus. Further, the central processor 722 may be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the intelligent contract management apparatus 700.
The smart contract management apparatus 700 may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input-output interfaces 758, and/or one or more operating systems 741, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
The steps performed by the intelligent contract management apparatus in the above-described embodiment may be based on the structure of the intelligent contract management apparatus shown in fig. 7.
Also provided in embodiments of the present application is a computer-readable storage medium having intelligent contract management instructions stored therein, which when executed on a computer, cause the computer to perform the steps performed by the intelligent contract management apparatus in the methods described in the foregoing embodiments of fig. 2-5.
Also provided in embodiments of the present application is a computer program product comprising intelligent contract management instructions that, when executed on a computer, cause the computer to perform the steps performed by the intelligent contract management apparatus in the method described in the embodiments of fig. 2-5 above.
Embodiments of the present application also provide an intelligent contract management system, which may include the intelligent contract management apparatus in the embodiment described in fig. 6 or the intelligent contract management apparatus described in fig. 7.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an intelligent contract management apparatus, or a network device) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In addition, the method and apparatus for intelligent contract management may also be applied to a data sharing system, see the data sharing system shown in fig. 8A, where the data sharing system 800 refers to a system for performing data sharing between nodes, the data sharing system may include a plurality of nodes 801, and the plurality of nodes 801 may refer to respective clients in the data sharing system, where each client operates on a corresponding terminal device based on the method of the present application. Each node 801 may receive input information and maintain shared data within the data sharing system based on the received input information while operating normally. In order to ensure information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and information transmission can be carried out between the nodes through the information connection. For example, when an arbitrary node in the data sharing system receives input information, other nodes in the data sharing system acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all the nodes in the data sharing system are consistent.
Each node in the data sharing system has a node identifier corresponding thereto, and each node in the data sharing system may store a node identifier of another node in the data sharing system, so that the generated block is broadcast to the other node in the data sharing system according to the node identifier of the other node in the following. Each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an Internet Protocol (IP) address and any other information that can be used to identify the node, and only the IP address is used as an example in table 1.
TABLE 1 node and node identification correspondence
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Each node in the data sharing system stores one identical blockchain. The block chain is composed of a plurality of blocks, as shown in fig. 8B, the block chain is composed of a plurality of blocks, the starting block includes a block header and a block main body, the block header stores an input information characteristic value, version information, a timestamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version information, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
When each block in the block chain is generated, referring to fig. 8C, when the node where the block chain is located receives the input information, the input information is verified, after the verification is completed, the input information is stored in the memory pool, and the hash tree for recording the input information is updated; and then, updating the updating time stamp to the time when the input information is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.
Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block head and the block main body are generated to obtain the current block. And then, the node where the block chain is located respectively sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identifications of the other nodes in the data sharing system, the newly generated blocks are verified by the other nodes, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (9)

1. A method of intelligent contract management, comprising:
receiving an operation instruction of a target event, and determining the target event, wherein the target event is an operation example in a block link point;
acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event;
traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts having association relations with the first intelligent contract, wherein the database is a code set of the intelligent contracts, the database comprises code sets of all intelligent contracts used for judging the target event, and the association relations are association relations among the intelligent contracts obtained by analyzing related codes of the intelligent contracts;
invoking the first intelligent contract and a plurality of the second intelligent contracts to cooperatively trigger an operation on the target event;
traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts having an association relationship with the first intelligent contract, comprising:
determining a characteristic element in the first intelligent contract, the characteristic element being set based on contract code, the contract code being a stored form of the first intelligent contract in the database;
traversing a contract set which has an association relation with the feature elements in the database according to the feature elements;
and determining a plurality of second intelligent contracts with incidence relations in the contract set according to the first intelligent contracts.
2. The method of claim 1, wherein determining the feature element in the first intelligent contract comprises:
acquiring a first intelligent contract corresponding to the target event;
determining version information of the first intelligent contract, wherein the version information is identification information indicating the first intelligent contract;
the determining a plurality of second intelligent contracts with incidence relations in the contract set according to the first intelligent contract comprises the following steps:
traversing the database according to the version information of the first intelligent contract to determine a plurality of second intelligent contracts which have an association relation with the first intelligent contract and correspond to the version information.
3. The method of claim 2, further comprising:
determining a plurality of version information corresponding to the first intelligent contract, wherein the version information is used for indicating the updated identification information of the first intelligent contract;
and respectively storing the first intelligent contracts according to the version information, and storing the corresponding second intelligent contracts to obtain a plurality of intelligent contract sets, wherein the intelligent contract sets are used for indicating the triggering processes of the target events under different version information.
4. The method according to any one of claims 1-3, wherein the receiving an operation instruction of a target event and determining the target event comprises:
receiving an operation instruction of a target event;
determining the corresponding block chain node according to the operation instruction;
and determining the target event according to the characteristics of the block chain nodes.
5. The method of claim 4, wherein after determining the corresponding block link point according to the operating instruction, the method further comprises:
determining a corresponding block chain node according to the operation instruction;
and determining a trigger operation corresponding to the block link point, wherein the trigger operation is used for indicating a judgment object after the first intelligent contract and the plurality of second intelligent contracts are called.
6. The method according to claim 4, wherein the management method of the intelligent contract is applied to a terminal device, and the terminal device is a block node device in a block chain node.
7. An intelligent contract management apparatus, comprising:
the receiving unit is used for receiving an operation instruction of a target event and determining the target event, wherein the target event is an operation example in a block link point;
the acquisition unit is used for acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event;
the traversing unit is used for traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts having association relations with the first intelligent contract, the database is a code set of the intelligent contract, the database comprises code sets of all the intelligent contracts used for judging the target event, and the association relations are association relations among the intelligent contracts obtained by analyzing related codes of the intelligent contracts;
the calling unit is used for calling the first intelligent contract and the plurality of second intelligent contracts so as to cooperatively trigger the operation on the target event;
the traversal unit is specifically configured to:
determining a characteristic element in the first intelligent contract, the characteristic element being set based on contract code, the contract code being a stored form of the first intelligent contract in the database;
traversing a contract set which has an association relation with the feature elements in the database according to the feature elements;
and determining a plurality of second intelligent contracts with incidence relations in the contract set according to the first intelligent contracts.
8. A computer-readable storage medium having instructions stored therein which, when executed on a computer, cause the computer to perform the intelligent contract management method of any of claims 1-6 above.
9. A computer device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of:
receiving an operation instruction of a target event, and determining the target event, wherein the target event is an operation example in a block link point;
acquiring a first intelligent contract corresponding to the target event, wherein the first intelligent contract is related to triggering the operation on the target event;
traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts having association relations with the first intelligent contract, wherein the database is a code set of the intelligent contracts, the database comprises code sets of all intelligent contracts used for judging the target event, and the association relations are association relations among the intelligent contracts obtained by analyzing related codes of the intelligent contracts;
invoking the first intelligent contract and a plurality of the second intelligent contracts to cooperatively trigger an operation on the target event;
traversing a database according to the first intelligent contract to determine a plurality of second intelligent contracts having an association relationship with the first intelligent contract, comprising:
determining a characteristic element in the first intelligent contract, the characteristic element being set based on contract code, the contract code being a stored form of the first intelligent contract in the database;
traversing a contract set which has an association relation with the feature elements in the database according to the feature elements;
and determining a plurality of second intelligent contracts with incidence relations in the contract set according to the first intelligent contracts.
CN201910888431.9A 2019-09-19 2019-09-19 Intelligent contract management method and related device Active CN110602227B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910888431.9A CN110602227B (en) 2019-09-19 2019-09-19 Intelligent contract management method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910888431.9A CN110602227B (en) 2019-09-19 2019-09-19 Intelligent contract management method and related device

Publications (2)

Publication Number Publication Date
CN110602227A CN110602227A (en) 2019-12-20
CN110602227B true CN110602227B (en) 2021-11-23

Family

ID=68861367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910888431.9A Active CN110602227B (en) 2019-09-19 2019-09-19 Intelligent contract management method and related device

Country Status (1)

Country Link
CN (1) CN110602227B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221904A (en) * 2019-12-23 2020-06-02 深圳壹账通智能科技有限公司 Intelligent contract deployment and execution method and device, electronic equipment and storage medium
CN111797106B (en) * 2020-06-24 2023-09-01 北京荷月科技有限公司 Contract authority setting method and system compatible with multi-version contract parallelism
CN112153023B (en) * 2020-09-11 2021-05-25 北京天德科技有限公司 Multi-intelligent contract system platform based on intelligent contract library
CN111857892B (en) 2020-09-22 2020-12-18 支付宝(杭州)信息技术有限公司 Method and device for processing service through block chain

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2017239154A1 (en) * 2016-03-21 2018-11-15 Commonwealth Scientific And Industrial Research Organisation Business process execution on a blockchain platform
CN108062672B (en) * 2017-12-07 2022-03-18 北京泛融科技有限公司 Flow scheduling method based on block chain intelligent contract
CN108876610A (en) * 2018-05-31 2018-11-23 深圳市零度智控科技有限公司 Intelligent contract implementation method, user equipment, storage medium and device
CN108830720B (en) * 2018-06-21 2021-04-30 北京京东尚科信息技术有限公司 Intelligent contract running method, device, system and computer readable storage medium
CN109191287B (en) * 2018-06-27 2020-08-04 浙江超脑时空科技有限公司 Block chain intelligent contract fragmentation method and device and electronic equipment
CN109376541A (en) * 2018-09-21 2019-02-22 上海点融信息科技有限责任公司 For running the method, apparatus and computer storage medium of intelligent contract
CN110188097A (en) * 2019-04-19 2019-08-30 阿里巴巴集团控股有限公司 The storage of intelligent contract, execution method and device and electronic equipment in block chain

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
《Blockchain Studio: A Role-Based Business Workflows Management System》;Lucie Mercenne; Kei-Leo Brousmiche; Elyes Ben Hamida;《IEEE》;20190117;全文 *
《Medrec: Using blockchain for medical data access and permission management》;A. Azaria, A. Ekblaw, T. Vieira and A. Lippman;《IEEE》;20161231;全文 *
《基于区块链的智能合约技术与应用综述》;贺海武; 延安; 陈泽华;《计算机研究与发展》;20181115;全文 *
《智能合约:架构及进展》;欧阳丽炜,袁勇,倪晓春,王飞跃;《自动化学报》;20190315;全文 *

Also Published As

Publication number Publication date
CN110602227A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
CN110602227B (en) Intelligent contract management method and related device
CN108156236B (en) Service request processing method and device, computer equipment and storage medium
CN108132830B (en) Task scheduling method, device and system
CN110830234B (en) User traffic distribution method and device
CN108492005B (en) Project data processing method and device, computer equipment and storage medium
CN110445828B (en) Data distributed processing method based on Redis and related equipment thereof
CN103810045A (en) Resource allocation method, resource manager, resource server and system
CN112579692B (en) Data synchronization method, device, system, equipment and storage medium
CN112559635B (en) Service processing method, device, equipment and medium for Ethernet alliance chain node
CN110852559A (en) Resource allocation method and device, storage medium and electronic device
CN114282011B (en) Knowledge graph construction method and device, and graph calculation method and device
CN112307105A (en) Timing task running method, device, equipment and storage medium based on multithreading
US8224933B2 (en) Method and apparatus for case-based service composition
CN113608751B (en) Operation method, device and equipment of reasoning service platform and storage medium
WO2021013185A1 (en) Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium
CN109727040B (en) Data publishing method, data calling method, device and storage medium
CN115578180A (en) Bank outlet cash resource management method and device
CN112685360B (en) Method and device for persistence of memory data, storage medium and computer equipment
CN112270539A (en) Multi-transaction task account data synchronization method, system and storage medium
CN107463374B (en) Subset model extraction method and system based on inheritance and association automatic deduction
CN111258879A (en) Service test scheduling method and device based on page acquisition and intelligent terminal
CN116501345A (en) Method and device for generating software update plan and electronic equipment
CN116701410B (en) Method and system for storing memory state data for data language of digital networking
CN110059125B (en) Method for invoking proxy contract and related equipment
CN108008966B (en) Resource updating method and system

Legal Events

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