CN114422535B - Method, apparatus, computer device and storage medium for distributing contracts in blockchain - Google Patents

Method, apparatus, computer device and storage medium for distributing contracts in blockchain Download PDF

Info

Publication number
CN114422535B
CN114422535B CN202210056362.7A CN202210056362A CN114422535B CN 114422535 B CN114422535 B CN 114422535B CN 202210056362 A CN202210056362 A CN 202210056362A CN 114422535 B CN114422535 B CN 114422535B
Authority
CN
China
Prior art keywords
contract
blockchain network
target
node
user node
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
CN202210056362.7A
Other languages
Chinese (zh)
Other versions
CN114422535A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210056362.7A priority Critical patent/CN114422535B/en
Publication of CN114422535A publication Critical patent/CN114422535A/en
Application granted granted Critical
Publication of CN114422535B publication Critical patent/CN114422535B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephonic Communication Services (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application discloses a method, a device, computer equipment and a storage medium for distributing contracts in a blockchain. The method comprises the following steps: receiving a contract deployment request of a target user node in a blockchain network, wherein the contract deployment request is used for indicating at least one target contract to be deployed of the target user node to be deployed in the blockchain network; acquiring an agent contract deployed by an administrator node of the blockchain network, the agent contract for deploying the target contract in the blockchain network according to a contract deployment request; acquiring a time threshold for contract deployment in a blockchain network from a proxy contract; acquiring the number of times to be deployed of contract deployment of a target user node in a blockchain network currently based on the number of target contracts; determining a number of deployed times for contract deployment in the blockchain network based on the proxy contract; and if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold, deploying the target contract in the blockchain network through the proxy contract.

Description

Method, apparatus, computer device and storage medium for distributing contracts in blockchain
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a computer device, and a storage medium for distributing contracts in a blockchain.
Background
The contract deployment of users in the blockchain network can not be controlled in the blockchain such as the alliance chain, any user with contract deployment authority can randomly deploy contracts in the blockchain network, the contract deployment times of the users in the blockchain network can not be well controlled, innumerable contracts with the same function can exist in the blockchain, and the contract confusion and the invalid contract overmany of the chain can also be caused.
Disclosure of Invention
The embodiment of the application provides a method, a device, computer equipment and a storage medium for deploying contracts in a blockchain, which can control the times of deploying contracts by user nodes in the blockchain network and avoid contract confusion and excessive invalid contracts in the blockchain network.
The embodiment of the application provides a method for distributing contracts in a blockchain, which is applied to a blockchain network with a plurality of user nodes, wherein the user nodes comprise manager nodes and comprise the following steps:
receiving a contract deployment request of a target user node in the blockchain network, wherein the contract deployment request is used for indicating at least one target contract to be deployed of the target user node to be deployed in the blockchain network;
Obtaining an agent contract deployed by an administrator node of the blockchain network, the agent contract for deploying the target contract in the blockchain network according to the contract deployment request;
acquiring a threshold of times of contract deployment in the blockchain network from the proxy contract;
acquiring the number of times to be deployed of contract deployment of the target user node in the blockchain network currently based on the number of the target contracts;
determining a number of deployed times for contract deployment in the blockchain network based on the proxy contract;
and if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold, deploying the target contract in the blockchain network through the proxy contract.
Correspondingly, the embodiment of the application also provides a contract deployment device which is applied to a blockchain network with a plurality of user nodes, wherein the user nodes comprise manager nodes and comprise:
a receiving unit, configured to receive a contract deployment request of a target user node in the blockchain network, where the contract deployment request is used to instruct at least one target contract to be deployed by the target user node to be deployed in the blockchain network;
A contract acquisition unit configured to acquire an agent contract deployed by an administrator node of the blockchain network, the agent contract being configured to deploy the target contract in the blockchain network according to the contract deployment request;
a number-of-times threshold obtaining unit configured to obtain, in the proxy contract, a number-of-times threshold for contract deployment in the blockchain network;
the to-be-deployed frequency acquisition unit is used for acquiring the to-be-deployed frequency of contract deployment of the target user node in the blockchain network currently based on the number of the target contracts;
a deployed number acquisition unit configured to determine a deployed number of times of contract deployment in the blockchain network based on the proxy contract;
the deployment unit is used for deploying the target contract in the blockchain network through the proxy contract if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold.
Optionally, the contract obtaining unit is further configured to:
determining the manager node among a plurality of the user nodes included in the blockchain network;
receiving, by the administrator node, a first deployment request of a contract for the first time that the user node deploys the contract in the blockchain network;
Deploying, by the administrator node, the proxy contract in the blockchain network based on the contract first deployment request.
Optionally, the number of times threshold includes a first number of times threshold, and the number of times threshold obtaining unit is further configured to:
receiving, by the administrator node, first time count constraint information sent by the target user node, where the first time count constraint information includes the first time count threshold for contract deployment by the target user node in the blockchain network;
setting, by the administrator node, the first time count threshold in the proxy contract;
the first time threshold for contract deployment of the target user node in the blockchain network is obtained in the proxy contract.
Optionally, the contract deployment request includes a target node identifier of the target user node in the blockchain network, the deployed number of times is a first deployed number of times, and the deployed number of times obtaining unit is further configured to:
and acquiring the first deployed times of contract deployment of the target user node in the blockchain network in the proxy contract based on the target node identification.
Optionally, the number of times threshold comprises a first time threshold for contract deployment by the target user node in the blockchain network, the apparatus further for:
if the sum of the first deployment times of the to-be-deployed times and the first deployed times exceeds the first time threshold, determining a time difference value between the sum of the first deployment times and the first time threshold by the manager node;
initiating, by the administrator node, a number of times increment transaction, the number of times increment transaction comprising the number of times difference;
and executing uplink processing on the times of increasing transactions to trigger the blockchain network to sum the first time threshold value and the times of difference value in the proxy contract according to the times of increasing transactions so as to obtain an updated first time threshold value.
Optionally, the deployment unit is further configured to:
acquiring a first deployment frequency sum of the first deployed frequency and the frequency to be deployed;
updating the first number of deployments in the proxy contract to the first sum of deployments based on the target node identification.
Optionally, the contract deployment request includes a candidate node identification that can deploy the target contract, and the deployment unit is further configured to:
Acquiring a target node identification of the target user node in the blockchain network according to the contract deployment request;
if the target node identifier belongs to the candidate node identifier, creating a method for distributing contracts in a blockchain corresponding to the target contract in the proxy contract through the administrator node;
invoking, by the target user node, a method of deploying contracts in the blockchain of the proxy contracts;
the target contract is deployed in the blockchain network based on the method of deploying contracts in the blockchain.
Optionally, the frequency threshold includes a second frequency threshold, and the frequency threshold obtaining unit is further configured to:
setting a second time threshold for contract deployment in the blockchain network by a deployable user node in the agent contract through the administrator node, wherein the deployable user node comprises a plurality of user nodes with contract deployment authority in the blockchain network;
and acquiring the second time threshold of contract deployment of the deployable user node in the blockchain network in the proxy contract.
Optionally, the deployed number of times is a second deployed number of times, and the deployed number of times obtaining unit is further configured to:
And acquiring the second deployed times of contract deployment of the deployable user node in the blockchain network within the preset time based on the proxy contract.
Optionally, the receiving unit is further configured to:
if the target user node does not have contract deployment authority for performing contract deployment in the blockchain network, initiating node addition transaction by the manager node, wherein the node addition transaction is used for enabling the target user node to have the contract deployment authority;
and executing uplink processing on the node addition transaction to trigger the blockchain network to set the contract deployment authority for the target user node according to the node addition transaction.
Optionally, the contract deployment request includes a calling node identifier of a calling user node that can call the target contract in the blockchain network, and the deployment unit is further configured to:
and feeding back a target contract address of the target contract in the blockchain network to the calling user node according to the calling node identification so that the calling user node calls the target contract according to the target contract address, wherein one target contract corresponds to one target contract address.
Optionally, the contract deployment request includes a maximum callable number of the target contract, and the apparatus is further configured to:
receiving a contract calling request sent by a target calling user node, wherein the contract calling request comprises a target calling node identifier of the target calling user node and the times to be called for the target contract;
if the calling node identification comprises the target calling node identification, acquiring the called times of the target contract in the proxy contract;
calculating the sum of the calling times of the current calling times and the called times;
and if the sum of the calling times is smaller than or equal to the maximum calling times, the target calling user node is realized to call the target contract.
Optionally, the receiving unit is further configured to:
if the target user nodes are a plurality of, receiving a contract deployment request of at least one target user node in the blockchain network, wherein the contract deployment request comprises private keys of the target user nodes and node identifiers in the blockchain network;
the deployed number acquisition unit is further configured to:
determining a deployed number of contract deployments of each of the target user nodes in the blockchain network based on the proxy contracts;
The deployment unit is further configured to:
and if the sum of the deployed times corresponding to each target user node and the times to be deployed does not exceed the time threshold, deploying the target contract through the proxy contract based on the private key of each target user node in the blockchain network and the node identification.
Also, an embodiment of the present application further provides a computer device, including:
a memory for storing a computer program;
a processor for deploying steps of any of the methods of contracts in executing the blockchain.
Furthermore, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of any of the methods of the blockchain deployment contract.
The embodiment of the application provides a method, a device, computer equipment and a storage medium for deploying contracts in a blockchain network, wherein a user node in the blockchain network cannot directly deploy contracts in the blockchain network, when a target user node wants to deploy a target contract in the blockchain network, the deployed times of contracts which are already deployed in the blockchain network and the times of waiting to be deployed of the target user node which are currently want to deploy the contracts need to be judged through proxy contracts, and the times of contracts which can be deployed in the blockchain network are not exceeded, and the target contract can be deployed through proxy contracts further, so that the times of contracts deployment of the user node in the blockchain network are limited, a plurality of blockchain contracts with the same functions in the blockchain network can be effectively reduced, and contract confusion and invalid contract overmany in the blockchain network are avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that need to be redeemed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without the need for inventive effort for a person skilled in the art.
FIG. 1 is a system diagram of a contract deployment apparatus provided by an embodiment of the present application;
FIG. 2 is a flow chart of a method of deploying contracts in a blockchain provided by an embodiment of the present application;
FIG. 3 is another flow diagram of a method of deploying contracts in a blockchain provided by an embodiment of the present application;
FIG. 4 is a schematic diagram of a contract deployment apparatus provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
The embodiment of the application provides a method, a device, computer equipment and a storage medium for distributing contracts in a blockchain. In particular, the contract deployment of the embodiments of the present application may be performed by a computer device, where the computer device may be a device such as a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a personal computer (Personal Computer, PC), a personal digital assistant (Personal Digital Assistant, PDA) and the like, and the terminal can also comprise a client, wherein the client can be a game application client, a browser client carrying a game program, an instant messaging client or the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution network services, basic cloud computing services such as big data and an artificial intelligence platform.
Referring to fig. 1, fig. 1 is a system schematic diagram of a contract deployment apparatus according to an embodiment of the present application. The system is a blockchain network system, and can comprise a plurality of terminals as user nodes, wherein one terminal is an administrator node, and the blockchain network is used for receiving a contract deployment request of a target user node in the blockchain network, wherein the contract deployment request comprises at least one target contract to be deployed by the target user node; acquiring an agent contract deployed by an administrator node, the agent contract for deploying a target contract in a blockchain network according to a contract deployment request; acquiring a time threshold for contract deployment in a blockchain network from a proxy contract; acquiring the number of times to be deployed of contract deployment of a target user node in a blockchain network currently based on the number of target contracts; determining a number of deployed times for contract deployment in the blockchain network based on the proxy contract; and if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold, deploying the target contract in the blockchain network through the proxy contract.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The present embodiment will be described from the perspective of a contract deployment apparatus, which may be integrated in a terminal device, and the terminal device may include a smart phone, a notebook computer, a tablet computer, a personal computer, and the like.
The embodiment of the present application provides a method for deploying contracts in a blockchain, which may be executed by a processor of a terminal, as shown in fig. 2, and the specific flow of the method for deploying contracts in a blockchain mainly includes steps 201 to 206, which are described in detail below:
step 201, receiving a contract deployment request of a target user node in a blockchain network, wherein the contract deployment request is used for indicating that at least one target contract to be deployed of the target user node is deployed in the blockchain network.
In the present embodiment, a contract is a digitally defined protocol that includes providing, verifying and executing the digital form, and is a contract that replaces legal language record terms with a computer language and is automatically executed by a program. A contract may be considered a digitized version of a traditional contract, running on a blockchain network, automatically executed by a program. Wherein the target contract is a contract for the target user node to be deployed in the blockchain network. In addition, the proxy contracts mentioned in step 202 include the number of times the contracts have been deployed by the respective user nodes in the blockchain network and the total number of times the contracts can be deployed in the blockchain network, as well as the proxy transaction method of the respective contracts deployed in the blockchain network, the proxy contracts being generated by the administrator node deployment in the blockchain network.
In the embodiment of the application, when the target user node wants to make the establishment of the protocol with other user nodes effective, the target user node can deploy a contract for recording the protocol in the blockchain network, so that the user nodes of both parties of the protocol can execute the protocol.
In this embodiment of the present application, the target user node may be one of the user nodes included in the blockchain network, and after the blockchain network receives the contract deployment request of the target user node, it needs to determine whether the target user node has the authority to perform contract deployment in the blockchain network. If yes, further judging the contract deployment times.
In the embodiment of the application, if the target user node which wants to perform contract deployment does not have the authority to perform contract deployment in the blockchain network, in order to enable the target user node to deploy a target user in the blockchain network, a node addition transaction can be initiated by an administrator node, so that a target user identifier can deploy a target contract in the blockchain network. After the step 201 "receiving the contract deployment request of the target user node in the blockchain network" at this time, the method may further include:
If the target user node does not have contract deployment authority for performing contract deployment in the blockchain network, initiating node addition transaction by an administrator node, wherein the node addition transaction is used for enabling the target user node to have the contract deployment authority;
and executing uplink processing on the node adding transaction to trigger the blockchain network to set contract deployment authority for the target user node according to the node adding transaction.
In the embodiment of the application, when the target user node can perform contract deployment in the blockchain network, the target user node can directly have the authority to perform contract deployment in the blockchain network, and then can continue to perform contract deployment in the blockchain network.
Furthermore, the target user node may still not have contract deployment rights, but may simply deploy the target contract in the blockchain network without rights to deploy other contracts in the blockchain network.
In an embodiment of the present application, the contract deployment request may include a contract identifier (contract name, contract number, etc.) and contract specific content (i.e., a code for deploying a contract) of a target contract to be deployed by the target user node in the blockchain network.
In the embodiment of the present application, the target user node performing contract deployment may be one or more, and if the target user node is more than one, the "receiving the contract deployment request of the target user node in the blockchain network" in step 201 may be: if the target user nodes are a plurality of, a contract deployment request of at least one target user node in the blockchain network is received, wherein the contract deployment request comprises private keys of all target user nodes in the blockchain network and node identifiers. At this point, step 205 "determine the number of deployed times of contract deployment in the blockchain network based on the proxy contract" may be: determining the deployed times of contract deployment for each target user node in the blockchain network based on the proxy contracts, step 206 "if the sum of the deployment times of the to-be-deployed times and the deployed times does not exceed the time threshold, deploying the target contracts in the blockchain network through the proxy contracts" may be: if the sum of the deployed times corresponding to each target user node and the to-be-deployed times does not exceed the time threshold, deploying the target contract through the proxy contract based on the private key of each target user node in the blockchain network and the node identification.
Step 202, obtaining an agent contract deployed by an administrator node of a blockchain network, the agent contract for deploying a target contract in the blockchain network according to a contract deployment request.
In this embodiment, before the agent contract is acquired, the agent contract needs to be deployed in the blockchain network by an administrator node, where the administrator node may be one of the user nodes or may be independent of the user nodes, that is, before the step 202 of acquiring the agent contract deployed by the administrator node, further includes:
determining an administrator node among a plurality of user nodes included in a blockchain network;
receiving a contract first deployment request of first contract deployment of a user node in a blockchain network through an administrator node;
an agent contract is deployed in a blockchain network by an administrator node based on a contract first deployment request.
In the embodiment of the present application, the determination method of the administrator node is not limited, and the administrator node may be a user node specified by a related technician in the blockchain network, or may be a user node selected by a predetermined rule (for example, multi-sign authority management, network resource is best, etc.). The number of manager nodes may be one or more without limitation.
In the embodiment of the application, the first contract deployment request is a contract deployment request sent when one of all user nodes in the blockchain network performs contract deployment for the first time, and after an administrator node receives the request, an agent contract is deployed in the blockchain network. To limit the number of times of contract deployment, a threshold of the number of times of contract deployment in the blockchain network may be set in the proxy contract, and the number of deployed times of contract deployment in the blockchain network is recorded in real time. In addition, in order to enable the user node to perform contract deployment in the blockchain network through the proxy contract, a method for performing contract deployment may be further set in the proxy contract.
In the embodiment of the application, in order to reduce the deployment of the proxy contracts and reduce the resource occupation of the proxy contracts, the blockchain network can only have one proxy contract, all user nodes for deploying the contracts acquire the frequency threshold and the deployed frequency through one proxy contract, and all the user nodes call a contract deployment method in one proxy contract to deploy the contracts.
In the embodiment of the present application, in order to avoid frequent use of proxy contracts, each user node performing contract deployment may correspond to one proxy contract, that is, when each user node first performs contract deployment in a blockchain network, an administrator node deploys the proxy contract corresponding to the user node in the blockchain network, and when each user node deploys a contract in the blockchain network, the user node performs frequency judgment through the corresponding proxy contract and invokes a contract deployment method.
In one embodiment of the present application, the administrator node may deploy a proxy contract each time the user node performs contract deployment in the blockchain network.
Step 203, obtaining a threshold of times of contract deployment in the blockchain network in the proxy contract.
In this embodiment of the present application, the maximum number of times that each user node can perform contract deployment in the blockchain network, that is, the first time threshold, may be set in the proxy contract, and before the step 203 of acquiring the number of times threshold for performing contract deployment in the blockchain network in the proxy contract, the method may further include: receiving, by an administrator node, first time count constraint information sent by a target user node, the first time count constraint information including a first time count threshold for contract deployment of the target user node in a blockchain network; the first time count threshold is set in the proxy contract by the administrator node. At this time, the step 203 "acquiring the threshold number of times of contract deployment in the blockchain network in the proxy contract" includes: the first time threshold value of contract deployment of the target user node in the blockchain network is obtained in the proxy contract.
In the embodiment of the present application, the first time number threshold for each user node performing contract deployment in the blockchain network may be determined by the user node itself, and then the first time number limitation information is sent to the administrator node, so that the administrator node obtains the first time number threshold.
In the embodiment of the application, in order to better manage the contract deployment times of each user node in the blockchain network, the first time number threshold value of each user node can be uniformly set. The first time threshold value corresponding to each user node may be the same or different.
In the embodiment of the present application, the total number of times that all user nodes can perform contract deployment in the blockchain network, that is, the second threshold of times, in a preset time (for example, one day) may be set in the proxy contract, so as to avoid more contracts deployed in the blockchain network. When the number of times threshold is the second number of times threshold, before "obtaining the number of times threshold for performing contract deployment in the blockchain network in the proxy contract" in step 203, the method may further include: the administrator node sets a second time threshold for contract deployment in the blockchain network by the deployable user node in the agent contract, wherein the deployable user node comprises a user node with contract deployment authority in the blockchain network in a plurality of user nodes. At this time, the step 203 "acquiring the threshold number of times of contract deployment in the blockchain network in the proxy contract" may be: a second time threshold for contract deployment of the deployable user node in the blockchain network is obtained in the proxy contract.
Step 204, obtaining the number of times to be deployed of contract deployment of the target user node in the blockchain network based on the number of target contracts.
In the embodiment of the application, since the user node deploys one target contract at a time, that is, the number of target contracts is the same as the number of times to be deployed for which the target user node is about to deploy the contract in the blockchain network, the number of target contracts can be determined according to the contract deployment request, and then the number of target contracts is the number of times to be deployed for the target user node.
Step 205, determining the deployed times of contract deployment in the blockchain network based on the proxy contract.
In the embodiment of the present application, the contract deployment request includes a target node identifier of the target user node in the blockchain network, and when the number threshold is the first number threshold, the deployed number is a first deployed number of times the target user node has deployed a contract in the blockchain network, where the step 205 of determining, based on the proxy contract, the deployed number of times the contract is deployed in the blockchain network may be based on the target node identifier, to obtain, in the proxy contract, the first deployed number of times the target user node is deployed in the blockchain network.
In the embodiment of the present application, when the number of times threshold is the second number of times threshold, the deployed number of times may be the second deployed number of times that contracts have been deployed in the blockchain network within a preset time, and in this case, the "determining the deployed number of times that contracts are deployed in the blockchain network based on the proxy contract" in step 205 may be obtaining the second deployed number of times that the deployable user node performs contracts deployment in the blockchain network within the preset time based on the proxy contract.
Step 206, if the sum of the deployment times of the number of times to be deployed and the deployed number of times does not exceed the time threshold, deploying the target contract in the blockchain network through the proxy contract.
In the embodiment of the present application, if the sum of the number of times to be deployed and the number of times to be deployed does not exceed the number of times threshold, the number of times to be deployed that the target user node performs contract deployment in the blockchain network does not exceed the maximum number of times that the target user node can perform contract deployment in the blockchain network, and the number of times to be deployed that the target user node performs contract deployment at the current moment does not exceed the number of times that the target user node can also perform contract deployment in the blockchain network, which indicates that the target user node can also deploy the target contract in the blockchain network.
In the embodiment of the present application, when the deployed number is the first deployed number, and the number threshold is a first number threshold for performing contract deployment on the target user node in the blockchain network, if the sum of the number to be deployed and the first deployed number of the first deployed number exceeds the first number threshold, it indicates that the target user node cannot currently deploy the target contract in the blockchain network. At this time, in order to avoid that some important contracts of the target user node cannot be deployed in the blockchain network, the administrator node may increase the maximum number of times the target user node can perform contract deployment in the blockchain network, that is, the administrator node may increase the first-time threshold originally set in the proxy contract. In order to enable the target user node to deploy the target contract currently and control the number of times the target user node deploys the contract in the blockchain network, the first time threshold may be changed to a minimum value that allows the target user node to deploy the target contract, which may specifically be:
if the first deployment frequency sum of the to-be-deployed frequency and the first deployed frequency exceeds a first frequency threshold, determining a frequency difference value between the first deployment frequency sum and the first frequency threshold through an administrator node;
Initiating a number of times increment transaction by the administrator node, the number of times increment transaction comprising a number of times difference;
and executing uplink processing on the times of increasing transactions to trigger the blockchain network to sum the first time threshold value and the times of difference value in the proxy contract according to the times of increasing transactions so as to obtain an updated first time threshold value.
In the embodiment of the present application, in order to accurately record, in real time, the deployed times of contract deployment performed by the target user node in the blockchain network, when the target user node deploys the target contract in the blockchain network, it is indicated that the deployed times of contract deployment performed by the target user node in the blockchain network are changed, and the deployed times need to be updated, and the specific method may be:
acquiring a first deployment frequency sum of the first deployed frequency and the frequency to be deployed;
the first number of deployments is updated in the proxy contract to a first sum of deployments based on the target node identification.
In the embodiment of the present application, the contract deployment request includes the candidate node identification of the deployable target contract, and the "deploying the target contract in the blockchain network through the proxy contract" in step 206 may be:
acquiring a target node identification of a target user node in a blockchain network according to a contract deployment request;
If the target node identifier belongs to the candidate node identifier, creating a contract deployment method corresponding to the target contract in the proxy contract through an administrator node;
invoking a contract deployment method in the proxy contract through the target user node;
a contract-based deployment method deploys a target contract in a blockchain network.
In this embodiment of the present application, after the target contract is deployed in the blockchain network, the user node having the authority to invoke the target contract may invoke the target contract to complete a series of functions, and the user node having the authority to invoke the target contract needs to obtain the contract address of the target contract in the blockchain network, so, after the deployment of the target contract is completed, the contract address of the target contract needs to be sent to the user node having the authority to invoke the target contract, where the specific contract deployment request includes the identity of the invoking node of the invoking user node that may invoke the target contract in the blockchain network, where step 206 "after deploying the target contract in the blockchain network through the proxy contract" may further include: and feeding back the target contract address of the target contract in the blockchain network to the calling user node according to the calling node identification so that the calling user node calls the target contract according to the target contract address, wherein one target contract corresponds to one target contract address.
In the embodiment of the present application, in order to avoid that a user node having authority to invoke a target contract makes multiple useless invocations, so that network resources are wasted, the number of invocations of each user node having authority to invoke the target contract may be limited, that is, the maximum invocable number of invocations of the target contract may be included in the contract deployment request, which may specifically be:
receiving a contract calling request sent by a target calling user node, wherein the contract calling request comprises a target calling node identifier of the target calling user node and the times to be called for the target contract;
if the calling node identification comprises the target calling node identification, acquiring the called times of the target contract in the proxy contract;
calculating the sum of the calling times of the current calling times and the called times;
and if the sum of the calling times is smaller than or equal to the maximum calling times, realizing that the target calling user node calls the target contract.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
According to the method for deploying contracts in the blockchain network, when a target user node wants to deploy a target contract in the blockchain network, the deployed times of contract deployment in the blockchain network and the times to be deployed of contract deployment currently want to be performed by the target user node are judged through the proxy contract, and the target contract can be further deployed through the proxy contract only if the times of contract deployment in the blockchain network are not exceeded by the threshold value of times of contract deployment in the blockchain network, so that the times of contract deployment of the user node in the blockchain network is limited, a plurality of blockchain contracts with the same functions in the blockchain network can be effectively reduced, and contract confusion and invalid contract overmuch in the blockchain network are avoided.
Referring to fig. 3, fig. 3 is another flow chart of a method for deploying contracts in a blockchain provided in an embodiment of the present application. The specific flow of the method can be as follows:
determining an administrator node in a user node of a blockchain network, deploying a proxy contract in the blockchain network by the administrator node, recording a first time threshold value of a user node for deploying the contract in the blockchain network and a first deployed time of the deployed contract in the proxy contract, determining that a target user node can deploy the contract in the blockchain network by the first time threshold value, the first deployed time and the current time to be deployed for deploying the contract when a contract deployment request of a user is received, deploying a contract deployment method corresponding to the target contract 1 in the proxy contract and a contract deployment method corresponding to the target contract n, invoking the contract deployment method corresponding to the target contract 1 in the proxy contract by the user node, deploying the user contract 1 in the blockchain network by the contract deployment method corresponding to the target contract n in the proxy contract, and deploying the user contract n in the blockchain network.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
According to the method for deploying contracts in the blockchain network, when a target user node wants to deploy a target contract in the blockchain network, the deployed times of contract deployment in the blockchain network and the times to be deployed of contract deployment currently want to be performed by the target user node are judged through the proxy contract, and the target contract can be further deployed through the proxy contract only if the times of contract deployment in the blockchain network are not exceeded by the threshold value of times of contract deployment in the blockchain network, so that the times of contract deployment of the user node in the blockchain network is limited, a plurality of blockchain contracts with the same functions in the blockchain network can be effectively reduced, and contract confusion and invalid contract overmuch in the blockchain network are avoided.
In order to facilitate better implementation of the method for deploying contracts in a blockchain of the embodiments of the present application, the embodiments of the present application further provide a contract deployment apparatus. Referring to fig. 4, fig. 4 is a schematic structural diagram of a contract deployment apparatus according to an embodiment of the present application. The contract deployment apparatus is applied to a blockchain network having a plurality of user nodes, including an administrator node, and may include a receiving unit 401, a contract acquiring unit 402, a number-of-times threshold acquiring unit 403, a number-of-times-to-be-deployed acquiring unit 404, a number-of-deployed acquiring unit 405, and a deployment unit 406.
Wherein, the receiving unit 401 is configured to receive a contract deployment request of a target user node in a blockchain network, where the contract deployment request is used to instruct at least one target contract to be deployed by the target user node to be deployed in the blockchain network;
a contract acquisition unit 402 for acquiring an agent contract deployed by an administrator node of the blockchain network, the agent contract being for deploying the target contract in the blockchain network according to a contract deployment request;
a number-of-times threshold obtaining unit 403 for obtaining, in the proxy contract, a number-of-times threshold for contract deployment in the blockchain network;
a to-be-deployed number acquisition unit 404, configured to acquire, based on the number of target contracts, the number of to-be-deployed numbers of contracts that the target user node currently performs contract deployment in the blockchain network;
a deployed number acquisition unit 405 for determining a deployed number of times of contract deployment in the blockchain network based on the proxy contract;
a deployment unit 406, configured to deploy the target contract in the blockchain network through the proxy contract if the sum of the number of deployments of the number of times to be deployed and the number of times deployed does not exceed the number of times threshold.
Optionally, the contract obtaining unit 402 is further configured to:
determining an administrator node among a plurality of user nodes included in a blockchain network;
Receiving a contract first deployment request of first contract deployment of a user node in a blockchain network through an administrator node;
an agent contract is deployed in a blockchain network by an administrator node based on a contract first deployment request.
Optionally, the number of times threshold includes a first number of times threshold, and the number of times threshold obtaining unit 403 is further configured to:
receiving, by an administrator node, first time count constraint information sent by a target user node, the first time count constraint information including a first time count threshold for contract deployment of the target user node in a blockchain network;
setting a first time count threshold in the proxy contract by the administrator node;
the first time threshold value of contract deployment of the target user node in the blockchain network is obtained in the proxy contract.
Optionally, the contract deployment request includes a target node identifier of the target user node in the blockchain network, the deployed number is a first deployed number, and the deployed number obtaining unit 405 is further configured to:
the method comprises the steps of obtaining a first deployed number of times of contract deployment of a target user node in a blockchain network in a proxy contract based on target node identification.
Optionally, the number of times threshold comprises a first time threshold for contractual deployment of the target user node in the blockchain network, the apparatus further for:
If the first deployment frequency sum of the to-be-deployed frequency and the first deployed frequency exceeds a first frequency threshold, determining a frequency difference value between the first deployment frequency sum and the first frequency threshold through an administrator node;
initiating a number of times increment transaction by the administrator node, the number of times increment transaction comprising a number of times difference;
and executing uplink processing on the times of increasing transactions to trigger the blockchain network to sum the first time threshold value and the times of difference value in the proxy contract according to the times of increasing transactions so as to obtain an updated first time threshold value.
Optionally, the deployment unit 406 is further configured to:
acquiring a first deployment frequency sum of the first deployed frequency and the frequency to be deployed;
the first number of deployments is updated in the proxy contract to a first sum of deployments based on the target node identification.
Optionally, the contract deployment request includes candidate node identifications of the deployable target contracts, and the deployment unit 406 is further configured to:
acquiring a target node identification of a target user node in a blockchain network according to a contract deployment request;
if the target node identifier belongs to the candidate node identifier, creating a contract deployment method corresponding to the target contract in the proxy contract through an administrator node;
Invoking a contract deployment method in the proxy contract through the target user node;
a contract-based deployment method deploys a target contract in a blockchain network.
Optionally, the frequency threshold includes a second frequency threshold, and the frequency threshold obtaining unit 403 is further configured to:
setting a second time threshold for contract deployment in the blockchain network by the deployable user node in a preset time in the proxy contract by the administrator node, wherein the deployable user node comprises a user node with contract deployment authority in the blockchain network in a plurality of user nodes;
a second time threshold for contract deployment of the deployable user node in the blockchain network is obtained in the proxy contract.
Optionally, the deployed number of times is a second deployed number of times, and the deployed number of times obtaining unit 405 is further configured to:
and acquiring a second deployed number of contract deployment performed by the deployable user node in the blockchain network within a preset time based on the proxy contract.
Optionally, the receiving unit 401 is further configured to:
if the target user node does not have contract deployment authority for performing contract deployment in the blockchain network, initiating node addition transaction by an administrator node, wherein the node addition transaction is used for enabling the target user node to have the contract deployment authority;
And executing uplink processing on the node adding transaction to trigger the blockchain network to set contract deployment authority for the target user node according to the node adding transaction.
Optionally, the contract deployment request includes a calling node identification of a calling user node in the blockchain network that can call the target contract, and the deployment unit 406 is further configured to:
and feeding back the target contract address of the target contract in the blockchain network to the calling user node according to the calling node identification so that the calling user node calls the target contract according to the target contract address, wherein one target contract corresponds to one target contract address.
Optionally, the contract deployment request includes a maximum callable number of the target contract, and the apparatus is further configured to:
receiving a contract calling request sent by a target calling user node, wherein the contract calling request comprises a target calling node identifier of the target calling user node and the times to be called for the target contract;
if the calling node identification comprises the target calling node identification, acquiring the called times of the target contract in the proxy contract;
calculating the sum of the calling times of the current calling times and the called times;
and if the sum of the calling times is smaller than or equal to the maximum calling times, realizing that the target calling user node calls the target contract.
Optionally, the receiving unit 401 is further configured to:
if the target user nodes are a plurality of, receiving a contract deployment request of at least one target user node in the blockchain network, wherein the contract deployment request comprises private keys of all target user nodes in the blockchain network and node identifiers;
the deployed number acquisition unit 405 is further configured to:
determining deployed times of contract deployment of each target user node in the blockchain network based on the proxy contract;
deployment unit 406 is also configured to:
if the sum of the deployed times corresponding to each target user node and the to-be-deployed times does not exceed the time threshold, deploying the target contract through the proxy contract based on the private key of each target user node in the blockchain network and the node identification.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
According to the contract deployment device provided by the embodiment of the application, a user node in the blockchain network cannot directly deploy contracts in the blockchain network, when a target user node wants to deploy target contracts in the blockchain network, the deployed times of contracts in the blockchain network and the times to be deployed of contracts which the target user node wants to deploy currently are judged through proxy contracts, and the times threshold of contracts which can be deployed in the blockchain network is not exceeded, the target contracts can be further deployed through proxy contracts, so that the times of contracts deployment of the user node in the blockchain network is limited, a plurality of blockchain contracts with the same functions in the blockchain network can be effectively reduced, and contract confusion and ineffective contracts in the blockchain network are avoided.
Correspondingly, the embodiment of the application also provides computer equipment, which can be a terminal, and the terminal can be terminal equipment such as a smart phone, a tablet personal computer, a notebook computer, a touch screen, a game machine, a personal computer, a personal digital assistant and the like. Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application, as shown in fig. 5. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer readable storage media, and a computer program stored on the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be appreciated by those skilled in the art that the computer device structure shown in the figures is not limiting of the computer device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The processor 501 is a control center of the computer device 500, connects various parts of the entire computer device 500 using various interfaces and lines, and performs various functions of the computer device 500 and processes data by running or loading software programs and/or modules stored in the memory 502, and calling data stored in the memory 502, thereby performing overall monitoring of the computer device 500.
In the embodiment of the present application, the processor 501 in the computer device 500 loads the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 executes the application programs stored in the memory 502, so as to implement various functions:
receiving a contract deployment request of a target user node in a blockchain network, wherein the contract deployment request is used for indicating at least one target contract to be deployed of the target user node to be deployed in the blockchain network;
acquiring an agent contract deployed by an administrator node of the blockchain network, the agent contract for deploying the target contract in the blockchain network according to a contract deployment request;
acquiring a time threshold for contract deployment in a blockchain network from a proxy contract;
acquiring the number of times to be deployed of contract deployment of a target user node in a blockchain network currently based on the number of target contracts;
determining a number of deployed times for contract deployment in the blockchain network based on the proxy contract;
and if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold, deploying the target contract in the blockchain network through the proxy contract.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 5, the computer device 500 further includes: a touch display screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch display 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art will appreciate that the computer device structure shown in FIG. 5 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components.
The touch display screen 503 may be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Wherein the display panel may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of a computer device, which may be composed of graphics, text, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations on or near the user (such as the user redeeming a finger, stylus, or any other suitable object or accessory on or near the touch panel) and generate corresponding operational instructions, and the operational instructions execute a corresponding program. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 501, and can receive commands from the processor 501 and execute them. The touch panel may overlay the display panel, and upon detection of a touch operation thereon or thereabout, the touch panel is passed to the processor 501 to determine the type of touch event, and the processor 501 then provides a corresponding visual output on the display panel based on the type of touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 503 to implement the input and output functions. In some embodiments, however, the touch panel and the touch panel may be implemented as two separate components to perform the input and output functions. I.e. the touch sensitive display 503 may also implement an input function as part of the input unit 506.
The radio frequency circuitry 504 may be used to transceive radio frequency signals to establish wireless communications with a network device or other computer device via wireless communications.
The audio circuitry 505 may be used to provide an audio interface between a user and a computer device through speakers, microphones, and so on. The audio circuit 505 may transmit the received electrical signal after audio data conversion to a speaker, and convert the electrical signal into a sound signal for output by the speaker; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 505 and converted into audio data, which are processed by the audio data output processor 501 for transmission to, for example, another computer device via the radio frequency circuit 504, or which are output to the memory 502 for further processing. The audio circuit 505 may also include an ear bud jack to provide communication of the peripheral ear bud with the computer device.
The input unit 506 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 507 is used to power the various components of the computer device 500. Alternatively, the power supply 507 may be logically connected to the processor 501 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 507 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 5, the computer device 500 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
As can be seen from the foregoing, in the computer device provided in this embodiment, when a target user node wants to deploy a target contract in a blockchain network, it is necessary to determine, through a proxy contract, the number of times that the target user node has been deployed in the blockchain network and the number of times that the target user node currently wants to deploy the contract do not exceed the threshold number of times that the target user node can deploy the contract in the blockchain network, and then the target contract can be further deployed through the proxy contract, thereby limiting the number of times that the user node deploys the contract in the blockchain network, effectively reducing the number of times that the target user node deploys the contract in the blockchain network with the same function, and avoiding confusion and excessive ineffective contracts in the blockchain network.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of computer programs that can be loaded by a processor to perform steps in a method of deploying contracts in a blockchain of any of the embodiments provided herein. For example, the computer program may perform the steps of:
receiving a contract deployment request of a target user node in a blockchain network, wherein the contract deployment request is used for indicating at least one target contract to be deployed of the target user node to be deployed in the blockchain network;
acquiring an agent contract deployed by an administrator node of the blockchain network, the agent contract for deploying the target contract in the blockchain network according to a contract deployment request;
acquiring a time threshold for contract deployment in a blockchain network from a proxy contract;
acquiring the number of times to be deployed of contract deployment of a target user node in a blockchain network currently based on the number of target contracts;
Determining a number of deployed times for contract deployment in the blockchain network based on the proxy contract;
and if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold, deploying the target contract in the blockchain network through the proxy contract.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
Since the computer program stored in the storage medium may perform the steps in any of the methods for distributing contracts in blockchain provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the methods for distributing contracts in blockchain provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
The above detailed description of a method, an apparatus, a computer device and a storage medium for distributing contracts in a blockchain provided in the embodiments of the present application, where specific examples are applied to illustrate the principles and embodiments of the present invention, the above description of the embodiments is only used to help understand the technical solution and core ideas of the present invention; those of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (15)

1. A method of blockchain deployment contracts, characterized by being applied to a blockchain network having a plurality of user nodes, the method comprising:
receiving a contract deployment request of a target user node in the blockchain network, wherein the contract deployment request is used for indicating at least one target contract to be deployed of the target user node to be deployed in the blockchain network;
determining an administrator node of the blockchain network among a plurality of user nodes included in the blockchain network;
receiving a contract first deployment request of first contract deployment of each user node in the blockchain network through the administrator node;
deploying, by the administrator node, a proxy contract corresponding to each of the user nodes in the blockchain network based on the contract first deployment request, where the target user node is one of the user nodes included in the blockchain network;
acquiring an agent contract corresponding to the target user node deployed by an administrator node of the blockchain network, wherein the agent contract corresponding to the target user node is used for deploying the target contract in the blockchain network according to the contract deployment request;
Acquiring a time threshold for contract deployment in the blockchain network from a proxy contract corresponding to the target user node;
acquiring the number of times to be deployed of contract deployment of the target user node in the blockchain network currently based on the number of the target contracts;
determining the deployed times of contract deployment in the blockchain network based on the proxy contracts corresponding to the target user nodes;
and if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold, deploying the target contract in the blockchain network through the proxy contract corresponding to the target user node.
2. The method of claim 1, wherein the number of times threshold comprises a first number of times threshold, and wherein before the obtaining the number of times threshold for contract deployment in the blockchain network in the proxy contract corresponding to the target user node, further comprises:
receiving, by the administrator node, first time count constraint information sent by the target user node, where the first time count constraint information includes the first time count threshold for contract deployment by the target user node in the blockchain network;
Setting the first time number threshold value in a proxy contract corresponding to the target user node through the administrator node;
the step of obtaining the threshold of times of contract deployment in the blockchain network in the proxy contracts corresponding to the target user nodes comprises the following steps:
and acquiring the first time threshold value of contract deployment of the target user node in the blockchain network from the proxy contracts corresponding to the target user node.
3. The method of claim 1, wherein the contract deployment request includes a target node identification of the target user node in the blockchain network, the number of deployments is a first number of deployments, and wherein determining the number of deployments for contract deployment in the blockchain network based on the proxy contract corresponding to the target user node includes:
and acquiring the first deployed times of contract deployment of the target user node in the blockchain network in a proxy contract corresponding to the target user node based on the target node identification.
4. The method of claim 3, wherein the number of times threshold is a first time threshold for contractual deployment of the target user node in the blockchain network, the method further comprising:
If the sum of the first deployment times of the to-be-deployed times and the first deployed times exceeds the first time threshold, determining a time difference value between the sum of the first deployment times and the first time threshold by the manager node;
initiating, by the administrator node, a number of times increment transaction, the number of times increment transaction comprising the number of times difference;
and executing uplink processing on the frequency increasing transaction to trigger the blockchain network to sum the first time threshold value and the frequency difference value in a proxy contract corresponding to the target user node according to the frequency increasing transaction, so as to obtain an updated first time threshold value.
5. The method of claim 3, wherein the deploying the target contract in the blockchain network by the proxy contract corresponding to the target user node further comprises:
acquiring a first deployment frequency sum of the first deployed frequency and the frequency to be deployed;
and updating the first deployed times to be the sum of the first deployed times in a proxy contract corresponding to the target user node based on the target node identification.
6. The method of claim 1, wherein the contract deployment request includes candidate node identifications at which the target contract can be deployed, the deploying the target contract in the blockchain network by the proxy contract corresponding to the target user node comprising:
Acquiring a target node identification of the target user node in the blockchain network according to the contract deployment request;
if the target node identifier belongs to the candidate node identifier, creating a contract deployment method corresponding to the target contract in the proxy contract corresponding to the target user node through the administrator node;
invoking the contract deployment method in the proxy contract corresponding to the target user node through the target user node;
deploying the target contract in the blockchain network based on the contract deployment method.
7. The method of claim 1, wherein the number of times threshold is a second number of times threshold, and wherein before the obtaining the number of times threshold for performing contract deployment in the blockchain network in the proxy contract corresponding to the target user node, further comprises:
setting a second time threshold for contract deployment of a deployable user node in the blockchain network in a preset time in a proxy contract corresponding to the target user node through the administrator node, wherein the deployable user node comprises a user node with contract deployment authority in the blockchain network in a plurality of user nodes;
The step of obtaining the threshold of times of contract deployment in the blockchain network in the proxy contracts corresponding to the target user nodes comprises the following steps:
and acquiring the second time threshold of contract deployment of the deployable user node in the blockchain network in the proxy contract corresponding to the target user node.
8. The method of claim 7, wherein the deployed number is a second deployed number, wherein the determining the deployed number for performing contract deployment in the blockchain network based on the proxy contract corresponding to the target user node comprises:
and acquiring the second deployed times of contract deployment of the deployable user node in the blockchain network within the preset time based on the proxy contract corresponding to the target user node.
9. The method of claim 1, wherein the receiving the contract deployment request of the target user node in the blockchain network further comprises:
if the target user node does not have contract deployment authority for performing contract deployment in the blockchain network, initiating node addition transaction by the manager node, wherein the node addition transaction is used for enabling the target user node to have the contract deployment authority;
And executing uplink processing on the node addition transaction to trigger the blockchain network to set the contract deployment authority for the target user node according to the node addition transaction.
10. The method of claim 1, wherein the contract deployment request includes a calling node identification in the blockchain network of a calling user node that can call the target contract, and wherein the deploying the target contract in the blockchain network through the proxy contract corresponding to the target user node further includes:
and feeding back a target contract address of the target contract in the blockchain network to the calling user node according to the calling node identification so that the calling user node calls the target contract according to the target contract address, wherein one target contract corresponds to one target contract address.
11. The method of claim 10, wherein the contract deployment request includes a maximum number of invokables of the target contract, the method further comprising:
receiving a contract calling request sent by a target calling user node, wherein the contract calling request comprises a target calling node identifier of the target calling user node and the times to be called for the target contract;
If the calling node identification comprises the target calling node identification, acquiring the called times of the target contract from the proxy contract corresponding to the target user node;
calculating the sum of the calling times of the current calling times and the called times;
and if the sum of the calling times is smaller than or equal to the maximum calling times, the target calling user node is realized to call the target contract.
12. The method of claim 1, wherein the receiving a contract deployment request for a target user node in the blockchain network comprises:
if the target user nodes are a plurality of, receiving a contract deployment request of at least one target user node in the blockchain network, wherein the contract deployment request comprises a private key of each target user node in the blockchain network and a node identifier;
the determining the deployed times of contract deployment in the blockchain network based on the proxy contract corresponding to the target user node includes:
determining deployed times of contract deployment of each target user node in the blockchain network based on the proxy contract corresponding to the target user node;
If the sum of the deployment times of the number of times to be deployed and the number of times deployed does not exceed the number of times threshold, deploying the target contract in the blockchain network through the proxy contract corresponding to the target user node, including:
and if the sum of the deployed times corresponding to each target user node and the deployed times of the to-be-deployed times does not exceed the time threshold, deploying the target contract through the proxy contract corresponding to the target user node based on the private key of each target user node in the blockchain network and the node identifier.
13. A contract deployment apparatus for use in a blockchain network having a plurality of user nodes, the apparatus comprising:
a receiving unit, configured to receive a contract deployment request of a target user node in the blockchain network, where the contract deployment request is used to instruct at least one target contract to be deployed by the target user node to be deployed in the blockchain network;
a contract acquisition unit configured to determine an administrator node of the blockchain network among a plurality of user nodes included in the blockchain network; receiving a contract first deployment request of first contract deployment of each user node in the blockchain network through the administrator node; deploying, by the administrator node, a proxy contract corresponding to each of the user nodes in the blockchain network based on the contract first deployment request, where the target user node is one of the user nodes included in the blockchain network; acquiring an agent contract deployed by an administrator node of the blockchain network, wherein the agent contract corresponding to the target user node is used for deploying the target contract in the blockchain network according to the contract deployment request;
The time threshold value acquisition unit is used for acquiring a time threshold value for contract deployment in the blockchain network from the proxy contracts corresponding to the target user nodes;
the to-be-deployed frequency acquisition unit is used for acquiring the to-be-deployed frequency of contract deployment of the target user node in the blockchain network currently based on the number of the target contracts;
a deployed number acquisition unit, configured to determine a deployed number of times of contract deployment in the blockchain network based on a proxy contract corresponding to the target user node;
the deployment unit is used for deploying the target contract in the blockchain network through the proxy contract corresponding to the target user node if the sum of the deployment times of the times to be deployed and the deployed times does not exceed the time threshold.
14. A computer device, comprising:
a memory for storing a computer program;
a processor for implementing steps in a method of deploying contracts in a blockchain as in any of claims 1 to 12 when executing the computer program.
15. A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps in the method of deploying contracts in a blockchain as in any of claims 1 to 12.
CN202210056362.7A 2022-01-18 2022-01-18 Method, apparatus, computer device and storage medium for distributing contracts in blockchain Active CN114422535B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210056362.7A CN114422535B (en) 2022-01-18 2022-01-18 Method, apparatus, computer device and storage medium for distributing contracts in blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210056362.7A CN114422535B (en) 2022-01-18 2022-01-18 Method, apparatus, computer device and storage medium for distributing contracts in blockchain

Publications (2)

Publication Number Publication Date
CN114422535A CN114422535A (en) 2022-04-29
CN114422535B true CN114422535B (en) 2024-04-09

Family

ID=81274389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210056362.7A Active CN114422535B (en) 2022-01-18 2022-01-18 Method, apparatus, computer device and storage medium for distributing contracts in blockchain

Country Status (1)

Country Link
CN (1) CN114422535B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392619A (en) * 2017-07-31 2017-11-24 众安信息技术服务有限公司 Intelligent contract processing method and processing device
CN108009823A (en) * 2017-11-03 2018-05-08 厦门快商通信息技术有限公司 The distributed call method and system for calculating power resource based on block chain intelligence contract
CN110602133A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Intelligent contract processing method, block chain management device and storage medium
CN110599179A (en) * 2019-09-25 2019-12-20 腾讯科技(深圳)有限公司 Risk control method based on block chain system and related equipment
CN110908786A (en) * 2019-11-19 2020-03-24 腾讯科技(深圳)有限公司 Intelligent contract calling method, device and medium
CN111062060A (en) * 2019-11-28 2020-04-24 杭州趣链科技有限公司 Voting proposal life cycle management method based on intelligent contract
CN111161006A (en) * 2018-11-08 2020-05-15 北京京东尚科信息技术有限公司 Block chain credit service method, system and storage medium
CN111160911A (en) * 2019-12-31 2020-05-15 杭州趣链科技有限公司 Intelligent contract calling frequency control method facing block chain
CN111240772A (en) * 2020-01-22 2020-06-05 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and storage medium
CN111628997A (en) * 2020-05-26 2020-09-04 中国联合网络通信集团有限公司 Attack prevention method and device
CN112613043A (en) * 2020-12-30 2021-04-06 杭州趣链科技有限公司 Intelligent contract vulnerability detection method based on intelligent contract calling network
CN113037817A (en) * 2020-08-31 2021-06-25 支付宝(杭州)信息技术有限公司 Method and device for starting intelligent contract, electronic equipment and storage medium
CN113242230A (en) * 2021-05-07 2021-08-10 中国科学技术大学 Multi-level authentication and access control system and method based on intelligent contracts
CN113379420A (en) * 2021-06-25 2021-09-10 远光软件股份有限公司 Block chain execution intelligent contract method, computer equipment and block chain system
CN113408746A (en) * 2021-06-22 2021-09-17 深圳大学 Block chain-based distributed federal learning method and device and terminal equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648071B (en) * 2018-05-17 2020-05-19 阿里巴巴集团控股有限公司 Resource value evaluation method and device based on block chain
CN111770113B (en) * 2020-08-31 2021-07-30 支付宝(杭州)信息技术有限公司 Method for executing intelligent contract, block chain node and node equipment
CN111770116B (en) * 2020-08-31 2020-12-15 支付宝(杭州)信息技术有限公司 Method for executing intelligent contract, block chain node and storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392619A (en) * 2017-07-31 2017-11-24 众安信息技术服务有限公司 Intelligent contract processing method and processing device
CN108009823A (en) * 2017-11-03 2018-05-08 厦门快商通信息技术有限公司 The distributed call method and system for calculating power resource based on block chain intelligence contract
CN111161006A (en) * 2018-11-08 2020-05-15 北京京东尚科信息技术有限公司 Block chain credit service method, system and storage medium
CN110602133A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Intelligent contract processing method, block chain management device and storage medium
CN110599179A (en) * 2019-09-25 2019-12-20 腾讯科技(深圳)有限公司 Risk control method based on block chain system and related equipment
CN110908786A (en) * 2019-11-19 2020-03-24 腾讯科技(深圳)有限公司 Intelligent contract calling method, device and medium
CN111062060A (en) * 2019-11-28 2020-04-24 杭州趣链科技有限公司 Voting proposal life cycle management method based on intelligent contract
CN111160911A (en) * 2019-12-31 2020-05-15 杭州趣链科技有限公司 Intelligent contract calling frequency control method facing block chain
CN111240772A (en) * 2020-01-22 2020-06-05 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and storage medium
CN111628997A (en) * 2020-05-26 2020-09-04 中国联合网络通信集团有限公司 Attack prevention method and device
CN113037817A (en) * 2020-08-31 2021-06-25 支付宝(杭州)信息技术有限公司 Method and device for starting intelligent contract, electronic equipment and storage medium
CN112613043A (en) * 2020-12-30 2021-04-06 杭州趣链科技有限公司 Intelligent contract vulnerability detection method based on intelligent contract calling network
CN113242230A (en) * 2021-05-07 2021-08-10 中国科学技术大学 Multi-level authentication and access control system and method based on intelligent contracts
CN113408746A (en) * 2021-06-22 2021-09-17 深圳大学 Block chain-based distributed federal learning method and device and terminal equipment
CN113379420A (en) * 2021-06-25 2021-09-10 远光软件股份有限公司 Block chain execution intelligent contract method, computer equipment and block chain system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于区块链智能合约的物联网恶意节点检测和定位;黄豪杰;吴晓晓;李刚强;;物联网学报(02);全文 *
基于密集度的虚拟力节点部署算法;滕志军;张力;郭力文;吕金玲;;传感技术学报(07);全文 *

Also Published As

Publication number Publication date
CN114422535A (en) 2022-04-29

Similar Documents

Publication Publication Date Title
CN110368676A (en) Control method, device, storage medium and the electronic equipment of touch information
CN110333917A (en) Data processing method, device, equipment and readable storage medium storing program for executing based on micro services
CN113506100B (en) Alliance chain data processing method, device, computer equipment and storage medium
CN113034189A (en) Attribution method, attribution device, computer equipment and storage medium
CN113010238A (en) Permission determination method, device and system for micro application call interface
CN111359210B (en) Data processing method and device, electronic equipment and storage medium
CN114422535B (en) Method, apparatus, computer device and storage medium for distributing contracts in blockchain
CN107332988A (en) Information processing method, mobile terminal and computer-readable recording medium
CN107292614A (en) Pay class application management method, device and mobile terminal
CN111723163A (en) Information processing method, device and system
CN113890753B (en) Digital identity management method, device, system, computer equipment and storage medium
CN112380411B (en) Sensitive word processing method, device, electronic equipment, system and storage medium
CN113342776B (en) Transaction information migration method, device, equipment and medium based on intelligent contract
CN113342429B (en) Intelligent contract data processing method, intelligent contract data processing device, computer equipment and storage medium
CN114449605A (en) Call method, device, terminal equipment and storage medium
US10783020B2 (en) Method for invoking component, and terminal
CN113360883B (en) Intelligent contract processing method and device, computer equipment and storage medium
CN113806801B (en) Transaction information uplink method, device, computer equipment and storage medium
CN116384998A (en) DID contract management method, DID contract management device, electronic equipment and readable storage medium
CN117579853A (en) Information prompting method and device for live broadcasting room, electronic equipment and readable storage medium
CN116384997A (en) DID contract management method, DID contract management system, electronic device and readable storage medium
CN115801717A (en) Welcome language selection method, device, medium and equipment for chat tool
CN114579204A (en) Risk control method, device, terminal and storage medium
CN116192845A (en) Device processing method, device, electronic device and storage medium
CN115622968A (en) Black product behavior blocking method and device, computer equipment and storage medium

Legal Events

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