CN114968422A - Method and device for automatically executing contracts based on variable state - Google Patents

Method and device for automatically executing contracts based on variable state Download PDF

Info

Publication number
CN114968422A
CN114968422A CN202210600436.9A CN202210600436A CN114968422A CN 114968422 A CN114968422 A CN 114968422A CN 202210600436 A CN202210600436 A CN 202210600436A CN 114968422 A CN114968422 A CN 114968422A
Authority
CN
China
Prior art keywords
callback
contract
variable
list
transaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210600436.9A
Other languages
Chinese (zh)
Inventor
刘晓建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210600436.9A priority Critical patent/CN114968422A/en
Publication of CN114968422A publication Critical patent/CN114968422A/en
Priority to PCT/CN2022/135342 priority patent/WO2023231342A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4498Finite state machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/107Computer-aided management of electronic mailing [e-mailing]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The embodiment of the specification provides a method and a device for automatically executing contracts based on variable states. One embodiment of the method comprises: determining that the state of a first variable of a target type is changed according to an execution result of a target transaction, wherein the target transaction calls a first contract; determining whether a callback list for the first variable is included in a contract state of the first contract, wherein a callback item in the callback list comprises information of a callback contract and a callback parameter; and executing the callback contract based on the callback parameter of the callback item in the callback list in response to determining that the callback list comprises the callback for the first variable.

Description

Method and device for automatically executing contracts based on variable state
Technical Field
The embodiment of the specification belongs to the technical field of block chains, and particularly relates to a method and a device for automatically executing contracts based on variable states.
Background
The Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. In the block chain system, data blocks are combined into a chain data structure in a sequential connection mode according to a time sequence, and a distributed account book which is not falsifiable and counterfeitable is ensured in a cryptographic mode. Because the blockchain has the characteristics of decentralization, information non-tampering, autonomy and the like, the blockchain is also paid more and more attention and is applied by people.
A blockchain can be understood as a distributed state machine: all nodes start from the same creation state, sequentially run transactions in the blocks which achieve consensus, drive the states of all nodes to change continuously according to the same operation sequence (adding, deleting and modifying), and realize that the states of all nodes are consistent after the transactions in the blocks with the same number are executed, and the state is called as a world state. Various information such as account balance, intelligent contract byte codes, data defined by each intelligent contract, configuration parameters of a chain and the like are recorded in the world state. The world state represents the current state, i.e. the current value of each recorded state data. In some application scenarios of the blockchain, it is sometimes necessary to perform some preset operations according to values of some variables in the world state, for example, in a privacy calculation process based on the blockchain, the values of some variables in the world state are required to meet certain operating conditions (for example, enough data usage authorization is collected) before a corresponding privacy calculation can be started. For the scenes, how to sense the change of the variable in the world state in time and efficiently execute the preset operation based on the change of the variable in the world state have important practical significance and value.
Disclosure of Invention
One or more embodiments of the present specification describe a method and apparatus for automatically executing contracts based on variable states.
According to a first aspect, there is provided a method for automatically executing contracts based on variable states, the method comprising: determining that the state of a first variable of a target type is changed according to an execution result of a target transaction, wherein the target transaction calls a first contract; determining whether a callback list for the first variable is included in a contract state of the first contract, wherein a callback item in the callback list comprises information of a callback contract and a callback parameter; and executing the callback contract based on the callback parameter of the callback item in the callback list in response to determining that the callback list comprises the callback for the first variable.
According to a second aspect, there is provided an apparatus for automatically executing a contract based on a variable state, the apparatus comprising: the first determining unit is configured to determine that the state of a first variable of a target type is changed according to an execution result of a target transaction, wherein the target transaction calls a first contract; a second determining unit, configured to determine whether a callback list for the first variable is included in the contract state of the first contract, wherein a callback item in the callback list includes information of a callback contract and a callback parameter; and the execution unit is configured to respond to the callback list which contains the first variable and execute the callback contract based on the callback parameter of the callback item in the callback list.
According to a third aspect, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method as described in any one of the implementations of the first aspect.
According to a fourth aspect, there is provided a node of a blockchain, comprising a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method as described in any implementation manner of the first aspect.
According to the method and the device for automatically executing the contract based on the variable state, when the contract definition variable is used, the type of the variable which can affect the execution of the preset operation after the state is changed can be declared as the target type, wherein the first variable of the target type can be defined through the first contract. The node of the blockchain can firstly determine that the state of the first variable of the target type is changed according to the execution result of the target transaction, and then determine whether a callback list aiming at the first variable is included in the contract state of the first contract, wherein a callback item in the callback list comprises information of a callback contract and a callback parameter. If the contract state of the first contract is determined to contain the callback list aiming at the first variable, the callback contract is executed based on the callback parameter of the callback item in the callback list, and the preset operation can be executed based on the callback contract, so that the state change of the target type variable in the world state is sensed in time, and the preset operation is automatically executed based on the state change of the target type variable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and it is obvious for a person skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 illustrates a block chain architecture diagram in one embodiment;
FIG. 2 shows a schematic diagram of one application scenario in which embodiments of the present specification may be applied;
FIG. 3 illustrates a flow diagram of a method for automatically executing a contract based on variable state, according to one embodiment;
FIG. 4 illustrates a flow diagram of one example of registering a callback entry for a first variable;
FIG. 5 is a flow diagram illustrating an example of deregistering a callback entry for a first variable;
FIG. 6 illustrates a schematic block diagram of an apparatus for automatically executing a contract based on variable state according to one embodiment.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
To further illustrate the blockchain technique, FIG. 1 illustrates a blockchain architecture diagram in one embodiment. In the block chain architecture diagram shown in fig. 1, for example, 6 nodes are included in the block chain 100. The lines between the nodes schematically represent P2P (Peer-to-Peer) connections. The nodes may have a full ledger stored on them, i.e. the status of all blocks and all accounts. Wherein each node in the blockchain can generate the same state in the blockchain by performing the same transaction, and each node in the blockchain can store the same state database. It is to be understood that although fig. 1 illustrates 6 nodes included in the blockchain, embodiments of the present specification are not limited thereto and may include other numbers of nodes. Specifically, the nodes included in the block chain can meet the Byzantine Fault Tolerance (BFT) requirement. The byzantine fault tolerance requirement can be understood as that byzantine nodes can exist in a block chain, and the block chain does not show the byzantine behavior to the outside. Generally, some Byzantine Fault-tolerant algorithms require the number of nodes to be greater than 3f +1, where f is the number of Byzantine nodes, such as the practical Byzantine Fault-tolerant algorithm pbft (practical Byzantine Fault tolerance).
A transaction in the blockchain domain may refer to a unit of task that is performed in the blockchain and recorded in the blockchain. The transaction typically includes a send field (From), a receive field (To), and a Data field (Data). Where the transaction is a transfer transaction, the From field indicates the account address From which the transaction was initiated (i.e. the transfer task To another account was initiated), the To field indicates the account address From which the transaction was received (i.e. the transfer was received), and the Data field includes the transfer amount. In the case of a transaction calling an intelligent contract in a blockchain, the From field represents the account address From which the transaction was initiated, the To field represents the account address of the contract called by the transaction, and the Data field includes the name of the function in the calling contract, and Data such as incoming parameters To the function, for use in retrieving the code of the function From the blockchain and executing the code of the function when the transaction is executed.
The block chain may provide the functionality of an intelligent contract. An intelligent contract on a blockchain is a contract that can be executed by a transaction trigger on the blockchain system. An intelligent contract may be defined in the form of code. Calling the intelligent contract in the Ethernet workshop initiates a transaction pointing to the intelligent contract address, so that each node in the Ethernet workshop runs the intelligent contract code in a distributed mode. It should be noted that, in addition to the creation of the smart contracts by the users, the smart contracts may also be set by the system in the creation block. Such contracts are generally referred to as foundational contracts. In general, the data structure, parameters, attributes and methods of some blockchains may be set in the startup contract. Further, an account with system administrator privileges may create a contract at the system level, or modify a contract at the system level (simply referred to as a system contract). Wherein the system contract is usable to add data structures for different services in a blockchain.
In the scenario of contract deployment, for example, Bob sends a transaction containing information to create an intelligent contract (i.e., a deployment contract) into the blockchain as shown in fig. 1, the data field of the transaction includes the code (e.g., bytecode or machine code) of the contract to be created, and the to field of the transaction is null to indicate that the transaction is for contract deployment. After the agreement is achieved among the nodes through a consensus mechanism, a contract address '0 x6f8ae93 …' of the contract is determined, each node adds a contract account corresponding to the contract address of the intelligent contract in a state database, allocates a state storage corresponding to the contract account, and stores a contract code in the state storage of the contract, so that the contract creation is successful.
In the scenario of invoking a contract, for example, Bob sends a transaction for invoking a smart contract into the blockchain as shown in fig. 1, where the from field of the transaction is the address of the account of the transaction initiator (i.e., Bob), and "0 x6f8ae93 …" in the to field represents the address of the invoked smart contract, and the data field of the transaction includes the method and parameters for invoking the smart contract. After the transaction is identified in the blockchain, each node in the blockchain may execute the transaction separately, thereby executing the contract separately, and updating the state database based on the execution of the contract.
As described above, in some application scenarios of blockchains, it is sometimes necessary to perform preset operations according to the values of certain variables in the world state. For example, in a block chain-based privacy computation process, enough data usage authorization needs to be collected to start a workflow contract corresponding to the privacy computation operation. For this reason, in one scheme, the data authorization adding function of the workflow contract corresponding to the privacy computation needs to check whether the required data access authorization is obtained after the authorization is added based on the transaction, and actively start the workflow contract in the execution process of the transaction with the identity of the workflow initiator after the authorization meets the requirement. The scheme needs to write the logic for automatically starting the workflow contract according to the authorization adding condition into the contract body, is not flexible enough and cannot meet the unexpected functional requirement during the contract development. And upgrading contracts to extend their capabilities may also involve auditing of the relevant aspects. According to another scheme, the blockchain supports an authorization state obtained by a transaction query workflow contract, the external part of the workflow initiator calls a query interface regularly, and after the workflow contract is determined to obtain enough authorization, the workflow initiator sends a transaction start workflow. The scheme needs to inquire the authorization state through transactions periodically by the outside in a polling mode, lacks real-time performance and also causes higher energy consumption in calculation.
To this end, embodiments of the present specification provide a method for automatically executing a contract based on a variable state, thereby implementing sensing of a state change of a variable in a world state in time and automatically executing a preset operation based on the change of the variable state.
As shown in fig. 2, fig. 2 is a schematic diagram illustrating an application scenario to which the embodiment of the present specification may be applied, and the application scenario may be a scenario in which privacy calculation is performed based on a blockchain. In this scenario, after the authorized number of data usage reaches a certain amount, corresponding privacy calculation may be started. That is, the value of the variable N1 representing the amount of authorized data affects the execution of the privacy-computation-corresponding operation after being changed, and therefore, when the variable N1 is defined by the contract C1, the type of the variable N1 is declared as the target type, and the information of the variable N1 is stored in the contract state of the contract C1. As an example, a user may be allowed to query the state of a variable of a target type in the world state.
The node of the blockchain may receive a transaction Tx1 sent by the caller B for registering a callback item, the transaction Tx1 may invoke a contract C1, and the transaction Tx1 may include a variable name of the variable N1, a callback parameter of the callback contract, and information of the callback contract (e.g., a contract address of the callback contract). In this example, the callback contract may be used to determine whether the variable N1 at the current time exceeds a preset number threshold, and when the variable N1 exceeds the preset number threshold, the workflow contract for performing privacy computation is invoked to perform relevant privacy computation operations. The nodes of the blockchain may execute a transaction Tx1, adding a callback entry in a callback list preset for variable N1, where the callback entry may include information of the callback contract, the account of caller B, and the callback parameters of the callback contract. As an example, a list of callbacks to which variable N1 corresponds may be stored in the contract state of contract C1.
In this way, the data owner a may send a target transaction for chaining authorization information to the nodes of the blockchain, which may invoke the contract C1. The nodes of the blockchain may receive and execute the target transaction sent by the data owner a and determine that the state of the variable N1 of the target type is changed according to the execution result of the target transaction. At this point, the node of the blockchain may determine in the contract state of the contract C1 whether to include a callback list for the variable N1, and the callback entries in the callback list may include information of the callback contract and callback parameters. If the contract state of the contract C1 includes a callback list for the variable N1, a callback contract is executed based on a callback parameter of a callback item in the callback list, the callback contract may determine whether the value of the variable N1 at the current time exceeds a preset number threshold, and if so, a workflow contract for performing privacy computation is invoked to perform relevant privacy computation operations. Therefore, the change of the variable N1 is sensed in time, and the workflow contract corresponding to the privacy calculation is automatically called based on the change of the world state of the variable N1 to perform the privacy calculation operation. The method does not need to specify the action to be executed after the world state of the variable N1 is changed in the contract body of the workflow contract corresponding to the privacy calculation, and the calling party B customizes the workflow contract in a callback item registration mode, so that the method has flexibility. In addition, the method does not need to use a polling mode to inquire the value of the variable N1 through transactions periodically from the outside, and energy consumption is saved.
With continued reference to FIG. 3, FIG. 3 illustrates a flowchart of a method for automatically executing a contract based on variable state, according to one embodiment. It will be appreciated that the method may be performed by a node of a blockchain, which may be implemented by any device, apparatus, cluster of devices, etc. having computing, processing capabilities.
As shown in FIG. 3, the method for automatically executing contracts based on variable states may include the following steps:
step 301, determining that the state of the first variable of the target type changes according to the execution result of the target transaction.
In this embodiment, the node of the blockchain may receive and execute a target transaction sent by a user, and after the target transaction is executed, the node of the blockchain may determine that the state of the first variable of the target type is changed according to an execution result of the target transaction. That is, the result of the execution of the target transaction changes the state of the first variable of the target type in the world state. Here, the first variable of the target type may be previously defined by the first contract, and when the first variable is defined by the first contract, the type of the first variable may be declared as the target type, and information of the first variable (e.g., a variable value, a variable name, an attribute, and the like) may be stored in a contract state of the first contract. The target transaction may invoke the first contract to change a variable value of a first variable recorded in a contract state of the first contract.
In order to automatically perform the preset operation after the state of the first variable is changed, the user may register a callback item for the first variable in a callback list preset for the first variable, wherein the callback list for the first variable may be stored in a contract state of the first contract. Here, the user may be a caller who calls the callback contract. In this way, the node of the blockchain may automatically execute the callback contract based on the state of the first variable in the current world state, for example, when it is determined that the state of the first variable in the contract state of the first contract changes after a certain transaction is executed, a callback item in a callback list registered by the user for the first variable in advance may be invoked.
In some alternative implementations, as shown in FIG. 4, FIG. 4 illustrates a flow diagram of one example of registering a callback entry for a first variable. In the example shown in FIG. 4, a callback entry may be registered for the first variable by:
s401, a caller of the callback contract may send a first transaction for registering a callback item to the blockchain.
In this implementation, the first transaction may include a variable name of the first variable, information of the callback contract, and a callback parameter of the callback contract. Here, the information of the callback contract may include a code of the callback contract, an address of the callback contract, and the like. The callback parameters may refer to parameters used when invoking the callback contract. In practice, the caller may set a callback parameter of the callback contract according to actual service needs, and define a corresponding service logic in the callback contract, that is, define an operation to be correspondingly executed for a state change of the first variable. For example, in a business scenario of the privacy computation, assuming that the first variable is a data access authorization amount in the privacy computation, the callback contract may be used to determine whether the data access authorization amount at the current time exceeds a preset number threshold, and when the data access authorization amount exceeds the number threshold, a preset workflow contract is invoked, which may be used to perform operations related to the privacy computation. Specifically, a contract address of a workflow contract corresponding to the privacy computation and a business logic of the workflow contract corresponding to the privacy computation may be defined in the callback contract, for example, the business logic may be the workflow contract corresponding to the workflow contract calling the privacy computation when the amount of authorized data exceeds a preset value. For another example, in a service scenario of sending an email according to the account balance of the account, a service logic of sending the email may be defined in the callback contract, for example, the service logic may be to automatically send a preset content email to a mailbox corresponding to the account when the account balance is less than a preset value.
A node of the blockchain may receive a first transaction sent by a caller to register a callback item, which may invoke a first contract.
S403, the node of the blockchain may execute the first transaction, and add a callback item in a callback list preset for the first variable.
In this implementation, a node of the blockchain may execute the first transaction, invoke the first contract, and add a callback item in a callback list preset for the first variable, where the callback item may include information of the callback contract, an account of the caller, a callback parameter of the callback contract, and so on. Wherein the callback list for the first variable may be stored in a contract state of the first contract. It will be appreciated that the callback list will not be set for the first variable until a caller registers a callback entry for the first variable. If no caller registers a callback item for the first variable, or the callback item registered for the first variable is logged out after registration, the callback list may not be set for the first variable. Through the implementation mode, the caller can set the callback item aiming at the first variable according to the actual service requirement, and defines the operation to be executed aiming at the state change of the first variable in the callback contract included in the callback item. The present method provides flexibility by registering a callback entry to customize the operation to be performed when the state of the first variable changes without modifying other existing contracts related to the business.
In some alternative implementations, as shown in FIG. 5, FIG. 5 illustrates a flow diagram of one example of logging out a callback entry for a first variable. In the example shown in fig. 5, the caller may also unregister the callback entry registered for the first variable by:
s501, the caller of the callback contract may send a second transaction to the blockchain for deregistering the callback item.
In this implementation, the second transaction may include the caller's account and the variable name of the first variable.
The node of the blockchain may receive a second transaction sent by the caller to deregister the callback item, which may invoke the first contract.
S503, the node of the blockchain may execute the second transaction, and delete the callback item containing the account of the caller in the callback list corresponding to the first variable.
In this implementation, a node of the blockchain may execute the second transaction to invoke the first contract, and delete the callback item including the account of the caller in the callback list corresponding to the first variable. Specifically, the node of the blockchain may search a callback list for the first variable in the contract state of the first contract according to the variable name of the first variable included in the second transaction, and then delete the callback item including the account of the caller from the searched callback list. Through the implementation mode, the calling party can delete the callback item which is set aiming at the first variable before according to the actual service requirement, so that the flexible setting of the callback item is realized.
At step 302, it is determined whether a callback list for a first variable is included in a contract state of a first contract.
In this embodiment, after determining that the state of the first variable of the target type has changed according to the execution result of the target transaction, the node of the blockchain may determine whether a callback list for the first variable is included in the contract state of the first contract. The callback list may include a callback item, and the callback item may include information of a callback contract, a callback parameter, and the like.
Step 303, in response to determining that the callback list for the first variable is included, executing the callback contract based on the callback parameter of the callback item in the callback list.
In this embodiment, if a node of the blockchain determines that a callback list for the first variable is included in the contract state of the first contract, the node of the blockchain may execute the callback contract based on the callback parameters of the callback entries in the callback list. In practice, the callback list for the first variable may include one or more callback entries, for example, a callback entry registered by a caller, and multiple callback entries registered by multiple callers.
In some optional implementations, executing the callback contract based on the callback parameter of the callback item in the callback list in step 303 may specifically be performed as follows: and after the target transaction is executed, executing a callback contract corresponding to the information of the callback contract included in the callback item based on the callback parameter of the callback item in the callback list. By the implementation mode, the callback contract corresponding to the callback item contained in the callback list of the first variable can be immediately executed after the target transaction is executed.
In other alternative implementations, the target transaction may be a transaction in a target block, the target block may be a consensus block, and the target block may include one or more transactions. And executing the callback contract based on the callback parameter of the callback item in the callback list in step 303, which may be specifically performed as follows:
first, a node of the block chain may determine whether a plurality of transactions included in the target block at the current time are performed.
Second, in response to determining that the transaction contained in the target block at the current time is not completed, the variable name of the first variable may be added to a preset to-be-called list.
Then, in response to determining that the transaction contained in the target block at the current moment is executed, after the variable name of the first variable is added to the to-be-called list, the corresponding callback contract and the callback parameter are determined from the callback item of the callback list corresponding to the variable based on the variable name contained in the to-be-called list, and the corresponding callback contract is called through the determined callback parameter.
In this implementation, if the target block in which the target transaction is located includes multiple transactions, the node of the block chain may determine whether all the multiple transactions in the target block at the current time are executed. If the multiple transactions in the target block are not all executed, the variable name of the first variable may be added to a preset to-be-called list, and in practice, the to-be-called list may include variable names of one or more target types of variables. If the execution of the multiple transactions in the target block is completed, the corresponding callback contract may be executed according to the variable name of at least one variable included in the to-be-called list after the variable name of the first variable is added to the to-be-called list. Taking the first variable as an example, the node of the block chain may query the callback list of the first variable from the contract state of the first contract according to the variable name of the first variable, then determine the corresponding callback contract and callback parameter from the callback item of the callback list of the first variable, and call the corresponding callback contract through the determined callback parameter. By the implementation mode, the callback contract can be executed after the multiple transactions in the target block are executed, so that the execution flexibility of the callback contract is improved.
Optionally, the nodes of the blockchain may also sort callback items corresponding to variable names included in the to-be-called list. For example, a node of the blockchain may first obtain a callback item in a callback list of a variable corresponding to a variable name in a to-be-called list, and then may sort the obtained call items in various ways, for example, randomly sort. After the callback items corresponding to the variable names in the list to be called are sorted, the nodes of the block chain can execute the callback items according to the sorting result sequence, and specifically, for a certain callback item, the corresponding callback contract can be called based on the callback parameter of the callback item.
As one example, the callback entry in the callback list of variables of the target type may include a callback priority in addition to information of the callback contract, callback parameters, and the like. As an example, the callback priority may be set by the caller at the time the callback entry is registered. For example, the caller may set a fee willing to be paid for executing a callback contract when registering a callback entry, the higher the priority the fee is paid for. That is, the nodes of the blockchain may prioritize the callback entries based on the pay-per-view level. Based on this, sorting callback items corresponding to variable names included in the to-be-called list may be specifically performed as follows: and sequencing the callback items corresponding to the variable names in the list to be called according to the callback priorities of the callback items corresponding to the variable names in the list to be called. For example, the callback priorities may be ordered from high to low. According to the implementation mode, the execution sequence of the callback item corresponding to the variable name in the list to be called can be controlled based on the callback priority of the callback item.
As another example, the above sorting of the callback items corresponding to the variable names included in the to-be-called list may be specifically performed as follows:
first, hash may be calculated according to a callback contract and a callback party account of a callback item corresponding to each variable name in a to-be-called list, and a block number of a target block where a target transaction is located. It is understood that, in practice, the information used for calculating the hash may also be determined according to actual needs, and is not limited to the use of the callback contract, the callback party account, and the block number. For example, the hash may be computed using the callback contract and the callback party account. Also for example, a hash may be computed using a callback contract, a callback party account, registration time of a callback item, and the like.
And then, sequencing callback items corresponding to the variable names contained in the list to be called according to the Hash calculation result. For example, the hash calculation results may be sorted in order from big to small or from small to big. According to the implementation mode, the execution sequence of the callback items corresponding to the variable names in the list to be called can be determined based on Hash calculation.
Referring back to the above process, in the embodiment of the present specification, when a contract definition variable is used, a type of a first variable that may affect execution of a preset operation after a state change may be declared as a target type, where the first variable of the target type may be defined by a first contract. The node of the blockchain can firstly determine that the state of the first variable of the target type is changed according to the execution result of the target transaction, and then determine whether a callback list aiming at the first variable is included in the contract state of the first contract, wherein a callback item in the callback list comprises information of a callback contract and a callback parameter. If the contract state of the first contract is determined to contain the callback list aiming at the first variable, the callback contract is executed based on the callback parameter of the callback item in the callback list, and the preset operation can be executed based on the callback contract, so that the state change of the target type variable in the world state is sensed in time, and the preset operation is automatically executed based on the state change of the target type variable.
According to an embodiment of another aspect, an apparatus for automatically executing contracts based on variable states is provided. The above-mentioned apparatus for automatically executing contracts based on variable states may be deployed at nodes of a blockchain, and the nodes of the blockchain may be implemented by any apparatus, device cluster, etc. having computing and processing capabilities.
FIG. 6 illustrates a schematic block diagram of an apparatus for automatically executing a contract based on variable state according to one embodiment. As shown in fig. 6, the apparatus 600 for automatically executing a contract based on a variable state includes: a first determining unit 601 configured to determine that a state of a first variable of a target type is changed according to an execution result of a target transaction, wherein the target transaction invokes a first contract; a second determining unit 602, configured to determine whether a callback list for the first variable is included in the contract state of the first contract, where a callback item in the callback list includes information of a callback contract and a callback parameter; the execution unit 603 is configured to execute a callback contract based on a callback parameter of a callback item in the callback list in response to determining that the callback list includes the callback for the first variable.
In some optional implementations of this embodiment, the apparatus 600 further includes: a first receiving unit (not shown in the figure), configured to receive a first transaction sent by a calling party for registering a callback item, the first transaction calling the first contract, wherein the first transaction includes a variable name of the first variable, a callback parameter of the callback contract, and information of the callback contract; an adding unit (not shown in the figure) configured to execute the first transaction, and add a callback item in a callback list preset for the first variable, wherein the callback item includes information of the callback contract, an account of the caller, and the callback parameter.
In some optional implementations of this embodiment, the apparatus 600 further includes: a second receiving unit (not shown in the figure), configured to receive a second transaction sent by the caller for deregistering the callback item, the second transaction invoking the first contract, wherein the second transaction includes a variable name of the first variable; a deleting unit (not shown in the figure) configured to execute the second transaction, and delete the callback item including the account of the calling party in the callback list corresponding to the first variable.
In some optional implementations of this embodiment, the executing unit 603 is further configured to: and executing a callback contract based on the callback parameter of the callback item in the callback list after the target transaction is executed.
In some optional implementations of this embodiment, the target transaction is a transaction in a target block, and the executing unit 603 includes: a variable name adding module (not shown in the figure) configured to add the variable name of the first variable to a preset list to be called in response to determining that the transaction contained in the target block is not completed at the current time; and a contract invoking module (not shown in the figure) configured to, in response to determining that the transaction execution included in the target block at the current time is completed, after adding the variable name of the first variable to the to-be-invoked list, determine, based on the variable name included in the to-be-invoked list, a corresponding callback contract and a callback parameter from a callback item of the callback list of the corresponding variable, and invoke the corresponding callback contract through the determined callback parameter.
In some optional implementations of this embodiment, the apparatus 600 further includes: and a sorting module (not shown in the figure) configured to sort the callback items corresponding to the variable names included in the to-be-called list.
In some optional implementations of this embodiment, the callback item further includes a callback priority, and the sorting module is further configured to: and sequencing the callback items corresponding to the variable names in the list to be called according to the callback priorities of the callback items corresponding to the variable names in the list to be called.
In some optional implementations of this embodiment, the sorting module is further configured to: calculating hash according to the callback contract and the callback party account of the callback item corresponding to each variable name in the list to be called and the block number of the target block where the target transaction is located; and sequencing callback items corresponding to the variable names contained in the list to be called according to the Hash calculation result.
In some optional implementation manners of this embodiment, the first variable is a data access authorization amount in the privacy calculation, and the callback contract is used to determine whether the data access authorization amount at the current time exceeds a preset number threshold, and when the data access authorization amount exceeds the number threshold, a preset workflow contract is invoked, where the workflow contract is used to perform operations related to the privacy calculation.
According to an embodiment of another aspect, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method described in fig. 3.
According to another embodiment of the present invention, there is also provided a node of a blockchain, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described in fig. 3.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a server system. Of course, this application does not exclude that with future developments in computer technology, the computer implementing the functionality of the above described embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device or a combination of any of these devices.
Although one or more embodiments of the present description provide method operational steps as described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive approaches. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When implemented in an actual device or end product, can be executed sequentially or in parallel according to the methods shown in the embodiments or figures (e.g., parallel processor or multi-thread processing environments, even distributed data processing environments). The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. For example, if the terms first, second, etc. are used to denote names, they do not denote any particular order.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, when implementing one or more of the present description, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of multiple sub-modules or sub-units, etc. The above-described embodiments of the apparatus 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 present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In the description of the specification, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
The above description is merely exemplary of one or more embodiments of the present disclosure and is not intended to limit the scope of one or more embodiments of the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present specification should be included in the scope of the claims.

Claims (20)

1. A method for automatically executing contracts based on variable states, the method comprising:
determining that the state of a first variable of a target type is changed according to an execution result of a target transaction, wherein the target transaction calls a first contract;
determining whether a callback list for the first variable is included in a contract state of the first contract, wherein a callback item in the callback list comprises information of a callback contract and a callback parameter;
in response to determining that the callback list includes a callback for the first variable, executing a callback contract based on a callback parameter of a callback entry in the callback list.
2. The method of claim 1, wherein the method further comprises:
receiving a first transaction for registering a callback item, which is sent by a calling party and calls the first contract, wherein the first transaction comprises a variable name of the first variable, a callback parameter of the callback contract and information of the callback contract;
and executing the first transaction, and adding a callback item in a callback list preset for the first variable, wherein the callback item comprises the information of the callback contract, the account of the calling party and the callback parameter.
3. The method of claim 2, wherein the method further comprises:
receiving a second transaction sent by the caller for cancelling the callback item, wherein the second transaction calls the first contract, and the second transaction comprises a variable name of the first variable;
and executing the second transaction, and deleting a callback item containing the account of the calling party in a callback list corresponding to the first variable.
4. The method of claim 1, wherein executing the callback contract based on the callback parameters of the callback entries in the callback list comprises:
and executing a callback contract based on the callback parameter of the callback item in the callback list after the target transaction is executed.
5. The method of claim 1, wherein the target transaction is a transaction in a target block, an
The executing of the callback contract based on the callback parameter of the callback item in the callback list comprises:
in response to determining that the transaction contained in the target block at the current moment is not executed completely, adding the variable name of the first variable into a preset list to be called;
and in response to the fact that the transaction execution contained in the target block at the current moment is completed, after the variable name of the first variable is added to the list to be called, on the basis of the variable name contained in the list to be called, corresponding callback contracts and callback parameters are determined from callback items of the callback list corresponding to the variables, and the corresponding callback contracts are called through the determined callback parameters.
6. The method of claim 5, wherein the method further comprises:
and sequencing callback items corresponding to the variable names contained in the list to be called.
7. The method of claim 6, wherein the callback entry further comprises a callback priority, and the sorting of the callback entries corresponding to variable names included in the to-be-called list comprises:
and sequencing the callback items corresponding to the variable names in the list to be called according to the callback priorities of the callback items corresponding to the variable names in the list to be called.
8. The method of claim 6, wherein the sorting callback items corresponding to variable names included in the to-be-called list comprises:
calculating hash according to the callback contract and the callback party account of the callback item corresponding to each variable name in the list to be called and the block number of the target block where the target transaction is located;
and sequencing callback items corresponding to the variable names contained in the list to be called according to the Hash calculation result.
9. The method of claim 1, wherein the first variable is a data access authorization amount in the privacy computation, and the callback contract is used for judging whether the data access authorization amount at the current moment exceeds a preset number threshold, and when the data access authorization amount exceeds the number threshold, a preset workflow contract is invoked, wherein the workflow contract is used for relevant operations of the privacy computation.
10. An apparatus for automatically executing contracts based on variable states, the apparatus comprising:
the first determining unit is configured to determine that the state of a first variable of a target type is changed according to an execution result of a target transaction, wherein the target transaction calls a first contract;
a second determining unit configured to determine whether a callback list for the first variable is included in a contract state of the first contract, wherein a callback item in the callback list includes information of a callback contract and a callback parameter;
an execution unit configured to execute a callback contract based on a callback parameter of a callback item in the callback list in response to determining that the callback list includes the callback for the first variable.
11. The apparatus of claim 10, wherein the apparatus further comprises:
the first receiving unit is configured to receive a first transaction sent by a calling party and used for registering a callback item, wherein the first transaction calls the first contract, and the first transaction comprises a variable name of the first variable, a callback parameter of the callback contract and information of the callback contract;
and the adding unit is configured to execute the first transaction and add a callback item in a callback list preset for the first variable, wherein the callback item comprises information of the callback contract, the account of the calling party and the callback parameter.
12. The apparatus of claim 11, wherein the apparatus further comprises:
a second receiving unit, configured to receive a second transaction sent by the caller for deregistering a callback item, where the second transaction invokes the first contract, and the second transaction includes a variable name of the first variable;
and the deleting unit is configured to execute the second transaction and delete the callback item containing the account of the calling party in the callback list corresponding to the first variable.
13. The apparatus of claim 10, wherein the execution unit is further configured to:
and after the target transaction is executed, executing a callback contract based on a callback parameter of a callback item in the callback list.
14. The apparatus of claim 10, wherein the target transaction is a transaction in a target block, an
The execution unit includes:
the variable name adding module is configured to add the variable name of the first variable to a preset list to be called in response to the fact that the transaction contained in the target block at the current moment is not executed and completed;
and the contract calling module is configured to determine a corresponding callback contract and a callback parameter from a callback item of a callback list of a corresponding variable based on the variable name included in the to-be-called list after the variable name of the first variable is added to the to-be-called list in response to the fact that the execution of the transaction included in the target block at the current moment is determined, and call the corresponding callback contract through the determined callback parameter.
15. The apparatus of claim 14, wherein the apparatus further comprises:
and the sequencing module is configured to sequence callback items corresponding to the variable names contained in the list to be called.
16. The apparatus of claim 15, wherein a callback entry further comprises a callback priority, and the ranking module is further configured to:
and sequencing the callback items corresponding to the variable names in the list to be called according to the callback priorities of the callback items corresponding to the variable names in the list to be called.
17. The apparatus of claim 15, wherein the ranking module is further configured to:
calculating hash according to the callback contract and the callback party account of the callback item corresponding to each variable name in the list to be called and the block number of the target block where the target transaction is located;
and sequencing callback items corresponding to the variable names contained in the list to be called according to the Hash calculation result.
18. The apparatus of claim 10, wherein the first variable is a data access authorization amount in the privacy computation, and the callback contract is used to determine whether the data access authorization amount at the current time exceeds a preset number threshold, and when the data access authorization amount exceeds the number threshold, a preset workflow contract is invoked, wherein the workflow contract is used for performing related operations of the privacy computation.
19. A computer-readable storage medium, on which a computer program is stored which, when executed in a computer, causes the computer to carry out the method of any one of claims 1-9.
20. A blockchain node comprising a memory and a processor, wherein the memory has stored therein executable code, and wherein the processor, when executing the executable code, implements the method of any of claims 1-9.
CN202210600436.9A 2022-05-30 2022-05-30 Method and device for automatically executing contracts based on variable state Pending CN114968422A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210600436.9A CN114968422A (en) 2022-05-30 2022-05-30 Method and device for automatically executing contracts based on variable state
PCT/CN2022/135342 WO2023231342A1 (en) 2022-05-30 2022-11-30 Method and apparatus for automatically executing contract on the basis of variable state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210600436.9A CN114968422A (en) 2022-05-30 2022-05-30 Method and device for automatically executing contracts based on variable state

Publications (1)

Publication Number Publication Date
CN114968422A true CN114968422A (en) 2022-08-30

Family

ID=82958417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210600436.9A Pending CN114968422A (en) 2022-05-30 2022-05-30 Method and device for automatically executing contracts based on variable state

Country Status (2)

Country Link
CN (1) CN114968422A (en)
WO (1) WO2023231342A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231342A1 (en) * 2022-05-30 2023-12-07 蚂蚁区块链科技(上海)有限公司 Method and apparatus for automatically executing contract on the basis of variable state

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11037211B2 (en) * 2016-08-04 2021-06-15 Clarovia Holdings, Llc Systems and methods for using smart contracts to control the trade, supply, manufacture, and distribution of commodities
CN110929229A (en) * 2019-11-26 2020-03-27 中国石油大学(华东) Block chain-based office document credibility verification method and system
CN112819621B (en) * 2021-01-22 2021-09-24 支付宝(杭州)信息技术有限公司 Intelligent contract resource loss testing method and system
CN114968422A (en) * 2022-05-30 2022-08-30 蚂蚁区块链科技(上海)有限公司 Method and device for automatically executing contracts based on variable state

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231342A1 (en) * 2022-05-30 2023-12-07 蚂蚁区块链科技(上海)有限公司 Method and apparatus for automatically executing contract on the basis of variable state

Also Published As

Publication number Publication date
WO2023231342A1 (en) 2023-12-07

Similar Documents

Publication Publication Date Title
KR102226257B1 (en) Method and device for writing service data to a blockchain system
CN110020542B (en) Data reading and writing method and device and electronic equipment
CN110992038B (en) Transaction processing method, device and equipment
CN114827165B (en) Method and block link point for grouping multiple transactions
TWI694700B (en) Data processing method and device, user terminal
CN109725989B (en) Task execution method and device
CN107578338B (en) Service publishing method, device and equipment
WO2023160085A1 (en) Method for executing transaction, blockchain, master node, and slave node
CN114529417A (en) Method for executing transaction, block chain, main node and slave node
CN109145053B (en) Data processing method and device, client and server
CN114942847A (en) Method for executing transaction and block link point
CN114936256A (en) Method for executing transaction in block chain and block chain link point
CN111784468A (en) Account association method and device and electronic equipment
CN114968422A (en) Method and device for automatically executing contracts based on variable state
WO2024001025A1 (en) Pre-execution cache data cleaning method and blockchain node
CN116032756A (en) Method for updating configuration information of application program based on block chain and block chain link point
CN113254163B (en) Processing method and device of block chain data
CN115150409A (en) Method for executing transaction in block chain system, block chain system and node
CN115098114A (en) Block chain-based distributed application deployment method and device
EP3779691B1 (en) Data processing method and apparatus
CN114268540B (en) Rule engine optimization method, device and equipment
CN115063238A (en) Method for processing digital resources based on block chain and node of block chain
CN115731040A (en) Block chain-based collection management method, block chain node and system
CN116226277A (en) NFT resource transfer method and block chain link point
CN114638702A (en) Block chain transaction execution method and device

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