CN115174589B - Selection method and device of blockchain virtual machine, electronic equipment and storage medium - Google Patents

Selection method and device of blockchain virtual machine, electronic equipment and storage medium Download PDF

Info

Publication number
CN115174589B
CN115174589B CN202210550135.XA CN202210550135A CN115174589B CN 115174589 B CN115174589 B CN 115174589B CN 202210550135 A CN202210550135 A CN 202210550135A CN 115174589 B CN115174589 B CN 115174589B
Authority
CN
China
Prior art keywords
service
virtual machine
contract
block chain
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210550135.XA
Other languages
Chinese (zh)
Other versions
CN115174589A (en
Inventor
曹崇瑞
杜茂兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210550135.XA priority Critical patent/CN115174589B/en
Publication of CN115174589A publication Critical patent/CN115174589A/en
Application granted granted Critical
Publication of CN115174589B publication Critical patent/CN115174589B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1059Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a selection method and device of a block chain virtual machine, electronic equipment and a storage medium, wherein the selection method of the block chain virtual machine comprises the following steps: obtaining a first service contract of a first service block chain in a father block chain, wherein the father block chain is a main block chain generated based on at least two service contracts, and the service contracts respectively correspond to sub-block chains in the father block chain; the first service block chain is a sub-block chain corresponding to a first service contract of the at least two service contracts; determining a first virtual machine corresponding to the first service block chain according to the first service contract; the method solves the problem of incompatibility of virtual machines in the block chain in the prior art, and improves the service development capability of the block chain.

Description

Selection method and device of blockchain virtual machine, electronic equipment and storage medium
Technical Field
The application relates to the technical field of blockchain, in particular to a method and a device for selecting a blockchain virtual machine, electronic equipment and a storage medium.
Background
Blockchain is a novel application system based on computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. It is essentially a decentralised database, a series of data blocks generated by cryptographic means, each of which contains a batch of information of network transactions for verifying the validity (anti-counterfeiting) of the information and generating the next block. In a narrow sense, a blockchain is a distributed ledger that combines blocks of data in a sequential manner in time order into a chain data structure, and that is cryptographically secured against tampering and counterfeiting. In broad terms, blockchain technology is a completely new distributed infrastructure and computing method that uses a blockchain data structure to verify and store data, a distributed node consensus algorithm to generate and update data, a cryptographic way to secure data transmission and access, and an intelligent contract consisting of automated script code to program and manipulate data.
In the existing blockchain, service data are often aggregated together and stored in an MPT tree based on service contracts of different services, so that the service data are not tampered, but the implementation efficiency of the blockchain is low due to the design mode of the blockchain, and different types of virtual machines cannot be compatible, so that the service development aiming at the blockchain is greatly limited.
Therefore, how to solve the above technical problems is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application provides a selection method and device of a blockchain virtual machine, electronic equipment and a storage medium, and aims to solve the problems in the prior art.
The selection method of the block chain virtual machine comprises the following steps:
obtaining a first service contract of a first service block chain in a father block chain, wherein the father block chain is a main block chain generated based on at least two service contracts, and the service contracts respectively correspond to sub-block chains in the father block chain; the first service block chain is a sub-block chain corresponding to a first service contract of the at least two service contracts;
and determining a first virtual machine corresponding to the first service block chain according to the first service contract.
Optionally, the obtaining the first service contract of the first service blockchain in the parent blockchain includes:
acquiring a service contract list in the father block chain, wherein the service contract list comprises contract address information of the first service contract;
obtaining storage position information of the first business contract according to contract address information of the first business contract in the business contract list;
a first service contract of the first service blockchain is obtained based on the storage location information of the first service contract.
Optionally, the determining, according to the first service contract, a first virtual machine corresponding to the first service blockchain includes:
and selecting the virtual machine corresponding to the service type from a virtual machine deployment unit deployed with a plurality of virtual machines of different types as a first virtual machine of the first service block chain according to the service type corresponding to the first service contract.
Optionally, the determining, according to the first service contract, a first virtual machine corresponding to the first service blockchain includes:
determining whether at least one virtual machine matched with the service type exists in a virtual machine deployment unit in which a plurality of virtual machines of different types are deployed according to the service type corresponding to the first service contract;
and under the condition that the virtual machine deployment unit does not exist the at least one virtual machine matched with the service type, selecting at least one virtual machine matched with the service type to deploy to the virtual machine deployment unit according to the service type, and taking the at least one virtual machine matched with the first service type as the first virtual machine.
Optionally, the method further comprises:
determining a virtual machine which does not establish an association relationship with other service block chains except the first service block chain in the at least one virtual machine matched with the service type under the condition that the virtual machine deployment unit exists the at least one virtual machine matched with the service type;
and taking the virtual machine which does not establish association relation with other service block chains except the first service block chain as the first virtual machine.
Optionally, the plurality of different types of virtual machines are deployed to the virtual machine deployment unit by:
normalizing the virtual machine call parameters of the plurality of different types of virtual machines, and deploying the plurality of different types of virtual machines subjected to the normalization of the virtual machine call parameters to the virtual machine deployment unit.
Optionally, the first traffic blockchain in the parent blockchain is generated by:
acquiring service data stored in each parent block from each parent block of the parent block chain respectively;
performing business contract dimension division on the business data stored in each father block, and obtaining first business data corresponding to a first business contract in each father block based on a division result;
and generating the first service block chain according to the first service data corresponding to the first service contract in each parent block.
Optionally, the method further comprises: and recording the service data change of each service through each sub-block chain, and generating a new sub-block corresponding to each sub-block chain according to the service data change of each service.
Optionally, the method further comprises:
respectively obtaining service data recorded by new sub-blocks of each sub-block chain;
generating hash values of the new sub-blocks according to the service data recorded by the new sub-blocks of the sub-block chain;
based on the hash value of each new sub-block, a new parent block of the parent blockchain is generated.
The application also provides a selection device of the block chain virtual machine, which comprises:
an obtaining unit, configured to obtain a first service contract of a first service blockchain in a parent blockchain, where the parent blockchain is a main blockchain generated based on at least two service contracts, and the service contracts respectively correspond to sub-blockchains in the parent blockchain; the first service block chain is a sub-block chain corresponding to a first service contract of the at least two service contracts;
and the selection unit is used for determining a first virtual machine corresponding to the first service block chain according to the first service contract.
Optionally, the acquiring the first service contract of the first service blockchain in the parent blockchain includes
Acquiring a service contract list in the father block chain, wherein the service contract list comprises contract address information of the first service contract;
obtaining storage position information of the first business contract according to contract address information of the first business contract in the business contract list;
a first service contract of the first service blockchain is obtained based on the storage location information of the first service contract.
Optionally, the determining, according to the first service contract, a first virtual machine corresponding to the first service blockchain includes:
and selecting the virtual machine corresponding to the service type from a virtual machine deployment unit deployed with a plurality of virtual machines of different types as a first virtual machine of the first service block chain according to the service type corresponding to the first service contract.
Optionally, the determining, according to the first service contract, a first virtual machine corresponding to the first service blockchain includes:
determining whether at least one virtual machine matched with the service type exists in a virtual machine deployment unit in which a plurality of virtual machines of different types are deployed according to the service type corresponding to the first service contract;
and under the condition that the virtual machine deployment unit does not exist the at least one virtual machine matched with the service type, selecting at least one virtual machine matched with the service type to deploy to the virtual machine deployment unit according to the service type, and taking the at least one virtual machine matched with the first service type as the first virtual machine.
Optionally, the device is further configured to:
determining a virtual machine which does not establish an association relationship with other service block chains except the first service block chain in the at least one virtual machine matched with the service type under the condition that the virtual machine deployment unit exists the at least one virtual machine matched with the service type;
and taking the virtual machine which does not establish association relation with other service block chains except the first service block chain as the first virtual machine.
Optionally, the plurality of different types of virtual machines are deployed to the virtual machine deployment unit by:
normalizing the virtual machine call parameters of the plurality of different types of virtual machines, and deploying the plurality of different types of virtual machines subjected to the normalization of the virtual machine call parameters to the virtual machine deployment unit.
The application also provides an electronic device, comprising:
a processor;
and a memory for storing a program of the method, which when read and executed by the processor, performs the method of creation of the service sub-chain described above.
The present application also provides a computer storage medium storing a computer program which when executed implements the above-described method of creating a service sub-chain.
Compared with the prior art, the application has the following advantages:
the application provides a selection method of a block chain virtual machine, which is characterized by comprising the following steps:
obtaining a first service contract of a first service block chain in a father block chain, wherein the father block chain is a main block chain generated based on at least two service contracts, and the service contracts respectively correspond to sub-block chains in the father block chain; the first service block chain is a sub-block chain corresponding to a first service contract of the at least two service contracts; and determining a first virtual machine corresponding to the first service block chain according to the first service contract.
According to the method, on the basis of service contract dimension, a father block chain is divided into a plurality of sub-block chains corresponding to different service types, then virtual machines matched with the service types of the sub-block chains are selected for the sub-block chains respectively based on the service contracts of the sub-block chains, so that the problem of incompatibility of the virtual machines in the block chains in the prior art is solved, and meanwhile, the service development capability of the block chains is improved.
Drawings
FIG. 1 is a flowchart of a method for selecting a blockchain virtual machine according to an embodiment of the present application;
FIG. 2 is a block chain architecture diagram according to another embodiment of the present application;
FIG. 3 is a schematic diagram of generating new blocks in a parent blockchain based on a child blockchain in accordance with another embodiment of the present application;
FIG. 4 is a block chain architecture diagram supporting multiple virtual machines according to another embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a selection device of a blockchain virtual machine according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, this application can be embodied in many other forms than those described herein and similarly practiced by those skilled in the art without departing from the spirit or scope of the application, which is therefore not limited to the specific embodiments disclosed below.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The manner of description used in the present application and in the appended claims is for example: "a", "a" and "a" etc. are not limited in number or order, but are used to distinguish the same type of information from each other.
The embodiment of the application firstly provides a selection method of a blockchain virtual machine, and in an alternative implementation of the application, an implementation subject of the method can be a notebook computer, a tablet computer, a desktop computer, a set-top box, various types of user terminals such as mobile phones, portable music players, personal digital assistants, special message equipment and game hosts or any combination of two or more of the data processing equipment, and the like, or can also be a server.
Referring to fig. 1, fig. 1 is a flowchart of a selection method of a blockchain virtual machine according to an embodiment of the present application, and the method includes the following steps S101 to S102.
Step S101, a first service contract of a first service block chain in a father block chain is obtained, wherein the father block chain is a main block chain generated based on at least two service contracts, and the service contracts respectively correspond to sub-block chains in the father block chain; the first service blockchain is a sub-blockchain corresponding to a first service contract of the at least two service contracts.
The parent blockchain may be understood as a blockchain backbone generated by an intelligent contract that includes a plurality of businesses, for example, the parent blockchain may be understood as a blockchain for storing funds flow data between enterprises a and B and contract data signed between two enterprises, wherein the funds flow data stored in the parent blockchain is data generated by the intelligent contract 1, and the contract data is data generated by the intelligent contract 2.
The business contracts are intelligent contracts, wherein the intelligent contracts are electronic agreements which can automatically execute tasks which can be completed manually, for example, contracts which can automatically calculate the payment amount of a contract principal and arrange for payment of a shielding amount. The intelligent contract ensures the characteristic of decentralization of a blockchain, and allows both transaction parties to execute traceable and irreversible safe transactions under the condition that no third party is fair.
In particular, the smart contract may be understood as a digital contract in life, and a technology of automatically executing contents specified by the contract by a program if a certain condition is satisfied. For example, a contract with rewards and punishments is made between the user A and the user B, then the contract is recorded into the blockchain in the form of codes, and once the condition prescribed by the contract is met, the corresponding rewards and punishments are automatically executed by the program.
In the embodiment of the application, the first service contract is an intelligent contract corresponding to a service type. Further, in order to facilitate understanding of the relationship between the parent blockchain and the first service blockchain in step S101 in the embodiment of the present application, a process of generating the sub-blockchains corresponding to the various service types based on the parent blockchain is first described below.
Referring to fig. 2, fig. 2 is a schematic block chain structure according to another embodiment of the present application.
Parent blockchain 201 is included in FIG. 2; sub-blocks in parent blockchain 201: parent tile 201-1, parent tile 202-2, and parent tile 202-3;
a first 202, a second 203, a third 204 traffic blockchain;
in fig. 2, service contract 1 is taken as the first service contract, where service contract 1 corresponds to a first service blockchain 202, and further, service contracts 2 and 3 correspond to other service contracts except service contract 1 in a parent blockchain 201.
Service contract 2 and service contract 3 are service contracts of the second service blockchain 203 and the third service blockchain 204, respectively.
The first traffic blockchain 202 also includes: sub-block 202-1, sub-block 202-2, sub-block 202-3;
the second traffic blockchain 203 also includes: sub-block 203-1, sub-block 203-2, sub-block 203-3;
the third traffic blockchain 204 also includes: sub-block 204-1, sub-block 204-2, sub-block 204-3;
specifically, the sub-block 202-1 in the first business blockchain 202, the sub-block 203-1 in the second business contract 203, and the sub-block 204-1 in the third business contract 204 are generated from the business data of the parent block 201 of the parent blockchain 201.
The generation of sub-blocks 202-1 through 202-3 in the first traffic blockchain 202 is described herein as an example to facilitate understanding of the generation of each sub-block.
For the generation process of sub-block 202-1:
firstly, business data in a parent block 201-1 is subjected to contract dimension division, business data corresponding to different business contracts are obtained according to division results, and further business data corresponding to the business contract 1 in the parent block 201-1 are obtained, wherein the business data corresponding to the business contract 1 in the parent block 201-1 are recorded as business data 1-1;
secondly, transmitting the service data 1-1 and the total service data in the father block 201-1 to the whole network node of the father block chain 201, processing the service data 1-1 by each node according to the processing process of the total service data, and judging whether the whole network node achieves node consensus on the service data 1-1 based on the processing result of each node;
finally, in the case that the node consensus is achieved for the whole network node, the service data 1-1 is used as the service data recorded by the sub-block 202-1, and the hash value of the sub-block 202-1 is constructed based on the service data 1-1, so that the sub-block 202-1 is conveniently associated with the subsequent block.
Further, for the generation process of sub-block 202-2:
similar to the generation process of the above-mentioned sub-block 202-1, firstly, the business data in the parent block 201-2 is subjected to contract dimension division, so as to obtain business data corresponding to the business contract 2 in the parent block 201-2, and here, the business data corresponding to the business contract 2 in the parent block 201-2 is denoted as business data 1-2;
secondly, similar to the above node consensus process, the service data 1-2 and the total amount of service data in the parent block 201-2 are sent to the whole network node, so as to judge whether the whole network node achieves node consensus on the service data 1-2;
finally, under the condition that the node consensus of the whole network node is achieved, the service data 1-2 is used as the service data recorded by the sub-block 202-2, and the hash value of the sub-block 202-2 is constructed based on the service data 1-2, so that the sub-block 202-1 is conveniently associated with a subsequent block; the hash value of sub-block 202-1 is recorded to sub-block 202-2 at the same time to associate sub-block 202-1 with sub-block 202-2.
Further, for the generation process of sub-block 202-3:
similar to the generation process of the above sub-blocks 202-1 and 202-2, firstly, the business data in the parent block 201-3 is subjected to contract dimension division, so as to obtain business data corresponding to the business contract 3 in the parent block 201-3, and the business data is recorded as business data 1-3;
secondly, similar to the above node consensus process, the service data 1-3 and the total amount of service data in the parent block 201-3 are sent to the whole network node, so as to judge whether the whole network node achieves node consensus on the service data 1-3;
finally, under the condition that the node consensus of the whole network node is achieved, the service data 1-3 is used as the service data recorded by the sub-block 202-3, and the hash value of the sub-block 202-3 is constructed based on the service data 1-3, so that the sub-block 202-3 is conveniently associated with a subsequent block; the hash value of sub-block 202-2 is recorded to sub-block 202-3 to associate sub-block 202-2 with sub-block 202-3.
The above is the generation process of each sub-block of the first traffic block chain 202 in fig. 2 provided in the embodiment of the present application, and the generation process of each sub-block of the second traffic block chain 203 and the third traffic block chain 204 is similar to the generation process of each sub-block of the first traffic block chain 202, which is not described herein again.
In an alternative embodiment of the application, after the sub-blockchain corresponding to each service contract is established on the basis of the parent blockchain, the parent blockchain only needs to record the hash value of the sub-blocks in the sub-blockchain and monitor each service in the parent blockchain, and the original functions of recording and monitoring the service data of the parent blockchain are completed by the sub-blockchain corresponding to each service contract.
Further, after each sub-blockchain generates a new sub-block, the embodiment of the present application further includes a process of merging the newly generated sub-blocks of the respective blockchains into a new service block of the parent blockchain:
referring to fig. 3, fig. 3 is a schematic diagram illustrating generation of a new block in a parent blockchain based on a child blockchain according to another embodiment of the present application.
Fig. 3 includes: parent blockchain 301; sub-blocks in the parent blockchain: parent tile 301-1, parent tile 301-2, parent tile 301-3, and parent tile 301-4.
Wherein parent block 301-1 and parent block 301-2 are original child blocks in parent blockchain 301.
A first traffic blockchain 302, a second traffic blockchain 303, a third traffic blockchain 304;
wherein the first service block chain 302 includes: a sub-block 302-1 and a sub-block 302-2 generated based on traffic data of the parent block 301-1 and the parent block 301-2, a sub-block 302-3 and a sub-block 302-4 newly generated after monitoring the first traffic data through the first traffic block chain;
similar to the first traffic blockchain 302 described above, the second traffic blockchain 303 includes: sub-blocks 303-1 and 303-2 generated based on traffic data of the parent block 301-1 and 301-2, sub-blocks 303-3 and 303-4 generated after monitoring the first traffic data through the second traffic sub-block chain;
the third service block chain comprises: sub-block 304-1 and sub-block 304-2 generated based on the traffic data of parent block 301-1 and parent block 301-2, sub-block 304-3 and sub-block 304-4 generated after monitoring the third traffic data through the third traffic sub-block chain;
specifically, the process of generating the sub-blocks according to the original parent blocks in the parent block chain in the first, second and third service block chains 302, 303, 304 is similar to the process described in fig. 2, and the description of fig. 2 is referred to for relevant points and is not repeated here.
Further, taking the generation process of the parent block 301-3 as an example, the process of merging business sub-chains to generate a new parent block will be described.
As shown in fig. 3, the first, second and third traffic blockchains 302, 303, 304 generate new sub-blocks of: the sub-blocks 302-3, 303-3 and 303-4 generate new hash values, namely hash value 1, hash value 2 and hash value 3, respectively, based on the service data stored in the sub-blocks, and provide the hash values 1, 2 and 3 to the parent block chain 301, so that the parent block chain 301 records the hash values as a hash value set to the new parent block 301-3.
Similar to the parent block 301-3 described above, the parent block 301-4 is also generated based on similar manners described above, and will not be described again here.
As can be seen from the above description, the first service blockchain in step S101 is a blockchain derived from the master blockchain and having a certain service function in the master blockchain. And the blockchain can be independently operated based on the business contracts corresponding to the businesses so as to ensure that the sub-chains independently develop own businesses.
Further, in the above step S101, the first service contract of the first service blockchain may be obtained according to the following steps S1 to S3.
Step S1, a service contract list in the father block chain is obtained, wherein the service contract list comprises contract address information of the first service contract;
step S2, obtaining storage position information of the first business contract according to contract address information of the first business contract in the business contract list;
and step S3, obtaining the first business contract of the first business block chain based on the storage position information of the first business contract.
In the embodiment of the application, in the process of creating each service blockchain based on the father blockchain, the service data corresponding to each service blockchain is stored in a data storage model corresponding to the father blockchain, for example, each service contract of the father blockchain, so in order to obtain a first service contract of the first service blockchain, a contract address of the first service contract is first found according to a service contract list in the father blockchain, and then, a storage position of the first service contract is determined based on the contract address of the first service contract so as to obtain various attribute information of the first service contract.
Step S102, determining a first virtual machine corresponding to the first service blockchain according to the first service contract.
Specifically, in the field of blockchain, a virtual machine may be understood as an operating environment of a code built on the blockchain, but the virtual machine itself is not stored in the blockchain, but is stored on the same computer as the blockchain as each node, each node participating in the blockchain operates the virtual machine and uses it as part of a blockvalidity verification protocol, and each node performs the same calculation according to the deployment and invocation of a contract and stores the same data to ensure that the most realistic result is recorded in the blockchain.
Further, the determining, according to the first service contract, a first virtual machine corresponding to the first service blockchain includes: and selecting the virtual machine corresponding to the service type from a virtual machine deployment unit deployed with a plurality of virtual machines of different types as a first virtual machine of the first service block chain according to the service type corresponding to the first service contract.
Wherein the virtual machine deployment unit may be understood as a unit designed for selecting a virtual machine for a plurality of different self-blockchains of a parent blockchain, which may deploy a plurality of different types of virtual machines, for example: evm virtual machines of Ethernet, move virtual machines of libra, cadence virtual machines of flow, and the like.
Specifically, referring to fig. 4, fig. 4 is a block chain architecture diagram supporting multiple virtual machines according to another embodiment of the present application.
Similar to fig. 2 described above, fig. 4 includes: included in fig. 4 are parent blockchain 401, parent block 401-1, parent block 402-2, parent block 402-3;
a first traffic blockchain 402, a second traffic block403, a third traffic blockchain 404; wherein, the intelligent contract corresponding to the first service block 402 chain is about service contract 1, the intelligent contract corresponding to the second service block chain 403 is about intelligent contract 2, and the intelligent contract corresponding to the third service block 404 is intelligent contract 3;
the first traffic blockchain 402 also includes: sub-block 402-1, sub-block 402-2, sub-block 402-3;
the second traffic blockchain 403 also includes: sub-block 403-1, sub-block 403-2, sub-block 403-3;
the third traffic blockchain 404 also includes: sub-block 404-1, sub-block 404-2, sub-block 404-3;
the above blockchains and sub-blocks are substantially the same as those described in fig. 2 of the present application, and the relevant points are described with reference to fig. 2, and are not repeated here.
Further, fig. 4 further includes a virtual machine deployment unit 405.
In a specific application process, in order to improve the call efficiency of the virtual machine, in a process of deploying different types of virtual machines to the virtual machine deployment unit 405, first, call parameters of the different types of virtual machines are normalized, where the call parameters of the normalization process include: the type parameter of the virtual machine, the calling contract parameter of the virtual machine, the signature of the calling interface and the like.
Further, in the process of deploying virtual machines for the different service blockchains, whether available virtual machines corresponding to the service contract types of the service blockchains exist in the virtual machine deployment unit is also considered.
Specifically, the method further includes the following steps S4 to S7:
step S4, determining whether at least one virtual machine matched with the service type exists in a virtual machine deployment unit in which a plurality of virtual machines of different types are deployed according to the service type corresponding to the first service contract;
and S5, selecting at least one virtual machine matched with the service type to be deployed to the virtual machine deployment unit according to the service type when the at least one virtual machine matched with the service type does not exist in the virtual machine deployment unit, and taking the at least one virtual machine matched with the first service type as the first virtual machine.
Step S6, when the virtual machine deployment unit exists at least one virtual machine matched with the service type, determining the virtual machines which are not in association with other service block chains except the first service block chain in the at least one virtual machine matched with the service type;
and S7, taking the virtual machine which does not establish association relation with other service block chains except the first service block chain as the first virtual machine.
That is, if the virtual machine deployment unit does not have a virtual machine corresponding to the service type, a virtual machine corresponding to the service type may be selected, normalization processing may be performed on a call interface of the virtual machine, and the normalized virtual machine is deployed to the virtual machine deployment unit, so as to facilitate the call of the service blockchain.
In summary, according to the selection method of the blockchain virtual machine provided by the embodiment of the application, on the basis of the service contract dimension, the father blockchain is divided into a plurality of sub-blockchains corresponding to different service types, and then virtual machines matched with the service types of the sub-blockchains are respectively selected for the sub-blockchains based on the service contracts of the sub-blockchains, so that the problem of incompatibility of the different types of virtual machines in the blockchain in the prior art is solved, and meanwhile, the service development capability of the blockchain is improved.
The application also provides a selection device of the blockchain virtual machine, and the embodiment of the device is basically similar to the embodiment of the method, so the description is simpler, and the relevant parts can be referred to the description of the embodiment of the method and are not repeated here.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a selection device of a blockchain virtual machine according to another embodiment of the present application, where the device includes:
an obtaining unit 501, configured to obtain a first service contract of a first service blockchain in a parent blockchain, where the parent blockchain is a main blockchain generated based on at least two service contracts, and the service contracts respectively correspond to sub-blockchains in the parent blockchain; the first service block chain is a sub-block chain corresponding to a first service contract of the at least two service contracts;
a selecting unit 502, configured to determine, according to the first service contract, a first virtual machine corresponding to the first service blockchain.
Optionally, the acquiring the first service contract of the first service blockchain in the parent blockchain includes
Acquiring a service contract list in the father block chain, wherein the service contract list comprises contract address information of the first service contract;
obtaining storage position information of the first business contract according to contract address information of the first business contract in the business contract list;
a first service contract of the first service blockchain is obtained based on the storage location information of the first service contract.
Optionally, the determining, according to the first service contract, a first virtual machine corresponding to the first service blockchain includes:
and selecting the virtual machine corresponding to the service type from a virtual machine deployment unit deployed with a plurality of virtual machines of different types as a first virtual machine of the first service block chain according to the service type corresponding to the first service contract.
Optionally, the determining, according to the first service contract, a first virtual machine corresponding to the first service blockchain includes:
determining whether at least one virtual machine matched with the service type exists in a virtual machine deployment unit in which a plurality of virtual machines of different types are deployed according to the service type corresponding to the first service contract;
and under the condition that the virtual machine deployment unit does not exist the at least one virtual machine matched with the service type, selecting at least one virtual machine matched with the service type to deploy to the virtual machine deployment unit according to the service type, and taking the at least one virtual machine matched with the first service type as the first virtual machine.
Optionally, the device is further configured to:
determining a virtual machine which does not establish an association relationship with other service block chains except the first service block chain in the at least one virtual machine matched with the service type under the condition that the virtual machine deployment unit exists the at least one virtual machine matched with the service type;
and taking the virtual machine which does not establish association relation with other service block chains except the first service block chain as the first virtual machine.
Optionally, the plurality of different types of virtual machines are deployed to the virtual machine deployment unit by:
normalizing the virtual machine call parameters of the plurality of different types of virtual machines, and deploying the plurality of different types of virtual machines subjected to the normalization of the virtual machine call parameters to the virtual machine deployment unit.
In another embodiment of the present application, referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
The electronic device includes:
at least one processor 601, at least one memory 603, at least one communication interface 602, and at least one communication bus 604;
alternatively, the communication interface 602 may be an interface of a communication module, such as an interface of a GSM module;
the processor 601 may be a CPU or a specific integrated circuit ASIC (APPlication Specific Integrated Circuit) or one or more integrated circuits configured to implement embodiments of the present application;
the memory 603 may comprise high-speed RAM memory or may further comprise non-volatile memory (non-volatile memory), such as at least one disk memory.
The memory 603 is a program for storing a method, which when read and executed by a processor, performs the method provided by the method embodiment of the present application.
A sixth embodiment of the present application also provides a computer storage medium storing a computer program which, when executed, implements the method provided in the method embodiment described above.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
1. Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
2. Those skilled in the art will appreciate that embodiments of the application may be provided as a system or an electronic device. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (11)

1. A method for selecting a blockchain virtual machine, comprising:
obtaining a first service contract of a first service block chain in a father block chain, wherein the father block chain is a main block chain generated based on at least two service contracts; the first service block chain is a sub-block chain corresponding to a first service contract of the at least two service contracts; the first one of the parent blockchains is generated by: acquiring service data stored in each parent block from each parent block of the parent block chain respectively; performing business contract dimension division on the business data stored in each father block, and obtaining first business data corresponding to a first business contract in each father block based on a division result; generating a first service block chain according to first service data corresponding to the first service contract in each parent block; and determining a first virtual machine corresponding to the first service block chain according to the first service contract.
2. The method of claim 1, wherein the obtaining a first service contract for a first service blockchain in a parent blockchain comprises:
acquiring a service contract list in the father block chain, wherein the service contract list comprises contract address information of the first service contract;
obtaining storage position information of the first business contract according to contract address information of the first business contract in the business contract list;
a first service contract of the first service blockchain is obtained based on the storage location information of the first service contract.
3. The method of claim 1, wherein the determining a first virtual machine corresponding to the first traffic blockchain according to the first traffic contract comprises:
and selecting the virtual machine corresponding to the service type from a virtual machine deployment unit deployed with a plurality of virtual machines of different types as a first virtual machine of the first service block chain according to the service type corresponding to the first service contract.
4. The method of claim 1, wherein the determining a first virtual machine corresponding to the first traffic blockchain according to the first traffic contract comprises:
determining whether at least one virtual machine matched with the service type exists in a virtual machine deployment unit in which a plurality of virtual machines of different types are deployed according to the service type corresponding to the first service contract;
and under the condition that the virtual machine deployment unit does not exist the at least one virtual machine matched with the service type, selecting at least one virtual machine matched with the service type to deploy to the virtual machine deployment unit according to the service type, and taking the at least one virtual machine matched with the service type as the first virtual machine.
5. The method according to claim 1, wherein the method further comprises:
determining a virtual machine which does not establish an association relationship with other service block chains except the first service block chain in the at least one virtual machine matched with the service type under the condition that the virtual machine deployment unit exists the at least one virtual machine matched with the service type;
and taking the virtual machine which does not establish association relation with other service block chains except the first service block chain as the first virtual machine.
6. The method of claim 3, wherein the plurality of different types of virtual machines are deployed to the virtual machine deployment unit by:
normalizing the virtual machine call parameters of the plurality of different types of virtual machines, and deploying the plurality of different types of virtual machines subjected to the normalization of the virtual machine call parameters to the virtual machine deployment unit.
7. The method according to claim 1, wherein the method further comprises: recording service data changes of each service through each sub-block chain of the parent block chain, and generating a new sub-block corresponding to each sub-block chain according to the service data changes of each service.
8. The method of claim 7, wherein the method further comprises:
respectively obtaining service data recorded by new sub-blocks of each sub-block chain;
generating hash values of the new sub-blocks according to the service data recorded by the new sub-blocks of each sub-block chain;
based on the hash value of each new sub-block, a new parent block of the parent blockchain is generated.
9. A selection apparatus for a blockchain virtual machine, comprising:
an obtaining unit, configured to obtain a first service contract of a first service blockchain in a parent blockchain, where the parent blockchain is a master blockchain generated based on at least two service contracts; the first service block chain is a sub-block chain corresponding to a first service contract of the at least two service contracts; the first one of the parent blockchains is generated by: acquiring service data stored in each parent block from each parent block of the parent block chain respectively; performing business contract dimension division on the business data stored in each father block, and obtaining first business data corresponding to a first business contract in each father block based on a division result; generating a first service block chain according to first service data corresponding to the first service contract in each parent block;
and the selection unit is used for determining a first virtual machine corresponding to the first service block chain according to the first service contract.
10. An electronic device, comprising:
a processor;
a memory for storing a program of methods, which when read and executed by the processor performs the method of any of claims 1-8.
11. A computer storage medium, characterized in that it stores a computer program, which when executed implements the method of any of claims 1-8.
CN202210550135.XA 2022-05-20 2022-05-20 Selection method and device of blockchain virtual machine, electronic equipment and storage medium Active CN115174589B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210550135.XA CN115174589B (en) 2022-05-20 2022-05-20 Selection method and device of blockchain virtual machine, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210550135.XA CN115174589B (en) 2022-05-20 2022-05-20 Selection method and device of blockchain virtual machine, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115174589A CN115174589A (en) 2022-10-11
CN115174589B true CN115174589B (en) 2023-11-03

Family

ID=83483749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210550135.XA Active CN115174589B (en) 2022-05-20 2022-05-20 Selection method and device of blockchain virtual machine, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115174589B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843774A (en) * 2017-02-24 2017-06-13 合肥工业大学 A kind of mass-rent construction method of the intelligent contract based on block chain
CN109241087A (en) * 2018-09-27 2019-01-18 福建福链科技有限公司 A kind of data processing method and terminal of alliance's chain
CN109615517A (en) * 2018-12-07 2019-04-12 北京瑞卓喜投科技发展有限公司 A kind of intelligence contract execution method and intelligent contract execute system
CN111176791A (en) * 2019-12-31 2020-05-19 杭州趣链科技有限公司 Cross-virtual machine calling method based on multi-virtual machine blockchain platform
US10699269B1 (en) * 2019-05-24 2020-06-30 Blockstack Pbc System and method for smart contract publishing
CN111736954A (en) * 2020-06-24 2020-10-02 陈鹏 Multi-intelligent contract virtual machine implementation method, multi-intelligent contract virtual machine and system
CN112529711A (en) * 2021-02-07 2021-03-19 腾讯科技(深圳)有限公司 Transaction processing method and device based on block chain virtual machine multiplexing
CN112685136A (en) * 2021-01-07 2021-04-20 腾讯科技(深圳)有限公司 Intelligent contract operation method, device, equipment and storage medium
CN114372882A (en) * 2021-12-15 2022-04-19 杭州顶天网络有限公司 Fragmentation and capacity expansion method based on network protocol

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10958418B2 (en) * 2017-10-10 2021-03-23 Chromata Corporation System and method for a blockchain network with heterogeneous privacy
US11139979B2 (en) * 2017-12-18 2021-10-05 Koninklijke Kpn N.V. Primary and secondary blockchain device
US20190236606A1 (en) * 2018-01-31 2019-08-01 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing a virtual chain model for distributed ledger technologies in a cloud based computing environment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843774A (en) * 2017-02-24 2017-06-13 合肥工业大学 A kind of mass-rent construction method of the intelligent contract based on block chain
CN109241087A (en) * 2018-09-27 2019-01-18 福建福链科技有限公司 A kind of data processing method and terminal of alliance's chain
CN109615517A (en) * 2018-12-07 2019-04-12 北京瑞卓喜投科技发展有限公司 A kind of intelligence contract execution method and intelligent contract execute system
US10699269B1 (en) * 2019-05-24 2020-06-30 Blockstack Pbc System and method for smart contract publishing
CN111176791A (en) * 2019-12-31 2020-05-19 杭州趣链科技有限公司 Cross-virtual machine calling method based on multi-virtual machine blockchain platform
CN111736954A (en) * 2020-06-24 2020-10-02 陈鹏 Multi-intelligent contract virtual machine implementation method, multi-intelligent contract virtual machine and system
CN112685136A (en) * 2021-01-07 2021-04-20 腾讯科技(深圳)有限公司 Intelligent contract operation method, device, equipment and storage medium
CN112529711A (en) * 2021-02-07 2021-03-19 腾讯科技(深圳)有限公司 Transaction processing method and device based on block chain virtual machine multiplexing
CN114372882A (en) * 2021-12-15 2022-04-19 杭州顶天网络有限公司 Fragmentation and capacity expansion method based on network protocol

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
《A Novel Smart Healthcare System Design for Internet of Health Things》;Pulkit Jain etal;《2021 International Conference on Innovative Computing, Intelligent Communication and Smart Electrical Systems (ICSES)》;全文 *
区块链技术在个税管理中的嵌入研究;周佳瑶;;财务与金融(01);全文 *
发布区块链标准应用模型及应用部署技术研究;白杰;李东云;吴先锋;;信息技术与网络安全(08);全文 *

Also Published As

Publication number Publication date
CN115174589A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
CN108846659B (en) Block chain-based transfer method and device and storage medium
EP3591510B1 (en) Method and device for writing service data in block chain system
CN109981679B (en) Method and apparatus for performing transactions in a blockchain network
CN109146490B (en) Block generation method, device and system
TW202101440A (en) Cross-blockchain resource transmission
CN108572986B (en) Data updating method and node equipment
CN108347483B (en) Decentralized computing system based on double-layer network
CN111985921B (en) Verification processing method based on block chain offline payment and digital financial service platform
CN109447820A (en) Data processing method, device, computer equipment and storage medium
WO2021007863A1 (en) Integrity auditing for multi-copy storage
CN110659905A (en) Transaction verification method, device, terminal equipment and storage medium
CN110660466A (en) Personal health data chaining method and system of Internet of things by combining block chains
CN111292190A (en) Transaction generation method, block creation method, related device and equipment
CN115150413B (en) Block chain data storage method and device, electronic equipment and storage medium
CN113486118A (en) Consensus node selection method and device
CN113688418A (en) Engineering order settlement method and system based on block chain data storage
CN113469811A (en) Block chain transaction processing method and device
CN113220640A (en) Arbitration method and device based on block chain
CN115174589B (en) Selection method and device of blockchain virtual machine, electronic equipment and storage medium
CN110060151B (en) Service execution method and device
CN111324645B (en) Block chain data processing method and device
CN108710658A (en) A kind of storage method and device of data record
CN111383008B (en) Block chain transfer method and device based on account model
CN114298840A (en) Block chain transaction endorsement method and system based on zero knowledge proof
CN112906171B (en) Credible collaborative optimization method and simulation platform for comprehensive energy system

Legal Events

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