WO2023240933A1 - Distributed application deployment method and apparatus based on blockchain - Google Patents

Distributed application deployment method and apparatus based on blockchain Download PDF

Info

Publication number
WO2023240933A1
WO2023240933A1 PCT/CN2022/135258 CN2022135258W WO2023240933A1 WO 2023240933 A1 WO2023240933 A1 WO 2023240933A1 CN 2022135258 W CN2022135258 W CN 2022135258W WO 2023240933 A1 WO2023240933 A1 WO 2023240933A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
application
computing node
target application
node
Prior art date
Application number
PCT/CN2022/135258
Other languages
French (fr)
Chinese (zh)
Inventor
庞洋
王志伟
孙兵兵
Original Assignee
蚂蚁区块链科技(上海)有限公司
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 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023240933A1 publication Critical patent/WO2023240933A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • 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

Definitions

  • the embodiments of this specification belong to the field of blockchain technology, and particularly relate to a distributed application deployment method and device based on blockchain.
  • Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • data blocks are combined into a chain data structure in a sequential manner according to time sequence, and cryptography is used to ensure that the data cannot be tampered with or forged.
  • Blockchain can generally be divided into three categories: public blockchain, private blockchain and consortium blockchain according to different application scenarios and user needs.
  • the embodiments of this specification are intended to provide a blockchain-based distributed application deployment method, device, computer-readable storage medium and computing device, which improves the deployment efficiency of distributed applications.
  • the first aspect of this specification provides a distributed application deployment method based on the blockchain.
  • the method is executed by the first computing node and includes: obtaining the first application information of the target application from the blockchain,
  • the first application information includes connection information of a second computing node, and the first application information is uploaded to the blockchain through the second computing node; based on the first application information, it is determined whether it is necessary to deploy the Target application; if the target application needs to be deployed, obtain the first installation package of the target application from the second computing node according to the connection information, and deploy the target application based on the first installation package.
  • a second aspect of this specification provides a blockchain-based distributed application deployment method.
  • the method is executed by a second computing node and includes: obtaining a release request for a target application, where the release request includes the target application.
  • First application information and a first installation package the first application information including connection information of the second computing node; uploading the first application information to the second computing node through the second blockchain node in the blockchain
  • the first installation package is stored, wherein the second blockchain node is a node in the blockchain that is connected to the second computing node.
  • a second aspect of this specification provides a blockchain-based distributed application deployment method.
  • the method is executed by a first blockchain node and includes: receiving a first transaction for calling a smart contract, the first transaction being performed by The second computing node connected to the second blockchain node sends it to the blockchain, the first transaction includes the first application information of the target application, and the first application information includes the second computing node’s Connection information, the first installation package of the target application is stored in the second computing node; according to the first transaction, the first application information is stored in the contract state of the smart contract; from the first The computing node receives a second transaction for calling a smart contract, the second transaction is used to query application information; and sends the first application information in the contract state to the first calculation according to the second transaction. node so that the first computing node obtains the first installation package of the target application from the second computing node according to the connection information.
  • the fourth aspect of this specification provides a blockchain-based distributed application deployment device, which is deployed on a first computing node.
  • the device includes: an acquisition module configured to acquire the first application information of the target application from the blockchain, The first application information includes the node identification of the second computing node, and the first application information is uploaded to the blockchain through the second computing node; the determination module is configured to determine, based on the first application information, Whether the target application needs to be deployed; the acquisition module is further configured to obtain the first installation package of the target application from the second computing node when the judgment module determines that the target application needs to be deployed; A processing module configured to deploy the target application based on the first installation package when the acquisition module obtains the first installation package.
  • a fifth aspect of this specification provides a blockchain-based distributed application deployment device deployed on a second computing node.
  • the device includes: an acquisition module configured to obtain a release request for a target application, where the release request includes The first application information and the first installation package of the target application; a processing module configured to upload the first application information to the blockchain through the second blockchain node in the blockchain, and store In the first installation package, the second blockchain node is a node in the blockchain that is connected to the second computing node.
  • a sixth aspect of this specification provides a blockchain-based distributed application deployment device, deployed at a first blockchain node, including: an acquisition module configured to receive a first transaction for calling a smart contract, the first The transaction is sent to the blockchain by a second computing node connected to the second blockchain node.
  • the first transaction includes first application information of the target application, and the first application information includes the second computing node.
  • the connection information of the node, the first installation package of the target application is stored in the second computing node; the processing module is configured to store the first application information in the smart contract according to the first transaction.
  • the acquisition module is also configured to receive a second transaction for calling the smart contract from the first computing node, and the second transaction is used to query application information; the processing module is also configured to according to the The second transaction sends the first application information in the contract state to the first computing node so that the first computing node obtains the target application from the second computing node according to the connection information.
  • the first installation package is also configured to send the first application information in the contract state to the first computing node so that the first computing node obtains the target application from the second computing node according to the connection information.
  • a seventh aspect of this specification provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed in a computing device, the computing device executes the above-mentioned first aspect, second aspect or third aspect. method.
  • An eighth aspect of this specification provides a computing device, including a memory and a processor.
  • a computer program is stored in the memory.
  • the processor executes the computer program, the first aspect, the second aspect or the third aspect are implemented. described method.
  • the first computing node can obtain the application information of the published target application from the blockchain, and through the application information, it can be compared with the information stored in the target application.
  • the second computing node communicates with the first installation package to obtain the first installation package and deploy the target application, thereby realizing automatic and dynamic deployment of the target application and improving the deployment efficiency, security and stability of the target application.
  • Figure 1 is a system architecture diagram of the blockchain system in an embodiment of this specification
  • Figure 2 is a schematic flow chart of a blockchain-based distributed application deployment method in an embodiment of this specification
  • Figure 3 is a schematic diagram of the steps for a first computing node to obtain a first installation package from a second computing node in an embodiment of this specification;
  • Figure 4 is a schematic structural diagram of a blockchain-based distributed application deployment device provided in the embodiment of this specification.
  • FIG. 5 is a schematic structural diagram of another blockchain-based distributed application deployment device provided in the embodiment of this specification.
  • Figure 6 is a schematic structural diagram of yet another blockchain-based distributed application deployment device provided in the embodiment of this specification.
  • DAPP distributed application
  • N the number of distributed application developers
  • M the number of distributed application developers
  • P the number of nodes that need to be deployed
  • O the number of DAPP version iterations.
  • the scale of developer deployment will increase exponentially as the number of nodes to be deployed and/or the number of DAPPs increases, and deployment efficiency and speed will also become a major obstacle to business development.
  • DAPP is deployed manually on-site, so the resources allocated when starting the application vary "from person to person". Different deployers use different computing node resources when deploying applications. This may eventually lead to unreasonable and uncontrollable allocation of resources, and neither the number of DAPPs that can be deployed on computing nodes nor the quality of deployment can be guaranteed.
  • DAPP deployment isolation is also uncontrollable during manual deployment. Since there is no standardized intervention for manual deployment, the application may be started directly when it is started, and sandbox isolation cannot be implemented for each application. This makes it possible that when an application has performance problems, it may cause the entire Compute node crash.
  • embodiments of this specification provide a blockchain-based distributed application deployment method and device.
  • the blockchain connected to the computing node.
  • the nodes in can upload the relevant information of the target application to the blockchain, and the computing nodes connected to other nodes in the blockchain can obtain the relevant information of the target application from the blockchain.
  • the other computing nodes can automatically obtain the installation package of the target application from the computing node that publishes the target application, and automatically complete the application deployment. This enables automatic deployment of target applications, improving deployment efficiency, security and stability.
  • FIG 1 is a schematic architectural diagram of a blockchain system provided in the embodiment of this specification.
  • the blockchain includes, for example, node 1 to node 6, a total of 6 nodes.
  • Each node can be any device, server or device cluster with computing and processing capabilities.
  • the connections between nodes schematically represent P2P (Peer to Peer, point-to-point) connections.
  • each node in the blockchain can generate the same state in the blockchain by executing the same transaction, and each node in the blockchain can store the same state database.
  • the blockchain shown in Figure 1 can be, but is not limited to, a consortium chain.
  • FIG. 1 shows that the blockchain includes 6 nodes, the embodiments of this specification are not limited to this, and may include other numbers of nodes.
  • the nodes included in the blockchain can meet Byzantine Fault Tolerance (BFT) requirements.
  • BFT Byzantine Fault Tolerance
  • the mentioned Byzantine fault tolerance requirements can be understood as meaning that Byzantine nodes can exist within the blockchain, but the blockchain does not reflect Byzantine behavior externally.
  • Transactions in the blockchain field can refer to task units that are executed and recorded in the blockchain. Transactions usually include sending fields (From), receiving fields (To) and data fields (Data). Among them, when the transaction is a transfer transaction, the From field represents the account address that initiated the transaction (that is, initiated a transfer task to another account), the To field represents the account address that received the transaction (that is, received the transfer), and the Data field Include transfer amount.
  • the From field indicates the account address that initiated the transaction
  • the To field indicates the account address of the contract called by the exchange
  • the Data field includes the function name in the calling contract and the corresponding Data such as the incoming parameters of the function are used to obtain the code of the function from the blockchain and execute the code of the function when the transaction is executed.
  • Smart contracts on the blockchain are contracts that can be triggered and executed by transactions on the blockchain system.
  • Smart contracts can be defined in the form of code. Calling a smart contract in the alliance chain is to initiate a transaction pointing to the smart contract address, allowing each node in the alliance chain network to run the smart contract code in a distributed manner.
  • smart contracts can also be set by the system in the genesis block. This type of contract is generally called a creation contract.
  • some blockchain data structures, parameters, properties and methods can be set in the genesis contract.
  • accounts with system administrator rights can create system-level contracts or modify system-level contracts (referred to as system contracts). Among them, the system contract can be used to add data structures for different business data in the blockchain.
  • Bob sends a transaction containing information about creating a smart contract (i.e., deploying the contract) to the blockchain as shown in Figure 1.
  • the data field of the transaction includes the code of the contract to be created (such as bytecode or machine code), the to field of the transaction is empty to indicate that the transaction is used to deploy the contract.
  • the contract address "0x6f8ae93" of the contract is determined.
  • Each node adds the contract account corresponding to the contract address of the smart contract in the state database, allocates the state storage corresponding to the contract account, and stores The contract code is saved in the state storage of the contract, so the contract is created successfully.
  • each node in the blockchain can execute the transaction respectively, thereby executing the contract respectively, and update the status database based on the execution of the contract.
  • This contract account generally has some states, which are defined by the state variables in the smart contract and generate new values when the smart contract is created and executed. Among them, contract accounts can be used to store status related to smart contracts. Once an event triggers the terms in the smart contract (execution conditions are met), the code can be executed automatically.
  • the relevant status of the contract is stored in the storage trie, and the hash value of the root node of the storage tree is stored in the above-mentioned storage_root, thereby locking all the status of the contract to the contract account through hash.
  • the storage tree is also an MPT tree structure, which stores the key-value mapping from state addresses to state values. The address of a state is stored from the root node of the storage tree to the leaf nodes, and the value of a state is stored in a leaf node.
  • different nodes in the blockchain shown in Figure 1 can be responsible for docking with different computing nodes 10.
  • Each computing node 10 may be, but is not limited to, used to perform calculation processing on data, etc., and transmit the processed results, etc. to the nodes in the blockchain connected to it.
  • Each node in the blockchain can reach consensus with other nodes in the blockchain on the data obtained from the computing nodes it is connected to through the consensus mechanism.
  • different computing nodes can establish communication connections through, but are not limited to, BTN (Blockchain Transmission Network), etc.
  • an industry application middleware needs to be deployed on each computing node 10.
  • developers can log in to the DAPP publishing website through the industry application middleware on the computing node and publish DAPP.
  • Users can log in to the DAPP subscription website through the industry application middleware on the computing node and subscribe to DAPP.
  • the application information of the DAPP may include one or more of the following: the node identification of the computing node where the industry application middleware is deployed, the network identification of the computing node in the network, the description information of the DAPP, the information associated with the DAPP and required The data structure of the business data on the chain, or the strategy for data flow in the network associated with DAPP, etc.
  • users can obtain the application information of the DAPP that the computing node can subscribe to from the blockchain through a computing node deployed with industry middleware; and, users can obtain the application information of the DAPP that the computing node can subscribe to through a computing node deployed with industry middleware and publish It communicates with the computing node of the DAPP it can subscribe to to obtain the installation package of the DAPP it can subscribe to. Then, the computing node used by the user that is deployed with industry middleware can deploy the DAPP based on the obtained DAPP installation package. After the computing node is deployed, the user can use the DAPP.
  • the computing node used by the developer can automatically complete the distribution, and the computing node used by the user can automatically obtain the data that it can subscribe to DAPP installation package and complete the deployment of DAPP, so that developers do not need to manually go to each node to deploy and distribute DAPP, solving the resource distribution problem of distributed applications with multiple nodes, multiple applications, and multiple developers. , which improves the deployment efficiency, security and stability of DAPP.
  • Figure 2 is a schematic flowchart of a blockchain-based distributed application deployment method provided in the embodiment of this specification.
  • the first computing node is deployed with the first industry application middleware
  • the second computing node is deployed with the second industry application middleware
  • a chain node and a second blockchain node connected to the second computing node.
  • the first computing node may be a node used by users of DAPP
  • the second computing node may be a node used by developers of DAPP.
  • the method may include the following steps:
  • the second computing node obtains a publishing request for the target application, where the publishing request includes the first application information and the first installation package of the target application.
  • the developer can log in to the website for publishing the target application through the second industry application middleware deployed in the second computing node, and submit a publishing request for the target application.
  • the second computing node can obtain to a publish request to the target application.
  • the publishing request may include: the first application information and the first installation package of the target application.
  • the first application information may include one or more of the following: connection information of the second computing node, description information of the target application, a data structure of business data associated with the target application and to be uploaded, or, associated with the target application Strategies for data flow in the network, etc.
  • the connection information of the second computing node may include: the node identification of the second computing node, the network identification of the second computing node in the network, and so on.
  • the description information of the target application may include: the subscription type of the target application.
  • the subscription type can include: mandatory subscription, limited subscription or open subscription.
  • the subscription scope can be one or more specific objects. At this time, only specific objects can subscribe to the application; when the subscription type is limited subscription, the subscription scope can be one or more specific objects.
  • the subscription scope can be all objects, in which case all objects can subscribe to the application.
  • the subscription scope can be understood as the authorization information for the target application to authorize the computing node. For example, when the first computing node is included in the subscription scope, it indicates that the target application is authorized for the first computing node, that is, the first computing node can subscribe to the target application.
  • the second computing node uploads the first application information to the blockchain through the second blockchain node, and stores the first installation package.
  • the second industry application middleware may send a transaction for calling the smart contract to the second blockchain node through the second computing node, and the data field in the transaction may include the first application information.
  • the second blockchain node obtains the transaction sent by the second computing node, it can reach consensus on the transaction with other nodes in the blockchain.
  • each node in the blockchain can execute the transaction separately, thereby executing the smart contract respectively, and update the status database based on the execution of the smart contract, so that each node in the blockchain
  • the corresponding state database may all have the first application information.
  • the first application information is stored in the contract state of the smart contract.
  • the second computing node uploads the first application information to the blockchain through the second blockchain node.
  • the second computing node may store the first installation package locally.
  • the first computing node obtains the first application information from the blockchain.
  • the first computing node can obtain the first application information from the blockchain.
  • the first computing node can send a query transaction for calling the smart contract to the first blockchain node in a polling manner through the first industry application middleware on it, and the query transaction includes the first The node ID of a compute node.
  • This query transaction can be used to filter out applications authorized for the first computing node from the contract status of the smart contract.
  • the target application is an application authorized for the first computing node
  • the query transaction can be understood as querying the first application information of the target application.
  • the first blockchain node After the first blockchain node obtains the query transaction sent by the first computing node, it can execute the query transaction, thereby filtering out the first query transaction from the contract status of the smart contract based on the node identification of the first computing node in the query transaction.
  • the target applications authorized by the computing node are to filter out the target applications that the first computing node can subscribe to. For example, when the objects that can subscribe to the application in the application information of each application in the contract state include the first computing node, the target application can be filtered out from each application based on the node identifier of the first computing node, and the target application can be obtained. The first application information of the target application. Then, the first blockchain node can return the first application information to the first computing node. In this way, the first computing node obtains the first application information.
  • the first computing node determines whether it needs to deploy the target application based on the first application information.
  • the first industry application middleware deployed on it can determine whether the target application needs to be deployed based on the subscription type in the first application information.
  • the subscription type is mandatory subscription
  • the first industry application middleware can determine that the target application needs to be deployed on the first computing node.
  • the first computing node immediately deploys the target application.
  • the subscription type is limited subscription or open subscription
  • the first industry application middleware can ask the user through the first computing node whether to deploy the target application.
  • the first computing node needs to deploy the target application.
  • the first industry application middleware may control the display of query information on the user UI displayed by the first computing node, and the query information is used to query the user whether to deploy the target application.
  • the first computing node obtains the first installation package of the target application from the second computing node according to the connection information of the second computing node included in the first application information.
  • the first computing node can obtain the connection information of the second computing node from the first application information, such as the node identification of the second computing node and the network identification of the second computing node in the network. Then, the first computing node may communicate with the second computing node through the BTN based on the connection information of the second computing node to obtain the installation package of the target application. For example, as shown in Figure 3, in S301, the first computing node may send an application acquisition request to the second computing node, and the application acquisition request may include the application identification of the target application. In S402, the second computing node may filter out the installation package of the target application from the installation packages of the application stored therein based on the application identifier of the target application, and send the installation package to the first computing node.
  • the first application information such as the node identification of the second computing node and the network identification of the second computing node in the network.
  • the first computing node may communicate with the second computing node through the BTN based on the connection information of the second computing node to obtain
  • the first computing node deploys the target application based on the first installation package.
  • the first computing node after the first computing node obtains the first installation package of the target application, the first computing node dynamically configures and dynamically deploys the target application based on the first installation package to complete the deployment of the target application, thereby enabling use The user can use the target application on the first computing node.
  • the first computing node when the first computing node is dynamically configured, based on its own software environment, the first computing node can generate an account and password for a database (such as mysql) for storing local data of the target application, and generate an account and password for storing the target application.
  • the account and password of the application's cache data storage system (such as Redis).
  • startup commands such as configuring startup resource occupancy, CPU, memory, startup port, sub-configuration files to be loaded, JVM commands, etc.
  • the first computing node When the first computing node is dynamically deployed, you can use docker or k8s (kubernetes) to build an image to isolate the target application, thereby ensuring that the target application does not affect each other and other applications, and ensuring the safety of the first computing node. stability. After the image construction is completed, the first computing node can start the image and load the installation package of the target application to complete the installation. At this point, after the target application is released through the second computing node, the target application is automatically deployed on the first computing node.
  • docker or k8s tunneles
  • the blockchain shown in Figure 2 can represent any blockchain node in the blockchain.
  • the embodiments of this specification also provide a blockchain-based distributed application deployment device.
  • FIG. 4 is a schematic structural diagram of a blockchain-based distributed application deployment device provided in the embodiment of this specification.
  • the device can be deployed on the first computing node.
  • the device 400 includes: an acquisition module 410, a judgment module 420 and a processing module 430.
  • the acquisition module 410 is configured to acquire the first application information of the target application from the blockchain, where the first application information includes the connection information of the second computing node, and the first application information is uploaded to the blockchain through the second computing node.
  • the determination module 420 is configured to determine whether the target application needs to be deployed based on the first application information.
  • the acquisition module 410 is also configured to acquire the first installation package of the target application from the second computing node according to the connection information of the second computing node when the determination module 420 determines that the target application needs to be deployed.
  • the processing module 430 is configured to deploy the target application based on the first installation package when the obtaining module 410 obtains the first installation package.
  • the first application information is stored in the contract state of the smart contract, and the first application information also includes authorization information for the target application to authorize the first computing node.
  • the acquisition module 410 is specifically configured to: send a query transaction for calling the smart contract to the first blockchain node in the blockchain, and the query transaction is used to filter applications authorized for the first computing node from the contract status of the smart contract.
  • the first blockchain node is a node in the blockchain that is connected to the first computing node; and, obtain the first application information returned by the first blockchain node.
  • the first application information also includes one or more of the following: a data structure of business data associated with the target application that needs to be uploaded, or a data structure of data associated with the target application that flows in the network. Strategy.
  • the first application information also includes the subscription type of the target application.
  • Subscription types include mandatory subscription, limited subscription, or open subscription.
  • the determination module 420 is specifically configured to determine whether the target application needs to be deployed based on the subscription type.
  • the processing module 430 is specifically configured to: generate an account and password for a database used to store local data of the target application, and deploy the target application based on the account and password.
  • FIG. 5 is a schematic structural diagram of another blockchain-based distributed application deployment device provided in the embodiment of this specification.
  • the device can be deployed on the second computing node.
  • the device 500 includes: an acquisition module 510 and a processing module 520.
  • the acquisition module 510 is configured to obtain a release request for the target application, where the release request includes first application information and a first installation package of the target application, and the first application information includes connection information of the second computing node.
  • the processing module 520 is configured to upload the first application information to the blockchain through a second blockchain node in the blockchain, and store the first installation package, where the second blockchain node is the same as in the blockchain. The node to which the second computing node is connected.
  • FIG. 6 is a schematic structural diagram of yet another blockchain-based distributed application deployment device provided in the embodiment of this specification.
  • the device can be deployed at the first blockchain node.
  • the device 600 includes: an acquisition module 610 and a processing module 620.
  • the acquisition module 610 is configured to receive a first transaction for calling a smart contract.
  • the first transaction is sent to the blockchain by a second computing node connected to the second blockchain node.
  • the first transaction includes the target application's information.
  • the first application information includes the connection information of the second computing node, and the second computing node stores the first installation package of the target application.
  • the processing module 620 is configured to store the first application information into the contract state of the smart contract according to the first transaction.
  • the acquisition module 610 is further configured to receive a second transaction for calling the smart contract from the first computing node, and the second transaction is used for querying application information.
  • the processing module 620 is further configured to send the first application information in the contract state to the first computing node according to the second transaction so that the first computing node obtains the first installation package of the target application from the second computing node according to the connection information.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers.
  • controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
  • the systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
  • the functions are divided into various modules and described separately.
  • the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. .
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may be computer-readable instructions, data structures, modules of programs, 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), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape magnetic tape storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • program modules may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided in the embodiments of the present description are a distributed application deployment method and apparatus based on a blockchain. The method comprises: a first computing node acquiring, from a blockchain, first application information of a target application, wherein the first application information comprises connection information of a second computing node, and the first application information is uploaded to the blockchain by means of the second computing node; the first computing node determining, on the basis of the first application information, whether it is necessary to deploy the target application; and if it is necessary to deploy the target application, the first computing node acquiring, from the second computing node and according to the connection information of the second computing node, a first application package of the target application, and deploying the target application. In this way, after a second computing node releases a target application, a first computing node can automatically and dynamically deploy the target application, such that the deployment efficiency, security and stability of the target application are improved.

Description

一种基于区块链的分布式应用部署方法及装置A distributed application deployment method and device based on blockchain
本申请要求于2022年6月14日提交中国国家知识产权局、申请号为2022106686230、申请名称为“一种基于区块链的分布式应用部署方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requests the priority of the Chinese patent application submitted to the State Intellectual Property Office of China on June 14, 2022, with application number 2022106686230 and the application name "A blockchain-based distributed application deployment method and device", which The entire contents are incorporated herein by reference.
技术领域Technical field
本说明书实施例属于区块链技术领域,尤其涉及一种基于区块链的分布式应用部署方法及装置。The embodiments of this specification belong to the field of blockchain technology, and particularly relate to a distributed application deployment method and device based on blockchain.
背景技术Background technique
区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证数据不可篡改和不可伪造。由于区块链具有去中心化、信息不可篡改、自治性等特性,区块链也受到人们越来越多的重视和应用。区块链根据不同的应用场景以及使用者需求,一般可以分为公有链(public blockchain)、私有链(private blockchain)以及联盟链(consortium blockchain)三大类。Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. In the blockchain system, data blocks are combined into a chain data structure in a sequential manner according to time sequence, and cryptography is used to ensure that the data cannot be tampered with or forged. Due to the characteristics of blockchain, such as decentralization, non-tamperable information, and autonomy, blockchain has also received more and more attention and applications. Blockchain can generally be divided into three categories: public blockchain, private blockchain and consortium blockchain according to different application scenarios and user needs.
发明内容Contents of the invention
本说明书实施例旨在提供一种基于区块链的分布式应用部署方法、装置、计算机可读存储介质及计算设备,提高了分布式应用的部署效率。The embodiments of this specification are intended to provide a blockchain-based distributed application deployment method, device, computer-readable storage medium and computing device, which improves the deployment efficiency of distributed applications.
为实现上述目的,本说明书第一方面提供一种基于区块链的分布式应用部署方法,所述方法由第一计算节点执行,包括:从区块链上获取目标应用的第一应用信息,所述第一应用信息包括第二计算节点的连接信息,所述第一应用信息通过所述第二计算节点上传至所述区块链;基于所述第一应用信息,判断是否需要部署所述目标应用;若需要部署所述目标应用,根据所述连接信息从所述第二计算节点处获取所述目标应用的第一安装包,以及,基于所述第一安装包部署所述目标应用。In order to achieve the above purpose, the first aspect of this specification provides a distributed application deployment method based on the blockchain. The method is executed by the first computing node and includes: obtaining the first application information of the target application from the blockchain, The first application information includes connection information of a second computing node, and the first application information is uploaded to the blockchain through the second computing node; based on the first application information, it is determined whether it is necessary to deploy the Target application; if the target application needs to be deployed, obtain the first installation package of the target application from the second computing node according to the connection information, and deploy the target application based on the first installation package.
本说明书第二方面提供一种基于区块链的分布式应用部署方法,所述方法由第二计算节点执行,包括:获取针对目标应用的发布请求,所述发布请求中包括所述目标应用的第一应用信息和第一安装包,所述第一应用信息包括所述第二计算节点的连接信息;通过区块链中的第二区块链节点将所述第一应用信息上传至所述区块链中,以及存储所述第一安装包,其中,所述第二区块链节点为所述区块链中与所述第二计算节点对接的节点。A second aspect of this specification provides a blockchain-based distributed application deployment method. The method is executed by a second computing node and includes: obtaining a release request for a target application, where the release request includes the target application. First application information and a first installation package, the first application information including connection information of the second computing node; uploading the first application information to the second computing node through the second blockchain node in the blockchain In the blockchain, the first installation package is stored, wherein the second blockchain node is a node in the blockchain that is connected to the second computing node.
本说明书第二方面提供一种基于区块链的分布式应用部署方法,所述方法由第一区块链节点执行,包括:接收用于调用智能合约的第一交易,所述第一交易由与第二区块链节点连接的第二计算节点发送到区块链中,所述第一交易中包括目标应用的第一应用信息,所述第一应用信息中包括所述第二计算节点的连接信息,所述第二计算节点中存储有所述目标应用的第一安装包;根据所述第一交易,将所述第一应用信息存储到所述智能合约的合约状态中;从第一计算节点接收用于调用智能合约的第二交易,所述第二交易用于查询应用信息;根据所述第二交易将所述合约状态中的所述第一应用信息发送给所述第一计算节点以使得所述第一计算节点根据所述连接信息从所述第二计算节点处获取所述目标应用的第一安装包。A second aspect of this specification provides a blockchain-based distributed application deployment method. The method is executed by a first blockchain node and includes: receiving a first transaction for calling a smart contract, the first transaction being performed by The second computing node connected to the second blockchain node sends it to the blockchain, the first transaction includes the first application information of the target application, and the first application information includes the second computing node’s Connection information, the first installation package of the target application is stored in the second computing node; according to the first transaction, the first application information is stored in the contract state of the smart contract; from the first The computing node receives a second transaction for calling a smart contract, the second transaction is used to query application information; and sends the first application information in the contract state to the first calculation according to the second transaction. node so that the first computing node obtains the first installation package of the target application from the second computing node according to the connection information.
本说明书第四方面提供一种基于区块链的分布式应用部署装置,部署在第一计算节点,所述装置包括:获取模块,配置为从区块链上获取目标应用的第一应用信息,所述第一应用信息包括第二计算节点的节点标识,所述第一应用信息通过所述第二计算节点上传至所述区块链;判断模块,配置为基于所述第一应用信息,判断是否需要部署所述目标应用;所述获取模块,还配置为在所述判断模块判断出需要部署所述目标应用时,从所述第二计算节点处获取所述目标应用的第一安装包;处理模块,配置为在所述获取模块获取到所述第一安装包时,基于所述第一安装包部署所述目标应用。The fourth aspect of this specification provides a blockchain-based distributed application deployment device, which is deployed on a first computing node. The device includes: an acquisition module configured to acquire the first application information of the target application from the blockchain, The first application information includes the node identification of the second computing node, and the first application information is uploaded to the blockchain through the second computing node; the determination module is configured to determine, based on the first application information, Whether the target application needs to be deployed; the acquisition module is further configured to obtain the first installation package of the target application from the second computing node when the judgment module determines that the target application needs to be deployed; A processing module configured to deploy the target application based on the first installation package when the acquisition module obtains the first installation package.
本说明书第五方面提供一种基于区块链的分布式应用部署装置,部署在第二计算节点,所述装置包括:获取模块,配置为获取针对目标应用的发布请求,所述发布请求中包括所述目标应用的第一应用信息和第一安装包;处理模块,配置为通过区块链中的第二区块链节点将所述第一应用信息上传至所述区块链中,以及存储所述第一安装包,其中,所述第二区块链节点为所述区块链中与所述第二计算节点对接的节点。A fifth aspect of this specification provides a blockchain-based distributed application deployment device deployed on a second computing node. The device includes: an acquisition module configured to obtain a release request for a target application, where the release request includes The first application information and the first installation package of the target application; a processing module configured to upload the first application information to the blockchain through the second blockchain node in the blockchain, and store In the first installation package, the second blockchain node is a node in the blockchain that is connected to the second computing node.
本说明书第六方面提供一种基于区块链的分布式应用部署装置,部署在第一区块链节点,包括:获取模块,配置为接收用于调用智能合约的第一交易,所述第一交易由与第二区块链节点连接的第二计算节点发送到区块链中,所述第一交易中包括目标应用的第一应用信息,所述第一应用信息中包括所述第二计算节点的连接信息,所述第二计算节点中存储有所述目标应用的第一安装包;处理模块,配置为根据所述第一交易,将所述第一应用信息存储到所述智能合约的合约状态中;所述获取模块,还配置为从第一计算节点接收用于调用智能合约的第二交易,所述第二交易用于查询应用信息;所述处理模块,还配置为根据所述第二交易将所述合约状态中的所述第一应用信息发送给所述第一计算节点以使得所述第一计算节点根据所述连接信息从所述第二计算节点处获取所述目标应用的第一安装包。A sixth aspect of this specification provides a blockchain-based distributed application deployment device, deployed at a first blockchain node, including: an acquisition module configured to receive a first transaction for calling a smart contract, the first The transaction is sent to the blockchain by a second computing node connected to the second blockchain node. The first transaction includes first application information of the target application, and the first application information includes the second computing node. The connection information of the node, the first installation package of the target application is stored in the second computing node; the processing module is configured to store the first application information in the smart contract according to the first transaction. In the contract state; the acquisition module is also configured to receive a second transaction for calling the smart contract from the first computing node, and the second transaction is used to query application information; the processing module is also configured to according to the The second transaction sends the first application information in the contract state to the first computing node so that the first computing node obtains the target application from the second computing node according to the connection information. The first installation package.
本说明书第七方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算设备中执行时,计算设备执行上述第一方面、第二方面或第三方面所述方法。A seventh aspect of this specification provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computing device, the computing device executes the above-mentioned first aspect, second aspect or third aspect. method.
本说明书第八方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器执行所述计算机程序时,实现上述第一方面、第二方面或第三方面所述方法。An eighth aspect of this specification provides a computing device, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the first aspect, the second aspect or the third aspect are implemented. described method.
通过本说明书一个或多个实施例中提供的方法及装置,第一计算节点可以从区块链上获取到已发布的目标应用的应用信息,并通过该应用信息可以与存储有该目标应用的第一安装包的第二计算节点通信,以获取到第一安装包,并部署目标应用,实现了自动对目标应用进行动态部署,提升了目标应用的部署效率、安全性和稳定性。Through the methods and devices provided in one or more embodiments of this specification, the first computing node can obtain the application information of the published target application from the blockchain, and through the application information, it can be compared with the information stored in the target application. The second computing node communicates with the first installation package to obtain the first installation package and deploy the target application, thereby realizing automatic and dynamic deployment of the target application and improving the deployment efficiency, security and stability of the target application.
附图说明Description of the drawings
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of this specification more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the embodiments recorded in this specification. , for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative labor.
图1是本说明书一实施例中区块链系统的系统架构图;Figure 1 is a system architecture diagram of the blockchain system in an embodiment of this specification;
图2是本说明书一实施例中一种基于区块链的分布式应用部署方法的流程示意图;Figure 2 is a schematic flow chart of a blockchain-based distributed application deployment method in an embodiment of this specification;
图3是本说明书一实施例中一种第一计算节点从第二计算节点处获取第一安装包的步骤示意图;Figure 3 is a schematic diagram of the steps for a first computing node to obtain a first installation package from a second computing node in an embodiment of this specification;
图4是本说明书实施例中提供的一种基于区块链的分布式应用部署装置的结构示意图;Figure 4 is a schematic structural diagram of a blockchain-based distributed application deployment device provided in the embodiment of this specification;
图5是本说明书实施例中提供的另一种基于区块链的分布式应用部署装置的结构示意图;Figure 5 is a schematic structural diagram of another blockchain-based distributed application deployment device provided in the embodiment of this specification;
图6是本说明书实施例中提供的又一种基于区块链的分布式应用部署装置的结构示意图。Figure 6 is a schematic structural diagram of yet another blockchain-based distributed application deployment device provided in the embodiment of this specification.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described The embodiments are only some of the embodiments of this specification, but not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of protection of this specification.
一般地,在一些特定的场景(比如反诈场景等)下部署DAPP(distributed application,分布式应用)时,由于DAPP的开发者往往隶属于不同的机构/公司,且DAPP往往是部署在各个机构/公司的内网环境中,致使开发者在外网环境下无法对需要部署DAPP的机构/公司进行访问。因此,当开发者部署DAPP时,往往需要开发者到各个机构/公司的现场进行手动部署,部署次数为:N*M*P*O;N是分布式应用开发者的数量,M是每个开发者开发的DAPP的数量,P是需要部署的节点的数量,O是DAPP版本迭代的数量。开发者部署的规模随着所需部署的节点的增多和/或DAPP的增多,将会呈指数级增加,部署效率和部署速度也会成为限制业务发展的极大障碍。Generally, when deploying DAPP (distributed application) in some specific scenarios (such as anti-fraud scenarios, etc.), because DAPP developers often belong to different institutions/companies, and DAPPs are often deployed in various institutions /In the company’s intranet environment, developers cannot access the institutions/companies that need to deploy DAPP in the external network environment. Therefore, when developers deploy DAPP, they often need to go to various institutions/companies for manual deployment. The number of deployments is: N*M*P*O; N is the number of distributed application developers, and M is each The number of DAPPs developed by developers, P is the number of nodes that need to be deployed, and O is the number of DAPP version iterations. The scale of developer deployment will increase exponentially as the number of nodes to be deployed and/or the number of DAPPs increases, and deployment efficiency and speed will also become a major obstacle to business development.
另外,由于开发者无法评估所需部署DAPP的边缘计算服务器(以下简称“计算节点”)的环境多样性,这导致开发者在部署DAPP时容易出现不兼容性问题。而对于DAPP所依赖的基础能力(mysql,redis等),当DAPP在不同计算节点进行部署时,开发者是不知道不同计算节点的相关配置的,这些信息需要开发者到现场后,在现场进行手动的创建。但手动创建又会带来安全性问题(可能会使用root账户等)。In addition, because developers cannot evaluate the environmental diversity of the edge computing servers (hereinafter referred to as "computing nodes") where DAPP needs to be deployed, this leads to developers being prone to incompatibility issues when deploying DAPP. As for the basic capabilities that DAPP relies on (mysql, redis, etc.), when DAPP is deployed on different computing nodes, developers do not know the relevant configurations of different computing nodes. This information needs to be carried out on-site after the developers go to the site. Manual creation. However, manual creation will bring security issues (the root account may be used, etc.).
此外,DAPP的部署是由人工到现场部署,那么在启动应用所分配的资源时,是“因人”而异,不同的部署者,在部署应用时,使用的计算节点的资源也不相同,这最终可能会导致资源的分配不合理和不可控,计算节点上所能部署的DAPP数量、部署质量均都无法保证。同时,在人工手动部署时,DAPP部署隔离也是无法控制的。由于无法对人工部署进行标准化干预,那么应用在启动时,可能会直接对应用进行启动,无法针对每个应用做到沙盒的隔离方式,这使得当一个应用出现性能问题时,可能会导致整个计算节点的崩溃。In addition, DAPP is deployed manually on-site, so the resources allocated when starting the application vary "from person to person". Different deployers use different computing node resources when deploying applications. This may eventually lead to unreasonable and uncontrollable allocation of resources, and neither the number of DAPPs that can be deployed on computing nodes nor the quality of deployment can be guaranteed. At the same time, DAPP deployment isolation is also uncontrollable during manual deployment. Since there is no standardized intervention for manual deployment, the application may be started directly when it is started, and sandbox isolation cannot be implemented for each application. This makes it possible that when an application has performance problems, it may cause the entire Compute node crash.
鉴于以上问题,本说明书实施例中提供了一种基于区块链的分布式应用部署方法及装置,在开发者通过其所使用的计算节点发布目标应用后,与该计算节点对接的区块链中的节点可以将该目标应用的相关信息上传至区块链中,而与区块链中其他的节点对接的计算节点可以从区块链中获取到目标应用的相关信息。当其他的计算节点可以部署目标应用时,其他的计算节点可以自动从发布该目标应用的计算节点处获取到该目标应用的安装包,并自动完成应用部署。由此实现了对目标应用的自动部署,提升了部署效率、安全性和稳定性。In view of the above problems, embodiments of this specification provide a blockchain-based distributed application deployment method and device. After the developer publishes the target application through the computing node used by the developer, the blockchain connected to the computing node The nodes in can upload the relevant information of the target application to the blockchain, and the computing nodes connected to other nodes in the blockchain can obtain the relevant information of the target application from the blockchain. When other computing nodes can deploy the target application, the other computing nodes can automatically obtain the installation package of the target application from the computing node that publishes the target application, and automatically complete the application deployment. This enables automatic deployment of target applications, improving deployment efficiency, security and stability.
图1为本说明书实施例中提供的一种区块链系统的架构示意图。如图1所示,该区块链中例如包含节点1至节点6,共6个节点。每个节点均可以是任何具有计算、处理能力的装置、服务器或设备集群等。节点之间的连线示意性的表示P2P(Peer to Peer,点 对点)连接。Figure 1 is a schematic architectural diagram of a blockchain system provided in the embodiment of this specification. As shown in Figure 1, the blockchain includes, for example, node 1 to node 6, a total of 6 nodes. Each node can be any device, server or device cluster with computing and processing capabilities. The connections between nodes schematically represent P2P (Peer to Peer, point-to-point) connections.
这些节点上可存储全量的账本,即存储全部区块和全部账户的状态。其中,区块链中的每个节点可通过执行相同的交易而产生区块链中的相同的状态,区块链中的每个节点可存储相同的状态数据库。可以理解,图1中所示的区块链可以但不限于为联盟链。另外,图1中虽然示出了区块链中包括6个节点,本说明书实施例不限于此,而是可以包括其他数目的节点。具体是,区块链中包含的节点可以满足拜占庭容错(Byzantine Fault Tolerance,BFT)要求。所述的拜占庭容错要求可以理解为在区块链内部可以存在拜占庭节点,而区块链对外不体现拜占庭行为。一般的,一些拜占庭容错算法中要求节点个数大于(3f+1),f为拜占庭节点个数,例如实用拜占庭容错算法PBFT(Practical Byzantine Fault Tolerance)。These nodes can store the entire ledger, that is, store the status of all blocks and all accounts. Among them, each node in the blockchain can generate the same state in the blockchain by executing the same transaction, and each node in the blockchain can store the same state database. It can be understood that the blockchain shown in Figure 1 can be, but is not limited to, a consortium chain. In addition, although FIG. 1 shows that the blockchain includes 6 nodes, the embodiments of this specification are not limited to this, and may include other numbers of nodes. Specifically, the nodes included in the blockchain can meet Byzantine Fault Tolerance (BFT) requirements. The mentioned Byzantine fault tolerance requirements can be understood as meaning that Byzantine nodes can exist within the blockchain, but the blockchain does not reflect Byzantine behavior externally. Generally, some Byzantine fault-tolerant algorithms require the number of nodes to be greater than (3f+1), where f is the number of Byzantine nodes, such as the Practical Byzantine Fault Tolerance algorithm PBFT (Practical Byzantine Fault Tolerance).
区块链领域中的交易可以指在区块链中执行并记录在区块链中的任务单元。交易中通常包括发送字段(From)、接收字段(To)和数据字段(Data)。其中,在交易为转账交易的情况中,From字段表示发起该交易(即发起对另一个账户的转账任务)的账户地址,To字段表示接收该交易(即接收转账)的账户地址,Data字段中包括转账金额。在交易调用区块链中的智能合约的情况中,From字段表示发起该交易的账户地址,To字段表示交易所调用的合约的账户地址,Data字段中包括调用合约中的函数名、及对该函数的传入参数等数据,以用于在交易执行时从区块链中获取该函数的代码并执行该函数的代码。Transactions in the blockchain field can refer to task units that are executed and recorded in the blockchain. Transactions usually include sending fields (From), receiving fields (To) and data fields (Data). Among them, when the transaction is a transfer transaction, the From field represents the account address that initiated the transaction (that is, initiated a transfer task to another account), the To field represents the account address that received the transaction (that is, received the transfer), and the Data field Include transfer amount. In the case of a transaction calling a smart contract in the blockchain, the From field indicates the account address that initiated the transaction, the To field indicates the account address of the contract called by the exchange, and the Data field includes the function name in the calling contract and the corresponding Data such as the incoming parameters of the function are used to obtain the code of the function from the blockchain and execute the code of the function when the transaction is executed.
区块链中可提供智能合约的功能。区块链上的智能合约是在区块链系统上可以被交易触发执行的合约。智能合约可以通过代码的形式定义。在联盟链中调用智能合约,是发起一笔指向智能合约地址的交易,使得联盟链网络中每个节点分布式地运行智能合约代码。需要说明的是,除了可以由用户创建智能合约,也可以在创世块中由系统设置智能合约。这类合约一般称为创世合约。一般的,创世合约中可以设置一些区块链的数据结构、参数、属性和方法。此外,具有系统管理员权限的账户可以创建系统级的合约,或者修改系统级的合约(简称为系统合约)。其中,所述系统合约可用于在区块链中增加不同业务的数据的数据结构。The functions of smart contracts can be provided in the blockchain. Smart contracts on the blockchain are contracts that can be triggered and executed by transactions on the blockchain system. Smart contracts can be defined in the form of code. Calling a smart contract in the alliance chain is to initiate a transaction pointing to the smart contract address, allowing each node in the alliance chain network to run the smart contract code in a distributed manner. It should be noted that in addition to smart contracts that can be created by users, smart contracts can also be set by the system in the genesis block. This type of contract is generally called a creation contract. Generally, some blockchain data structures, parameters, properties and methods can be set in the genesis contract. In addition, accounts with system administrator rights can create system-level contracts or modify system-level contracts (referred to as system contracts). Among them, the system contract can be used to add data structures for different business data in the blockchain.
在部署合约的场景中,例如,Bob将一个包含创建智能合约信息(即部署合约)的交易发送到如图1所示的区块链中,该交易的data字段包括待创建的合约的代码(如字节码或者机器码),交易的to字段为空,以表示该交易用于部署合约。节点间通过共识机制达成一致后,确定合约的合约地址“0x6f8ae93…”,各个节点在状态数据库中添加与该智能合约的合约地址对应的合约账户,分配与该合约账户对应的状态存储,并将合约代码保存在该合约的状态存储中,从而合约创建成功。In the scenario of deploying a contract, for example, Bob sends a transaction containing information about creating a smart contract (i.e., deploying the contract) to the blockchain as shown in Figure 1. The data field of the transaction includes the code of the contract to be created ( Such as bytecode or machine code), the to field of the transaction is empty to indicate that the transaction is used to deploy the contract. After the nodes reach an agreement through the consensus mechanism, the contract address "0x6f8ae93..." of the contract is determined. Each node adds the contract account corresponding to the contract address of the smart contract in the state database, allocates the state storage corresponding to the contract account, and stores The contract code is saved in the state storage of the contract, so the contract is created successfully.
在调用合约的场景中,例如,Bob将一个用于调用智能合约的交易发送到如图1所示的区块链中,该交易的from字段是交易发起方(即Bob)的账户的地址,to字段中的“0x6f8ae93…”代表了被调用的智能合约的地址,交易的data字段包括调用智能合约的方法和参数。在区块链中对该交易进行共识之后,区块链中的各个节点可分别执行该交易,从而分别执行该合约,基于该合约的执行更新状态数据库。In the scenario of calling a contract, for example, Bob sends a transaction for calling a smart contract to the blockchain as shown in Figure 1. The from field of the transaction is the address of the account of the transaction initiator (Bob). "0x6f8ae93..." in the to field represents the address of the smart contract being called, and the data field of the transaction includes the method and parameters for calling the smart contract. After consensus is reached on the transaction in the blockchain, each node in the blockchain can execute the transaction respectively, thereby executing the contract respectively, and update the status database based on the execution of the contract.
另外,智能合约在区块链上完成部署后,会产生一个对应的合约账户。这个合约账户一般会具有一些状态,这些状态由智能合约中状态变量所定义并在智能合约创建、执行时产生新的值。其中,合约账户可以用于存储智能合约相关的状态。一旦某个事件触发智 能合约中的条款(满足执行条件),代码即可以自动执行。在区块链中,合约的相关状态保存在存储树(storage trie)中,存储树根节点的hash值即存储于上述storage_root中,从而将该合约的所有状态通过hash锁定到该合约账户下。存储树也是一个MPT树形结构,存储了状态地址到状态值的key-value映射。从存储树的根节点到叶子节点存储有一个状态的地址,一个叶子节点中存储一个状态的值。In addition, after the smart contract is deployed on the blockchain, a corresponding contract account will be generated. This contract account generally has some states, which are defined by the state variables in the smart contract and generate new values when the smart contract is created and executed. Among them, contract accounts can be used to store status related to smart contracts. Once an event triggers the terms in the smart contract (execution conditions are met), the code can be executed automatically. In the blockchain, the relevant status of the contract is stored in the storage trie, and the hash value of the root node of the storage tree is stored in the above-mentioned storage_root, thereby locking all the status of the contract to the contract account through hash. The storage tree is also an MPT tree structure, which stores the key-value mapping from state addresses to state values. The address of a state is stored from the root node of the storage tree to the leaf nodes, and the value of a state is stored in a leaf node.
继续参阅图1,图1所示的区块链中不同的节点可以负责与不同的计算节点10对接。每个计算节点10均可以但不限于用于对数据进行计算处理等,并将处理后的结果等传输至与其对接的区块链中的节点。区块链中的每个节点均可以与区块链中其他的节点通过共识机制对由其对接的计算节点处获取到的数据达成共识。其中,不同的计算节点间可以但不限于通过BTN(Blockchain Transmission Network,区块链高速通信网络)等建立通信连接。Continuing to refer to Figure 1, different nodes in the blockchain shown in Figure 1 can be responsible for docking with different computing nodes 10. Each computing node 10 may be, but is not limited to, used to perform calculation processing on data, etc., and transmit the processed results, etc. to the nodes in the blockchain connected to it. Each node in the blockchain can reach consensus with other nodes in the blockchain on the data obtained from the computing nodes it is connected to through the consensus mechanism. Among them, different computing nodes can establish communication connections through, but are not limited to, BTN (Blockchain Transmission Network), etc.
本实施例中,每个计算节点10上均需要部署一个行业应用中间件。其中,开发者可以在计算节点上通过该行业应用中间件登录到DAPP发布网站,并发布DAPP。使用者可以在计算节点上通过行业应用中间件登录到DAPP订阅网站,并订阅DAPP。In this embodiment, an industry application middleware needs to be deployed on each computing node 10. Among them, developers can log in to the DAPP publishing website through the industry application middleware on the computing node and publish DAPP. Users can log in to the DAPP subscription website through the industry application middleware on the computing node and subscribe to DAPP.
示例性的,在发布DAPP时,开发者可以通过部署有行业中间件的计算节点将与DAPP相关的应用信息上传至区块链中,以及将DAPP的安装包存储在计算节点上。其中,DAPP的应用信息示例性的可以包括以下一项或多项:部署有行业应用中间件的计算节点的节点标识,计算节点在网络中的网络标识,DAPP的描述信息,与DAPP关联且需上链的业务数据的数据结构,或者,与DAPP关联的数据在网络中流转的策略等。For example, when releasing a DAPP, developers can upload the application information related to the DAPP to the blockchain through a computing node deployed with industry middleware, and store the DAPP installation package on the computing node. Among them, the application information of the DAPP may include one or more of the following: the node identification of the computing node where the industry application middleware is deployed, the network identification of the computing node in the network, the description information of the DAPP, the information associated with the DAPP and required The data structure of the business data on the chain, or the strategy for data flow in the network associated with DAPP, etc.
在订阅DAPP时,使用者可以通过部署有行业中间件的计算节点从区块链中获取到该计算节点所能够订阅的DAPP的应用信息;以及,可以通过部署有行业中间件的计算节点与发布其可以订阅的DAPP的计算节点通信,以获取到其可以订阅的DAPP的安装包。接着,使用者所使用的部署有行业中间件的计算节点可以基于其获取到的DAPP的安装包在其上部署该DAPP。在该计算节点部署完成后,使用者即可以使用该DAPP。When subscribing to a DAPP, users can obtain the application information of the DAPP that the computing node can subscribe to from the blockchain through a computing node deployed with industry middleware; and, users can obtain the application information of the DAPP that the computing node can subscribe to through a computing node deployed with industry middleware and publish It communicates with the computing node of the DAPP it can subscribe to to obtain the installation package of the DAPP it can subscribe to. Then, the computing node used by the user that is deployed with industry middleware can deploy the DAPP based on the obtained DAPP installation package. After the computing node is deployed, the user can use the DAPP.
由此,利用区块链的点对点传输网络特点,使得开发者在发布/更新DAPP后,开发者所使用的计算节点可以自动完成分发,且使用者所使用的计算节点可以自动获取到其可以订阅的DAPP的安装包,并完成DAPP的部署,使得开发者无需人工再到各个节点进行DAPP的部署和分发,解决了分布式应用多节点,多应用,多开发者在分布式应用的资源分发问题,提升了DAPP的部署效率、安全性和稳定性。Therefore, using the point-to-point transmission network characteristics of the blockchain, after the developer publishes/updates the DAPP, the computing node used by the developer can automatically complete the distribution, and the computing node used by the user can automatically obtain the data that it can subscribe to DAPP installation package and complete the deployment of DAPP, so that developers do not need to manually go to each node to deploy and distribute DAPP, solving the resource distribution problem of distributed applications with multiple nodes, multiple applications, and multiple developers. , which improves the deployment efficiency, security and stability of DAPP.
下面结合具体的实施例对本说明书提供的方案进行详细描述。The solutions provided in this specification will be described in detail below with reference to specific examples.
图2为本说明书实施例中提供的一种基于区块链的分布式应用部署方法的流程示意图。在图2中,第一计算节点中部署有第一行业应用中间件,第二计算节点中部署有第二行业应用中间件,在区块链中具有与第一计算节点对接的第一区块链节点,和,与第二计算节点对接的第二区块链节点。其中,第一计算节点可以是DAPP的使用者所使用的节点,第二计算节点可以是DAPP的开发者所使用的节点。如图2所示,该方法可以包括以下步骤:Figure 2 is a schematic flowchart of a blockchain-based distributed application deployment method provided in the embodiment of this specification. In Figure 2, the first computing node is deployed with the first industry application middleware, the second computing node is deployed with the second industry application middleware, and there is a first block in the blockchain that is connected to the first computing node. a chain node, and a second blockchain node connected to the second computing node. The first computing node may be a node used by users of DAPP, and the second computing node may be a node used by developers of DAPP. As shown in Figure 2, the method may include the following steps:
在S201中,第二计算节点获取对目标应用的发布请求,发布请求中包括目标应用的第一应用信息和第一安装包。In S201, the second computing node obtains a publishing request for the target application, where the publishing request includes the first application information and the first installation package of the target application.
本实施例中,开发者可以通过部署在第二计算节点中的第二行业应用中间件登录到 用于发布目标应用的网站,并提交目标应用的发布请求,这样,第二计算节点即可以获取到对目标应用的发布请求。示例性的,该发布请求中可以包括:目标应用的第一应用信息和第一安装包。其中,第一应用信息可以包括以下一项或多项:第二计算节点的连接信息,目标应用的描述信息,与目标应用关联且需上链的业务数据的数据结构,或者,与目标应用关联的数据在网络中流转的策略等。示例性的,第二计算节点的连接信息可以包括:第二计算节点的节点标识和第二计算节点在网络中的网络标识等。In this embodiment, the developer can log in to the website for publishing the target application through the second industry application middleware deployed in the second computing node, and submit a publishing request for the target application. In this way, the second computing node can obtain to a publish request to the target application. For example, the publishing request may include: the first application information and the first installation package of the target application. The first application information may include one or more of the following: connection information of the second computing node, description information of the target application, a data structure of business data associated with the target application and to be uploaded, or, associated with the target application Strategies for data flow in the network, etc. For example, the connection information of the second computing node may include: the node identification of the second computing node, the network identification of the second computing node in the network, and so on.
示例性的,目标应用的描述信息中可以包括:目标应用的订阅类型。其中,订阅类型可以包括:强制订阅、有限订阅或开放订阅。当订阅类型为强制订阅时,订阅范围可以是特定的一个或多个对象,此时仅有特定的对象可以订阅该应用;当订阅类型为有限订阅时,订阅范围可以是特定的一种或多种类别的对象,此时仅有特定类别的对象可以订阅该应用;当订阅类型为开放订阅时,订阅范围可以是全部的对象,此时所有的对象均可以订阅该应用。示例性的,订阅范围可以理解为目标应用对计算节点授权的授权信息。例如,当订阅范围内包括第一计算节点时,表明目标应用对第一计算节点是授权的,即第一计算节点可以订阅该目标应用。For example, the description information of the target application may include: the subscription type of the target application. Among them, the subscription type can include: mandatory subscription, limited subscription or open subscription. When the subscription type is mandatory subscription, the subscription scope can be one or more specific objects. At this time, only specific objects can subscribe to the application; when the subscription type is limited subscription, the subscription scope can be one or more specific objects. When the subscription type is open subscription, the subscription scope can be all objects, in which case all objects can subscribe to the application. For example, the subscription scope can be understood as the authorization information for the target application to authorize the computing node. For example, when the first computing node is included in the subscription scope, it indicates that the target application is authorized for the first computing node, that is, the first computing node can subscribe to the target application.
在S202,第二计算节点通过第二区块链节点将第一应用信息上传至区块链中,以及存储第一安装包。In S202, the second computing node uploads the first application information to the blockchain through the second blockchain node, and stores the first installation package.
本实施例中,第二行业应用中间件可以通过第二计算节点向第二区块链节点发送一个用于调用智能合约的交易,该交易中的data字段可以包括第一应用信息。第二区块链节点获取到第二计算节点发送的交易后,可以与区块链中其他的节点对该交易进行共识。在区块链中的节点对该交易共识后,区块链中的各个节点可分别执行该交易,从而分别执行智能合约,并基于智能合约的执行更新状态数据库,这样区块链中每个节点对应的状态数据库中均可以具有该第一应用信息,此时,该第一应用信息即存储到智能合约的合约状态中。由此,第二计算节点通过第二区块链节点将第一应用信息上传至区块链中。In this embodiment, the second industry application middleware may send a transaction for calling the smart contract to the second blockchain node through the second computing node, and the data field in the transaction may include the first application information. After the second blockchain node obtains the transaction sent by the second computing node, it can reach consensus on the transaction with other nodes in the blockchain. After the nodes in the blockchain reach consensus on the transaction, each node in the blockchain can execute the transaction separately, thereby executing the smart contract respectively, and update the status database based on the execution of the smart contract, so that each node in the blockchain The corresponding state database may all have the first application information. At this time, the first application information is stored in the contract state of the smart contract. Thus, the second computing node uploads the first application information to the blockchain through the second blockchain node.
另外,第二计算节点在获取到第一安装包后,可以在其本地存储该第一安装包。In addition, after obtaining the first installation package, the second computing node may store the first installation package locally.
在S203,第一计算节点从区块链上获取第一应用信息。In S203, the first computing node obtains the first application information from the blockchain.
本实施例中,当第一应用信息上传至区块链中后,第一计算节点可以从区块链上获取第一应用信息。In this embodiment, after the first application information is uploaded to the blockchain, the first computing node can obtain the first application information from the blockchain.
作为一种可能的实现方式,第一计算节点可以通过其上的第一行业应用中间件以轮询的方式向第一区块链节点发送用于调用智能合约的查询交易,查询交易中包含第一计算节点的节点标识。该查询交易可以用于从智能合约的合约状态中筛选出对第一计算节点授权的应用。示例性的,当目标应用是对第一计算节点授权的应用时,该查询交易可以理解为是查询目标应用的第一应用信息。第一区块链节点获取到第一计算节点发送的查询交易后,可以执行该查询交易,从而基于查询交易中第一计算节点的节点标识从其上智能合约的合约状态中筛选出对第一计算节点授权的目标应用,即筛选出第一计算节点可订阅的目标应用。示例性的,当合约状态中的各个应用的应用信息中可以订阅应用的对象包括第一计算节点时,则可以基于第一计算节点的节点标识,从各个应用中筛选出目标应用,并获取到目标应用的第一应用信息。接着,第一区块链节点可以将该第一应用信息返回至第一计算节点。这样,第一计算节点即获取到第一应用信息。As a possible implementation method, the first computing node can send a query transaction for calling the smart contract to the first blockchain node in a polling manner through the first industry application middleware on it, and the query transaction includes the first The node ID of a compute node. This query transaction can be used to filter out applications authorized for the first computing node from the contract status of the smart contract. For example, when the target application is an application authorized for the first computing node, the query transaction can be understood as querying the first application information of the target application. After the first blockchain node obtains the query transaction sent by the first computing node, it can execute the query transaction, thereby filtering out the first query transaction from the contract status of the smart contract based on the node identification of the first computing node in the query transaction. The target applications authorized by the computing node are to filter out the target applications that the first computing node can subscribe to. For example, when the objects that can subscribe to the application in the application information of each application in the contract state include the first computing node, the target application can be filtered out from each application based on the node identifier of the first computing node, and the target application can be obtained. The first application information of the target application. Then, the first blockchain node can return the first application information to the first computing node. In this way, the first computing node obtains the first application information.
在S204,第一计算节点基于第一应用信息,判断其是否需要部署目标应用。In S204, the first computing node determines whether it needs to deploy the target application based on the first application information.
本实施例中,第一计算节点获取到第一应用信息后,其上部署的第一行业应用中间件可以由第一应用信息中的订阅类型,判断是否需要部署目标应用。其中,当订阅类型是强制订阅时,第一行业应用中间件可以确定出第一计算节点上需要部署目标应用,此时,第一计算节点立即对目标应用进行部署。当订阅类型是有限订阅或开放订阅时,第一行业应用中间件可以通过第一计算节点询问使用者是否部署该目标应用,当使用者下发部署的指令后,第一计算节点则需要部署目标应用。示例性的,第一行业应用中间件可以控制在第一计算节点所显示的用户UI上显示询问信息,该询问信息用于询问使用者是否部署该目标应用。In this embodiment, after the first computing node obtains the first application information, the first industry application middleware deployed on it can determine whether the target application needs to be deployed based on the subscription type in the first application information. When the subscription type is mandatory subscription, the first industry application middleware can determine that the target application needs to be deployed on the first computing node. At this time, the first computing node immediately deploys the target application. When the subscription type is limited subscription or open subscription, the first industry application middleware can ask the user through the first computing node whether to deploy the target application. After the user issues a deployment instruction, the first computing node needs to deploy the target application. For example, the first industry application middleware may control the display of query information on the user UI displayed by the first computing node, and the query information is used to query the user whether to deploy the target application.
在S205,若第一计算节点上需要部署目标应用,第一计算节点根据第一应用信息中包含的第二计算节点的连接信息从第二计算节点处获取目标应用的第一安装包。In S205, if the target application needs to be deployed on the first computing node, the first computing node obtains the first installation package of the target application from the second computing node according to the connection information of the second computing node included in the first application information.
本实施例中,第一计算节点可以由第一应用信息中获取到第二计算节点的连接信息,比如第二计算节点的节点标识和第二计算节点在网络中的网络标识等信息。接着,第一计算节点可以基于第二计算节点的连接信息并通过BTN与第二计算节点进行通信,以获取到目标应用的安装包。示例性的,如图3所示,在S301中,第一计算节点可以向第二计算节点发送应用获取请求,该应用获取请求中可以包含目标应用的应用标识。在S402中,第二计算节点可以基于目标应用的应用标识从其存储的应用的安装包中,筛选出目标应用的安装包,并将该安装包发送至第一计算节点。In this embodiment, the first computing node can obtain the connection information of the second computing node from the first application information, such as the node identification of the second computing node and the network identification of the second computing node in the network. Then, the first computing node may communicate with the second computing node through the BTN based on the connection information of the second computing node to obtain the installation package of the target application. For example, as shown in Figure 3, in S301, the first computing node may send an application acquisition request to the second computing node, and the application acquisition request may include the application identification of the target application. In S402, the second computing node may filter out the installation package of the target application from the installation packages of the application stored therein based on the application identifier of the target application, and send the installation package to the first computing node.
在S206中,第一计算节点基于第一安装包部署目标应用。In S206, the first computing node deploys the target application based on the first installation package.
本实施例中,第一计算节点获取到目标应用的第一安装包后,第一计算节点基于该第一安装包,对目标应用进行动态配置和动态部署,以完成部署目标应用,从而使得使用者可以在第一计算节点上使用目标应用。In this embodiment, after the first computing node obtains the first installation package of the target application, the first computing node dynamically configures and dynamically deploys the target application based on the first installation package to complete the deployment of the target application, thereby enabling use The user can use the target application on the first computing node.
其中,第一计算节点在进行动态配置时,可以基于其自身的软件环境,针对目标应用生成用于存储目标应用的本地数据的数据库(比如:mysql)的账户和密码,以及生成用于存储目标应用的缓存数据的存储系统(比如:Redis)的账户和密码。另外,第一计算节点在进行动态配置时,还可以配置启动命令,比如:配置启动的资源占用、CPU、内存、启动端口、要加载的子配置文件、JVM命令等。Among them, when the first computing node is dynamically configured, based on its own software environment, the first computing node can generate an account and password for a database (such as mysql) for storing local data of the target application, and generate an account and password for storing the target application. The account and password of the application's cache data storage system (such as Redis). In addition, when dynamically configuring the first computing node, you can also configure startup commands, such as configuring startup resource occupancy, CPU, memory, startup port, sub-configuration files to be loaded, JVM commands, etc.
第一计算节点在进行动态部署时,可以使用docker或k8s(kubernetes)等构建镜像,以对目标应用进行隔离处理,从而保证目标应用与其他的应用之间互不影响,保障第一计算节点的稳定性。第一计算节点在镜像构建完成后,可以启动镜像,并加载目标应用的安装包,以完成安装。至此,即完成在通过第二计算节点发布目标应用后,自动在第一计算节点上完成目标应用的部署。When the first computing node is dynamically deployed, you can use docker or k8s (kubernetes) to build an image to isolate the target application, thereby ensuring that the target application does not affect each other and other applications, and ensuring the safety of the first computing node. stability. After the image construction is completed, the first computing node can start the image and load the installation package of the target application to complete the installation. At this point, after the target application is released through the second computing node, the target application is automatically deployed on the first computing node.
在一些实施例中,图2中所示的区块链可以表示区块链中的任意一个区块链节点。In some embodiments, the blockchain shown in Figure 2 can represent any blockchain node in the blockchain.
可以理解的是,图2中虽然示出了两个计算节点,但本说明书实施例并不限于此,而是可以包括其他数量的计算节点。It can be understood that although two computing nodes are shown in Figure 2, the embodiments of this specification are not limited thereto, and may include other numbers of computing nodes.
与前述方法实施例基于相同的构思,本说明书实施例中还提供了一种基于区块链的分布式应用部署装置。Based on the same concept as the foregoing method embodiments, the embodiments of this specification also provide a blockchain-based distributed application deployment device.
示例性的,图4为本说明书实施例中提供的一种基于区块链的分布式应用部署装置的结构示意图。其中,该装置可以部署在第一计算节点。如图4所示,该装置400包括: 获取模块410、判断模块420和处理模块430。其中,获取模块410配置为从区块链上获取目标应用的第一应用信息,第一应用信息包括第二计算节点的连接信息,第一应用信息通过第二计算节点上传至区块链。判断模块420配置为基于第一应用信息,判断是否需要部署目标应用。获取模块410还配置为在判断模块420判断出需要部署目标应用时,根据第二计算节点的连接信息从第二计算节点处获取目标应用的第一安装包。处理模块430配置为在获取模块410获取到第一安装包时,基于第一安装包部署目标应用。Illustratively, FIG. 4 is a schematic structural diagram of a blockchain-based distributed application deployment device provided in the embodiment of this specification. Wherein, the device can be deployed on the first computing node. As shown in Figure 4, the device 400 includes: an acquisition module 410, a judgment module 420 and a processing module 430. The acquisition module 410 is configured to acquire the first application information of the target application from the blockchain, where the first application information includes the connection information of the second computing node, and the first application information is uploaded to the blockchain through the second computing node. The determination module 420 is configured to determine whether the target application needs to be deployed based on the first application information. The acquisition module 410 is also configured to acquire the first installation package of the target application from the second computing node according to the connection information of the second computing node when the determination module 420 determines that the target application needs to be deployed. The processing module 430 is configured to deploy the target application based on the first installation package when the obtaining module 410 obtains the first installation package.
在一种可能的实现方式中,第一应用信息存储在智能合约的合约状态中,第一应用信息还包括目标应用对第一计算节点授权的授权信息。获取模块410,具体配置为:向区块链中的第一区块链节点发送用于调用智能合约的查询交易,查询交易用于从智能合约的合约状态中筛选对第一计算节点授权的应用,第一区块链节点为区块链中与第一计算节点对接的节点;以及,获取第一区块链节点返回的第一应用信息。In a possible implementation, the first application information is stored in the contract state of the smart contract, and the first application information also includes authorization information for the target application to authorize the first computing node. The acquisition module 410 is specifically configured to: send a query transaction for calling the smart contract to the first blockchain node in the blockchain, and the query transaction is used to filter applications authorized for the first computing node from the contract status of the smart contract. , the first blockchain node is a node in the blockchain that is connected to the first computing node; and, obtain the first application information returned by the first blockchain node.
在一种可能的实现方式中,第一应用信息还包括以下一项或多项:与目标应用关联且需上链的业务数据的数据结构,或者,与目标应用关联的数据在网络中流转的策略。In a possible implementation, the first application information also includes one or more of the following: a data structure of business data associated with the target application that needs to be uploaded, or a data structure of data associated with the target application that flows in the network. Strategy.
在一种可能的实现方式中,第一应用信息还包括目标应用的订阅类型。In a possible implementation manner, the first application information also includes the subscription type of the target application.
订阅类型包括强制订阅、有限订阅或开放订阅。判断模块420,具体配置为:基于订阅类型,判断是否需要部署目标应用。Subscription types include mandatory subscription, limited subscription, or open subscription. The determination module 420 is specifically configured to determine whether the target application needs to be deployed based on the subscription type.
在一种可能的实现方式中,处理模块430具体配置为:生成用于存储目标应用的本地数据的数据库的账户和密码基于该账户和密码,部署目标应用。In one possible implementation, the processing module 430 is specifically configured to: generate an account and password for a database used to store local data of the target application, and deploy the target application based on the account and password.
示例性的,图5为本说明书实施例中提供的另一种基于区块链的分布式应用部署装置的结构示意图。其中,该装置可以部署在第二计算节点。如图5所示,该装置500包括:获取模块510和处理模块520。其中,获取模块510配置为获取针对目标应用的发布请求,发布请求中包括目标应用的第一应用信息和第一安装包,第一应用信息包括第二计算节点的连接信息。处理模块520配置为通过区块链中的第二区块链节点将第一应用信息上传至区块链中,以及存储第一安装包,其中,第二区块链节点为区块链中与第二计算节点对接的节点。For example, FIG. 5 is a schematic structural diagram of another blockchain-based distributed application deployment device provided in the embodiment of this specification. Wherein, the device can be deployed on the second computing node. As shown in Figure 5, the device 500 includes: an acquisition module 510 and a processing module 520. The acquisition module 510 is configured to obtain a release request for the target application, where the release request includes first application information and a first installation package of the target application, and the first application information includes connection information of the second computing node. The processing module 520 is configured to upload the first application information to the blockchain through a second blockchain node in the blockchain, and store the first installation package, where the second blockchain node is the same as in the blockchain. The node to which the second computing node is connected.
示例性的,图6为本说明书实施例中提供的又一种基于区块链的分布式应用部署装置的结构示意图。其中,该装置可以部署在第一区块链节点。如图6所示,该装置600包括:获取模块610和处理模块620。其中,获取模块610配置为接收用于调用智能合约的第一交易,第一交易由与第二区块链节点连接的第二计算节点发送到区块链中,第一交易中包括目标应用的第一应用信息,第一应用信息中包括第二计算节点的连接信息,第二计算节点中存储有目标应用的第一安装包。处理模块620配置为根据第一交易,将第一应用信息存储到智能合约的合约状态中。另外,获取模块610还配置为从第一计算节点接收用于调用智能合约的第二交易,第二交易用于查询应用信息。处理模块620还配置为根据第二交易将合约状态中的第一应用信息发送给第一计算节点以使得第一计算节点根据连接信息从第二计算节点处获取目标应用的第一安装包。Illustratively, FIG. 6 is a schematic structural diagram of yet another blockchain-based distributed application deployment device provided in the embodiment of this specification. Among them, the device can be deployed at the first blockchain node. As shown in Figure 6, the device 600 includes: an acquisition module 610 and a processing module 620. Wherein, the acquisition module 610 is configured to receive a first transaction for calling a smart contract. The first transaction is sent to the blockchain by a second computing node connected to the second blockchain node. The first transaction includes the target application's information. The first application information includes the connection information of the second computing node, and the second computing node stores the first installation package of the target application. The processing module 620 is configured to store the first application information into the contract state of the smart contract according to the first transaction. In addition, the acquisition module 610 is further configured to receive a second transaction for calling the smart contract from the first computing node, and the second transaction is used for querying application information. The processing module 620 is further configured to send the first application information in the contract state to the first computing node according to the second transaction so that the first computing node obtains the first installation package of the target application from the second computing node according to the connection information.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。 因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, improvements in a technology could be clearly distinguished as hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method processes). However, with the development of technology, many improvements in today's method processes can be regarded as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement of a method flow cannot be implemented using hardware entity modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic functions are determined by the user programming the device. Designers can program themselves to "integrate" a digital system on a PLD, instead of asking chip manufacturers to design and produce dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing, and before compilation The original code must also be written in a specific programming language, which is called Hardware Description Language (HDL), and HDL is not just one kind, but there are many, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., are currently the most commonly used The two are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that by simply logically programming the method flow using the above-mentioned hardware description languages and programming it into the integrated circuit, the hardware circuit that implements the logical method flow can be easily obtained.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本申请不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not rule out that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这 种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-inventive means. The sequence of steps listed in the embodiment is only one way of executing the sequence of many steps, and does not represent the only execution sequence. When the actual device or terminal product is executed, it may be executed sequentially or in parallel according to the methods shown in the embodiments or figures (for example, a parallel processor or a multi-thread processing environment, or even a distributed data processing environment). The terms "comprises," "comprises" or any other variation thereof are intended to cover a non-exclusive inclusion such that a process, method, product or apparatus including a list of elements includes not only those elements but also others not expressly listed elements, or also elements inherent to the process, method, product or equipment. Without further limitation, it does not exclude the presence of additional identical or equivalent elements in a process, method, product or apparatus including the stated elements. For example, if the words "first" and "second" are used to express names, they do not indicate any specific order.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。For the convenience of description, when describing the above device, the functions are divided into various modules and described separately. Of course, when implementing one or more of this specification, the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. . The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information. Information may be computer-readable instructions, data structures, modules of programs, 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), and 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 disc (DVD) or other optical storage, Magnetic tape, magnetic tape storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present description may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。Each embodiment in this specification is described in a progressive manner. The same and similar parts between the various embodiments can be referred to each other. Each embodiment focuses on its differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. In the description of this specification, reference to the terms "one embodiment," "some embodiments," "an example," "specific examples," or "some examples" or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of this specification. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。The above descriptions are only examples of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. To those skilled in the art, various modifications and changes may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification shall be included in the scope of the claims.

Claims (12)

  1. 一种基于区块链的分布式应用部署方法,所述方法由第一计算节点执行,包括:A blockchain-based distributed application deployment method, the method is executed by a first computing node, including:
    从区块链上获取目标应用的第一应用信息,所述第一应用信息包括第二计算节点的连接信息,所述第一应用信息通过所述第二计算节点上传至所述区块链;Obtain the first application information of the target application from the blockchain, the first application information includes the connection information of the second computing node, and the first application information is uploaded to the blockchain through the second computing node;
    基于所述第一应用信息,判断是否需要部署所述目标应用;Based on the first application information, determine whether the target application needs to be deployed;
    若需要部署所述目标应用,根据所述连接信息,从所述第二计算节点处获取所述目标应用的第一安装包,以及,基于所述第一安装包部署所述目标应用。If the target application needs to be deployed, obtain the first installation package of the target application from the second computing node according to the connection information, and deploy the target application based on the first installation package.
  2. 根据权利要求1所述的方法,其中,所述第一应用信息存储在智能合约的合约状态中,所述第一应用信息还包括所述目标应用对所述第一计算节点授权的授权信息,所述从区块链上获取目标应用的第一应用信息,包括:The method of claim 1, wherein the first application information is stored in a contract state of a smart contract, and the first application information further includes authorization information for the target application to authorize the first computing node, Obtaining the first application information of the target application from the blockchain includes:
    向所述区块链中的第一区块链节点发送用于调用智能合约的查询交易,所述查询交易用于从所述智能合约的合约状态中筛选对所述第一计算节点授权的应用,所述第一区块链节点为所述区块链中与所述第一计算节点对接的节点;Send a query transaction for calling a smart contract to the first blockchain node in the blockchain, where the query transaction is used to filter applications authorized for the first computing node from the contract status of the smart contract. , the first blockchain node is a node in the blockchain that is connected to the first computing node;
    获取所述第一区块链节点返回的所述第一应用信息。Obtain the first application information returned by the first blockchain node.
  3. 根据权利要求1或2所述的方法,其中,所述第一应用信息还包括:与所述目标应用关联且需上链的业务数据的数据结构,和/或,与所述目标应用关联的数据在网络中流转的策略。The method according to claim 1 or 2, wherein the first application information further includes: a data structure of business data associated with the target application and to be uploaded, and/or a data structure associated with the target application. Strategies for data flow in the network.
  4. 根据权利要求1或2所述的方法,其中,所述第一应用信息还包括:所述目标应用的订阅类型,所述订阅类型包括强制订阅、有限订阅或开放订阅,所述基于所述第一应用信息,判断是否需要部署所述目标应用,包括:基于所述订阅类型,判断是否需要部署所述目标应用。The method according to claim 1 or 2, wherein the first application information further includes: a subscription type of the target application, the subscription type includes a mandatory subscription, a limited subscription or an open subscription. Application information, determining whether the target application needs to be deployed, including: based on the subscription type, determining whether the target application needs to be deployed.
  5. 根据权利要求1或2所述的方法,其中,所述基于所述第一安装包部署所述目标应用,包括:The method according to claim 1 or 2, wherein the deploying the target application based on the first installation package includes:
    生成用于存储所述目标应用的本地数据的数据库的账户和密码,基于所述账户和密码部署所述目标应用。Generate an account and password for a database that stores local data of the target application, and deploy the target application based on the account and password.
  6. 一种基于区块链的分布式应用部署方法,所述方法由第二计算节点执行,包括:A blockchain-based distributed application deployment method, the method is executed by a second computing node, including:
    获取针对目标应用的发布请求,所述发布请求中包括所述目标应用的第一应用信息和第一安装包,所述第一应用信息包括所述第二计算节点的连接信息;Obtain a release request for the target application, the release request includes first application information and a first installation package of the target application, and the first application information includes connection information of the second computing node;
    通过区块链中的第二区块链节点将所述第一应用信息上传至所述区块链中,以及存储所述第一安装包,其中,所述第二区块链节点为所述区块链中与所述第二计算节点对接的节点。Upload the first application information to the blockchain through a second blockchain node in the blockchain, and store the first installation package, where the second blockchain node is the A node in the blockchain that is connected to the second computing node.
  7. 一种基于区块链的分布式应用部署方法,所述方法由第一区块链节点执行,包括:A blockchain-based distributed application deployment method, the method is executed by a first blockchain node, including:
    接收用于调用智能合约的第一交易,所述第一交易由与第二区块链节点连接的第二计算节点发送到区块链中,所述第一交易中包括目标应用的第一应用信息,所述第一应用信息中包括所述第二计算节点的连接信息,所述第二计算节点中存储有所述目标应用的第一安装包;Receive a first transaction for invoking a smart contract, the first transaction is sent to the blockchain by a second computing node connected to the second blockchain node, the first transaction includes a first application of the target application Information, the first application information includes connection information of the second computing node, and the first installation package of the target application is stored in the second computing node;
    根据所述第一交易,将所述第一应用信息存储到所述智能合约的合约状态中;According to the first transaction, store the first application information in the contract state of the smart contract;
    从第一计算节点接收用于调用智能合约的第二交易,所述第二交易用于查询应用信息;Receive a second transaction for invoking a smart contract from the first computing node, the second transaction being used to query application information;
    根据所述第二交易将所述合约状态中的所述第一应用信息发送给所述第一计算节点 以使得所述第一计算节点根据所述连接信息从所述第二计算节点处获取所述目标应用的第一安装包。The first application information in the contract state is sent to the first computing node according to the second transaction so that the first computing node obtains the application information from the second computing node according to the connection information. The first installation package of the target application.
  8. 一种基于区块链的分布式应用部署装置,部署在第一计算节点,所述装置包括:A distributed application deployment device based on blockchain, deployed on the first computing node, the device includes:
    获取模块,配置为从区块链上获取目标应用的第一应用信息,所述第一应用信息包括第二计算节点的连接信息,所述第一应用信息通过所述第二计算节点上传至所述区块链;The acquisition module is configured to obtain the first application information of the target application from the blockchain, the first application information includes the connection information of the second computing node, and the first application information is uploaded to the second computing node through the second computing node. The blockchain;
    判断模块,配置为基于所述第一应用信息,判断是否需要部署所述目标应用;A judgment module configured to judge whether the target application needs to be deployed based on the first application information;
    所述获取模块,还配置为在所述判断模块判断出需要部署所述目标应用时,根据所述连接信息从所述第二计算节点处获取所述目标应用的第一安装包;The acquisition module is further configured to acquire the first installation package of the target application from the second computing node according to the connection information when the determination module determines that the target application needs to be deployed;
    处理模块,配置为在所述获取模块获取到所述第一安装包时,基于所述第一安装包部署所述目标应用。A processing module configured to deploy the target application based on the first installation package when the acquisition module obtains the first installation package.
  9. 一种基于区块链的分布式应用部署装置,部署在第二计算节点,所述装置包括:A blockchain-based distributed application deployment device, deployed on the second computing node, the device includes:
    获取模块,配置为获取针对目标应用的发布请求,所述发布请求中包括所述目标应用的第一应用信息和第一安装包,所述第一应用信息包括所述第二计算节点的连接信息;Obtaining module, configured to obtain a release request for a target application, the release request includes first application information and a first installation package of the target application, the first application information includes connection information of the second computing node ;
    处理模块,配置为通过区块链中的第二区块链节点将所述第一应用信息上传至所述区块链中,以及存储所述第一安装包,其中,所述第二区块链节点为所述区块链中与所述第二计算节点对接的节点。A processing module configured to upload the first application information to the blockchain through a second blockchain node in the blockchain, and store the first installation package, wherein the second block A chain node is a node in the blockchain that is connected to the second computing node.
  10. 一种基于区块链的分布式应用部署装置,部署在第一区块链节点,包括:A distributed application deployment device based on blockchain, deployed on the first blockchain node, including:
    获取模块,配置为接收用于调用智能合约的第一交易,所述第一交易由与第二区块链节点连接的第二计算节点发送到区块链中,所述第一交易中包括目标应用的第一应用信息,所述第一应用信息中包括所述第二计算节点的连接信息,所述第二计算节点中存储有所述目标应用的第一安装包;An acquisition module configured to receive a first transaction for invoking a smart contract, the first transaction being sent to the blockchain by a second computing node connected to the second blockchain node, the first transaction including a target The first application information of the application, the first application information includes the connection information of the second computing node, and the first installation package of the target application is stored in the second computing node;
    处理模块,配置为根据所述第一交易,将所述第一应用信息存储到所述智能合约的合约状态中;A processing module configured to store the first application information in the contract state of the smart contract according to the first transaction;
    所述获取模块,还配置为从第一计算节点接收用于调用智能合约的第二交易,所述第二交易用于查询应用信息;The acquisition module is further configured to receive a second transaction for calling the smart contract from the first computing node, where the second transaction is used to query application information;
    所述处理模块,还配置为根据所述第二交易将所述合约状态中的所述第一应用信息发送给所述第一计算节点以使得所述第一计算节点根据所述连接信息从所述第二计算节点处获取所述目标应用的第一安装包。The processing module is further configured to send the first application information in the contract state to the first computing node according to the second transaction so that the first computing node obtains the information from the connection information based on the connection information. Obtain the first installation package of the target application at the second computing node.
  11. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算设备中执行时,计算设备执行权利要求1至5中任一项所述的方法,或者,执行权利要求6中所述的方法,或者,执行权利要求7中所述的方法。A computer-readable storage medium with a computer program stored thereon. When the computer program is executed in a computing device, the computing device performs the method described in any one of claims 1 to 5, or performs claim 6 The method described in claim 7, or perform the method described in claim 7.
  12. 一种计算设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器执行所述计算机程序时,实现权利要求1至5中任一项所述的方法,或者,执行权利要求6中所述的方法,或者,执行权利要求7中所述的方法。A computing device, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, it implements the method described in any one of claims 1 to 5, or executes the claim. The method described in claim 6, or performing the method described in claim 7.
PCT/CN2022/135258 2022-06-14 2022-11-30 Distributed application deployment method and apparatus based on blockchain WO2023240933A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210668623.0A CN115098114A (en) 2022-06-14 2022-06-14 Block chain-based distributed application deployment method and device
CN202210668623.0 2022-06-14

Publications (1)

Publication Number Publication Date
WO2023240933A1 true WO2023240933A1 (en) 2023-12-21

Family

ID=83290219

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135258 WO2023240933A1 (en) 2022-06-14 2022-11-30 Distributed application deployment method and apparatus based on blockchain

Country Status (2)

Country Link
CN (1) CN115098114A (en)
WO (1) WO2023240933A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115098114A (en) * 2022-06-14 2022-09-23 蚂蚁区块链科技(上海)有限公司 Block chain-based distributed application deployment method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077557A (en) * 2016-12-29 2017-08-18 深圳前海达闼云端智能科技有限公司 The method and device that software application is issued and verified
CN108984784A (en) * 2018-07-26 2018-12-11 百度在线网络技术(北京)有限公司 Application implementation method, device, equipment and storage medium based on block chain network
CN111984271A (en) * 2020-08-27 2020-11-24 北京海益同展信息科技有限公司 Block chain application program processing method and device and block chain application system
CN115098114A (en) * 2022-06-14 2022-09-23 蚂蚁区块链科技(上海)有限公司 Block chain-based distributed application deployment method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077557A (en) * 2016-12-29 2017-08-18 深圳前海达闼云端智能科技有限公司 The method and device that software application is issued and verified
CN108984784A (en) * 2018-07-26 2018-12-11 百度在线网络技术(北京)有限公司 Application implementation method, device, equipment and storage medium based on block chain network
CN111984271A (en) * 2020-08-27 2020-11-24 北京海益同展信息科技有限公司 Block chain application program processing method and device and block chain application system
CN115098114A (en) * 2022-06-14 2022-09-23 蚂蚁区块链科技(上海)有限公司 Block chain-based distributed application deployment method and device

Also Published As

Publication number Publication date
CN115098114A (en) 2022-09-23

Similar Documents

Publication Publication Date Title
US11138030B2 (en) Executing code referenced from a microservice registry
EP3761170B1 (en) Virtual machine creation method and apparatus
US10225335B2 (en) Apparatus, systems and methods for container based service deployment
US10873512B2 (en) Methods for managing self-healing cloud infrastructure and applications
US20120158819A1 (en) Policy-based application delivery
WO2022037612A1 (en) Method for providing application construction service, and application construction platform, application deployment method and system
WO2023231345A1 (en) Method for grouping a plurality of transactions, and blockchain node
US11991094B2 (en) Metadata driven static determination of controller availability
US9336020B1 (en) Workflows with API idiosyncrasy translation layers
WO2023231336A1 (en) Method for executing transaction and blockchain node
WO2024001024A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
US20150012669A1 (en) Platform runtime abstraction
WO2023160083A1 (en) Method for executing transactions, blockchain, master node, and slave node
WO2023185058A1 (en) Method and system for deploying chain code in consortium blockchain
WO2023160085A1 (en) Method for executing transaction, blockchain, master node, and slave node
US11381638B1 (en) System and method for parallel execution of activites in an integration flow
US20220214931A1 (en) System and method for exposing features of integration platform adapters as first-class actions in an orchestration template
WO2023240933A1 (en) Distributed application deployment method and apparatus based on blockchain
WO2023185054A1 (en) Method and system for deploying chaincode in alliance chain
WO2023231335A1 (en) Method for executing transaction in blockchain, and master node of blockchain
WO2024001032A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
WO2023231342A1 (en) Method and apparatus for automatically executing contract on the basis of variable state
WO2024001025A1 (en) Pre-execution cache data cleaning method and blockchain node
US9628401B2 (en) Software product instance placement
CN114661421A (en) Method and system for deploying chain code in alliance chain

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22946599

Country of ref document: EP

Kind code of ref document: A1