CN111651469A - Method and device for managing block chain system contract - Google Patents

Method and device for managing block chain system contract Download PDF

Info

Publication number
CN111651469A
CN111651469A CN202010487174.0A CN202010487174A CN111651469A CN 111651469 A CN111651469 A CN 111651469A CN 202010487174 A CN202010487174 A CN 202010487174A CN 111651469 A CN111651469 A CN 111651469A
Authority
CN
China
Prior art keywords
contract
block chain
system contract
address
registration
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.)
Granted
Application number
CN202010487174.0A
Other languages
Chinese (zh)
Other versions
CN111651469B (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.)
Hangzhou Rivtower Technology Co Ltd
Original Assignee
Hangzhou Rivtower Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Rivtower Technology Co Ltd filed Critical Hangzhou Rivtower Technology Co Ltd
Priority to CN202010487174.0A priority Critical patent/CN111651469B/en
Publication of CN111651469A publication Critical patent/CN111651469A/en
Application granted granted Critical
Publication of CN111651469B publication Critical patent/CN111651469B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the specification discloses a method for managing a block chain system contract, which is applied to a first component, and is used for creating a system contract registration contract and deploying the system contract registration contract to a block chain, wherein the system contract registration contract is an intelligent contract for recording the block chain system contract and a method address thereof; the method comprises the following steps: after a system contract is issued and deployed to the block chain, the address of the system contract and the address of the method of the system contract in the block chain are obtained; when the system contract is about a new contract, calling the system contract registration contract to register the new contract; and when the system contract is an existing contract, calling the system contract registration contract to update the existing contract. The invention manages the system contract by using the intelligent contract, thereby completing the discovery, updating and calling processes of the system contract in an automatic mode, reducing the time for stopping and maintaining the block chain system and the application system and improving the service availability.

Description

Method and device for managing block chain system contract
Technical Field
The present disclosure relates to the field of computer software technologies, and in particular, to a method, an apparatus, a system, and an electronic device for managing a block chain system contract.
Background
In order to meet the requirements of admission control, identity authentication, configuration management, authority management and the like, a set of intelligent contracts which are powerful in function, flexible in structure and capable of supporting customized extension, which are collectively called system contracts, are deployed at the beginning of network startup. The system contract is in principle validated by the blockchain administrator at the initial deployment of the network. If the change upgrade is redeployed during network operation, it needs to be performed by the blockchain administrator with permission from all nodes of the entire network. What system contracts, contract method addresses are available in the blockchain, which is typically published to administrators of blockchain nodes through documents. Because the content in the blockchain has the characteristic of being incapable of being changed, generally, the upgrading of the blockchain intelligent contract needs to issue a new contract, so that an application system cannot know a new contract address, and thus a new system contract cannot be directly used. The upgrade process often requires a system administrator to issue a change instruction to an administrator of each node, and the administrator of the node notifies the application system administrator to complete adaptation of a new block system contract by modifying and upgrading an application system program. The process is manually participated, multi-role participated, is easy to make mistakes, and needs to apply system shutdown maintenance, therefore, the process should be completed in an automatic mode, thereby reducing the time of system shutdown maintenance and improving the availability of the system.
Disclosure of Invention
In order to solve the above problems, the present invention first deploys a common intelligent contract to register a newly deployed system contract and an address of a method thereof, so as to facilitate an application system to obtain the system contract and the address of the method thereof, and facilitate the system contract in a block chain system to be easily obtained, discovered, and automatically adapted.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
in a first aspect, a method for managing a block chaining system contract is provided,
the method comprises the steps that after a system contract registration contract is created and deployed to a blockchain, the system contract registration contract is an intelligent contract recording system contracts of the blockchain and method addresses of the system contract; further comprising:
after a system contract is issued and deployed to the block chain, the address of the system contract and the address of the method of the system contract in the block chain are obtained;
when the system contract is about to be a new contract, calling the system contract to register the contract as the new contract;
when the system contracts an existing contract, calling the system contract to register the contract and updating the existing contract to a new contract.
In a second aspect, an apparatus for managing a block chaining system contract is provided, comprising:
the acquisition module is used for acquiring the addresses of the system contracts and the method thereof in the block chain after the system contract registration contracts are created and deployed to the block chain and the system contracts are issued and deployed to the block chain, wherein the system contract registration contracts are intelligent contracts recording the system contracts and the method addresses of the block chain;
the calling module is used for calling the system contract to register the contract as a new contract when the system contract is about the new contract; and the number of the first and second groups,
and the contract management module is used for calling the system contract registration contract to update the existing contract to the new contract when the system contract is the existing contract.
In a third aspect, a method for managing a block chaining system contract is provided, which is applied to a second component, and includes:
calling a query method of a system contract registration contract to acquire all callable system contract addresses in a block chain;
acquiring the address of the system contract method according to the system contract address required by the block chain node or the application program;
and sending the addresses of the system contracts and the methods thereof to a block chain node or an application program so that the block chain node or the application program calls the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
In a fourth aspect, an apparatus for managing a block chaining system contract is provided, including:
the calling module is used for calling a query method of the system contract registration contract to acquire all the callable system contract addresses in the block chain;
the acquisition module is used for acquiring the address of the system contract method according to the system contract address required by the block link node or the application program;
and the sending module is used for sending the addresses of the system contracts and the methods thereof to the block chain nodes or the application programs so as to enable the block chain nodes or the application programs to call the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
In a fifth aspect, a system for managing a blockchain system contract is provided, comprising a first component and a second component, wherein,
the first component creates a system contract registration contract and deploys the contract to a block chain, obtains the system contract and a method address thereof deployed to the block chain, and calls the system contract registration contract to complete registration or updating of the system contract and the method thereof; the second component is arranged in a node or an application program, and acquires the system contract and a method address thereof through a system contract registration contract;
the first component sends the system contract and its method address to the blockchain; a plurality of the second components request the system contracts and their method addresses from the blockchain.
In a sixth aspect, an electronic device is provided, including: a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of the first aspect.
In a seventh aspect, an electronic device is provided, including: a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of the third aspect.
In an eighth aspect, a computer-readable storage medium is presented, which stores one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of the first aspect.
In a ninth aspect, a computer readable storage medium is presented, storing one or more programs which, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of the third aspect.
The specification can achieve at least the following technical effects:
the invention manages the system contract by using the intelligent contract, thereby completing the discovery, updating and calling processes of the system contract in an automatic mode, reducing the time for stopping and maintaining the block chain system and the application system and improving the service availability.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic diagram illustrating steps of a method for managing contracts of a blockchain system according to an embodiment of the present disclosure.
Fig. 2 is a second schematic diagram illustrating steps of a method for managing contracts of a blockchain system according to an embodiment of the present disclosure.
Fig. 3 is a third schematic diagram of the steps of a method for managing a system contract of a blockchain according to an embodiment of the present disclosure.
Fig. 4 is a diagram illustrating a fourth step of a method for managing a system contract of a blockchain according to an embodiment of the present disclosure.
Fig. 5 is a diagram illustrating fifth steps of a method for managing a system contract of a blockchain according to an embodiment of the present disclosure.
Fig. 6 is a sixth schematic diagram illustrating method steps for managing a blockchain system contract according to an embodiment of the present disclosure.
Fig. 7 is a schematic diagram of an apparatus for managing contracts of a blockchain system according to an embodiment of the present disclosure.
Fig. 8 is a second schematic diagram of an apparatus for managing contracts of a blockchain system according to an embodiment of the present disclosure.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
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.
Key terms
Block chaining techniques: the distributed data processing system is a brand new distributed infrastructure and computing paradigm for verifying and storing data by using a block chain type data structure, generating and updating data by using a distributed node consensus algorithm, ensuring the safety of data transmission and access by using a cryptographic mode, and programming and operating data by using an intelligent contract consisting of automatic script codes. In essence, it is a shared database, and the data or information stored in it has the characteristics of being unforgeable, having trace in the whole course, being traceable, being publicly transparent, being maintained collectively, and the like. Based on the characteristics, the block chain technology lays a solid trust foundation, creates a reliable cooperation mechanism and has wide application prospect.
Intelligent contract: the program running in the block chain system has the characteristics of automatic execution according to the set logic and non-falsification of the execution result.
A system contract: some intelligent contracts built into the blockchain system encapsulate management functions that affect the system level, such as rights management, account identity management, etc. The system contract is in principle validated by the blockchain administrator at the initial deployment of the network. If the change upgrade is redeployed during network operation, it needs to be performed by the blockchain administrator with permission from all nodes of the entire network.
The contract method comprises the following steps: the defined function in the intelligent contract is declared as publicly-invokable and can be called by an external program or other contracts. A contract method that is successfully deployed has a globally unique address that can be called by an external program.
The following describes a detailed example of a scheme for managing a blockchain system contract using a blockchain intelligent contract according to the present specification.
Example one
Because the content in the blockchain has the characteristic of being incapable of being changed, the application system cannot know a new contract address and cannot directly use a new system contract due to the fact that the block chain system contract needs to be issued when being upgraded. This upgrade process often requires the blockchain network administrator to issue a change specification to each node administrator, who then notifies the application administrator to complete the adaptation of the new system contract by modifying and upgrading the application. The process has manual participation and multi-role participation, is easy to make errors, and needs shutdown maintenance of an application system.
Thus, in a scheme that uses blockchain intelligent contracts to manage blockchain system contracts, 2-party execution agents are involved, one party being a blockchain network and the other party being a node or application. The first component is formed by encapsulation in 3 stages of deploying system contract registration contract service, issuing system contract, updating system contract and the like in the blockchain, and is executed by a blockchain network administrator. And calling a system contract registration contract to obtain a system contract address, calling a system contract method address, executing a system contract method and the like, packaging to form a second component, and executing by a block link point or an application program administrator. A blockchain network includes a first component, a first component corresponding to a plurality of blockchain nodes and also supporting a plurality of applications; a blockchain node or application comprises a second component; the blockchain node or application invokes a system contract registration contract query and invokes a system contract and methods thereof via the second component.
For blockchain networks:
in the stage of deploying the system contract registration contracts, firstly, a system contract registration contract is created by a first component built in a block chain network, the system contract registration contract is a public intelligent contract which is specially used for recording the block chain system contract and a method address thereof, and the method for registering the system contract comprises at least one of registration, updating and query of the system contract; the contract is then deployed onto the blockchain.
In the stage of issuing the system contract, a block chain network administrator encapsulates and compiles the written system contract and the method thereof and deploys the system contract and the method to a block chain. Because the content of the existing blockchain network has the characteristic of being unchangeable, generally, the upgrading of the blockchain intelligent contract needs to issue a new contract, so that an application system cannot know a new contract address, and a new system contract cannot be directly used. Therefore, when a new system contract is issued, the system contract registration contract is called to register the newly issued system contract, namely, the addresses of the system contract and the method thereof in the block chain network are received; and searching whether the address of the system contract and the method thereof exists in the block chain network, and if not, storing the address of the system contract and the method thereof into the block chain.
In the stage of updating the system contract, the block chain network administrator needs to encapsulate and compile the compiled system contract and the method thereof and then deploy the system contract and the method to the block chain; then, receiving the original system contract address and the address of the new system contract and the method thereof in the block chain network; and searching whether the original system contract address exists in a block chain network, and if so, replacing the original system contract and the method address thereof with the address of the new system contract and the method thereof and storing the new system contract and the method address in the block chain network.
For blockchain nodes or applications:
in the process of calling and executing a system contract method, a blockchain node or an application program needs to master the latest address of the system contract and the method thereof, and the process needs to call a system contract registration contract to complete. Firstly, calling a query method of a system contract registration contract to acquire all callable system contract addresses in a block chain; then, acquiring the address of the system contract method according to the system contract address required by the block chain node or the application program; and sending the addresses of the system contracts and the methods thereof to a block chain node or an application program so that the block chain node or the application program calls the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
In summary, the system for managing the system contract of the blockchain based on the technical solution includes a first component and a second component, wherein,
the first component creates a system contract registration contract and deploys the contract to a block chain, obtains the system contract and a method address thereof deployed to the block chain, and calls the system contract registration contract to complete registration or updating of the system contract and the method thereof; the second component is arranged in a node or an application program, and acquires the system contract and a method address thereof through a system contract registration contract;
the first component sends the system contract and its method address to the blockchain; a plurality of the second components request the system contracts and their method addresses from the blockchain.
Example two
Referring to fig. 1, a schematic diagram of steps of a method for managing a blockchain system contract provided in an embodiment of the present specification is provided, where an execution subject of the method may be a blockchain system side, and an executor is a blockchain network administrator, that is, defined as a first component in the present specification; the first component may specifically be a service program or an electronic device such as a terminal. The method creates a system contract registration contract and deploys the system contract registration contract to the blockchain, the system contract registration contract method comprises at least one of registration, updating and query of the system contract, and the written system contract registration contract is deployed to the blockchain network, and the method comprises the following steps:
step 101: a system contract registration contract is created and deployed to the blockchain, the system contract registration contract being an intelligent contract that records the blockchain system contract and its method addresses, so as to obtain the method addresses of the system contract registration contract for system contract registration, updating and querying.
Optionally, the method for processing a registration transaction of a system contract registration contract is shown in fig. 3 and includes:
step 121: receiving an address of a system contract and a method thereof;
step 122: storing addresses of the system contract and its methods to the blockchain.
Optionally, the update transaction processing method of the system contract registration contract is shown in fig. 4 and includes:
step 131: receiving an original system contract address and an address of a new system contract and a method thereof;
step 132: and replacing the original system contract and the method address thereof with the address of the new system contract and the method thereof, and storing the new system contract and the method thereof in the block chain.
Optionally, the query transaction processing method of the system contract registration contract is shown in fig. 5, and includes:
step 141: inquiring and feeding back all the system contract addresses which are registered in the block chain and can be called;
step 142: and inquiring and feeding back the addresses of all contract methods according to the system contract addresses requested by the block connection points or the application programs.
Step 102: and after issuing a system contract and deploying the system contract to the block chain, acquiring the address of the system contract and the address of the method thereof in the block chain.
Because the content of the existing blockchain network has the characteristic of being unchangeable, generally, the upgrading of the blockchain intelligent contract needs to issue a new contract, so that an application system cannot know the address of the new system contract, and the new system contract cannot be directly used. The system contract registration contract has the function that after the system contract and the method thereof are deployed in the blockchain network and are endowed with corresponding storage addresses, the system contract registration contract is used as a public intelligent contract and issues the address of the latest system contract and the method thereof to the whole blockchain network so as to be used by the blockchain link points or application programs needing to call the system contracts.
It should be understood that, since the system contract undertakes some common behaviors in the blockchain network, such as the authority management of the account, the identity management of the account, and the like, when the blockchain contract is used for blockchain system management, the blockchain node or the application program can complete hot update without restarting, that is, update codes are dynamically issued, and the system configuration can be synchronized without restarting a device or the application program. And after a new node or application program is added, the block chain ledger data synchronization is completed, and the same system contract function and configuration can be immediately realized. Therefore, the introduction of the system contract registration contract solves the automatic perception that the block chain link point or the application program newly releases and updates the system contract, namely the block chain node or the application program is internally provided with the calling function of the system contract registration contract, so that the function of acquiring the latest address of the system contract and the method thereof can be realized.
Step 103: when the system contract is about to be a new contract, calling the system contract to register the contract as the new contract;
step 104: when the system contracts an existing contract, calling the system contract to register the contract and updating the existing contract to a new contract.
Alternatively, referring to fig. 2, a schematic diagram of method steps for managing a blockchain system contract provided for an embodiment of the present specification may be provided, where an execution subject of the method may be a blockchain system side, and an executor is a blockchain network administrator, that is, defined as a first component in the present specification; the first component may specifically be a service program or an electronic device such as a terminal. The method creates a system contract registration contract and deploys the system contract registration contract to the blockchain, the system contract registration contract method comprises at least one of registration, updating and query of the system contract, and the written system contract registration contract is deployed to the blockchain network. Wherein the content of the first and second substances,
the method for processing the registration transaction of the system contract registration contract is shown in fig. 3 and comprises the following steps:
step 121: receiving an address of a system contract and a method thereof;
step 122: storing addresses of the system contract and its methods to the blockchain.
The update transaction processing method of the system contract registration contract is shown in fig. 4 and comprises the following steps:
step 131: receiving an original system contract address and an address of a new system contract and a method thereof;
step 132: and replacing the original system contract and the method address thereof with the address of the new system contract and the method thereof, and storing the new system contract and the method thereof in the block chain.
The query transaction processing method of the system contract registration contract is shown in fig. 5 and comprises the following steps:
step 141: inquiring and feeding back all the system contract addresses which are registered in the block chain and can be called;
step 142: and inquiring and feeding back the addresses of all contract methods according to the system contract addresses requested by the block connection points or the application programs.
Step 111: and after issuing a system contract and deploying the system contract to the block chain, acquiring the address of the system contract and the address of the method thereof in the block chain.
Because the content of the existing blockchain network has the characteristic of being unchangeable, generally, the upgrading of the blockchain intelligent contract needs to issue a new contract, so that an application system cannot know the address of the new system contract, and the new system contract cannot be directly used. The system contract registration contract has the function that after the system contract and the method thereof are deployed in the blockchain network and are endowed with corresponding storage addresses, the system contract registration contract is used as a public intelligent contract and issues the address of the latest system contract and the method thereof to the whole blockchain network so as to be used by the blockchain link points or application programs needing to call the system contracts.
It should be understood that, since the system contract undertakes some common behaviors in the blockchain network, such as the authority management of the account, the identity management of the account, and the like, when the blockchain contract is used for blockchain system management, the blockchain node or the application program can complete hot update without restarting, that is, update codes are dynamically issued, and the system configuration can be synchronized without restarting a device or the application program. And after a new node or application program is added, the block chain ledger data synchronization is completed, and the same system contract function and configuration can be immediately realized. Therefore, the introduction of the system contract registration contract solves the automatic perception that the block chain link point or the application program newly releases and updates the system contract, namely the block chain node or the application program is internally provided with the calling function of the system contract registration contract, so that the function of acquiring the latest address of the system contract and the method thereof can be realized.
Step 112: when the system contract is about to be a new contract, calling the system contract to register the contract as the new contract;
step 113: when the system contracts an existing contract, calling the system contract to register the contract and updating the existing contract to a new contract.
Referring to fig. 6, a schematic diagram of steps of a method for managing contracts of a blockchain system provided in an embodiment of the present specification is provided, where an execution subject of the method may be a blockchain point or an application side, and is defined as a second component in the present specification; the second component is placed in a blockchain node or an application program, and the method comprises the following steps:
step 201: calling a query method of a system contract registration contract to acquire all callable system contract addresses in a block chain;
step 202: acquiring the address of the system contract method according to the system contract address required by the block chain node or the application program;
step 203: and sending the addresses of the system contracts and the methods thereof to a block chain node or an application program so that the block chain node or the application program calls the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
The invention manages the system contract by using the intelligent contract, thereby completing the discovery, updating and calling processes of the system contract in an automatic mode, reducing the time for stopping and maintaining the block chain system and the application system and improving the service availability.
EXAMPLE III
Fig. 7 is a schematic structural diagram of an apparatus 600 for managing a blockchain system contract according to an embodiment of the present disclosure. Referring to fig. 7, in one embodiment, an apparatus 600 for managing a blockchain system contract includes:
the obtaining module 601 is configured to obtain addresses of the system contract and the method thereof in the blockchain after creating a system contract registration contract and deploying the system contract to the blockchain, and after issuing the system contract and deploying the system contract to the blockchain, where the system contract registration contract is an intelligent contract that records addresses of the blockchain system contract and the method thereof.
The method for registering the system contract registration contract comprises the following steps: receiving an address of a system contract and a method thereof; and searching whether the addresses of the system contract and the method thereof exist in the block chain, and if not, storing the addresses of the system contract and the method thereof into the block chain.
The method for updating the system contract registration contract comprises the following steps: receiving an original system contract address and an address of a new system contract and a method thereof; and searching whether the original system contract address exists in the block chain, if so, replacing the original system contract and the method address thereof with the address of the new system contract and the method thereof, and storing the new system contract and the method thereof in the block chain.
The inquiry method of the system contract registration contract comprises the following steps: inquiring and feeding back all the system contract addresses registered in the block chain; and inquiring and feeding back the addresses of all contract methods according to the system contract addresses.
A calling module 602, configured to, when the system contract is a new contract, call the system contract to register the contract as the new contract; and the number of the first and second groups,
and the contract management module is used for calling the system contract registration contract to update the existing contract to the new contract when the system contract is the existing contract.
Fig. 8 is a schematic structural diagram of an apparatus 700 for managing a blockchain system contract according to an embodiment of the present disclosure. Referring to fig. 8, in one embodiment, an apparatus 700 for managing a blockchain system contract includes:
the calling module 701 is used for calling a query method of a system contract registration contract to acquire all callable system contract addresses in a block chain;
an obtaining module 702, configured to obtain an address of the system contract method according to the system contract address required by a block chain node or an application;
a sending module 703, configured to send the address of the system contract and the method thereof to a block link point or an application program, so that the block link point or the application program invokes the method of the system contract according to the address of the system contract and the method thereof.
In fact, the apparatus 700 for managing the blockchain system contract may further include: the receiving module is used for receiving a system contract request required by the node or the application program and receiving transaction processing result data returned by a system contract register contract.
It should be understood that the apparatus for managing blockchain system contracts according to the embodiment of the present disclosure may also perform the method performed by the apparatus (or device) for managing blockchain system contracts in fig. 1 to 6, and implement the functions of the apparatus (or device) for managing blockchain system contracts according to the embodiment shown in fig. 1 to 6, which are not described herein again.
Example four
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present specification. Referring to fig. 9, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the shared resource access control device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
applied to a first component, comprising:
creating a system contract registration contract and deploying the system contract registration contract to the blockchain, wherein the system contract registration contract is an intelligent contract recording the blockchain system contract and a method address thereof;
issuing a system contract, deploying the system contract to the block chain, and receiving the address of the system contract and the method thereof in the block chain;
when the system contract is about a new contract, calling the system contract registration contract to register the system contract and the method address thereof;
and when the system contract is an existing contract, calling the system contract registration contract pair to update the original system contract and the method address thereof into a new system contract and the method address thereof.
Alternatively, the first and second electrodes may be,
applied to a second component comprising:
calling a query method of a system contract registration contract to acquire all callable system contract addresses in a block chain;
acquiring the address of the system contract method according to the system contract address required by the block chain node or the application program;
and sending the addresses of the system contracts and the methods thereof to a block chain node or an application program so that the block chain node or the application program calls the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
The method for managing the block chain system contract disclosed in the embodiments of fig. 1 to 6 in this specification may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
EXAMPLE five
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiments shown in fig. 1 to 6, and in particular to perform the method of:
applied to a first component, comprising:
creating a system contract registration contract and deploying the system contract registration contract to the blockchain, wherein the system contract registration contract is an intelligent contract recording the blockchain system contract and a method address thereof;
issuing a system contract, deploying the system contract to the block chain, and receiving the address of the system contract and the method thereof in the block chain;
when the system contract is about a new contract, calling the system contract registration contract to register the system contract and the method address thereof;
and when the system contract is an existing contract, calling the system contract registration contract pair to update the original system contract and the method address thereof into a new system contract and the method address thereof.
Alternatively, the first and second electrodes may be,
applied to a second component comprising:
calling a query method of a system contract registration contract to acquire all callable system contract addresses in a block chain;
acquiring the address of the system contract method according to the system contract address required by the block chain node or the application program;
and sending the addresses of the system contracts and the methods thereof to a block chain node or an application program so that the block chain node or the application program calls the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
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 computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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.
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 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.
It should also be noted that 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. The use of the phrase "including a" does not exclude the presence of other, identical elements in the process, method, article, or apparatus that comprises the same element, whether or not the same element is present in all of the same element.
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.

Claims (13)

1. A method of managing blockchain system contracts, applied to a first component, the system contract registration contract being an intelligent contract that records blockchain system contracts and their method addresses after the system contract registration contract is created and deployed to a blockchain; the method comprises the following steps:
after a system contract is issued and deployed to the block chain, the address of the system contract and the address of the method of the system contract in the block chain are obtained;
when the system contract is about to be a new contract, calling the system contract to register the contract as the new contract;
when the system contracts an existing contract, calling the system contract to register the contract and updating the existing contract to a new contract.
2. The method of claim 1, wherein the system contract enrollment contract further includes a query method for the system contract.
3. The method of claim 1, wherein the method of registering a system contract into a contract comprises:
receiving an address of a system contract and a method thereof;
storing addresses of the system contract and its methods to the blockchain.
4. The method of claim 1, wherein the method of updating the system contract registration contract comprises:
receiving an original system contract address and an address of a new system contract and a method thereof;
and replacing the original system contract and the method address thereof with the address of the new system contract and the method thereof, and storing the new system contract and the method thereof in the block chain.
5. The method of claim 2, wherein the query method of the system contract registration contract comprises:
inquiring and feeding back all the system contract addresses which are registered in the block chain and can be called; and
and inquiring and feeding back the addresses of all contract methods according to the system contract addresses requested by the block connection nodes or the application programs.
6. An apparatus for managing a blockchain system contract, comprising:
the acquisition module is used for acquiring the addresses of the system contracts and the method thereof in the block chain after the system contract registration contracts are created and deployed to the block chain and the system contracts are issued and deployed to the block chain, wherein the system contract registration contracts are intelligent contracts recording the system contracts and the method addresses of the block chain;
the calling module is used for calling the system contract to register the contract as a new contract when the system contract is about the new contract; and the number of the first and second groups,
and the contract management module is used for calling the system contract registration contract to update the existing contract to the new contract when the system contract is the existing contract.
7. A method for managing a blockchain system contract, applied to a second component, comprising:
calling a query method of a system contract registration contract to acquire all callable system contract addresses in a block chain;
acquiring the address of the system contract method according to the system contract address required by the block chain node or the application program;
and sending the addresses of the system contracts and the methods thereof to a block chain node or an application program so that the block chain node or the application program calls the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
8. An apparatus for managing a blockchain system contract, comprising:
the calling module is used for calling a query method of the system contract registration contract to acquire all the callable system contract addresses in the block chain;
the acquisition module is used for acquiring the address of the system contract method according to the system contract address required by the block link node or the application program;
and the sending module is used for sending the addresses of the system contracts and the methods thereof to the block chain nodes or the application programs so as to enable the block chain nodes or the application programs to call the methods of the system contracts according to the addresses of the system contracts and the methods thereof.
9. A system for managing block chain system contracts, comprising a first component and a second component, wherein,
the first component creates a system contract registration contract and deploys the contract to a block chain, obtains the system contract and a method address thereof deployed to the block chain, and calls the system contract registration contract to complete registration or updating of the system contract and the method thereof; the second component is arranged in a node or an application program, and acquires the system contract and a method address thereof through a system contract registration contract;
the first component sends the system contract and its method address to the blockchain; a plurality of the second components request the system contracts and their method addresses from the blockchain.
10. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any of claims 1 to 5.
11. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of claim 7.
12. A computer readable storage medium, characterized in that the computer readable storage medium stores one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of any of claims 1 to 5.
13. A computer readable storage medium storing one or more programs which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform the method of claim 7.
CN202010487174.0A 2020-06-01 2020-06-01 Method and device for managing blockchain system contracts Active CN111651469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010487174.0A CN111651469B (en) 2020-06-01 2020-06-01 Method and device for managing blockchain system contracts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010487174.0A CN111651469B (en) 2020-06-01 2020-06-01 Method and device for managing blockchain system contracts

Publications (2)

Publication Number Publication Date
CN111651469A true CN111651469A (en) 2020-09-11
CN111651469B CN111651469B (en) 2023-05-26

Family

ID=72347013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010487174.0A Active CN111651469B (en) 2020-06-01 2020-06-01 Method and device for managing blockchain system contracts

Country Status (1)

Country Link
CN (1) CN111651469B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117172913A (en) * 2023-10-12 2023-12-05 广州保德来小额贷款有限公司 Intelligent contract-based contract change procedure execution method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943580A (en) * 2017-11-13 2018-04-20 上海点融信息科技有限责任公司 For managing the method and equipment of user's intelligence contract at block chain link point
CN109087104A (en) * 2018-08-29 2018-12-25 北京京东尚科信息技术有限公司 Block chain intelligence contract administration method and system, computer readable storage medium
CN110348202A (en) * 2019-07-12 2019-10-18 北京物资学院 A kind of mutual role help system and method based on block chain intelligence contract
KR20200048458A (en) * 2018-10-30 2020-05-08 서강대학교산학협력단 Method for managing wallet address of blockchain system and processing transaction based on domain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943580A (en) * 2017-11-13 2018-04-20 上海点融信息科技有限责任公司 For managing the method and equipment of user's intelligence contract at block chain link point
CN109087104A (en) * 2018-08-29 2018-12-25 北京京东尚科信息技术有限公司 Block chain intelligence contract administration method and system, computer readable storage medium
KR20200048458A (en) * 2018-10-30 2020-05-08 서강대학교산학협력단 Method for managing wallet address of blockchain system and processing transaction based on domain
CN110348202A (en) * 2019-07-12 2019-10-18 北京物资学院 A kind of mutual role help system and method based on block chain intelligence contract

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117172913A (en) * 2023-10-12 2023-12-05 广州保德来小额贷款有限公司 Intelligent contract-based contract change procedure execution method and system
CN117172913B (en) * 2023-10-12 2024-02-13 广州保德来小额贷款有限公司 Intelligent contract-based contract change procedure execution method and system

Also Published As

Publication number Publication date
CN111651469B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
CN109669709B (en) Data migration method and data migration system for block chain upgrading
CN110597918A (en) Account management method and device and computer readable storage medium
CN111651467B (en) Block chain node interface issuing and calling method and device
CN111461887A (en) Block chain consensus processing method and device and electronic equipment
EP3584732B1 (en) Application management method for terminal, application server and terminal
CN111639308A (en) Software serial number distribution verification method and device based on block chain
CN111899008A (en) Resource transfer method, device, equipment and system
CN112751935B (en) Request processing method and device, electronic equipment and storage medium
CN111651469A (en) Method and device for managing block chain system contract
CN111461886B (en) Management method and device for system configuration independent of intelligent contracts on block chains
CN108563514B (en) Method for accessing application configuration service, application and electronic equipment
CN111949297A (en) Block chain intelligent contract upgrading method and device and electronic equipment
CN114221865B (en) Method, device, equipment and storage medium for realizing business function of Internet of things terminal
CN113065120B (en) Interface calling authentication method and device, electronic equipment and readable storage medium
CN112738181B (en) Method, device and server for cluster external IP access
CN115511595A (en) Service execution method and device based on block chain
CN112416612B (en) Service calling method and device, computer equipment and readable storage medium
CN114462101A (en) Processing system, method and device for application apk packet
CN111444483A (en) Authentication method, device and equipment
CN110727498B (en) Virtual network function management method, NFVO, block chain node and MANO network element
CN113326201A (en) Software testing method based on distributed system, electronic equipment and storage medium
CN113507432A (en) Alliance link authority management method and device
CN111796864A (en) Data verification method and device
CN111030826A (en) Certificate revocation method and device for block chain network and electronic equipment
CN111369246A (en) Calling authentication method and device of intelligent contract, electronic 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
CB02 Change of applicant information

Address after: 10th Floor, Guotou Building, No. 398 Shaoxing Road, Gongshu District, Hangzhou City, Zhejiang Province, 310014

Applicant after: Hangzhou Xita Technology Co.,Ltd.

Address before: No. 1001, 10th floor, block a, Huaxing Times Square, 478 Wensan Road, Xihu District, Hangzhou City, Zhejiang Province, 310012

Applicant before: Hangzhou Xita Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant