CN111651469B - Method and device for managing blockchain system contracts - Google Patents

Method and device for managing blockchain system contracts Download PDF

Info

Publication number
CN111651469B
CN111651469B CN202010487174.0A CN202010487174A CN111651469B CN 111651469 B CN111651469 B CN 111651469B CN 202010487174 A CN202010487174 A CN 202010487174A CN 111651469 B CN111651469 B CN 111651469B
Authority
CN
China
Prior art keywords
contract
blockchain
address
system contract
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.)
Active
Application number
CN202010487174.0A
Other languages
Chinese (zh)
Other versions
CN111651469A (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

Landscapes

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

Abstract

The embodiment of the specification discloses a method for managing a blockchain system contract, which is applied to a first component, creates a system contract registration contract and deploys the system contract registration contract to a blockchain, wherein the system contract registration contract is an intelligent contract for recording the blockchain system contract and a method address thereof; comprising 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 thereof in the block chain are acquired; when the system is about to be a new contract, calling the system contract registration contract to register the new contract; and when the system contract is about an existing contract, calling the system contract registration contract to update the existing contract. The invention manages the system contracts by using the intelligent contracts, thereby completing the discovery, updating and calling processes of the system contracts in an automatic mode, reducing the downtime maintenance time of the blockchain system and the application system and improving the service availability.

Description

Method and device for managing blockchain system contracts
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 blockchain system contract.
Background
In order to meet the requirements of access control, identity authentication, configuration management, authority management and the like, a set of intelligent contracts which are powerful in function, flexible in structure and supporting custom expansion are deployed at the beginning of network starting, and are collectively called system contracts. The system contracts are in principle validated by the blockchain administrator to deploy the whole network at the beginning of the network start. If the change upgrade is redeployed during network operation, operations need to be performed by the blockchain administrator with permission from all nodes of the whole network. What system contracts, contract method addresses are in the blockchain are available, which is typically published by a document to an administrator of the blockchain node. Because the content in the existing blockchain has the characteristic of being unchangeable, the updating of the blockchain intelligent contract generally needs to issue a new contract, which causes the application system to be unable to know the new contract address, and thus the new system contract cannot be directly used. The upgrade process often requires a system administrator to issue a change description to the administrators of each node, and the administrators of the nodes notify the application system administrator again, and complete the adaptation of the new block system contract by modifying and upgrading the application system program. The process has the advantages of manual participation and multi-role participation, is easy to make mistakes, and needs to stop and maintain the application system, so that the process is finished in an automatic mode, the time of the system stop and maintenance is reduced, and the usability of the system is improved.
Disclosure of Invention
In order to solve the above problems, the present invention registers the address of a newly deployed system contract and its method by first deploying a public intelligent contract, thereby facilitating the application system to acquire the system contract and its method address, so that the system contract in the blockchain system is easily acquired, discovered and automatically adapted.
In order to solve the above technical problems, the embodiments of the present specification are implemented as follows:
in a first aspect, a method of managing a blockchain system contract is presented,
applying to a first component, after creating a system contract registration contract and deploying to a blockchain, the system contract registration contract being an intelligent contract that records addresses of the blockchain system contract and methods thereof; further comprises:
after a system contract is issued and deployed to the block chain, the address of the system contract and the address of the method thereof in the block chain are acquired;
when the system contracts as a new contract, calling the system contract registration contract to register as the new contract;
when the system contracts about existing contracts, the system contract registration contract is called to update the existing contracts to new contracts.
In a second aspect, an apparatus for managing a blockchain system contract is provided, comprising:
an obtaining module, configured to obtain an address of a system contract and a method thereof in a blockchain after a system contract registration contract is created and deployed to the blockchain, and after a system contract is issued and deployed 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;
a calling module, configured to call the system contract registration contract to register as a new contract when the system contract is about the new contract; the method comprises the steps of,
for invoking the system contract registration contract to update the existing contract to a new contract when the system contract is about the existing contract.
In a third aspect, a method of managing a blockchain system contract is provided, for use with a second component, comprising:
calling a query method of a system contract registration contract to acquire all callable system contract addresses in a blockchain;
acquiring an address of the system contract method according to the system contract address required by a blockchain node or an application program;
and sending the address of the system contract and the address of the method thereof to a blockchain node or an application program so that the blockchain node or the application program can call the method of the system contract according to the address of the system contract and the address of the method thereof.
In a fourth aspect, an apparatus for managing blockchain system contracts is provided, comprising:
the calling module is used for calling a query method of the system contract registration contract to acquire all 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 blockchain node or the application program;
and the sending module is used for sending the address of the system contract and the method thereof to a blockchain node or an application program so that the blockchain node or the application program can call the method of the system contract according to the address of the system contract and the method thereof.
In a fifth aspect, a system for managing blockchain system contracts is provided, comprising a first component and a second component, wherein,
the first component creates a system contract registration contract and deploys the system contract registration contract to a blockchain, acquires the system contract and a method address of the system contract deployed to the blockchain, and calls the system contract registration contract to complete registration or update of the system contract and the method thereof; the second component is arranged in a node or an application program, and the system contract and the method address thereof are acquired through a system contract registration contract;
The first component sending the system contract and its method address to the blockchain; a plurality of the second components request the system contract and its method address from the blockchain.
In a sixth aspect, an electronic device is provided, including: a processor; and
a memory arranged to store computer executable instructions which, 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 which, when executed, cause the processor to perform the method of the third aspect.
In an eighth aspect, a computer readable storage medium is provided, the computer readable storage medium 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 first aspect.
In a ninth aspect, a computer readable storage medium is provided, the computer readable storage medium 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 contracts by using the intelligent contracts, thereby completing the discovery, updating and calling processes of the system contracts in an automatic mode, reducing the downtime maintenance time of the blockchain system and the application system and improving the service availability.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some of the embodiments described in the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a diagram illustrating steps of a method for managing blockchain system contracts in accordance with an embodiment of the present disclosure.
FIG. 2 is a second exemplary method for managing blockchain system contracts in accordance with the embodiments of the present disclosure.
FIG. 3 is a third exemplary method for managing blockchain system contracts according to the present disclosure.
FIG. 4 is a diagram illustrating steps of a method for managing blockchain system contracts in accordance with an embodiment of the present disclosure.
FIG. 5 is a diagram illustrating steps of a method for managing blockchain system contracts in accordance with an embodiment of the present disclosure.
FIG. 6 is a diagram illustrating steps of a method for managing blockchain system contracts in accordance with an embodiment of the present disclosure.
FIG. 7 is a diagram illustrating an apparatus for managing blockchain system contracts in accordance with an embodiment of the present disclosure.
FIG. 8 is a second diagram illustrating an apparatus for managing blockchain system contracts in accordance with the embodiments of the present disclosure.
Fig. 9 is one of schematic structural diagrams of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, 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 some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
Key terms
Blockchain techniques: the system is a brand new distributed infrastructure and calculation paradigm which uses a block chain type data structure to verify and store data, uses a distributed node consensus algorithm to generate and update data, uses a cryptography mode to ensure the safety of data transmission and access, and uses an intelligent contract consisting of automatic script codes to program and operate the data. Essentially, the system is a shared database, and data or information stored in the shared database has the characteristics of incapability of counterfeiting, whole trace, traceability, openness, transparency, collective maintenance and the like. Based on the characteristics, the blockchain 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.
System contracts: some intelligent contracts built in the blockchain system encapsulate management functions such as rights management, account identity management, etc. that affect the system level. The system contracts are in principle validated by the blockchain administrator to deploy the whole network at the beginning of the network start. If the change upgrade is redeployed during network operation, operations need to be performed by the blockchain administrator with permission from all nodes of the whole network.
The contract method comprises the following steps: defined functions in the smart contracts are declared publicly callable and can be invoked by external programs or other contracts. The successfully deployed contract method has a globally unique address for external program invocation.
The following details, by way of specific example, of a scheme for managing blockchain system contracts using blockchain intelligence contracts in accordance with the present specification.
Example 1
Because the content in the existing blockchain has the characteristic of being unchangeable, the updating of the blockchain system contract generally needs to issue a new contract, which causes the application system to be unable to know the new contract address, and thus the new system contract cannot be directly used. The upgrading process often requires that the blockchain network administrator issue a change description to each node administrator, and the node administrator notifies the application administrator again, and completes the adaptation of the new system contract by modifying and upgrading the application. The process has the advantages of manual participation and multi-role participation, is easy to make errors, and needs to stop and maintain an application system.
Thus, in a scheme for managing blockchain system contracts using blockchain intelligence contracts, a 2-party execution subject is involved, one being a blockchain network and the other being a node or application. Wherein the first component is encapsulated and formed by a blockchain network administrator at 3 stages of a blockchain deployment system contract registration contract service, a system contract release, a system contract update, and the like. The calling system contract registration contract obtains the system contract address, the calling system contract method address, the executing system contract method and other 3 stages, and the second assembly is formed by encapsulation and is executed by the blockchain node or the application program manager. A blockchain network includes a first component, wherein the first component corresponds to a plurality of blockchain nodes and can also support a plurality of application programs; a blockchain node or application includes a second component; the blockchain node or the application program calls the system contract registration contract query and call system contracts and methods thereof through the second component.
For blockchain networks:
in a system contract registration contract deployment stage, firstly, a system contract registration contract is created by a first component built in a blockchain network, wherein the system contract registration contract is a public intelligent contract specially used for recording the blockchain system contract and the address of a method thereof, and the method for registering the system contract comprises at least one of registering, updating and inquiring the system contract; the contract is then deployed onto the blockchain.
In the system contract releasing stage, the block chain network manager packages and compiles the written system contracts and the method thereof and deploys the system contracts to the block chain. Because the content of the blockchain network has the characteristic of being unchangeable, the updating of the blockchain intelligent contract generally needs to issue a new contract, so that an application system cannot know a new contract address, and thus cannot directly use the new system contract. Therefore, when a new system contract is issued, the system contract registration contract is required to be called to register the newly issued system contract, namely, the address of the system contract and the address of the method thereof in the blockchain network are received; searching whether the addresses of the system contracts and the methods thereof exist in the blockchain network, and if not, storing the addresses of the system contracts and the methods thereof into the blockchain.
In the system contract updating stage, the system contracts and the method thereof which are written are packaged and compiled by a blockchain network administrator and then deployed to a blockchain; then, receiving the address of the original system contract and the address of the new system contract and the method thereof in the block chain network; searching whether the original system contract address exists in the blockchain network, if so, replacing the original system contract and the method address thereof with the new system contract and the method address thereof, and storing the new system contract and the method address thereof into the blockchain.
For blockchain nodes or applications:
the blockchain node or the application program needs to grasp the latest address of the system contract and the method thereof in the process of calling and executing the system contract method, and the process needs to call the 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 blockchain; then, the address of the system contract method is obtained according to the system contract address required by the blockchain node or the application program; and sending the address of the system contract and the address of the method thereof to a blockchain node or an application program so that the blockchain node or the application program can call the method of the system contract according to the address of the system contract and the address of the method thereof.
In summary, the system for managing blockchain system contracts can be formed based on the technical scheme, and the system comprises a first component and a second component, wherein,
the first component creates a system contract registration contract and deploys the system contract registration contract to a blockchain, acquires the system contract and a method address of the system contract deployed to the blockchain, and calls the system contract registration contract to complete registration or update of the system contract and the method thereof; the second component is arranged in a node or an application program, and the system contract and the method address thereof are acquired through a system contract registration contract;
The first component sending the system contract and its method address to the blockchain; a plurality of the second components request the system contract and its method address from the blockchain.
Example two
Referring to fig. 1, a schematic diagram of steps of a method for managing a blockchain system contract according to an embodiment of the present disclosure is shown, 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 disclosure; 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 a blockchain, the system contract registration contract method comprises at least one of registering, updating and inquiring the system contract, and deploys the written system contract registration contract 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 to obtain the method addresses of the system contract registration contract for system contract registration, updating and querying.
Optionally, as shown in fig. 3, the method for processing the registration transaction of the system contract registration contract includes:
step 121: receiving an address of a system contract and a method thereof;
step 122: addresses of the system contracts and methods thereof are stored to the blockchain.
Optionally, as shown in fig. 4, the method for updating the system contract registration contract includes:
step 131: receiving an address of an original system contract and an address of a new system contract and a method thereof;
step 132: replacing the address of the original system contract and the method thereof with the address of the new system contract and the method thereof, and storing the address to the blockchain.
Optionally, as shown in fig. 5, the query transaction processing method of the system contract registration contract includes:
step 141: querying and feeding back all the system contract addresses registered in the blockchain and capable of being called;
step 142: and inquiring and feeding back 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 the system contract is issued and deployed to the block chain, the address of the system contract and the address of the method thereof in the block chain are acquired.
Because the content of the blockchain network has the characteristic of being unchangeable, the updating of the blockchain intelligent contract needs to issue a new contract, so that an application system cannot know a new system contract address, and thus cannot directly use the new system contract. The system contract registration contract is used as public intelligent contract to issue the latest system contract and its address for the whole blockchain network to be used by the blockchain node or application program needing to call the system contracts.
It should be understood that, because the system contracts take on some common actions in the blockchain network, such as authority management of accounts, identity management of accounts, etc., when the system contracts are used for blockchain system management, the blockchain nodes or applications can complete hot update without restarting, i.e. dynamically issue update codes, and can synchronize system configuration without restarting devices or applications. The system contract function and configuration can be the same immediately by completing the blockchain ledger data synchronization after a new node or application program is added. Therefore, the introduction of the system contract registration contract solves the problem of automatic perception of new release and update of the system contract by the blockchain node or the application program, namely, the function of acquiring the latest address of the system contract and the method thereof can be realized only when the calling function of the system contract registration contract is built in the blockchain node or the application program.
Step 103: when the system contracts as a new contract, calling the system contract registration contract to register as the new contract;
step 104: when the system contracts about existing contracts, the system contract registration contract is called to update the existing contracts to new contracts.
Alternatively, referring to fig. 2, a schematic diagram of steps of a method for managing a blockchain system contract according to an embodiment of the present disclosure may be provided, where an execution subject of the method may be a blockchain system side, and an executor is a blockchain network administrator, which is defined as a first component in the present disclosure; 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 a blockchain, and the system contract registration contract method comprises at least one of registering, updating and inquiring the system contract, and deploys the written system contract registration contract to the blockchain network. Wherein, the liquid crystal display device comprises a liquid crystal display device,
the registration transaction processing method of the 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: addresses of the system contracts and methods thereof are stored to the blockchain.
The update transaction processing method of the system contract registration contract is shown in fig. 4, and includes:
step 131: receiving an address of an original system contract and an address of a new system contract and a method thereof;
step 132: replacing the address of the original system contract and the method thereof with the address of the new system contract and the method thereof, and storing the address to the blockchain.
The query transaction processing method of the system contract registration contract is shown in fig. 5, and includes:
step 141: querying and feeding back all the system contract addresses registered in the blockchain and capable of being called;
step 142: and inquiring and feeding back 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 the system contract is issued and deployed to the block chain, the address of the system contract and the address of the method thereof in the block chain are acquired.
Because the content of the blockchain network has the characteristic of being unchangeable, the updating of the blockchain intelligent contract needs to issue a new contract, so that an application system cannot know a new system contract address, and thus cannot directly use the new system contract. The system contract registration contract is used as public intelligent contract to issue the latest system contract and its address for the whole blockchain network to be used by the blockchain node or application program needing to call the system contracts.
It should be understood that, because the system contracts take on some common actions in the blockchain network, such as authority management of accounts, identity management of accounts, etc., when the system contracts are used for blockchain system management, the blockchain nodes or applications can complete hot update without restarting, i.e. dynamically issue update codes, and can synchronize system configuration without restarting devices or applications. The system contract function and configuration can be the same immediately by completing the blockchain ledger data synchronization after a new node or application program is added. Therefore, the introduction of the system contract registration contract solves the problem of automatic perception of new release and update of the system contract by the blockchain node or the application program, namely, the function of acquiring the latest address of the system contract and the method thereof can be realized only when the calling function of the system contract registration contract is built in the blockchain node or the application program.
Step 112: when the system contracts as a new contract, calling the system contract registration contract to register as the new contract;
step 113: when the system contracts about existing contracts, the system contract registration contract is called to update the existing contracts to new contracts.
Referring to fig. 6, a schematic diagram of method steps for managing a blockchain system contract according to an embodiment of the present disclosure is shown, where an execution subject of the method may be a blockchain node or an application side, and the method is defined as a second component in the present disclosure; the second component is placed in a blockchain node or application, comprising the steps of:
step 201: calling a query method of a system contract registration contract to acquire all callable system contract addresses in a blockchain;
step 202: acquiring an address of the system contract method according to the system contract address required by a blockchain node or an application program;
step 203: and sending the address of the system contract and the address of the method thereof to a blockchain node or an application program so that the blockchain node or the application program can call the method of the system contract according to the address of the system contract and the address of the method thereof.
The invention manages the system contracts by using the intelligent contracts, thereby completing the discovery, updating and calling processes of the system contracts in an automatic mode, reducing the downtime maintenance time of the blockchain system and the application system and improving the service availability.
Example III
Fig. 7 is a schematic diagram of an apparatus 600 for managing blockchain system contracts according to an embodiment of the present disclosure. Referring to fig. 7, in one embodiment, an apparatus 600 for managing blockchain system contracts includes:
An obtaining module 601, configured to obtain an address of a system contract and a method thereof in a blockchain after creating the 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 recording addresses of the blockchain system contract and the method thereof.
The registration method of the system contract registration contract comprises the following steps: receiving an address of a system contract and a method thereof; searching whether the addresses of the system contracts and the methods thereof exist in the blockchain, and if not, storing the addresses of the system contracts and the methods thereof into the blockchain.
The updating method of the system contract registration contract comprises the following steps: receiving an address of an original system contract and an address of a new system contract and a method thereof; 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 new system contract and the method address thereof, and storing the new system contract and the method address thereof into the block chain.
The query method of the system contract registration contract comprises the following steps: querying and feeding back all the system contract addresses registered in the blockchain; and inquiring and feeding back addresses of all contract methods according to the system contract address.
A calling module 602, configured to call the system contract registration contract to register as a new contract when the system contract is about a new contract; the method comprises the steps of,
for invoking the system contract registration contract to update the existing contract to a new contract when the system contract is about the existing contract.
Fig. 8 is a schematic diagram of an apparatus 700 for managing blockchain system contracts according to an embodiment of the present disclosure. Referring to fig. 8, in one embodiment, an apparatus 700 for managing blockchain system contracts includes:
a calling module 701, configured to call a query method of a system contract registration contract to obtain all callable system contract addresses in a blockchain;
an obtaining module 702, configured to obtain an address of the system contract method according to the system contract address required by a blockchain node or an application program;
a sending module 703, configured to send the address of the system contract and the method thereof to a blockchain node or an application program, so that the blockchain node or the application program invokes the method of the system contract according to the address of the system contract and the method thereof.
In essence, the apparatus 700 for managing blockchain system contracts may further include: and the receiving module is used for receiving the system contract request required by the node or the application program and receiving transaction processing result data returned by the system contract registration contract.
It should be understood that the apparatus for managing a blockchain system contract according to the embodiments of the present disclosure may also perform the method performed by the apparatus (or device) for managing a blockchain system contract in fig. 1 to 6, and implement the functions of the apparatus (or device) for managing a blockchain system contract in the embodiments shown in fig. 1 to 6, which are not described herein.
Example IV
Fig. 9 is a schematic structural view of an electronic device according to an embodiment of the present specification. Referring to fig. 9, at the hardware level, the electronic device includes a processor, and optionally 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 (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, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in fig. 9, but not only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs, and forms a shared resource access control device on a logic level. The processor is used for executing the programs 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 a blockchain, wherein the system contract registration contract is an intelligent contract for recording addresses of the blockchain system contract and a method thereof;
issuing a system contract and deploying the system contract to the block chain, and receiving addresses of the system contract and the method thereof in the block chain;
when the system contracts about new contracts, calling the system contract registration contract to register the system contracts and the method addresses thereof;
and when the system contract is about 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.
Or alternatively, the process may be performed,
applied to the second component, comprising:
calling a query method of a system contract registration contract to acquire all callable system contract addresses in a blockchain;
acquiring an address of the system contract method according to the system contract address required by a blockchain node or an application program;
and sending the address of the system contract and the address of the method thereof to a blockchain node or an application program so that the blockchain node or the application program can call the method of the system contract according to the address of the system contract and the address of the method thereof.
The method of managing blockchain system contracts disclosed in the embodiments of fig. 1-6 of the present specification may be implemented in or 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 by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (NetworkProcessor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The 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 hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
Of course, in addition to the software implementation, the electronic device of the embodiments of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
Example five
The present description also proposes 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, enable the portable electronic device to perform the method of the embodiments shown in fig. 1-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 a blockchain, wherein the system contract registration contract is an intelligent contract for recording addresses of the blockchain system contract and a method thereof;
issuing a system contract and deploying the system contract to the block chain, and receiving addresses of the system contract and the method thereof in the block chain;
when the system contracts about new contracts, calling the system contract registration contract to register the system contracts and the method addresses thereof;
And when the system contract is about 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.
Or alternatively, the process may be performed,
applied to the second component, comprising:
calling a query method of a system contract registration contract to acquire all callable system contract addresses in a blockchain;
acquiring an address of the system contract method according to the system contract address required by a blockchain node or an application program;
and sending the address of the system contract and the address of the method thereof to a blockchain node or an application program so that the blockchain node or the application program can call the method of the system contract according to the address of the system contract and the address of the method thereof.
In summary, the foregoing description is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the protection scope of the present specification.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
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 storage media for a computer 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, read only optical disk read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
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. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.

Claims (11)

1. A method of managing a blockchain system contract, characterized in that it is applied to a first component, after creating a system contract registration contract and deploying to a blockchain, the system contract registration contract is an intelligent contract that records addresses of the blockchain system contract and its methods; comprising 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 thereof in the block chain are acquired;
when the system is about a new contract, receiving addresses of the system contract and the method thereof; searching whether addresses of the system contracts and the methods thereof exist in the blockchain, and if not, storing the addresses of the system contracts and the methods thereof into the blockchain;
receiving an address of an original system contract and an address of a new system contract and a method thereof in a blockchain network when the system contract is about an existing contract; searching whether the original system contract address exists in the blockchain network, if so, replacing the original system contract and the method address thereof with the new system contract and the method address thereof, and storing the new system contract and the method address thereof into the blockchain.
2. The method of claim 1, wherein the system contract registration contract further comprises a query method for the system contract.
3. The method of claim 2, wherein the query method of the system contract registration contract comprises:
querying and feeding back all callable system contract addresses registered in the blockchain; and
and inquiring and feeding back addresses of all contract methods according to the system contract addresses requested by the block connecting node or the application program.
4. An apparatus for managing blockchain system contracts, comprising:
an obtaining module, configured to obtain an address of a system contract and a method thereof in a blockchain after a system contract registration contract is created and deployed to the blockchain, and after a system contract is issued and deployed 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;
a calling module for receiving the address of the system contract and the method thereof when the system contract is about a new contract; searching whether addresses of the system contracts and the methods thereof exist in the blockchain, and if not, storing the addresses of the system contracts and the methods thereof into the blockchain; the method comprises the steps of,
For receiving an address of an original system contract, and an address of a new system contract and a method thereof in a blockchain network when the system contract is about an existing contract; searching whether the original system contract address exists in the blockchain network, if so, replacing the original system contract and the method address thereof with the new system contract and the method address thereof, and storing the new system contract and the method address thereof into the blockchain.
5. A method of 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 blockchain;
acquiring an address of a system contract method according to the system contract address required by a block chain node or an application program;
sending the address of the system contract and the method thereof to a blockchain node or an application program so that the blockchain node or the application program calls the method of the system contract according to the address of the system contract and the method thereof;
a method for invoking the system contract according to the address of the system contract and the method thereof, comprising:
when the system is about a new contract, receiving addresses of the system contract and the method thereof; searching whether addresses of the system contracts and the methods thereof exist in the blockchain, and if not, storing the addresses of the system contracts and the methods thereof into the blockchain;
Receiving an address of an original system contract and an address of a new system contract and a method thereof in a blockchain network when the system contract is about an existing contract; searching whether the original system contract address exists in the blockchain network, if so, replacing the original system contract and the method address thereof with the new system contract and the method address thereof, and storing the new system contract and the method address thereof into the blockchain.
6. An apparatus for managing blockchain system contracts, comprising:
the calling module is used for calling a query method of the system contract registration contract to acquire all 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 blockchain node or the application program;
a sending module, configured to send an address of the system contract and the method thereof to a blockchain node or an application program, so that the blockchain node or the application program invokes the method of the system contract according to the address of the system contract and the method thereof;
a method for invoking the system contract according to the address of the system contract and the method thereof, comprising:
when the system is about a new contract, receiving addresses of the system contract and the method thereof; searching whether addresses of the system contracts and the methods thereof exist in the blockchain, and if not, storing the addresses of the system contracts and the methods thereof into the blockchain;
Receiving an address of an original system contract and an address of a new system contract and a method thereof in a blockchain network when the system contract is about an existing contract; searching whether the original system contract address exists in the blockchain network, if so, replacing the original system contract and the method address thereof with the new system contract and the method address thereof, and storing the new system contract and the method address thereof into the blockchain.
7. A system for managing a blockchain system contract includes a first component and a second component, wherein,
the first component creates a system contract registration contract and deploys the system contract registration contract to a blockchain, acquires the system contract and a method address of the system contract deployed to the blockchain, and calls the system contract registration contract to complete registration or update of the system contract and the method thereof; the second component is arranged in a node or an application program, and the system contract and the method address thereof are acquired through a system contract registration contract;
the first component sending the system contract and its method address to the blockchain; a plurality of the second components requesting the system contract and its method address from the blockchain;
invoking a system contract registration contract to complete registration of the system contract and methods thereof, comprising:
When the system is about a new contract, receiving addresses of the system contract and the method thereof; searching whether addresses of the system contracts and the methods thereof exist in the blockchain, and if not, storing the addresses of the system contracts and the methods thereof into the blockchain;
invoking a system contract registration contract to complete the updating of the system contract and its method, comprising:
receiving an address of an original system contract and an address of a new system contract and a method thereof in a blockchain network when the system contract is about an existing contract; searching whether the original system contract address exists in the blockchain network, if so, replacing the original system contract and the method address thereof with the new system contract and the method address thereof, and storing the new system contract and the method address thereof into the blockchain.
8. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the method of any of claims 1 to 3.
9. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the method of claim 5.
10. A computer readable storage medium 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 any of claims 1-3.
11. A computer readable storage medium 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 claim 5.
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 CN111651469A (en) 2020-09-11
CN111651469B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117172913B (en) * 2023-10-12 2024-02-13 广州保德来小额贷款有限公司 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

Also Published As

Publication number Publication date
CN111651469A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN111163129B (en) Resource processing method and device based on cross-link network
CN111651467B (en) Block chain node interface issuing and calling method and device
CN111861482B (en) Block chain account checking method and system
WO2022134186A1 (en) Smart contract calling method and apparatus for blockchains, server, and storage medium
EP3584732B1 (en) Application management method for terminal, application server and terminal
WO2017035737A1 (en) Method and device for onboarding network service descriptor
CN109885612B (en) Synchronous validation method and device for intelligent contracts of block chains
CN111461887A (en) Block chain consensus processing method and device and electronic equipment
CN110597918A (en) Account management method and device and computer readable storage medium
CN112416616B (en) Micro-service calling method and device, electronic equipment and storage medium
CN112433863A (en) Micro-service calling method and device, terminal equipment and storage medium
CN111651469B (en) Method and device for managing blockchain system contracts
CN112751935B (en) Request processing method and device, electronic equipment and storage medium
CN111949297B (en) Block chain intelligent contract upgrading method and device and electronic equipment
CN114363233B (en) Packet routing method, device, electronic equipment and storage medium
CN114328097A (en) File monitoring method and device, electronic equipment and storage medium
CN111523887B (en) Authority control method and device for intelligent contract read-only method and electronic equipment
CN112416612A (en) Service calling method and device, computer equipment and readable storage medium
CN112738181B (en) Method, device and server for cluster external IP access
CN113608831B (en) Plug-in instance management method, system, storage medium and equipment
CN112565340B (en) Service scheduling method, device, computer system and medium for distributed application
CN110730197A (en) Service discovery method and system
CN113973126A (en) Communication method and device between vehicle-end subsystems, electronic equipment and medium
CN113010206A (en) Containerization method, system and device for WEB application system
CN112068899A (en) Plug-in loading method and device, 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
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.

GR01 Patent grant
GR01 Patent grant