WO2021012794A1 - Blockchain construction method and apparatus based on cloud service, medium and electronic device - Google Patents

Blockchain construction method and apparatus based on cloud service, medium and electronic device Download PDF

Info

Publication number
WO2021012794A1
WO2021012794A1 PCT/CN2020/093587 CN2020093587W WO2021012794A1 WO 2021012794 A1 WO2021012794 A1 WO 2021012794A1 CN 2020093587 W CN2020093587 W CN 2020093587W WO 2021012794 A1 WO2021012794 A1 WO 2021012794A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
blockchain
target
block
preset service
Prior art date
Application number
PCT/CN2020/093587
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 WO2021012794A1 publication Critical patent/WO2021012794A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Definitions

  • This application relates to the field of computer technology, and in particular to a method for building a blockchain based on cloud services, a device for building a blockchain based on cloud services, computer-readable media, and electronic equipment.
  • Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • the basic structure of the blockchain includes the data layer, network layer, consensus layer, incentive layer, contract layer, and application layer. Each layer completes a core function, and each layer cooperates with each other to realize a decentralized trust mechanism.
  • the purpose of this application is to provide a method for building a blockchain based on cloud services, a device for building blockchain based on cloud services, computer-readable media, and electronic equipment, so as to overcome the high cost of user learning and the lack of The difficulty of popularization of blockchain technology is high, which in turn reduces the learning cost of users and the difficulty of popularization of blockchain technology.
  • the first aspect of this application provides a method for building a blockchain based on cloud services, including: generating blocks according to configuration information and creating multiple blockchain nodes; calling the target service from the cloud server according to the block and passing the target The service builds a blockchain channel; calls the target node in the blockchain node to start the smart contract deployed in the blockchain channel; synchronizes the smart contract to multiple blockchain nodes.
  • calling the target service from the cloud server according to the block and constructing the blockchain channel through the target service includes: determining the preset service from the cloud server according to the block and starting the preset service ; Call the target service in the preset service to build a blockchain channel.
  • determining the preset service from the cloud server according to the block includes: obtaining the preset service image from the cloud server according to the block; determining the preset service corresponding to the preset service image .
  • the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
  • the cloud service-based blockchain construction method further includes: constructing a target server according to resource configuration information in the configuration information, and the target server is used to provide server resources for a preset service.
  • calling the target service in the preset service to construct a blockchain channel includes: determining the target service from the preset service according to the block; calling the target server corresponding to the target service Server resources build blockchain channels.
  • the cloud service-based blockchain construction method further includes: generating a key corresponding to each blockchain node and uploading a certificate corresponding to the key.
  • a cloud service-based block chain construction device including a block generation unit, a block chain channel construction unit, a smart contract activation unit, and a smart contract synchronization unit, wherein: block generation unit , Used to generate blocks based on configuration information and create multiple blockchain nodes; block chain channel construction unit, used to call target services from cloud servers according to blocks and build blockchain channels through target services; smart contract start The unit is used to call the target node in the blockchain node to start the smart contract deployed in the blockchain channel; the smart contract synchronization unit is used to synchronize the smart contract to multiple blockchain nodes.
  • the block chain channel construction unit calls the target service from the cloud server according to the block and constructs the block chain channel through the target service:
  • the block determines the preset service from the cloud server and starts the preset service;
  • the blockchain channel construction unit calls the target service in the preset service to build the blockchain channel.
  • the way that the blockchain channel construction unit determines the preset service from the cloud server according to the block is specifically as follows: the blockchain channel construction unit obtains the preset service from the cloud server according to the block Service mirroring; the blockchain channel construction unit determines the preset service corresponding to the preset service mirroring.
  • the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
  • the cloud service-based blockchain construction device further includes a server construction unit: a server construction unit configured to construct a target server according to the resource configuration information in the configuration information, and the target server is used for Provide server resources for preset services.
  • the method for the blockchain channel construction unit to call the target service in the preset service to construct the blockchain channel is specifically as follows: the blockchain channel construction unit selects from the preset service according to the block Determine the target service; the block chain channel construction unit calls the server resources corresponding to the target service in the target server to construct the block chain channel.
  • the cloud service-based blockchain construction device further includes a key generation unit: a key generation unit for generating and uploading a key corresponding to each blockchain node The certificate corresponding to the key.
  • a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the cloud service-based blockchain construction as described in the first aspect of the above-mentioned embodiments is realized method.
  • an electronic device including: one or more processors; a storage device, used to store one or more programs, when one or more programs are executed by one or more processors At this time, one or more processors are caused to implement the cloud service-based blockchain construction method as described in the first aspect of the foregoing embodiments.
  • the terminal device or server can generate blocks (eg, genesis block) according to the configuration information input by the user (eg, the number of domain names, the name of each domain name) and create multiple Blockchain nodes, the multiple blockchain nodes can be corresponding blockchain nodes for multiple institutions.
  • the terminal The device or server can also call a target service (such as a consensus service) from the cloud server according to the created block and construct a blockchain channel through the target service.
  • a target service such as a consensus service
  • the establishment of a blockchain channel can realize communication between nodes; further, The terminal device or server can also call the target node in the blockchain node to start the smart contract of the blockchain channel, where the target node can be any node in the blockchain node or a certain node set in advance;
  • the smart contract can be uploaded by the user to the terminal device or server and deployed in the blockchain channel; further, the terminal device or server can synchronize the activated smart contract to multiple blockchain nodes to complete the blockchain Construction.
  • Fig. 1 shows a schematic flowchart of a method for constructing a blockchain based on cloud services according to an exemplary embodiment of the present application.
  • Fig. 2 shows a structural block diagram of a cloud service-based block chain construction device according to an exemplary embodiment of the present application.
  • Fig. 3 shows a schematic structural diagram of a computer system suitable for implementing an electronic device of an exemplary embodiment of the present application.
  • Figure 1 shows a schematic flow diagram of a cloud service-based blockchain construction method according to an exemplary embodiment of the present application.
  • the cloud service-based blockchain construction method can be implemented by a server or a terminal device .
  • the method for building a blockchain based on cloud services includes the following steps S110, S120, S130, and S140.
  • Step S110 Generate a block according to the configuration information and create multiple blockchain nodes.
  • Step S120 call the target service from the cloud server according to the block and construct a blockchain channel through the target service.
  • Step S130 Invoke the target node in the blockchain node to start the smart contract deployed in the blockchain channel.
  • Step S140 Synchronize the smart contract to multiple blockchain nodes.
  • the configuration information may include the number of domain names, the names of each domain name, the type of ranking service, the number of consensus modules, the number of blockchain channels, the names of each blockchain channel, the number of smart contracts, the names of smart contracts, the number of data nodes, and the number of data connections. The number of input modules and the number of secondary nodes.
  • the block generated according to the configuration information is the genesis block in the blockchain.
  • the blockchain is composed of multiple connected blocks, each The block records the transactions in the network for a period of time, and the block can be understood as the account page in the account book.
  • the first block to be constructed is called the genesis block and has a unique ID identification number. Except for the genesis block, each subsequent block contains two ID numbers, one is the ID number of the block itself, and the other is the ID number of the previous block. Through the front-to-back relationship between ID numbers, all blocks are connected in sequence to form a blockchain.
  • each computer participating in the network can receive the name of the blockchain node.
  • all blockchain nodes are responsible for providing network services.
  • Blockchain nodes can be communication endpoints or redistribution points of communication, linking to other nodes.
  • Each blockchain node in the network is considered equal.
  • step S120 there may be one or more blockchain channels, and the blockchain channels are used to connect blockchain nodes.
  • the following steps may be included: configuring the blockchain channel through the channel name, the node corresponding to the channel, and the object corresponding to the channel in the configuration information and configuring the block
  • the chain channel is synchronized to multiple blockchain nodes.
  • the target service may be a consensus service
  • the consensus service may include a consensus algorithm.
  • the consensus algorithm may be a PoW algorithm (Proof of Work), a PoS algorithm (Proof of Stake, equity Proof) or DPoS algorithm (Delegate Proof of Stake), the embodiment of this application is not limited.
  • the cloud service provided by the cloud server is based on the increase, use and interaction mode of Internet-based related services, and the cloud server provides dynamically expanded and virtualized services through the Internet. Resources.
  • Applying cloud services to the deployment and implementation of the blockchain system can realize the automated deployment of the blockchain and simplify the deployment cost of the blockchain.
  • the automated deployment of the blockchain can be applied to the attestation system. Since the attestation data cannot be tampered with, it does not rely on third-party certification and the security of distributed storage is high, it reduces independent audits compared to traditional attestation systems , The cost and difficulty of managing real records and complying with the rules of evidence.
  • the terminal device or server may receive the smart contract uploaded by the user, and then execute the above-mentioned calling the target node in the blockchain node to start the smart contract deployed in the blockchain channel.
  • a smart contract (Smart contract) is a computer protocol that spreads, verifies, or executes a contract in an informatized manner. Smart contracts allow trusted transactions without a third party, which are traceable and irreversible.
  • another optional method of calling the target node in the blockchain node to start the smart contract deployed in the blockchain channel may specifically be: calling the target node for starting The interface of the smart contract, through which the smart contract deployed in the blockchain channel is started, where the target node is included in the blockchain node.
  • step S140 the aforementioned synchronizing the smart contract to multiple blockchain nodes can also be understood as synchronizing the smart contract to all the created blockchain nodes.
  • the terminal device or server can connect the constructed blockchain network to the target application.
  • the target application can be an application for traceability, an application for reconciliation of the master account, or an application for digital asset transactions.
  • the implementation of this application The examples are not limited.
  • a user can build a blockchain through a cloud server.
  • the server or terminal device can automatically build a blockchain network, and the user can write the application layer
  • the code and smart contract code realize the storage system, through the electronic, encrypted signature and data chaining of the evidence to achieve the purpose of preserving the evidence and ensuring that the evidence will not be tampered with.
  • the implementation of the cloud service-based blockchain construction method shown in Figure 1 can overcome the high learning cost of users to a certain extent, thereby reducing the learning cost of users; and, through the automation of blockchain construction, Reduce the difficulty of promoting blockchain technology.
  • calling a target service from a cloud server according to a block and building a blockchain channel through the target service may include the following steps: determining a preset service from the cloud server according to the block and starting the preset service; Call the target service in the preset service to build a blockchain channel.
  • the preset service belongs to the service in the blockchain network, and the activation of the preset service can be understood as the activation of the blockchain service.
  • the preset services may include consensus services, data node services, data access services and other services that are used to construct a blockchain network.
  • the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
  • determining the preset service from the cloud server according to the block may include the following steps: obtaining the preset service image from the cloud server according to the block; determining the preset service corresponding to the preset service image .
  • the preset service image includes the code corresponding to the preset service
  • the preset service image is stored in the cloud server
  • the cloud server may include the image service.
  • the preset service mirroring may include consensus service mirroring, data node service mirroring, data access service mirroring, and other service mirroring used to construct a blockchain network.
  • the image can be a cloud server containing application programs and configuration information, and the image can also include an operating system or business data.
  • Image Management Service can include image self-service management functions.
  • the preset service image can be obtained through interaction with the cloud server, so as to start the preset service and construct a blockchain network.
  • the cloud service-based blockchain construction method may further include the following steps: constructing a target server according to resource configuration information in the configuration information, and the target server is used to provide server resources for a preset service.
  • the resource configuration information may include central processing unit (CPU) resources, hard disk resources, memory resources, and the like.
  • CPU central processing unit
  • the target server after constructing the target server according to the resource configuration information in the configuration information, it may further include: initializing the operating environment of the target server and the application to be run, so as to adjust the operating environment and the application to be run to be able to build a blockchain The state of the network.
  • calling the target service in the preset service to construct a blockchain channel may include the following steps: determining the target service from the preset service according to the block; calling the target server corresponding to the target service Server resources build blockchain channels.
  • the server resources corresponding to the target service may be server resources that the terminal device or server needs to run the target service, such as CPU resources, hard disk resources, and memory resources.
  • this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service.
  • users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
  • the cloud service-based blockchain construction method further includes: generating a key corresponding to each blockchain node and uploading a certificate corresponding to the key.
  • the key corresponding to each blockchain node includes a private key and a public key.
  • the certificate corresponding to the key may be a chain certificate, and the certificate is used to prove the area corresponding to the key.
  • the chain certificate is the certificate ca.crt saved in the directory where the chain is generated.
  • a chain corresponds to a chain certificate and a private key.
  • this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service.
  • users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
  • the configuration information before generating the block according to the configuration information, it further includes: outputting an interface containing the information to be configured, and storing information corresponding to user operations in the interface as configuration information, and the configuration information is the same as the information to be configured. correspond.
  • the output interface containing the information to be configured can be understood as an interactive interface for interacting with the user.
  • the interactive interface may include a sorting module, a consensus module, a data node module, and data access. Modules and modules such as secondary node modules, where the information contained in each module may be information to be configured.
  • the secondary node may be a light node that does not save the full amount of data files, may also be a broadcast node, or may be a mining node, which is not limited in the embodiment of the present application.
  • the above-mentioned broadcast node is used to issue transactions and receive blockchain information from a third party, and the above-mentioned mining node is used to mine virtual currency to create new blocks, as well as to publish information and disseminate transactions.
  • the user can create the name of the blockchain in the interactive interface, or select one or more consensus algorithms from the consensus algorithms provided by the consensus module in the interactive interface, and determine the underlying block in the interactive interface
  • the version of the chain service The information corresponding to the user operation performed by the user in the interactive interface can all be stored as configuration information.
  • the user operation can be a touch operation or a non-touch operation, where the non-touch operation can be a voice input operation, that is, it can be understood as a user input by voice Enter the information in a way so that the terminal device or server stores the information as configuration information.
  • the non-touch operation can be a voice input operation, that is, it can be understood as a user input by voice Enter the information in a way so that the terminal device or server stores the information as configuration information.
  • this exemplary embodiment can show users multiple modules to be deployed through an interactive interface, so that users can understand the information to be configured to construct a blockchain cloud network, and input configuration information according to their needs, compared with users in the prior art Self-build the underlying module of the blockchain, this application improves the experience of building the blockchain network, reduces the learning cost of users, and reduces the difficulty of promoting blockchain technology.
  • FIG. 2 shows a structural block diagram of a cloud service-based block chain construction device according to an exemplary embodiment of the present application.
  • the cloud service-based block chain construction device includes: a block generation unit 201, a block chain channel construction unit 202, a smart contract activation unit 203, and a smart contract synchronization unit 204.
  • the block generation unit 201 is used to generate blocks according to the configuration information and create multiple blockchain nodes;
  • the block chain channel construction unit 202 is used to call the target service from the cloud server according to the block and construct it through the target service Blockchain channel;
  • smart contract activation unit 203 used to call the target node in the blockchain node to activate the smart contract deployed in the blockchain channel;
  • smart contract synchronization unit 204 used to synchronize smart contracts to multiple blockchains Node.
  • the implementation of the cloud service-based blockchain construction device shown in Figure 2 can overcome the high learning cost of users to a certain extent, thereby reducing the learning cost of users; and, through the automation of blockchain construction, Reduce the difficulty of promoting blockchain technology.
  • the block chain channel construction unit 202 calls the target service from the cloud server according to the block and constructs the block chain channel through the target service specifically as follows:
  • the cloud server determines the preset service and starts the preset service;
  • the blockchain channel construction unit 202 calls the target service in the preset service to build a blockchain channel.
  • the way that the blockchain channel construction unit 202 determines the preset service from the cloud server according to the block is specifically as follows: the blockchain channel construction unit 202 obtains the preset service from the cloud server according to the block Mirror; Blockchain channel construction unit 202 determines the preset service corresponding to the preset service mirror.
  • the preset service image can be obtained through interaction with the cloud server, so as to start the preset service and construct a blockchain network.
  • the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
  • the cloud service-based blockchain construction device further includes a server construction unit (not shown): a server construction unit configured to construct a target server according to the resource configuration information in the configuration information, and the target server Used to provide server resources for preset services.
  • a server construction unit (not shown): a server construction unit configured to construct a target server according to the resource configuration information in the configuration information, and the target server Used to provide server resources for preset services.
  • the block chain channel construction unit 202 calls the target service in the preset service to construct the block chain channel specifically as follows: the block chain channel construction unit 202 determines from the preset service according to the block The target service is generated; the block chain channel construction unit 202 calls the server resources corresponding to the target service in the target server to construct a block chain channel.
  • this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service.
  • users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
  • the cloud service-based blockchain construction device further includes a key generation unit (not shown): a key generation unit for generating a key corresponding to each blockchain node And upload the certificate corresponding to the key.
  • a key generation unit (not shown): a key generation unit for generating a key corresponding to each blockchain node And upload the certificate corresponding to the key.
  • this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service.
  • users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
  • the cloud service-based blockchain construction device further includes an interface output unit (not shown) and a configuration information storage unit (not shown), where: the interface output unit is used to The block generating unit 201 outputs an interface containing information to be configured before generating a block according to the configuration information; the configuration information storage unit is used to store information corresponding to user operations in the interface as configuration information, and the configuration information corresponds to the information to be configured.
  • this exemplary embodiment can show users multiple modules to be deployed through an interactive interface, so that users can understand the information to be configured to construct a blockchain cloud network, and input configuration information according to their needs, compared with users in the prior art Self-build the underlying module of the blockchain, this application improves the experience of building the blockchain network, reduces the learning cost of users, and reduces the difficulty of promoting blockchain technology.
  • FIG. 3 shows a schematic structural diagram of a computer system 300 suitable for implementing an electronic device according to an exemplary embodiment of the present application.
  • the computer system 300 of the electronic device shown in FIG. 3 is only an example, and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
  • the computer system 300 includes a central processing unit (CPU) 301, which can follow a program stored in a read-only memory (ROM) 302 or a program loaded from a storage part 308 into a random access memory (RAM) 303 And perform various appropriate actions and processing.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data required for system operation are also stored.
  • the CPU 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304.
  • An input/output (I/O) interface 305 is also connected to the bus 304.
  • the following components are connected to the I/O interface 305: an input part 306 including a keyboard, a mouse, etc.; an output part 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers, etc.; a storage part 308 including a hard disk, etc. ; And a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet.
  • the driver 310 is also connected to the I/O interface 305 as needed.
  • a removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that the computer program read from it is installed into the storage portion 308 as needed.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • the embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication part 309, and/or installed from the removable medium 311.
  • the computer program is executed by the central processing unit (CPU) 301, it executes the above-mentioned functions defined in the system of the present application.
  • the computer-readable medium shown in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above.
  • the computer-readable storage medium may be non-volatile or volatile.
  • Computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein.
  • This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

Abstract

The present application provides a blockchain construction method based on a cloud service, a blockchain construction apparatus based on a cloud service, a computer readable medium, and an electronic device, which can be achieved in a blockchain. The method comprises: generating a block and creating a plurality of blockchain nodes according to configuration information; calling a target service from a cloud server according to the block and constructing a blockchain channel by means of the target service; calling a target node in the blockchain nodes to start a smart contract deployed in the blockchain channel; and synchronizing the smart contract into the plurality of blockchain nodes. The blockchain construction method based on a cloud service in the present application can overcome to some extent the problems of the relatively high learning cost of users and the relatively high popularization difficulty of the blockchain technology, thereby reducing the learning cost of the users and the popularization difficulty of the blockchain technology.

Description

基于云服务的区块链构建方法、装置、介质及电子设备Block chain construction method, device, medium and electronic equipment based on cloud service
本申请要求于2019年07月23日提交中国专利局、申请号为2019106673968,发明名称为“基于云服务的区块链构建方法、装置、介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on July 23, 2019, the application number is 2019106673968, and the invention title is "Cloud service-based blockchain construction methods, devices, media, and electronic equipment". The entire content is incorporated into this application by reference.
技术领域Technical field
本申请涉及计算机技术领域,具体而言,涉及一种基于云服务的区块链构建方法、基于云服务的区块链构建装置、计算机可读介质及电子设备。This application relates to the field of computer technology, and in particular to a method for building a blockchain based on cloud services, a device for building a blockchain based on cloud services, computer-readable media, and electronic equipment.
背景技术Background technique
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。其中,区块链的基础架构包括数据层、网络层、共识层、激励层、合约层以及应用层。每层分别完成一项核心功能,各层之间互相配合,实现一个去中心化的信任机制。Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Among them, the basic structure of the blockchain includes the data layer, network layer, consensus layer, incentive layer, contract layer, and application layer. Each layer completes a core function, and each layer cooperates with each other to realize a decentralized trust mechanism.
由于区块链的基础架构设计的层级较多并且网络复杂,因此,在实际构建区块链的过程中,需要专业人员进行一系列繁琐复杂的工作以实现区块链的构建。而普通民众大多专业知识较弱,如果想要构建区块链就需要先学习区块链的相关知识,才有可能完成对区块链的构建。然而,发明人意识到,这会增加用户的学习成本以及区块链技术的推广难度。Since the infrastructure design of the blockchain has many levels and the network is complex, in the actual process of building a blockchain, professionals are required to perform a series of tedious and complex tasks to realize the construction of the blockchain. Most of the ordinary people have weak professional knowledge. If you want to build a blockchain, you need to learn the relevant knowledge of the blockchain before it is possible to complete the construction of the blockchain. However, the inventor realized that this would increase the learning cost for users and the difficulty of promoting blockchain technology.
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本申请的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the background art section above is only used to strengthen the understanding of the background of the application, and therefore may include information that does not constitute the prior art known to those of ordinary skill in the art.
技术问题technical problem
本申请的目的在于提供一种基于云服务的区块链构建方法、基于云服务的区块链构建装置、计算机可读介质及电子设备,进而至少在一定程度上克服用户学习成本较高以及区块链技术的推广难度较高的问题,进而降低用户的学习成本和区块链技术的推广难度。The purpose of this application is to provide a method for building a blockchain based on cloud services, a device for building blockchain based on cloud services, computer-readable media, and electronic equipment, so as to overcome the high cost of user learning and the lack of The difficulty of popularization of blockchain technology is high, which in turn reduces the learning cost of users and the difficulty of popularization of blockchain technology.
技术解决方案Technical solutions
本申请的第一方面提供了一种基于云服务的区块链构建方法,包括:根据配置信息生成区块并创建多个区块链节点;根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道;调用区块链节点中的目标节点启动部署于区块链通道的智能合约;将智能合约同步至多个区块链节点中。The first aspect of this application provides a method for building a blockchain based on cloud services, including: generating blocks according to configuration information and creating multiple blockchain nodes; calling the target service from the cloud server according to the block and passing the target The service builds a blockchain channel; calls the target node in the blockchain node to start the smart contract deployed in the blockchain channel; synchronizes the smart contract to multiple blockchain nodes.
在本申请的一种示例性实施例中,根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道,包括:根据区块从云服务器中确定预设服务并启动预设服务;调用预设服务中的目标服务构建区块链通道。In an exemplary embodiment of the present application, calling the target service from the cloud server according to the block and constructing the blockchain channel through the target service includes: determining the preset service from the cloud server according to the block and starting the preset service ; Call the target service in the preset service to build a blockchain channel.
在本申请的一种示例性实施例中,根据区块从云服务器中确定预设服务,包括:根据区块从云服务器中获取预设服务镜像;确定与预设服务镜像对应的预设服务。In an exemplary embodiment of the present application, determining the preset service from the cloud server according to the block includes: obtaining the preset service image from the cloud server according to the block; determining the preset service corresponding to the preset service image .
在本申请的一种示例性实施例中,预设服务包括共识服务、数据封装服务、数据节点服务以及数据接入服务中至少一种。In an exemplary embodiment of the present application, the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
在本申请的一种示例性实施例中,该基于云服务的区块链构建方法还包括:根据配置信息中的资源配置信息构建目标服务器,目标服务器用于为预设服务提供服务器资源。In an exemplary embodiment of the present application, the cloud service-based blockchain construction method further includes: constructing a target server according to resource configuration information in the configuration information, and the target server is used to provide server resources for a preset service.
在本申请的一种示例性实施例中,调用预设服务中的目标服务构建区块链通道,包括:根据区块从预设服务中确定出目标服务;调用目标服务器中与目标服务对应的服务器资源构建区块链通道。In an exemplary embodiment of the present application, calling the target service in the preset service to construct a blockchain channel includes: determining the target service from the preset service according to the block; calling the target server corresponding to the target service Server resources build blockchain channels.
在本申请的一种示例性实施例中,该基于云服务的区块链构建方法还包括:生成与每个区块链节点对应的密钥并上传与密钥对应的证书。In an exemplary embodiment of the present application, the cloud service-based blockchain construction method further includes: generating a key corresponding to each blockchain node and uploading a certificate corresponding to the key.
根据本申请的第二方面,提供一种基于云服务的区块链构建装置,包括区块生成单元、区块链通道构建单元、智能合约启动单元和智能合约同步单元,其中:区块生成单元,用于根据配置信息生成区块并创建多个区块链节点;区块链通道构建单元,用于根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道;智能合约启动单元,用于调用区块链节点中的目标节点启动部署于区块链通道的智能合约;智能合约同步单元,用于将智能合约同步至多个区块链节点中。According to the second aspect of the present application, there is provided a cloud service-based block chain construction device, including a block generation unit, a block chain channel construction unit, a smart contract activation unit, and a smart contract synchronization unit, wherein: block generation unit , Used to generate blocks based on configuration information and create multiple blockchain nodes; block chain channel construction unit, used to call target services from cloud servers according to blocks and build blockchain channels through target services; smart contract start The unit is used to call the target node in the blockchain node to start the smart contract deployed in the blockchain channel; the smart contract synchronization unit is used to synchronize the smart contract to multiple blockchain nodes.
在本申请的一种示例性实施例中,区块链通道构建单元根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道的方式具体为:区块链通道构建单元根据区块从云服务器中确定预设服务并启动预设服务;区块链通道构建单元调用预设服务中的目标服务构建区块链通道。In an exemplary embodiment of the present application, the block chain channel construction unit calls the target service from the cloud server according to the block and constructs the block chain channel through the target service: The block determines the preset service from the cloud server and starts the preset service; the blockchain channel construction unit calls the target service in the preset service to build the blockchain channel.
在本申请的一种示例性实施例中,区块链通道构建单元根据区块从云服务器中确定预设服务的方式具体为:区块链通道构建单元根据区块从云服务器中获取预设服务镜像;区块链通道构建单元确定与预设服务镜像对应的预设服务。In an exemplary embodiment of the present application, the way that the blockchain channel construction unit determines the preset service from the cloud server according to the block is specifically as follows: the blockchain channel construction unit obtains the preset service from the cloud server according to the block Service mirroring; the blockchain channel construction unit determines the preset service corresponding to the preset service mirroring.
在本申请的一种示例性实施例中,预设服务包括共识服务、数据封装服务、数据节点服务以及数据接入服务中至少一种。In an exemplary embodiment of the present application, the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
在本申请的一种示例性实施例中,该基于云服务的区块链构建装置还包括服务器构建单元:服务器构建单元,用于根据配置信息中的资源配置信息构建目标服务器,目标服务器用于为预设服务提供服务器资源。In an exemplary embodiment of the present application, the cloud service-based blockchain construction device further includes a server construction unit: a server construction unit configured to construct a target server according to the resource configuration information in the configuration information, and the target server is used for Provide server resources for preset services.
在本申请的一种示例性实施例中,区块链通道构建单元调用预设服务中的目标服务构建区块链通道的方式具体为:区块链通道构建单元根据区块从预设服务中确定出目标服务;区块链通道构建单元调用目标服务器中与目标服务对应的服务器资源构建区块链通道。In an exemplary embodiment of the present application, the method for the blockchain channel construction unit to call the target service in the preset service to construct the blockchain channel is specifically as follows: the blockchain channel construction unit selects from the preset service according to the block Determine the target service; the block chain channel construction unit calls the server resources corresponding to the target service in the target server to construct the block chain channel.
在本申请的一种示例性实施例中,该基于云服务的区块链构建装置还包括密钥生成单元:密钥生成单元,用于生成与每个区块链节点对应的密钥并上传与密钥对应的证书。In an exemplary embodiment of the present application, the cloud service-based blockchain construction device further includes a key generation unit: a key generation unit for generating and uploading a key corresponding to each blockchain node The certificate corresponding to the key.
根据本申请的第三方面,提供了一种计算机可读介质,其上存储有计算机程序,程序被处理器执行时实现如上述实施例中第一方面所述的基于云服务的区块链构建方法。According to the third aspect of the present application, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the cloud service-based blockchain construction as described in the first aspect of the above-mentioned embodiments is realized method.
根据本申请的第四方面,提供了一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行时,使得一个或多个处理器实现如上述实施例中第一方面所述的基于云服务的区块链构建方法。According to a fourth aspect of the present application, there is provided an electronic device, including: one or more processors; a storage device, used to store one or more programs, when one or more programs are executed by one or more processors At this time, one or more processors are caused to implement the cloud service-based blockchain construction method as described in the first aspect of the foregoing embodiments.
有益效果Beneficial effect
在本申请的一些实施例所提供的技术方案中,终端设备或服务器可以根据用户输入的配置信息(如,域名数量、各域名的名称)生成区块(如,创世块)并创建多个区块链节点,该多个区块链节点可以为多个机构分别对应的区块链节点,通过为每个机构创建区块链节点,能够实现多个机构之间的互联互通;进而,终端设备或服务器还可以根据创建的区块从云服务器中调用目标服务(如,共识服务)并通过目标服务构建区块链通道,其中,建立区块链通道能够实现各节点之间通信;进而,终端设备或服务器还可以调用区块链节点中的目标节点启动区块链通道的智能合约,其中,目标节点可以为区块链节点中的任一节点也可以为预先设定的某一节点;另外,智能合约可以为用户上传至终端设备或服务器的,并且部署于区块链通道;进而,终端设备或服务器可以将已启动的智能合约同步至多个区块链节点,以完成对于区块链的构建。依据上述方案描述,本申请一方面能够在一定程度上克服用户学习成本较高的问题,进而降低用户的学习成本。另一方面能够通过区块链的构建自动化,降低区块链技术的推广难度。In the technical solutions provided by some embodiments of the present application, the terminal device or server can generate blocks (eg, genesis block) according to the configuration information input by the user (eg, the number of domain names, the name of each domain name) and create multiple Blockchain nodes, the multiple blockchain nodes can be corresponding blockchain nodes for multiple institutions. By creating a blockchain node for each institution, the interconnection between multiple institutions can be realized; furthermore, the terminal The device or server can also call a target service (such as a consensus service) from the cloud server according to the created block and construct a blockchain channel through the target service. The establishment of a blockchain channel can realize communication between nodes; further, The terminal device or server can also call the target node in the blockchain node to start the smart contract of the blockchain channel, where the target node can be any node in the blockchain node or a certain node set in advance; In addition, the smart contract can be uploaded by the user to the terminal device or server and deployed in the blockchain channel; further, the terminal device or server can synchronize the activated smart contract to multiple blockchain nodes to complete the blockchain Construction. According to the foregoing description of the solution, the present application can overcome the problem of high learning costs for users to a certain extent, thereby reducing the learning costs for users. On the other hand, it can reduce the difficulty of promoting blockchain technology through the automation of blockchain construction.
附图说明Description of the drawings
图1示出了根据本申请一示例性实施例的基于云服务的区块链构建方法的流程示意图。Fig. 1 shows a schematic flowchart of a method for constructing a blockchain based on cloud services according to an exemplary embodiment of the present application.
图2示出了根据本申请一示例性实施例的基于云服务的区块链构建装置的结构框图。Fig. 2 shows a structural block diagram of a cloud service-based block chain construction device according to an exemplary embodiment of the present application.
图3示出了适于用来实现本申请一示例性实施例的电子设备的计算机系统的结构示意图。Fig. 3 shows a schematic structural diagram of a computer system suitable for implementing an electronic device of an exemplary embodiment of the present application.
本发明的实施方式Embodiments of the invention
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本申请将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms, and should not be construed as being limited to the examples set forth herein; on the contrary, the provision of these embodiments makes this application more comprehensive and complete, and fully conveys the concept of the example embodiments To those skilled in the art.
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本申请的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本申请的各方面。Furthermore, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to give a sufficient understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be used. In other cases, well-known methods, devices, implementations or operations are not shown or described in detail to avoid obscuring various aspects of the present application.
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The block diagrams shown in the drawings are merely functional entities, and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in the form of software, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices. entity.
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowchart shown in the drawings is only an exemplary description, and does not necessarily include all contents and operations/steps, nor does it have to be performed in the described order. For example, some operations/steps can be decomposed, and some operations/steps can be combined or partially combined, so the actual execution order may be changed according to actual conditions.
请参阅图1,图1示出了根据本申请一示例性实施例的基于云服务的区块链构建方法的流程示意图,该基于云服务的区块链构建方法可以由服务器或终端设备来实现。Please refer to Figure 1. Figure 1 shows a schematic flow diagram of a cloud service-based blockchain construction method according to an exemplary embodiment of the present application. The cloud service-based blockchain construction method can be implemented by a server or a terminal device .
如图1所示,根据本申请的一个实施例的基于云服务的区块链构建方法,包括如下步骤S110、步骤S120、步骤S130以及步骤S140。As shown in FIG. 1, the method for building a blockchain based on cloud services according to an embodiment of the present application includes the following steps S110, S120, S130, and S140.
步骤S110:根据配置信息生成区块并创建多个区块链节点。Step S110: Generate a block according to the configuration information and create multiple blockchain nodes.
步骤S120:根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道。Step S120: call the target service from the cloud server according to the block and construct a blockchain channel through the target service.
步骤S130:调用区块链节点中的目标节点启动部署于区块链通道的智能合约。Step S130: Invoke the target node in the blockchain node to start the smart contract deployed in the blockchain channel.
步骤S140:将智能合约同步至多个区块链节点中。Step S140: Synchronize the smart contract to multiple blockchain nodes.
以下对各步骤进行详细说明。The steps are described in detail below.
在步骤S110中,配置信息可以包括域名数量、各域名名称、排序服务类型、共识模块数量、区块链通道数量、各区块链通道名称、智能合约数量、智能合约名称、数据节点数量、数据接入模块数量以及二级节点数量。In step S110, the configuration information may include the number of domain names, the names of each domain name, the type of ranking service, the number of consensus modules, the number of blockchain channels, the names of each blockchain channel, the number of smart contracts, the names of smart contracts, the number of data nodes, and the number of data connections. The number of input modules and the number of secondary nodes.
在本申请的示例性实施例中,根据配置信息生成的区块为该区块链中的创世区块,需要说明的是,区块链是由多个相连的区块构成的,每个区块记录了一段时间内网络中的交易情况,可以将区块理解为账簿中的帐页。第一个被最早构建的区块称为创世块,拥有一个唯一的ID标识号。除创世块之外,每个后续建立的区块均包含两个ID号,一个是该区块自身的ID号,另一个是前序区块的ID号。通过ID号间的前后指向关系,所有区块按序相连构成了区块链。In the exemplary embodiment of this application, the block generated according to the configuration information is the genesis block in the blockchain. It should be noted that the blockchain is composed of multiple connected blocks, each The block records the transactions in the network for a period of time, and the block can be understood as the account page in the account book. The first block to be constructed is called the genesis block and has a unique ID identification number. Except for the genesis block, each subsequent block contains two ID numbers, one is the ID number of the block itself, and the other is the ID number of the previous block. Through the front-to-back relationship between ID numbers, all blocks are connected in sequence to form a blockchain.
在本申请的示例性实施例中,需要说明的是,在区块链网络中,参与网络的每一台计算机都可以接收区块链节点的名称。在网络中,所有的区块链节点都有责任提供网络服务。区块链节点可以是通信端点,也可以是通信的重分发点,链接到其他节点。网络中的每个区块链节点都被认为是相等的。In the exemplary embodiment of the present application, it should be noted that in the blockchain network, each computer participating in the network can receive the name of the blockchain node. In the network, all blockchain nodes are responsible for providing network services. Blockchain nodes can be communication endpoints or redistribution points of communication, linking to other nodes. Each blockchain node in the network is considered equal.
在步骤S120中,上述的区块链通道可以为一个也可以为多个,区块链通道用于连接区块链节点。可选的,在通过目标服务构建区块链通道之后,还可以包括以下步骤:通过配置信息中的通道名称、通道对应的节点、通道对应的对象配置区块链通道并将配置后的区块链通道同步至多个区块链节点中。In step S120, there may be one or more blockchain channels, and the blockchain channels are used to connect blockchain nodes. Optionally, after constructing the blockchain channel through the target service, the following steps may be included: configuring the blockchain channel through the channel name, the node corresponding to the channel, and the object corresponding to the channel in the configuration information and configuring the block The chain channel is synchronized to multiple blockchain nodes.
在本申请的示例性实施例中,目标服务可以为共识服务,共识服务中可以包括共识算法,该共识算法可以为PoW算法(Proof of Work,工作量证明)、PoS算法(Proof of Stake,权益证明)或DPoS算法(Delegate Proof of Stake,委托权益证明),本申请的实施例不作限定。In the exemplary embodiment of this application, the target service may be a consensus service, and the consensus service may include a consensus algorithm. The consensus algorithm may be a PoW algorithm (Proof of Work), a PoS algorithm (Proof of Stake, equity Proof) or DPoS algorithm (Delegate Proof of Stake), the embodiment of this application is not limited.
在本申请的示例性实施例中,需要说明的是,上述云服务器所提供的云服务是基于互联网的相关服务的增加、使用和交互模式,云服务器通过互联网来提供动态已扩展且虚拟化的资源。将云服务运用于区块链系统的部署实施能够实现对区块链的自动化部署,可以简化区块链的部署成本。举例来说,自动化部署的区块链可以应用于存证系统,由于其存证数据不可篡改、不依赖第三方机构证明且分布式存储安全性较高,相比传统存证系统减少了独立审计、管理真实记录以及遵守存证规则的成本和难度。In the exemplary embodiment of the present application, it should be noted that the cloud service provided by the cloud server is based on the increase, use and interaction mode of Internet-based related services, and the cloud server provides dynamically expanded and virtualized services through the Internet. Resources. Applying cloud services to the deployment and implementation of the blockchain system can realize the automated deployment of the blockchain and simplify the deployment cost of the blockchain. For example, the automated deployment of the blockchain can be applied to the attestation system. Since the attestation data cannot be tampered with, it does not rely on third-party certification and the security of distributed storage is high, it reduces independent audits compared to traditional attestation systems , The cost and difficulty of managing real records and complying with the rules of evidence.
在步骤S130中,可选的,终端设备或服务器可以接收由用户上传的智能合约,进而执行上述的调用区块链节点中的目标节点启动部署于区块链通道的智能合约。其中,智能合约(Smart contract )是一种以信息化方式传播、验证或执行合同的计算机协议。智能合约允许在没有第三方的情况下进行可信交易,这些交易可追踪且不可逆转。In step S130, optionally, the terminal device or server may receive the smart contract uploaded by the user, and then execute the above-mentioned calling the target node in the blockchain node to start the smart contract deployed in the blockchain channel. Among them, a smart contract (Smart contract) is a computer protocol that spreads, verifies, or executes a contract in an informatized manner. Smart contracts allow trusted transactions without a third party, which are traceable and irreversible.
在本申请的示例性实施例中,另一可选的,上述的调用区块链节点中的目标节点启动部署于区块链通道的智能合约的方式具体可以为:调用目标节点中用于启动智能合约的接口,通过该接口启动部署于区块链通道的智能合约,其中,区块链节点中包括目标节点。In the exemplary embodiment of the present application, another optional method of calling the target node in the blockchain node to start the smart contract deployed in the blockchain channel may specifically be: calling the target node for starting The interface of the smart contract, through which the smart contract deployed in the blockchain channel is started, where the target node is included in the blockchain node.
在步骤S140中,上述的将智能合约同步至多个区块链节点中,也可以理解为将智能合约同步至创建的所有的区块链节点中。In step S140, the aforementioned synchronizing the smart contract to multiple blockchain nodes can also be understood as synchronizing the smart contract to all the created blockchain nodes.
在本申请的示例性实施例中,可选的,在将智能合约同步至多个区块链节点中之后,终端设备或服务器可以将构建的区块链网络接入目标应用。举例来说,如果该区块链网络应用于存证系统,则目标应用可以为用于溯源的应用、用于进行主账户对账的应用或用于进行数字资产交易的应用,本申请的实施例不作限定。In the exemplary embodiment of the present application, optionally, after synchronizing the smart contract to multiple blockchain nodes, the terminal device or server can connect the constructed blockchain network to the target application. For example, if the blockchain network is applied to a certificate deposit system, the target application can be an application for traceability, an application for reconciliation of the master account, or an application for digital asset transactions. The implementation of this application The examples are not limited.
举例来说,通过本申请中的技术方案,用户可以通过云服务器构建一个区块链,根据用户输入的配置信息,服务器或终端设备可以自动构建一个区块链网络,用户可以通过编写应用层的代码以及智能合约代码实现存证系统,通过对证据的电子化、加密签名以及数据上链,以达到保存证据以及保证该证据不会被篡改的目的。For example, through the technical solution in this application, a user can build a blockchain through a cloud server. According to the configuration information input by the user, the server or terminal device can automatically build a blockchain network, and the user can write the application layer The code and smart contract code realize the storage system, through the electronic, encrypted signature and data chaining of the evidence to achieve the purpose of preserving the evidence and ensuring that the evidence will not be tampered with.
可见,实施图1所示的基于云服务的区块链构建方法,能够在一定程度上克服用户学习成本较高的问题,进而降低用户的学习成本;以及,能够通过区块链的构建自动化,降低区块链技术的推广难度。It can be seen that the implementation of the cloud service-based blockchain construction method shown in Figure 1 can overcome the high learning cost of users to a certain extent, thereby reducing the learning cost of users; and, through the automation of blockchain construction, Reduce the difficulty of promoting blockchain technology.
作为一种示例性实施例,根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道,可以包括以下步骤:根据区块从云服务器中确定预设服务并启动预设服务;调用预设服务中的目标服务构建区块链通道。As an exemplary embodiment, calling a target service from a cloud server according to a block and building a blockchain channel through the target service may include the following steps: determining a preset service from the cloud server according to the block and starting the preset service; Call the target service in the preset service to build a blockchain channel.
在本申请的示例性实施例中,预设服务属于区块链网络中的服务,启动预设服务可以理解为启动了区块链服务。预设服务可以包括共识服务、数据节点服务以及数据接入服务等应用于构建区块链网络的服务。In the exemplary embodiment of the present application, the preset service belongs to the service in the blockchain network, and the activation of the preset service can be understood as the activation of the blockchain service. The preset services may include consensus services, data node services, data access services and other services that are used to construct a blockchain network.
可见,实施该示例性实施例,能够通过预设服务中的目标服务构建区块链通道,以实现节点之间的互联互通。It can be seen that implementing this exemplary embodiment can construct a blockchain channel through the target service in the preset service, so as to realize the interconnection and intercommunication between nodes.
作为另一种示例性实施例,预设服务包括共识服务、数据封装服务、数据节点服务以及数据接入服务中至少一种。As another exemplary embodiment, the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
作为又一种示例性实施例,根据区块从云服务器中确定预设服务,可以包括以下步骤:根据区块从云服务器中获取预设服务镜像;确定与预设服务镜像对应的预设服务。As yet another exemplary embodiment, determining the preset service from the cloud server according to the block may include the following steps: obtaining the preset service image from the cloud server according to the block; determining the preset service corresponding to the preset service image .
在本申请的示例性实施例中,预设服务镜像中包括预设服务对应的代码,预设服务镜像存储于云服务器中,云服务器中可以包括镜像服务。预设服务镜像可以包括共识服务镜像、数据节点服务镜像以及数据接入服务镜像等应用于构建区块链网络的服务镜像。镜像可以是包含应用程序及配置信息的云服务器,镜像还可以包括操作系统或业务数据。镜像服务(Image Management Service)可以包括镜像自助管理功能。In the exemplary embodiment of the present application, the preset service image includes the code corresponding to the preset service, the preset service image is stored in the cloud server, and the cloud server may include the image service. The preset service mirroring may include consensus service mirroring, data node service mirroring, data access service mirroring, and other service mirroring used to construct a blockchain network. The image can be a cloud server containing application programs and configuration information, and the image can also include an operating system or business data. Image Management Service can include image self-service management functions.
可见,实施该示例性实施例,能够通过与云服务器的交互,获取预设服务镜像,以启动预设服务,构建区块链网络。It can be seen that by implementing this exemplary embodiment, the preset service image can be obtained through interaction with the cloud server, so as to start the preset service and construct a blockchain network.
作为又一种示例性实施例,该基于云服务的区块链构建方法还可以包括以下步骤:根据配置信息中的资源配置信息构建目标服务器,目标服务器用于为预设服务提供服务器资源。As another exemplary embodiment, the cloud service-based blockchain construction method may further include the following steps: constructing a target server according to resource configuration information in the configuration information, and the target server is used to provide server resources for a preset service.
在本申请的示例性实施例中,资源配置信息可以包括中央处理器(CPU)资源、硬盘资源以及内存资源等。可选的,在根据配置信息中的资源配置信息构建目标服务器之后,还可以包括:初始化目标服务器的运行环境以及待运行应用程序,以将运行环境以及待运行应用程序调整至可构建区块链网络的状态。In the exemplary embodiment of the present application, the resource configuration information may include central processing unit (CPU) resources, hard disk resources, memory resources, and the like. Optionally, after constructing the target server according to the resource configuration information in the configuration information, it may further include: initializing the operating environment of the target server and the application to be run, so as to adjust the operating environment and the application to be run to be able to build a blockchain The state of the network.
可见,实施该示例性实施例,能够为构建区块链网络配置相应的服务器资源,以实现区块链网络的自动化部署。It can be seen that implementing this exemplary embodiment can configure corresponding server resources for building a blockchain network, so as to realize the automated deployment of the blockchain network.
作为又一种示例性实施例,调用预设服务中的目标服务构建区块链通道,可以包括以下步骤:根据区块从预设服务中确定出目标服务;调用目标服务器中与目标服务对应的服务器资源构建区块链通道。As yet another exemplary embodiment, calling the target service in the preset service to construct a blockchain channel may include the following steps: determining the target service from the preset service according to the block; calling the target server corresponding to the target service Server resources build blockchain channels.
在本申请的示例性实施例中,目标服务对应的服务器资源可以为,终端设备或服务器运行目标服务需要占用的服务器资源,如,CPU资源、硬盘资源以及内存资源等。In the exemplary embodiment of the present application, the server resources corresponding to the target service may be server resources that the terminal device or server needs to run the target service, such as CPU resources, hard disk resources, and memory resources.
可见,实施该示例性实施例,能够通过用户输入区块链网络服务相关信息,为用户创建区块链网络服务。用户可以在区块链云网络构建完成之后,可以通过业务逻辑和智能合约的开发实现,利用终端设备或服务器搭建完成一个区块链网络服务,以提高区块链云网络以及区块链网络服务的构建效率。It can be seen that implementing this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service. After the construction of the blockchain cloud network is completed, users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
作为又一种示例性实施例,该基于云服务的区块链构建方法还包括:生成与每个区块链节点对应的密钥并上传与密钥对应的证书。As yet another exemplary embodiment, the cloud service-based blockchain construction method further includes: generating a key corresponding to each blockchain node and uploading a certificate corresponding to the key.
在本申请的示例性实施例中,每个区块链节点对应的密钥中包括一个私钥和一个公钥,密钥对应的证书可以为链证书,证书用于证明该密钥对应的区块链节点的身份。链证书是在生成链的目录下保存的证书ca.crt,一条链对应一个链证书以及一个私钥。In the exemplary embodiment of this application, the key corresponding to each blockchain node includes a private key and a public key. The certificate corresponding to the key may be a chain certificate, and the certificate is used to prove the area corresponding to the key. The identity of the blockchain node. The chain certificate is the certificate ca.crt saved in the directory where the chain is generated. A chain corresponds to a chain certificate and a private key.
可见,实施该示例性实施例,能够通过用户输入区块链网络服务相关信息,为用户创建区块链网络服务。用户可以在区块链云网络构建完成之后,可以通过业务逻辑和智能合约的开发实现,利用终端设备或服务器搭建完成一个区块链网络服务,以提高区块链云网络以及区块链网络服务的构建效率。It can be seen that implementing this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service. After the construction of the blockchain cloud network is completed, users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
作为又一种示例性实施例,根据配置信息生成区块之前,还包括:输出包含待配置信息的界面,并将界面中的用户操作对应的信息作为配置信息存储,配置信息与待配置信息相对应。As yet another exemplary embodiment, before generating the block according to the configuration information, it further includes: outputting an interface containing the information to be configured, and storing information corresponding to user operations in the interface as configuration information, and the configuration information is the same as the information to be configured. correspond.
在本申请的示例性实施例中,输出的包含待配置信息的界面可以理解为用于与用户进行交互的交互界面,该交互界面中可以包括排序模块、共识模块、数据节点模块、数据接入模块以及二级节点模块等模块,其中每个模块中包含的信息可以为待配置信息。此外,需要说明的是,二级节点可以为未保存全量数据文件的轻节点,也可以为广播节点,也可以为挖掘节点,本申请的实施例不作限定。上述广播节点用于发出事务以及接收来自第三方的区块链信息,上述挖掘节点用于挖掘虚拟货币以创建新的区块,以及用于发布信息和传播交易。In the exemplary embodiment of the present application, the output interface containing the information to be configured can be understood as an interactive interface for interacting with the user. The interactive interface may include a sorting module, a consensus module, a data node module, and data access. Modules and modules such as secondary node modules, where the information contained in each module may be information to be configured. In addition, it should be noted that the secondary node may be a light node that does not save the full amount of data files, may also be a broadcast node, or may be a mining node, which is not limited in the embodiment of the present application. The above-mentioned broadcast node is used to issue transactions and receive blockchain information from a third party, and the above-mentioned mining node is used to mine virtual currency to create new blocks, as well as to publish information and disseminate transactions.
举例来说,用户可以在交互界面中创建区块链的名称,还可以在交互界面中从共识模块提供的共识算法中选择一种或多种共识算法,还可以在交互界面中确定底层区块链服务的版本。用户在交互界面中进行的用户操作所对应信息均可以被作为配置信息进行存储。For example, the user can create the name of the blockchain in the interactive interface, or select one or more consensus algorithms from the consensus algorithms provided by the consensus module in the interactive interface, and determine the underlying block in the interactive interface The version of the chain service. The information corresponding to the user operation performed by the user in the interactive interface can all be stored as configuration information.
在本申请的示例性实施例中,用户操作可以为触控性操作也可以为非触控性操作,其中,非触控性操作可以为语音输入操作,即,可以理解为用户通过语音输入的方式输入信息,以使得终端设备或服务器将该信息作为配置信息存储。In the exemplary embodiment of the present application, the user operation can be a touch operation or a non-touch operation, where the non-touch operation can be a voice input operation, that is, it can be understood as a user input by voice Enter the information in a way so that the terminal device or server stores the information as configuration information.
可见,实施该示例性实施例,能够通过交互界面向用户展示多个待部署模块,以便用户了解构建区块链云网络所要配置的信息,并根据需求输入配置信息,相较现有技术中用户自行构建区块链底层模块,本申请改善了区块链网络的构建体验,降低了用户的学习成本,以及降低了区块链技术的推广难度。It can be seen that implementing this exemplary embodiment can show users multiple modules to be deployed through an interactive interface, so that users can understand the information to be configured to construct a blockchain cloud network, and input configuration information according to their needs, compared with users in the prior art Self-build the underlying module of the blockchain, this application improves the experience of building the blockchain network, reduces the learning cost of users, and reduces the difficulty of promoting blockchain technology.
请参阅图2,图2示出了根据本申请一示例性实施例的基于云服务的区块链构建装置的结构框图。该基于云服务的区块链构建装置包括:区块生成单元201、区块链通道构建单元202、智能合约启动单元203以及智能合约同步单元204。Please refer to FIG. 2, which shows a structural block diagram of a cloud service-based block chain construction device according to an exemplary embodiment of the present application. The cloud service-based block chain construction device includes: a block generation unit 201, a block chain channel construction unit 202, a smart contract activation unit 203, and a smart contract synchronization unit 204.
其中,区块生成单元201,用于根据配置信息生成区块并创建多个区块链节点;区块链通道构建单元202,用于根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道;智能合约启动单元203,用于调用区块链节点中的目标节点启动部署于区块链通道的智能合约;智能合约同步单元204,用于将智能合约同步至多个区块链节点中。Among them, the block generation unit 201 is used to generate blocks according to the configuration information and create multiple blockchain nodes; the block chain channel construction unit 202 is used to call the target service from the cloud server according to the block and construct it through the target service Blockchain channel; smart contract activation unit 203, used to call the target node in the blockchain node to activate the smart contract deployed in the blockchain channel; smart contract synchronization unit 204, used to synchronize smart contracts to multiple blockchains Node.
可见,实施图2所示的基于云服务的区块链构建装置,能够在一定程度上克服用户学习成本较高的问题,进而降低用户的学习成本;以及,能够通过区块链的构建自动化,降低区块链技术的推广难度。It can be seen that the implementation of the cloud service-based blockchain construction device shown in Figure 2 can overcome the high learning cost of users to a certain extent, thereby reducing the learning cost of users; and, through the automation of blockchain construction, Reduce the difficulty of promoting blockchain technology.
作为一种示例性实施例,区块链通道构建单元202根据区块从云服务器中调用目标服务并通过目标服务构建区块链通道的方式具体为:区块链通道构建单元202根据区块从云服务器中确定预设服务并启动预设服务;区块链通道构建单元202调用预设服务中的目标服务构建区块链通道。As an exemplary embodiment, the block chain channel construction unit 202 calls the target service from the cloud server according to the block and constructs the block chain channel through the target service specifically as follows: The cloud server determines the preset service and starts the preset service; the blockchain channel construction unit 202 calls the target service in the preset service to build a blockchain channel.
可见,实施该示例性实施例,能够通过预设服务中的目标服务构建区块链通道,以实现节点之间的互联互通。It can be seen that implementing this exemplary embodiment can construct a blockchain channel through the target service in the preset service, so as to realize the interconnection and intercommunication between nodes.
作为另一种示例性实施例,区块链通道构建单元202根据区块从云服务器中确定预设服务的方式具体为:区块链通道构建单元202根据区块从云服务器中获取预设服务镜像;区块链通道构建单元202确定与预设服务镜像对应的预设服务。As another exemplary embodiment, the way that the blockchain channel construction unit 202 determines the preset service from the cloud server according to the block is specifically as follows: the blockchain channel construction unit 202 obtains the preset service from the cloud server according to the block Mirror; Blockchain channel construction unit 202 determines the preset service corresponding to the preset service mirror.
可见,实施该示例性实施例,能够通过与云服务器的交互,获取预设服务镜像,以启动预设服务,构建区块链网络。It can be seen that by implementing this exemplary embodiment, the preset service image can be obtained through interaction with the cloud server, so as to start the preset service and construct a blockchain network.
作为又一种示例性实施例,预设服务包括共识服务、数据封装服务、数据节点服务以及数据接入服务中至少一种。As yet another exemplary embodiment, the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
作为又一种示例性实施例,该基于云服务的区块链构建装置还包括服务器构建单元(未图示):服务器构建单元,用于根据配置信息中的资源配置信息构建目标服务器,目标服务器用于为预设服务提供服务器资源。As yet another exemplary embodiment, the cloud service-based blockchain construction device further includes a server construction unit (not shown): a server construction unit configured to construct a target server according to the resource configuration information in the configuration information, and the target server Used to provide server resources for preset services.
可见,实施该示例性实施例,能够为构建区块链网络配置相应的服务器资源,以实现区块链网络的自动化部署。It can be seen that implementing this exemplary embodiment can configure corresponding server resources for building a blockchain network, so as to realize the automated deployment of the blockchain network.
作为又一种示例性实施例,区块链通道构建单元202调用预设服务中的目标服务构建区块链通道的方式具体为:区块链通道构建单元202根据区块从预设服务中确定出目标服务;区块链通道构建单元202调用目标服务器中与目标服务对应的服务器资源构建区块链通道。As yet another exemplary embodiment, the block chain channel construction unit 202 calls the target service in the preset service to construct the block chain channel specifically as follows: the block chain channel construction unit 202 determines from the preset service according to the block The target service is generated; the block chain channel construction unit 202 calls the server resources corresponding to the target service in the target server to construct a block chain channel.
可见,实施该示例性实施例,能够通过用户输入区块链网络服务相关信息,为用户创建区块链网络服务。用户可以在区块链云网络构建完成之后,可以通过业务逻辑和智能合约的开发实现,利用终端设备或服务器搭建完成一个区块链网络服务,以提高区块链云网络以及区块链网络服务的构建效率。It can be seen that implementing this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service. After the construction of the blockchain cloud network is completed, users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
作为又一种示例性实施例,该基于云服务的区块链构建装置还包括密钥生成单元(未图示):密钥生成单元,用于生成与每个区块链节点对应的密钥并上传与密钥对应的证书。As yet another exemplary embodiment, the cloud service-based blockchain construction device further includes a key generation unit (not shown): a key generation unit for generating a key corresponding to each blockchain node And upload the certificate corresponding to the key.
可见,实施该示例性实施例,能够通过用户输入区块链网络服务相关信息,为用户创建区块链网络服务。用户可以在区块链云网络构建完成之后,可以通过业务逻辑和智能合约的开发实现,利用终端设备或服务器搭建完成一个区块链网络服务,以提高区块链云网络以及区块链网络服务的构建效率。It can be seen that implementing this exemplary embodiment can create a blockchain network service for the user by inputting information related to the blockchain network service. After the construction of the blockchain cloud network is completed, users can implement business logic and smart contract development and use terminal equipment or servers to build a blockchain network service to improve the blockchain cloud network and blockchain network services The construction efficiency.
作为又一种示例性实施例,该基于云服务的区块链构建装置还包括界面输出单元(未图示)和配置信息存储单元(未图示),其中:界面输出单元,用于在区块生成单元201根据配置信息生成区块之前,输出包含待配置信息的界面;配置信息存储单元,用于将界面中的用户操作对应的信息作为配置信息存储,配置信息与待配置信息相对应。As yet another exemplary embodiment, the cloud service-based blockchain construction device further includes an interface output unit (not shown) and a configuration information storage unit (not shown), where: the interface output unit is used to The block generating unit 201 outputs an interface containing information to be configured before generating a block according to the configuration information; the configuration information storage unit is used to store information corresponding to user operations in the interface as configuration information, and the configuration information corresponds to the information to be configured.
可见,实施该示例性实施例,能够通过交互界面向用户展示多个待部署模块,以便用户了解构建区块链云网络所要配置的信息,并根据需求输入配置信息,相较现有技术中用户自行构建区块链底层模块,本申请改善了区块链网络的构建体验,降低了用户的学习成本,以及降低了区块链技术的推广难度。It can be seen that implementing this exemplary embodiment can show users multiple modules to be deployed through an interactive interface, so that users can understand the information to be configured to construct a blockchain cloud network, and input configuration information according to their needs, compared with users in the prior art Self-build the underlying module of the blockchain, this application improves the experience of building the blockchain network, reduces the learning cost of users, and reduces the difficulty of promoting blockchain technology.
由于本申请的示例实施例的基于云服务的区块链构建装置的各个功能模块与上述基于云服务的区块链构建方法的示例实施例的步骤对应,因此对于本申请装置实施例中未披露的细节,请参照本申请上述的基于云服务的区块链构建方法的实施例。Since the various functional modules of the cloud service-based blockchain construction device of the exemplary embodiment of this application correspond to the steps of the example embodiment of the above-mentioned cloud service-based blockchain construction method, it is not disclosed in the device embodiment of this application For details, please refer to the embodiment of the cloud service-based blockchain construction method mentioned above in this application.
请参阅图3,图3示出了适于用来实现本申请一示例性实施例的电子设备的计算机系统300的结构示意图。图3示出的电子设备的计算机系统300仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Please refer to FIG. 3, which shows a schematic structural diagram of a computer system 300 suitable for implementing an electronic device according to an exemplary embodiment of the present application. The computer system 300 of the electronic device shown in FIG. 3 is only an example, and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
如图3所示,计算机系统300包括中央处理单元(CPU)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储部分308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM 303中,还存储有系统操作所需的各种程序和数据。CPU 301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。As shown in FIG. 3, the computer system 300 includes a central processing unit (CPU) 301, which can follow a program stored in a read-only memory (ROM) 302 or a program loaded from a storage part 308 into a random access memory (RAM) 303 And perform various appropriate actions and processing. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input/output (I/O) interface 305 is also connected to the bus 304.
以下部件连接至I/O接口305:包括键盘、鼠标等的输入部分306;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分307;包括硬盘等的存储部分308;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分309。通信部分309经由诸如因特网的网络执行通信处理。驱动器310也根据需要连接至I/O接口305。可拆卸介质311,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器310上,以便于从其上读出的计算机程序根据需要被安装入存储部分308。The following components are connected to the I/O interface 305: an input part 306 including a keyboard, a mouse, etc.; an output part 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers, etc.; a storage part 308 including a hard disk, etc. ; And a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. The driver 310 is also connected to the I/O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that the computer program read from it is installed into the storage portion 308 as needed.
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分309从网络上被下载和安装,和/或从可拆卸介质311被安装。在该计算机程序被中央处理单元(CPU)301执行时,执行本申请的系统中限定的上述功能。In particular, according to the embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication part 309, and/or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, it executes the above-mentioned functions defined in the system of the present application.
需要说明的是,本申请所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。所述计算机可读存储介质可以是非易失性,也可以是易失性。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. The computer-readable storage medium may be non-volatile or volatile. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (20)

  1. 一种基于云服务的区块链构建方法,其中,包括:A method for building a blockchain based on cloud services, which includes:
    根据配置信息生成区块并创建多个区块链节点;Generate blocks according to configuration information and create multiple blockchain nodes;
    根据所述区块从云服务器中调用目标服务并通过所述目标服务构建区块链通道;Calling a target service from a cloud server according to the block and building a blockchain channel through the target service;
    调用所述区块链节点中的目标节点启动部署于所述区块链通道的智能合约;Calling the target node in the blockchain node to start the smart contract deployed in the blockchain channel;
    将所述智能合约同步至所述多个区块链节点中。The smart contract is synchronized to the multiple blockchain nodes.
  2. 根据权利要求1所述的方法,其中,根据所述区块从云服务器中调用目标服务并通过所述目标服务构建区块链通道,包括:The method according to claim 1, wherein calling a target service from a cloud server according to the block and constructing a blockchain channel through the target service comprises:
    根据所述区块从云服务器中确定预设服务并启动所述预设服务;Determine a preset service from the cloud server according to the block and start the preset service;
    调用所述预设服务中的目标服务构建区块链通道。Call the target service in the preset service to construct a blockchain channel.
  3. 根据权利要求2所述的方法,其中,根据所述区块从云服务器中确定预设服务,包括:The method according to claim 2, wherein determining a preset service from a cloud server according to the block comprises:
    根据所述区块从云服务器中获取预设服务镜像;Obtaining a preset service image from the cloud server according to the block;
    确定与所述预设服务镜像对应的预设服务。Determine the preset service corresponding to the preset service image.
  4. 根据权利要求2所述的方法,其中,所述预设服务包括共识服务、数据封装服务、数据节点服务以及数据接入服务中至少一种。The method according to claim 2, wherein the preset service includes at least one of a consensus service, a data encapsulation service, a data node service, and a data access service.
  5. 根据权利要求2所述的方法,其中,还包括:The method according to claim 2, further comprising:
    根据所述配置信息中的资源配置信息构建目标服务器,所述目标服务器用于为所述预设服务提供服务器资源。A target server is constructed according to the resource configuration information in the configuration information, and the target server is used to provide server resources for the preset service.
  6. 根据权利要求5所述的方法,其中,调用所述预设服务中的目标服务构建区块链通道,包括:The method according to claim 5, wherein calling a target service in the preset service to construct a blockchain channel comprises:
    根据所述区块从所述预设服务中确定出目标服务;Determining a target service from the preset service according to the block;
    调用所述目标服务器中与所述目标服务对应的服务器资源构建区块链通道。Invoke server resources corresponding to the target service in the target server to construct a blockchain channel.
  7. 根据权利要求1所述的方法,其中,还包括:The method according to claim 1, further comprising:
    生成与每个所述区块链节点对应的密钥并上传与所述密钥对应的证书。Generate a key corresponding to each of the blockchain nodes and upload a certificate corresponding to the key.
  8. 一种基于云服务的区块链构建装置,其中,包括:A block chain construction device based on cloud services, which includes:
    区块生成单元,用于根据配置信息生成区块并创建多个区块链节点;Block generation unit, used to generate blocks according to configuration information and create multiple blockchain nodes;
    区块链通道构建单元,用于根据所述区块从云服务器中调用目标服务并通过所述目标服务构建区块链通道;A block chain channel construction unit, configured to call a target service from the cloud server according to the block and construct a block chain channel through the target service;
    智能合约启动单元,用于调用所述区块链节点中的目标节点启动部署于所述区块链通道的智能合约;The smart contract activation unit is used to call the target node in the blockchain node to activate the smart contract deployed on the blockchain channel;
    智能合约同步单元,用于将所述智能合约同步至所述多个区块链节点中。The smart contract synchronization unit is used to synchronize the smart contract to the multiple blockchain nodes.
  9. 一种电子设备,其中,包括存储器和处理器,所述处理器、和所述存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器用于执行所述存储器的所述程序指令,其中:An electronic device comprising a memory and a processor, the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute The program instructions of the memory, wherein:
    根据配置信息生成区块并创建多个区块链节点;Generate blocks according to configuration information and create multiple blockchain nodes;
    根据所述区块从云服务器中调用目标服务并通过所述目标服务构建区块链通道;Calling a target service from a cloud server according to the block and building a blockchain channel through the target service;
    调用所述区块链节点中的目标节点启动部署于所述区块链通道的智能合约;Calling the target node in the blockchain node to start the smart contract deployed in the blockchain channel;
    将所述智能合约同步至所述多个区块链节点中。The smart contract is synchronized to the multiple blockchain nodes.
  10. 根据权利要求9所述的电子设备,其中,所述处理器用于:The electronic device according to claim 9, wherein the processor is configured to:
    根据所述区块从云服务器中确定预设服务并启动所述预设服务;Determine a preset service from the cloud server according to the block and start the preset service;
    调用所述预设服务中的目标服务构建区块链通道。Call the target service in the preset service to construct a blockchain channel.
  11. 根据权利要求10所述的电子设备,其中,所述处理器用于:The electronic device according to claim 10, wherein the processor is configured to:
    根据所述区块从云服务器中获取预设服务镜像;Obtaining a preset service image from the cloud server according to the block;
    确定与所述预设服务镜像对应的预设服务。Determine the preset service corresponding to the preset service image.
  12. 根据权利要求10所述的电子设备,其中,所述预设服务包括共识服务、数据封装服务、数据节点服务以及数据接入服务中至少一种。The electronic device according to claim 10, wherein the preset service includes at least one of a consensus service, a data encapsulation service, a data node service, and a data access service.
  13. 根据权利要求10所述的电子设备,其中,所述处理器用于:The electronic device according to claim 10, wherein the processor is configured to:
    根据所述配置信息中的资源配置信息构建目标服务器,所述目标服务器用于为所述预设服务提供服务器资源。A target server is constructed according to the resource configuration information in the configuration information, and the target server is used to provide server resources for the preset service.
  14. 根据权利要求13所述的电子设备,其中,所述处理器用于:The electronic device according to claim 13, wherein the processor is configured to:
    根据所述区块从所述预设服务中确定出目标服务;Determining a target service from the preset service according to the block;
    调用所述目标服务器中与所述目标服务对应的服务器资源构建区块链通道。Invoke server resources corresponding to the target service in the target server to construct a blockchain channel.
  15. 根据权利要求9所述的电子设备,其中,所述处理器用于:The electronic device according to claim 9, wherein the processor is configured to:
    生成与每个所述区块链节点对应的密钥并上传与所述密钥对应的证书。Generate a key corresponding to each of the blockchain nodes and upload a certificate corresponding to the key.
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时,用于实现以下步骤:A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, they are used to implement the following steps:
    根据配置信息生成区块并创建多个区块链节点;Generate blocks according to configuration information and create multiple blockchain nodes;
    根据所述区块从云服务器中调用目标服务并通过所述目标服务构建区块链通道;Calling a target service from a cloud server according to the block and building a blockchain channel through the target service;
    调用所述区块链节点中的目标节点启动部署于所述区块链通道的智能合约;Calling the target node in the blockchain node to start the smart contract deployed in the blockchain channel;
    将所述智能合约同步至所述多个区块链节点中。The smart contract is synchronized to the multiple blockchain nodes.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述程序指令被处理器执行时,还用于实现以下步骤:The computer-readable storage medium according to claim 16, wherein when the program instructions are executed by the processor, they are further used to implement the following steps:
    根据所述区块从云服务器中确定预设服务并启动所述预设服务;Determine a preset service from the cloud server according to the block and start the preset service;
    调用所述预设服务中的目标服务构建区块链通道。Call the target service in the preset service to construct a blockchain channel.
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述程序指令被处理器执行时,还用于实现以下步骤:The computer-readable storage medium according to claim 17, wherein when the program instructions are executed by the processor, they are further used to implement the following steps:
    根据所述区块从云服务器中获取预设服务镜像;Obtaining a preset service image from the cloud server according to the block;
    确定与所述预设服务镜像对应的预设服务。Determine the preset service corresponding to the preset service image.
  19. 根据权利要求17所述的计算机可读存储介质,其中,所述预设服务包括共识服务、数据封装服务、数据节点服务以及数据接入服务中至少一种。The computer-readable storage medium according to claim 17, wherein the preset service includes at least one of a consensus service, a data packaging service, a data node service, and a data access service.
  20. 根据权利要求17所述的计算机可读存储介质,其中,所述程序指令被处理器执行时,还用于实现以下步骤:The computer-readable storage medium according to claim 17, wherein when the program instructions are executed by the processor, they are further used to implement the following steps:
    根据所述配置信息中的资源配置信息构建目标服务器,所述目标服务器用于为所述预设服务提供服务器资源。A target server is constructed according to the resource configuration information in the configuration information, and the target server is used to provide server resources for the preset service.
PCT/CN2020/093587 2019-07-23 2020-05-30 Blockchain construction method and apparatus based on cloud service, medium and electronic device WO2021012794A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910667396.8A CN110430248B (en) 2019-07-23 2019-07-23 Block chain construction method, device, medium and electronic equipment based on cloud service
CN201910667396.8 2019-07-23

Publications (1)

Publication Number Publication Date
WO2021012794A1 true WO2021012794A1 (en) 2021-01-28

Family

ID=68411938

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093587 WO2021012794A1 (en) 2019-07-23 2020-05-30 Blockchain construction method and apparatus based on cloud service, medium and electronic device

Country Status (2)

Country Link
CN (1) CN110430248B (en)
WO (1) WO2021012794A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242802A (en) * 2022-08-10 2022-10-25 上海柚子工道物联技术有限公司 Tracing link construction method and system of block chain and electronic equipment

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110430248B (en) * 2019-07-23 2022-03-25 平安科技(深圳)有限公司 Block chain construction method, device, medium and electronic equipment based on cloud service
CN111159299A (en) * 2019-12-31 2020-05-15 预言机(重庆)科技有限公司 Block chain chaining method
CN111711526B (en) * 2020-06-16 2024-03-26 深圳前海微众银行股份有限公司 Method and system for consensus of block chain nodes
CN112102081B (en) * 2020-08-19 2024-04-09 天星数科科技有限公司 Method, device, readable storage medium and blockchain network for generating blockchain
CN112904734A (en) * 2020-12-23 2021-06-04 上海上实龙创智能科技股份有限公司 Intelligent household appliance control system and method based on Internet of things and block chain double gateways

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321654A1 (en) * 2011-04-29 2016-11-03 Stephen Lesavich Method and system for storage and retrieval of blockchain blocks using galois fields
CN107634989A (en) * 2017-08-25 2018-01-26 中积有限公司 A kind of cloud wallet construction method and server
CN109710271A (en) * 2019-01-16 2019-05-03 杭州趣链科技有限公司 Key deployment, link setup and operation management system based on block chain
CN109783572A (en) * 2018-12-14 2019-05-21 平安科技(深圳)有限公司 Block chain multichain creation method, device, equipment and storage medium
CN109889503A (en) * 2019-01-22 2019-06-14 平安科技(深圳)有限公司 Identity management method, electronic device and storage medium based on block chain
CN110430248A (en) * 2019-07-23 2019-11-08 平安科技(深圳)有限公司 Block chain building method, apparatus, medium and electronic equipment based on cloud service

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101242B (en) * 2016-06-24 2019-08-06 深圳前海微众银行股份有限公司 The construction method and device of block chain cloud service platform
US10528551B2 (en) * 2017-09-29 2020-01-07 Oracle International Corporation System and method for providing a representational state transfer proxy service for a blockchain cloud service
CN109587200B (en) * 2017-09-29 2021-07-16 中兴通讯股份有限公司 Block chain as-a-service platform and system
CN109002527B (en) * 2018-07-13 2020-12-01 江苏开放大学(江苏城市职业学院) Block chain-based network examination system and method for managing network examination
CN109194506B (en) * 2018-08-16 2021-10-15 北京京东尚科信息技术有限公司 Block chain network deployment method, platform and computer storage medium
CN109190410B (en) * 2018-09-26 2020-05-19 华中科技大学 Log behavior auditing method based on block chain in cloud storage environment
CN109740923A (en) * 2018-12-29 2019-05-10 杭州趣链科技有限公司 A kind of students ' quality examination application system and method and information collecting device based on block chain
CN109858908B (en) * 2019-01-09 2021-07-27 暨南大学 Alliance chain construction method, transaction method and distributed supply chain system
CN109976774B (en) * 2019-04-11 2022-07-26 北京启迪区块链科技发展有限公司 Block link point deployment method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321654A1 (en) * 2011-04-29 2016-11-03 Stephen Lesavich Method and system for storage and retrieval of blockchain blocks using galois fields
CN107634989A (en) * 2017-08-25 2018-01-26 中积有限公司 A kind of cloud wallet construction method and server
CN109783572A (en) * 2018-12-14 2019-05-21 平安科技(深圳)有限公司 Block chain multichain creation method, device, equipment and storage medium
CN109710271A (en) * 2019-01-16 2019-05-03 杭州趣链科技有限公司 Key deployment, link setup and operation management system based on block chain
CN109889503A (en) * 2019-01-22 2019-06-14 平安科技(深圳)有限公司 Identity management method, electronic device and storage medium based on block chain
CN110430248A (en) * 2019-07-23 2019-11-08 平安科技(深圳)有限公司 Block chain building method, apparatus, medium and electronic equipment based on cloud service

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242802A (en) * 2022-08-10 2022-10-25 上海柚子工道物联技术有限公司 Tracing link construction method and system of block chain and electronic equipment
CN115242802B (en) * 2022-08-10 2023-11-24 上海柚子工道物联技术有限公司 Method, system and electronic equipment for constructing traceable link of block chain

Also Published As

Publication number Publication date
CN110430248B (en) 2022-03-25
CN110430248A (en) 2019-11-08

Similar Documents

Publication Publication Date Title
WO2021012794A1 (en) Blockchain construction method and apparatus based on cloud service, medium and electronic device
WO2020258912A1 (en) Blockchain consensus method, device and system
CN112631605B (en) Code compiling method, device and equipment of federal learning model and storage medium
US9503447B2 (en) Secure communication between processes in cloud
JP2022529967A (en) Extracting data from the blockchain network
WO2019144353A1 (en) Blockchain-based data training method and device, storage medium and blockchain node
US20200042625A1 (en) Blockchain-enabled datasets shared across different database systems
KR20230078706A (en) Certificate-based security using post-quantum cryptography
TWI768403B (en) Methods and devices for cryptographic key management based on blockchain system
US20210344754A1 (en) Self-Replicating Management Services for Distributed Computing Architectures
EP4350556A1 (en) Information verification method and apparatus
US20230379155A1 (en) Identity Information Processing Method, Device, and System
CN109951546A (en) Transactions requests processing method, device, equipment and medium based on intelligent contract
CN111191200B (en) Three-party linkage authentication page display method and device and electronic equipment
EP3811591B1 (en) Secure binding workflow
US11689375B2 (en) Data in transit protection with exclusive control of keys and certificates across heterogeneous distributed computing environments
US10715318B2 (en) Lightweight cryptographic service for simplified key life-cycle management
US20230119304A1 (en) Post Quantum Secure Ingress/Egress Network Communication
US20190327222A1 (en) Secure authentication in tls sessions
JP7298008B2 (en) Systems, methods and apparatus for developing smart contracts
CN113206738A (en) Digital certificate management method and device
CN113873004A (en) Task execution method and device and distributed computing system
CN115022053A (en) Method, device and system for accessing block chain network
US11863673B1 (en) White-labeled data connections for multi-tenant cloud platforms
WO2023098609A1 (en) Method and apparatus for generating image special effect package, device, and storage medium

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: 20843490

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20843490

Country of ref document: EP

Kind code of ref document: A1