WO2024000897A1 - Blockchain-based digital asset synthesis method and apparatus - Google Patents

Blockchain-based digital asset synthesis method and apparatus Download PDF

Info

Publication number
WO2024000897A1
WO2024000897A1 PCT/CN2022/122796 CN2022122796W WO2024000897A1 WO 2024000897 A1 WO2024000897 A1 WO 2024000897A1 CN 2022122796 W CN2022122796 W CN 2022122796W WO 2024000897 A1 WO2024000897 A1 WO 2024000897A1
Authority
WO
WIPO (PCT)
Prior art keywords
gene
sequence
gene sequence
blockchain
replacement
Prior art date
Application number
PCT/CN2022/122796
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 WO2024000897A1 publication Critical patent/WO2024000897A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/308Payment architectures, schemes or protocols characterised by the use of specific devices or networks using the Internet of Things

Definitions

  • Embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a blockchain-based digital asset synthesis method and device.
  • Fetech financial technology
  • Embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a blockchain-based digital asset synthesis method and device.
  • Digital assets are unique digital certificates generated using blockchain technology, corresponding to specific works and artworks. On the basis of protecting their digital copyrights, they can realize authentic and credible digital issuance, purchase, collection and use.
  • digital assets there are various types of digital assets, including but not limited to digital pictures, music, videos, 3D models, electronic tickets, digital souvenirs and other forms. Based on this, for a certain type of digital assets, in order to derive new digital assets of this type in a timely and effective manner, one or two existing digital assets of this type can be selected from the blockchain for synthesis, then , if you want to synthesize new digital assets of this type, you need to use genetic algorithms to achieve it.
  • Embodiments of the present invention provide a blockchain-based digital asset synthesis method and device to effectively ensure that the execution results of the gene sequences of new digital assets generated on different blockchain nodes are consistent, so as to This can solve the problem in the existing technology that the existing genetic algorithm cannot be applied to the blockchain due to the different random numbers generated by each blockchain node.
  • embodiments of the present invention provide a blockchain-based digital asset synthesis method, which is suitable for a blockchain network with m blockchain nodes.
  • the method includes:
  • the blockchain node when the blockchain node detects a digital asset synthesis transaction, it performs an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction to generate an initial sub- generation gene sequence; the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized Both the existing gene sequence and the unused random gene sequence include n genes;
  • the blockchain node When the blockchain node determines that the initial progeny gene sequence exists on the blockchain, it will perform the initial progeny gene sequence on the set gene replacement method based on the unused random gene sequence.
  • the i-th gene replacement generates an ordered progeny candidate set belonging to the i-th gene replacement; the ordered progeny candidate set belonging to the i-th gene replacement includes j candidate gene sequences;
  • the blockchain node determines that the j candidate gene sequences all exist in the blockchain, then based on the unused random gene sequence, the i+1th process is performed on the initial offspring gene sequence. times of gene replacement until the n-1th gene replacement is performed on the initial offspring gene sequence, thereby determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized.
  • the technical solution in the present invention generates the same unused random gene sequence for each blockchain node through the client, so that each blockchain node can perform genetic modification on the initial offspring gene sequence according to the same replacement method.
  • Replacement can avoid the situation where the genetic sequence of the new digital assets generated by each blockchain node is inconsistent due to the different random numbers generated, and can effectively ensure the uniqueness of the genetic sequence of the new digital assets generated.
  • the blockchain node when the blockchain node detects a digital asset synthesis transaction, it can perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, so as to This generates the initial progeny gene sequence.
  • the initial offspring gene sequence is used as the gene sequence of the new digital asset; when it is determined that the initial offspring gene sequence exists on the blockchain, the initial offspring gene sequence can be used as Based on the set gene replacement method, and based on the unused random gene sequence, the i-th gene replacement is performed on the initial offspring gene sequence to generate an ordered offspring candidate set belonging to the i-th gene replacement, which can effectively Determine whether a certain candidate gene sequence in the ordered descendant candidate set does not exist on the blockchain.
  • the i+1th gene replacement can be performed on the initial offspring gene sequence based on the unused random gene sequence until the initial After the n-1 gene replacement of the offspring gene sequence, the gene sequence of the new digital asset generated for the k digital assets to be synthesized can be determined.
  • this scheme can generate the gene sequence of a new digital asset within a certain search space, and judge the candidate genes in the ordered descendant candidate set based on the ordered descendant candidate set generated by a certain gene replacement. Whether the sequence exists on the blockchain, this can effectively avoid the problem of conflicts between the currently generated gene sequence and the previously generated gene sequence, thus effectively ensuring that the user response time will not time out.
  • this solution enables each blockchain node to perform gene replacement for the initial offspring gene sequence according to the same replacement method, so it can effectively Ensure that the execution results of the genetic sequences of the new digital assets generated on different blockchain nodes are consistent. This can solve the problem of existing genetic algorithms caused by different random numbers generated by each blockchain node in the existing technology. Problems that cannot be applied to the blockchain.
  • i-th gene replacement on the initial progeny gene sequence to generate an ordered progeny candidate set belonging to the i-th gene replacement, including:
  • the blockchain node selects i genes from the unused random gene sequences as replacement genes for the initial offspring gene sequence
  • the blockchain node exchanges the i genes in the unused random gene sequence with the i genes at the corresponding positions in the initial offspring gene sequence, thereby generating the i genes belonging to the i-th gene replacement.
  • the set of sequential descendant candidates The set of sequential descendant candidates.
  • the genes at multiple positions in the unused random gene sequence are used to replace the corresponding positions in the initial offspring gene sequence.
  • Multiple genes can obtain the gene sequence that does not exist on the blockchain to the greatest extent possible, that is, the gene sequence of the new digital asset can be obtained, and then the gene sequence of the generated new digital asset can be effectively ensured.
  • the uniqueness of the new digital asset can also enable the synthesized new digital asset to inherit the attributes of the parent to the greatest extent, that is, the probability of the synthesized new digital asset inheriting the attributes of the parent is greater than random generation, so as to retain the scarce characteristics of the parent's genes.
  • the blockchain node determines that any candidate gene sequence among the j candidate gene sequences does not exist in the blockchain, it will determine the candidate gene sequence as the gene sequence of the new digital asset.
  • the candidate gene sequence when it is determined that a candidate gene sequence in the ordered descendant candidate set generated after replacement does not exist on the blockchain, the candidate gene sequence can be used as the gene sequence of the new digital asset, so that it can Effectively ensure the uniqueness of the gene sequence of the new digital assets generated, which can effectively avoid the possibility of conflicts between offspring and offspring, and can realize the XOR of the gene sequences of multiple parents.
  • the purpose of the operation is to generate a new offspring with a genetic sequence.
  • the n-1th gene replacement on the initial progeny gene sequence it also includes:
  • the blockchain node determines that the p candidate gene sequences included in the ordered offspring candidate set belonging to the n-1th gene replacement generated by performing the n-1th gene replacement on the initial offspring gene sequence are all exists in the blockchain, the unused random gene sequence is determined as the gene sequence of the new digital asset.
  • the blockchain node exchanges i genes in the unused random gene sequence with i genes at corresponding positions in the initial offspring gene sequence, thereby generating the i-th An ordered set of progeny candidates for gene replacement, including:
  • the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and the n; each gene position sequence number combination includes at least one value with an operation sequence. gather;
  • the blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement.
  • corresponding calculations can be performed to generate at least one gene position sequence number combination for gene replacement, so that at least one gene position number combination can be generated.
  • a gene position sequence number combination replaces multiple genes in the initial progeny gene sequence with multiple genes at corresponding positions in the unused random gene sequence, so that effective replacement of the initial progeny gene sequence can be achieved.
  • the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n, including:
  • the blockchain node performs a remainder operation on the unused random gene sequence and n to determine the first value
  • the blockchain node determines n initial gene position numbers with operational order based on the first value and n;
  • the blockchain node performs a remainder operation on the n initial gene position numbers and n in sequence according to the order of operations of the n initial gene position numbers, thereby determining the n first gene positions in the order of operations.
  • Serial number; the n first gene position serial numbers with operational order are used to form a first gene position serial number combination; the n first gene position serial numbers with operational order are used to assist gene replacement;
  • the blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement, including:
  • the blockchain node sequentially adds the n first gene position numbers in the initial offspring gene sequence according to the order of operation of the n first gene position numbers included in the first gene position number combination.
  • the corresponding genes are replaced with genes corresponding to the n first gene position numbers in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
  • an ordered sequence i.e., the first numerical value with a certain order of operations
  • multiple candidate new progeny gene sequences can be generated with a certain degree of certainty.
  • Digital assets have gene sequences that enable each blockchain node to generate the same gene sequence and determine whether there is a candidate new child gene sequence among multiple candidate new child gene sequences in the same order. Does not exist on the blockchain.
  • the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n, including:
  • the blockchain node determines, based on the n first gene position numbers with operational order corresponding to the first gene replacement, except one gene corresponding to the first gene replacement.
  • the other i-1 genes each correspond to the q second gene position numbers in the order of operation;
  • the blockchain node determines a plurality of genes for use based on the n first gene position numbers with operational order and the q second gene position numbers with operational order corresponding to each of the i-1 genes.
  • the blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement, including:
  • the blockchain node For each second gene position sequence number combination, if at least one value set in the second gene position sequence number combination is an empty set, the blockchain node does not perform gene replacement for the initial offspring gene sequence;
  • the blockchain node will sequentially add at least one value set included in the second gene position sequence number combination in the initial offspring gene sequence.
  • the gene corresponding to the gene position number is replaced with the gene corresponding to at least one gene position number in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
  • the gene sequence of the new digital asset generated for the k digital assets to be synthesized it also includes:
  • embodiments of the present invention also provide a blockchain-based digital asset synthesis device, which is suitable for a blockchain network with m blockchain nodes.
  • the device includes:
  • the generation unit is used for any blockchain node, when a digital asset synthesis transaction is detected, to perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, and generate an initial offspring.
  • Gene sequence the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized has The gene sequence and the unused random gene sequence include n genes;
  • a processing unit configured to perform a third process on the initial offspring gene sequence based on the unused random gene sequence according to the set gene replacement method when it is determined that the initial offspring gene sequence exists on the blockchain.
  • the i-th gene replacement generates an ordered progeny candidate set belonging to the i-th gene replacement; the ordered progeny candidate set belonging to the i-th gene replacement includes j candidate gene sequences; if the j candidate genes are determined If the sequences all exist in the blockchain, then based on the unused random gene sequence, the i+1th gene replacement is performed on the initial offspring gene sequence until the initial offspring gene sequence is After the n-1th gene replacement, the gene sequence of the new digital asset generated for the k digital assets to be synthesized is determined.
  • embodiments of the present invention provide a computing device, including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processing The server executes any of the blockchain-based digital asset synthesis methods described in the first aspect above.
  • embodiments of the present invention provide a computer-readable storage medium that stores a computer program that can be executed by a computing device. When the program is run on the computing device, the computing device executes the above-mentioned first step.
  • Figure 1 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention.
  • Figure 2 is a schematic flow chart of a blockchain-based digital asset synthesis method provided by an embodiment of the present invention
  • Figure 3 is a schematic structural diagram of a blockchain-based digital asset synthesis device provided by an embodiment of the present invention.
  • Figure 4 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
  • Blockchain is a distributed storage system that is jointly maintained and trusted by multiple nodes.
  • the bottom layer of the blockchain is a chain composed of a series of blocks.
  • each block also records the hash value of the previous block.
  • a block consists of a block header and a block body.
  • the block header definition includes important fields such as the height of the block and the hash value of the previous block.
  • the block body mainly stores transaction data.
  • Blockchain uses cryptography to ensure the security of data transmission and access, and uses a chain structure to ensure that the data on the chain cannot be tampered with.
  • Node In the blockchain, a node refers to a participant with a unique identity. This node has a complete copy of the ledger and has the ability to participate in the consensus of the blockchain network and maintain the ledger.
  • Smart contract is a collection of code and data running on the blockchain system.
  • the code is responsible for realizing the functions of the smart contract
  • the data is responsible for storing the status of the smart contract
  • the smart contract can receive and send information.
  • any operation (deploying a contract, calling a contract interface, etc.) is performed by sending a transaction. Transactions are initiated by users and sent to blockchain nodes through the client. After receiving the transaction, the blockchain node will package the transaction into a block and execute it.
  • Digital assets non-homogeneous assets with unique identifiers on the blockchain.
  • G Genetic Algorithm
  • the system architecture may include a client 100 and a blockchain network 200.
  • the blockchain network 200 may include at least one blockchain node, such as blockchain node 201, blockchain node 202, blockchain node 203, blockchain node 204, etc., and any two zones in at least one node Blockchain nodes can be communicated and connected; the client 100 and any blockchain node in the blockchain network 200 can be communicated and connected through wired means, or can be communicated and connected through wireless means, which is not limited in the embodiment of the present invention. .
  • an unused random gene sequence will be generated, and the unused random gene sequence and each parent digital asset will be generated. All have the same number of genes, and based on the unused random gene sequence and multiple parent digital assets, a digital asset synthesis transaction is generated, and then, to any blockchain node in the blockchain network 200 (such as the district The blockchain node 201) submits the digital asset synthesis transaction, or may submit the digital asset synthesis transaction to each node in the blockchain network 200.
  • any blockchain node (such as node blockchain 201) in the blockchain network 200 to submit the digital asset synthesis transaction as an example
  • the blockchain node 201 will Other blockchain nodes in the blockchain network 200 synchronize the digital asset synthesis transaction, and each blockchain node stores the digital asset synthesis transaction in its own transaction pool.
  • the block-producing node will package the digital asset synthetic transaction into a block and initiate a consensus process for the block, such as using a Byzantine fault-tolerant algorithm or a proof-of-work consensus algorithm, etc., and after the block consensus is successful, The block is uploaded to the chain.
  • each blockchain node will execute the digital asset synthesis transaction in the block according to the same digital asset synthesis transaction execution rules, and then determine whether the execution results of each blockchain node for the digital asset synthesis transaction are consistent or reach an agreement.
  • the consistent number meets the first set quantity threshold (for example, two-thirds of the blockchain nodes have consistent execution results)
  • the execution result can be recognized.
  • a certain gene sequence can be confirmed as a new digital asset, and the usage status of the gene sequence can be marked as used, and the gene sequence marked as used can be uploaded to the blockchain.
  • FIG. 1 system architecture shown in FIG. 1 is only an example, and the embodiment of the present invention is not limited thereto.
  • Figure 2 exemplarily shows the process of a blockchain-based digital asset synthesis method provided by an embodiment of the present invention.
  • This process can be executed by a blockchain-based digital asset synthesis device.
  • the blockchain-based digital asset synthesis method in the embodiment of the present invention is suitable for a blockchain network with m blockchain nodes; the blockchain-based digital asset synthesis device may be a service device or may be a capable
  • the components (such as chips or integrated circuits) that support the service device to implement the functions required by the method may of course also be other electronic devices with the functions required to implement the method.
  • m is an integer greater than 1.
  • the process specifically includes:
  • Step 201 for any blockchain node, when the blockchain node detects a digital asset synthesis transaction, it performs an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, Generate initial progeny gene sequences.
  • the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized has The gene sequence and the unused random gene sequence include n genes. Among them, k is an integer greater than or equal to 1; n is an integer greater than or equal to 1.
  • the user when a user within the blockchain network has the need to synthesize a new digital asset, the user will use a certain terminal device (such as a smartphone, tablet, laptop, etc.) based on the genetic attributes of the digital asset.
  • the client installed on a desktop computer, etc.
  • the number of genes of the unused random gene sequence is the same as the number of genes of the digital asset.
  • the number of genes generated by the client is Unused random gene sequences can be used when there is an initial descendant gene sequence generated by an XOR operation on the blockchain, so that each blockchain node can generate new digital assets based on the unused random gene sequence to the greatest extent possible.
  • the genetic sequence can avoid the inability to use random numbers on the blockchain, and at the same time ensure that the execution results of each blockchain node on the blockchain for synthesizing new digital assets are basically consistent.
  • the client generates a digital asset synthesis transaction based on the unused random gene sequence and the gene sequences of k digital assets to be synthesized, and submits the digital asset synthesis transaction to any blockchain node in the blockchain network, or Digital asset synthesis transactions can be submitted to each blockchain node in the blockchain network.
  • the user can generate a digital asset synthesis request on the client of the terminal device based on an unused random gene sequence and the gene sequences of k digital assets to be synthesized, and use the client of the terminal device to generate the digital asset synthesis request.
  • the asset synthesis request is sent to any blockchain node in the blockchain network in the form of a transaction, or the digital asset synthesis request is sent to each blockchain node in the blockchain network in the form of a transaction.
  • any blockchain node can process the digital asset synthesis transaction accordingly. For example, it can perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction. , to generate the initial offspring gene sequence, or the digital asset synthetic transaction can be stored in the local transaction pool.
  • a certain blockchain node in the blockchain network is determined as the block producing node (that is, the main node), the blockchain node will package the digital asset synthetic transactions in the local transaction pool into blocks, and send the blocks to other blockchains in the blockchain network other than the blockchain node.
  • the nodes carry out consensus, and after confirming that the block consensus is successful, the block will be uploaded to the chain. That is to say, in the consensus process for the block, each blockchain node will execute the block, that is, execute the digital asset synthesis transaction in the block, such as for k pending digital asset synthesis transactions.
  • the gene sequence of the synthesized digital asset is XORed to generate the initial offspring gene sequence.
  • each digital asset is unique on the blockchain and has its own unique number. Therefore, the unique number of Fuhu digital assets can be used as the representation of the gene sequence of Fuhu digital assets. Assume that Fuhu has 6 attributes, each attribute has 16 possibilities, and a 32-bit positive integer is used to represent each Fuhu. The unique number, then 24 bits can be used as the tiger's 6 attributes. As shown in Table 1, every 4 bits represent an attribute.
  • an algorithm is needed to generate a new unique number. Fuhu. Since random numbers cannot be used in smart contracts, and in order to ensure that the user response time does not time out, this synthetic algorithm also needs to have a determined search space and consistent execution results on different machines (or nodes). Therefore, an ordered descendant candidate set can be generated by a deterministic genetic algorithm, and the descendants in the ordered descendant candidate set can be traversed one by one until a descendant that is not on the blockchain is found.
  • each gene has K possibilities, using M digital assets of the parent to synthesize a new digital asset, it is required that the synthesized new digital asset inherits the attributes of the parent.
  • the unique number of the Fuhu is composed of its 6 attributes, then You can search for new synthetic Fuhu as follows. For example, input: M gene sequences x1, x2,..., xM of parent digital assets and an unused random gene sequence G0.
  • Output The genetic sequence of the new digital asset, such as the genetic sequence of the new Fuhu digital asset.
  • the block producing node packages the digital asset synthesis transaction into a block.
  • each blockchain node will execute the digital asset synthesis transaction in the block, that is, perform an XOR operation on the gene sequences of the three Fu tigers to generate the gene sequence G1.
  • G1 is the gene sequence of the newly synthesized offspring Fuhu, and the deterministic genetic algorithm terminates; here, the XOR operation is selected as the gene synthesis algorithm, and the XOR operation is equivalent to no carry
  • the addition, through the XOR operation, can obtain the gene sequences related to all parents to the greatest extent, retaining the scarce characteristics of the genes of the parents. Then use the gene sequences of the three Fuhu digital assets to perform an XOR operation to get the initial offspring gene sequence.
  • Step 202 When the blockchain node determines that the initial offspring gene sequence exists on the blockchain, it will replace the initial offspring with the unused random gene sequence in accordance with the set gene replacement method. The gene sequence undergoes the i-th gene replacement to generate an ordered set of offspring candidates belonging to the i-th gene replacement.
  • Step 203 If the blockchain node determines that the j candidate gene sequences all exist in the blockchain, then based on the unused random gene sequence, the initial offspring gene sequence is processed for the first time. i+1 gene replacements, until the n-1th gene replacement is performed on the initial offspring gene sequence, thereby determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized. .
  • the unused random gene sequence does not exist on the blockchain
  • the corresponding positions in the initial offspring gene sequence are replaced by genes at multiple positions in the unused random gene sequence.
  • Multiple genes can obtain the gene sequence that does not exist on the blockchain to the greatest extent, that is, the gene sequence of the new digital asset can be obtained, and then the gene sequence of the new digital asset generated can be effectively ensured.
  • the uniqueness of the sequence can also enable the synthesized new digital assets to inherit the attributes of the parent to the greatest extent, so as to retain the scarce characteristics of the parent's genes.
  • the blockchain node can generate the initial offspring gene sequence, and determine the blockchain After the initial progeny gene sequence exists on the original progeny gene sequence, at least one gene in the initial progeny gene sequence can be replaced accordingly. If the blockchain node determines that the initial offspring gene sequence does not exist on the blockchain, the initial offspring gene sequence can be directly used as the gene sequence of the new digital asset generated by the k digital assets to be synthesized.
  • the blockchain node selects i genes from the unused random gene sequence as replacement genes for the initial offspring gene sequence, and combines i genes from the unused random gene sequence with the initial offspring The i genes at corresponding positions in the gene sequence are exchanged, thereby generating the i-th gene replacement.
  • the ordered offspring candidate set belonging to the i-th gene replacement includes j candidate gene sequences. If the blockchain node determines that any of the j candidate gene sequences does not exist in the blockchain, the candidate gene sequence can be determined as the gene sequence of the new digital asset.
  • the blockchain node can perform corresponding calculations based on the unused random gene sequence and the total number of genes n possessed by the digital asset to generate at least one gene position sequence number combination for gene replacement, so that it can Through at least one combination of gene position numbers, multiple genes in the initial progeny gene sequence are replaced with multiple genes at corresponding positions in the unused random gene sequence, so that effective replacement of the initial progeny gene sequence can be achieved.
  • This provides support for the subsequent effective generation of genetic sequences for new digital assets. That is, the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n.
  • Each gene position sequence number combination includes at least one value set with an operation sequence. .
  • an ordered set of descendant candidates i.e., the first value with a certain order of operations
  • an ordered sequence can be generated through the remainder operation of the unused random gene sequence and n.
  • multiple candidate new progeny gene sequences can be generated with a certain degree of certainty. In this way, a unique new digital asset can be determined to the greatest extent possible from multiple candidate new progeny gene sequences.
  • each blockchain node can produce the same genetic sequence. For example, if the value of i is 1, the blockchain node can perform a remainder operation on the unused random gene sequence and n to determine the first value, and based on the first value and n, n can be determined An initial gene position sequence number with a sequence of operations. Then, according to the order of operation of the n initial gene position numbers, the n initial gene position numbers and n are sequentially subjected to a remainder operation, so that n first gene position numbers with the order of operation can be determined. Among them, the n first gene position numbers with operation order are used to form a first gene position number combination; the n first gene position numbers with operation order are used to assist gene replacement.
  • n is an integer greater than or equal to 1.
  • the blockchain node can determine the n first gene position numbers in the order of operation based on the n corresponding to the first gene replacement, except the one corresponding to the first gene replacement.
  • the i-1 genes other than the gene each correspond to q second gene position numbers in the order of operation, and based on the n first gene position numbers in the order of operation and the q corresponding to each of the other i-1 genes
  • a plurality of second gene position sequence numbers with operational sequence can be used to determine multiple second gene position sequence number combinations for gene replacement. Then, for each second gene position sequence number combination, if at least one value set in the second gene position sequence number combination is an empty set, gene replacement may not be performed for the initial offspring gene sequence.
  • the gene corresponding to at least one gene position number included in the second gene position number combination in the initial offspring gene sequence can be replaced with an unused random gene sequence.
  • the gene corresponding to the sequence number of the at least one gene in the gene can be generated, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
  • q is an integer greater than or equal to 1.
  • the gene sequence of the new digital asset will be generated within a certain search space. Then, after the n-1th gene replacement of the initial offspring gene sequence, if it is determined that the n-1th gene replacement of the initial offspring gene sequence will be performed If the p candidate gene sequences included in the ordered progeny candidate set belonging to the n-1th gene replacement generated by gene replacement all exist in the blockchain, then the unused random gene sequences can be determined as new digital assets.
  • a gene replacement can be performed on the initial descendant gene sequence G1, that is, it has never been used.
  • the unused random gene sequence G0 0010 1000 1100 0110 1010 1101
  • the resulting ordered set of offspring candidates belonging to the first gene replacement is:
  • the candidate gene sequence 1101 0001 1111 0111 1010 0000 can be used as a new Fuhu digital assets have the genetic sequence.
  • the second gene replacement can be performed on the initial offspring gene sequence G1, that is, two genes are selected from the unused random gene sequence G0 as the initial offspring.
  • the i1 gene and the i2-th gene are used to replace the two genes at the corresponding positions of the initial descendant gene sequence G1.
  • the following ordered descendant candidate set can be generated, and each candidate in the ordered descendant candidate set is checked in order.
  • mark the candidate gene sequence as existing (or mark as used) and return, and upload the marked candidate gene sequence to the blockchain. If all If it exists, continue to the next step.
  • the resulting ordered set of offspring candidates belonging to the second gene replacement is:
  • the candidate gene sequences formed after replacement are:
  • the candidate gene sequences formed after replacement are:
  • the value set of i2 is the empty set ⁇ , and there is no value to take in this case.
  • the candidate gene sequences formed after replacement are:
  • the candidate gene sequences formed after replacement are:
  • the candidate gene sequences formed after replacement are:
  • the candidate gene sequence 1101 1000 1111 0110 1101 0000 can be used as a new Fuhu digital assets have the genetic sequence.
  • the third gene replacement can be performed on the initial descendant gene sequence G1, that is, the above operations are repeated until N is selected from the unused random gene sequence G0 -1 gene is used as the mutant gene of the initial descendant gene sequence G1, and the i1, i2,...,i(N-1)th gene in the initial descendant gene sequence G1 is used as the unused random gene sequence G0.
  • i1, i2, and i3th genes replace the corresponding position genes of G1.
  • i1 takes [3,4, 5,0,1,2]
  • i2 takes [i1+1,5]
  • i3 takes [i2+1,5]
  • the generated candidate set of ordered offspring belonging to the third gene replacement is:
  • the candidate gene sequence 1101 1000 0110 0111 1010 0000 can be used as a new Fuhu digital assets have the genetic sequence.
  • the fourth gene replacement can be performed on the initial offspring gene sequence G1, that is, 4 genes are selected from the unused random gene sequence G0 as the initial offspring.
  • the i1, i2, i3, and i4th genes are used to replace the corresponding position genes of the initial offspring gene sequence G1.
  • i1 takes [3,4,5,0,1,2]
  • i2 takes [i1+1,5]
  • i3 Taking [i2+1,5] and taking [i3+1,5] for i4, the following ordered descendant candidate set belonging to the fourth gene replacement can be generated.
  • Each of the ordered descendant candidate sets is checked in order. Whether the candidate gene sequence already exists on the blockchain, if not, mark the candidate gene sequence as existing (or mark as used) and return, and upload the marked candidate gene sequence to the blockchain. If If all exist, continue to the next step. Among them, the resulting ordered set of offspring candidates belonging to the fourth gene replacement is:
  • i1 5, i2, i3, i4 are empty sets ⁇ .
  • the candidate gene sequence 0010 0001 1111 0110 1010 1101 belonging to the ordered offspring candidate set of the fourth gene replacement does not exist on the blockchain
  • the candidate gene sequence 0010 0001 1111 0110 1010 1101 can be used as a new Fuhu digital assets have the genetic sequence.
  • the fifth gene replacement can be performed on the initial offspring gene sequence G1, that is, 5 genes are selected from the unused random gene sequence G0 as the initial offspring.
  • the mutated gene of the generation gene sequence G1 that is, using 5 genes in the unused random gene sequence G0 to replace the corresponding position genes in the initial offspring gene sequence G1, using the unused random gene sequence G0
  • the i1, i2, i3, i4, and i5th genes are used to replace the corresponding position genes of the initial offspring gene sequence G1.
  • i1 takes [3,4,5,0,1,2]
  • i2 takes [i1+1,5].
  • the following ordered offspring candidate set belonging to the fifth gene replacement can be generated, Check in order whether each candidate gene sequence in the ordered descendant candidate set already exists on the blockchain. If it does not exist, mark the candidate gene sequence as existing (or marked as used) and return, and at the same time, mark the following The candidate gene sequences are uploaded to the blockchain, and if all exist, continue to the next step. Among them, the generated candidate set of ordered offspring belonging to the fifth gene replacement is:
  • the deterministic genetic algorithm terminates and the unused gene sequence is The used random gene sequence is marked as present (or marked as used) and uploaded to the blockchain. In this way, this solution can meet the requirement of generating the genetic sequence of a new digital asset within a certain search space, and can effectively ensure the uniqueness of the genetic sequence of the generated new digital asset.
  • the above embodiments show that the technical solution in the present invention generates the same unused random gene sequence for each blockchain node through the client, so that each blockchain node can perform genetic modification on the initial offspring gene sequence according to the same replacement method.
  • Replacement can avoid the situation where the genetic sequence of the new digital assets generated by each blockchain node is inconsistent due to the different random numbers generated, and can effectively ensure the uniqueness of the genetic sequence of the new digital assets generated.
  • the blockchain node when the blockchain node detects a digital asset synthesis transaction, it can perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, so as to This generates the initial progeny gene sequence.
  • the initial offspring gene sequence is used as the gene sequence of the new digital asset; when it is determined that the initial offspring gene sequence exists on the blockchain, the initial offspring gene sequence can be used as Based on the set gene replacement method, and based on the unused random gene sequence, the i-th gene replacement is performed on the initial offspring gene sequence to generate an ordered offspring candidate set belonging to the i-th gene replacement, which can effectively Determine whether a certain candidate gene sequence in the ordered descendant candidate set does not exist on the blockchain.
  • the i+1th gene replacement can be performed on the initial offspring gene sequence based on the unused random gene sequence until the initial After the n-1 gene replacement of the offspring gene sequence, the gene sequence of the new digital asset generated for the k digital assets to be synthesized can be determined.
  • this scheme can generate the gene sequence of a new digital asset within a certain search space, and judge the candidate genes in the ordered descendant candidate set based on the ordered descendant candidate set generated by a certain gene replacement. Whether the sequence exists on the blockchain, this can effectively avoid the problem of conflicts between the currently generated gene sequence and the previously generated gene sequence, thus effectively ensuring that the user response time will not time out.
  • this solution enables each blockchain node to perform gene replacement for the initial offspring gene sequence according to the same replacement method, so it can effectively Ensure that the execution results of the genetic sequences of the new digital assets generated on different blockchain nodes are consistent. This can solve the problem of existing genetic algorithms caused by different random numbers generated by each blockchain node in the existing technology. Problems that cannot be applied to the blockchain.
  • Figure 3 exemplarily shows a blockchain-based digital asset synthesis device provided by an embodiment of the present invention.
  • the device can execute the process of the blockchain-based digital asset synthesis method.
  • the blockchain-based digital asset synthesis method in the embodiment of the present invention is suitable for a blockchain network with m blockchain nodes; the blockchain-based digital asset synthesis device may be a service device or may be a capable
  • the components (such as chips or integrated circuits) that support the service device to implement the functions required by the method may of course also be other electronic devices with the functions required to implement the method.
  • m is an integer greater than 1.
  • the device includes:
  • the generation unit 301 is used for any blockchain node, when a digital asset synthesis transaction is detected, to perform an XOR operation on the gene sequences of k digital assets to be synthesized in the digital asset synthesis transaction, and generate an initial sub- generation gene sequence; the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized Both the existing gene sequence and the unused random gene sequence include n genes;
  • the processing unit 302 is configured to, when it is determined that the initial offspring gene sequence exists on the blockchain, perform a genetic modification on the initial offspring gene sequence based on the unused random gene sequence according to the set gene replacement method.
  • the i-th gene replacement generates an ordered set of offspring candidates belonging to the i-th gene replacement; the ordered set of offspring candidates belonging to the i-th gene replacement includes j candidate gene sequences; if the j candidates are determined If all gene sequences exist in the blockchain, then based on the unused random gene sequence, the i+1th gene replacement is performed on the initial offspring gene sequence until the initial offspring gene sequence is Until the n-1th gene replacement is performed, the gene sequence of the new digital asset generated for the k digital assets to be synthesized is determined.
  • processing unit 302 is specifically used to:
  • the i genes in the unused random gene sequence are exchanged with the i genes at corresponding positions in the initial offspring gene sequence, thereby generating an ordered offspring candidate set belonging to the i-th gene replacement.
  • processing unit 302 is also used to:
  • the candidate gene sequence is determined to be the gene sequence possessed by the new digital asset.
  • processing unit 302 is also used to:
  • the n-1th gene replacement is performed on the initial progeny gene sequence, if it is determined that the n-1th gene replacement generated on the initial progeny gene sequence belongs to the n-1th gene replacement. If the p candidate gene sequences included in the descendant candidate set all exist in the blockchain, then the unused random gene sequence is determined to be the gene sequence of the new digital asset.
  • processing unit 302 is specifically used to:
  • each gene position sequence number combination includes at least one value set with an operation sequence
  • the i genes in the unused random gene sequence and through at least one gene position number combination, the i genes at the corresponding positions in the initial offspring gene sequence are replaced, thereby generating the i-th gene An ordered set of descendant candidates for replacement.
  • processing unit 302 is specifically used to:
  • the n initial gene position numbers and the n are sequentially subjected to a remainder operation, thereby determining n first gene position numbers with the order of operation; the n The first gene position numbers with the order of operations are used to form the first gene position number combination; the n first gene position numbers with the order of operations are used to assist gene replacement;
  • the processing unit 302 is specifically used to:
  • the genes corresponding to the n first gene position numbers in the initial offspring gene sequence are sequentially replaced with The n first gene position numbers correspond to genes in the unused random gene sequence, thereby generating an ordered set of offspring candidates belonging to the i-th gene replacement.
  • processing unit 302 is specifically used to:
  • the processing unit 302 is specifically used to:
  • the sequence corresponding to at least one gene position sequence number included in the second gene position sequence number combination in the initial offspring gene sequence is The gene is replaced with a gene corresponding to the position number of the at least one gene in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
  • processing unit 302 is also used to:
  • the usage status of the gene sequence of the new digital asset is marked as used, and the gene sequence is marked as used.
  • the genetic sequence of the new digital asset is uploaded to the blockchain for storage.
  • an embodiment of the present invention also provides a computing device, as shown in Figure 4, including at least one processor 401 and a memory 402 connected to the at least one processor.
  • the processing is not limited in the embodiment of the present invention.
  • the specific connection medium between the processor 401 and the memory 402 is as follows.
  • the processor 401 and the memory 402 are connected through a bus as an example.
  • the bus can be divided into address bus, data bus, control bus, etc.
  • the memory 402 stores instructions that can be executed by at least one processor 401. By executing the instructions stored in the memory 402, at least one processor 401 can execute the aforementioned blockchain-based digital asset synthesis method. steps included.
  • the processor 401 is the control center of the computing device. It can use various interfaces and lines to connect various parts of the computing device, and implement data by running or executing instructions stored in the memory 402 and calling data stored in the memory 402. deal with.
  • the processor 401 may include one or more processing units.
  • the processor 401 may integrate an application processor and a modem processor.
  • the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor
  • the debugging processor mainly handles issuing instructions. It can be understood that the above modem processor may not be integrated into the processor 401.
  • the processor 401 and the memory 402 can be implemented on the same chip, and in some embodiments, they can also be implemented on separate chips.
  • the processor 401 may be a general processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps and logical block diagrams disclosed in the embodiments of the present invention.
  • a general-purpose processor may be a microprocessor or any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the blockchain-based digital asset synthesis method can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the memory 402 can be used to store non-volatile software programs, non-volatile computer executable programs and modules.
  • the memory 402 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Memory, Disk , CD, etc.
  • Memory 402 is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
  • the memory 402 in the embodiment of the present invention can also be a circuit or any other device capable of realizing a storage function, used to store program instructions and/or data.
  • embodiments of the present invention also provide a computer-readable storage medium that stores a computer program that can be executed by a computing device.
  • the computing device causes the computing device to Execute the steps of the blockchain-based digital asset synthesis method described above.
  • embodiments of the present invention may be provided as methods, systems, or computer program products.
  • the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
  • the invention 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, etc.) having computer-usable program code embodied therein.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Abstract

A blockchain-based digital asset synthesis method and apparatus. The method comprises: any blockchain node, when detecting a digital asset synthesis transaction, performing an XOR operation on gene sequences of k digital assets to be synthesized, generating an initial filial-generation gene sequence (201); when it is determined that the initial filial-generation gene sequence exists on the blockchain, on the basis of an unused random gene sequence, performing ith gene replacement on the initial filial-generation gene sequence, generating an ordered filial-generation candidate set belonging to the ith gene replacement (202); if it is determined that j candidate gene sequences are all present in the blockchain, then performing ith+1 gene replacement on the initial filial-generation gene sequence and continuing until nth-1 gene replacement is performed on the initial filial-generation gene sequence, thereby determining the gene sequence of the new digital asset (203). It is thus possible to effectively ensure that execution results on different blockchain nodes are consistent for gene sequences of newly generated digital assets.

Description

一种基于区块链的数字资产合成方法及装置A blockchain-based digital asset synthesis method and device
相关申请的交叉引用Cross-references to related applications
本申请要求在2022年06月29日提交中国专利局、申请号为202210762540.8、申请名称为“一种基于区块链的数字资产合成方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of a Chinese patent application submitted to the China Patent Office on June 29, 2022, with the application number 202210762540.8 and the application name "A blockchain-based digital asset synthesis method and device", and its entire content has been approved This reference is incorporated into this application.
技术领域Technical field
本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种基于区块链的数字资产合成方法及装置。Embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a blockchain-based digital asset synthesis method and device.
背景技术Background technique
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,但由于金融行业的安全性、实时性要求,也对技术提出的更高的要求。With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually transforming into financial technology. However, due to the security and real-time requirements of the financial industry, it also places higher requirements on technology.
数字资产是使用区块链技术生成的唯一数字凭证,对应特定的作品、艺术品,保护其数字版权的基础上,实现真实可信的数字化发行、购买、收藏和使用。其中,数字资产品类丰富,包括但不限于数字图片、音乐、视频、3D模型、电子票证、数字纪念品等各种形式。基于此,针对某一类型的数字资产,为了能够及时有效地衍生出新的该类型的数字资产,可以通过从区块链上选取一个或两个现有的该类型的数字资产进行合成,那么,如果想要合成新的该类型的数字资产,则需要通过借助遗传算法来实现。Digital assets are unique digital certificates generated using blockchain technology, corresponding to specific works and artworks. On the basis of protecting their digital copyrights, they can realize authentic and credible digital issuance, purchase, collection and use. Among them, there are various types of digital assets, including but not limited to digital pictures, music, videos, 3D models, electronic tickets, digital souvenirs and other forms. Based on this, for a certain type of digital assets, in order to derive new digital assets of this type in a timely and effective manner, one or two existing digital assets of this type can be selected from the blockchain for synthesis, then , if you want to synthesize new digital assets of this type, you need to use genetic algorithms to achieve it.
但是,现有遗传算法在产生新的子代种群时需要借助于随机数,而在区块链上由于需要各个区块链节点执行结果一致,所以无法使用随机数(因为每个区块链节点是独立的,所产生的随机数是不同的),导致现有遗传算法无法应用在区块链上。However, existing genetic algorithms need to rely on random numbers when generating new offspring populations. On the blockchain, since the execution results of each blockchain node are required to be consistent, random numbers cannot be used (because each blockchain node are independent, and the random numbers generated are different), resulting in the existing genetic algorithm being unable to be applied to the blockchain.
综上,目前亟需一种基于区块链的数字资产合成方法,用以有效地确保在不同区块链节点上针对生成的新数字资产具有的基因序列的执行结果是一致的,以此可以解决现有技术中因各区块链节点产生的随机数不相同而导致现有遗传算法无法应用在区块链上的问题。In summary, there is an urgent need for a blockchain-based digital asset synthesis method to effectively ensure that the execution results of the genetic sequences of the new digital assets generated on different blockchain nodes are consistent, so that Solve the problem in the existing technology that the existing genetic algorithm cannot be applied to the blockchain due to the different random numbers generated by each blockchain node.
发明内容Contents of the invention
本发明实施例提供了一种基于区块链的数字资产合成方法及装置,用以有效地确保在不同区块链节点上针对生成的新数字资产具有的基因序列的执行结果是一致的,以此可以解决现有技术中因各区块链节点产生的随机数不相同而导致现有遗传算法无法应用在区块链上的问题。Embodiments of the present invention provide a blockchain-based digital asset synthesis method and device to effectively ensure that the execution results of the gene sequences of new digital assets generated on different blockchain nodes are consistent, so as to This can solve the problem in the existing technology that the existing genetic algorithm cannot be applied to the blockchain due to the different random numbers generated by each blockchain node.
第一方面,本发明实施例提供了一种基于区块链的数字资产合成方法,适用于具有m个区块链节点的区块链网络,所述方法包括:In a first aspect, embodiments of the present invention provide a blockchain-based digital asset synthesis method, which is suitable for a blockchain network with m blockchain nodes. The method includes:
针对任一区块链节点,所述区块链节点在检测到数字资产合成交易时,对所述数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,生成初始子代基因序 列;所述数字资产合成交易是客户端基于k个待合成的数字资产具有的基因序列以及所述客户端生成的一个未被使用的随机基因序列确定的;每个待合成的数字资产具有的基因序列以及所述未被使用的随机基因序列中均包括n个基因;For any blockchain node, when the blockchain node detects a digital asset synthesis transaction, it performs an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction to generate an initial sub- generation gene sequence; the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized Both the existing gene sequence and the unused random gene sequence include n genes;
所述区块链节点在确定区块链上存在所述初始子代基因序列时,按照设定的基因替换方式,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集;所述属于第i次基因替换的有序子代候选集包括j个候选基因序列;When the blockchain node determines that the initial progeny gene sequence exists on the blockchain, it will perform the initial progeny gene sequence on the set gene replacement method based on the unused random gene sequence. The i-th gene replacement generates an ordered progeny candidate set belonging to the i-th gene replacement; the ordered progeny candidate set belonging to the i-th gene replacement includes j candidate gene sequences;
所述区块链节点若确定所述j个候选基因序列均存在于所述区块链中,则基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i+1次基因替换,直至对所述初始子代基因序列进行第n-1次基因替换后为止,从而确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列。If the blockchain node determines that the j candidate gene sequences all exist in the blockchain, then based on the unused random gene sequence, the i+1th process is performed on the initial offspring gene sequence. times of gene replacement until the n-1th gene replacement is performed on the initial offspring gene sequence, thereby determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized.
上述技术方案中,本发明中的技术方案通过客户端为各区块链节点生成相同的未被使用的随机基因序列,即可使得各区块链节点能够按照同一替换方式针对初始子代基因序列进行基因替换,从而可以避免出现因产生的随机数不同导致各区块链节点生成的新数字资产具有的基因序列不一致的情况,并可以有效地确保所生成的新数字资产具有的基因序列的唯一性。具体来说,针对任一区块链节点,区块链节点在检测到数字资产合成交易时,即可对数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,以此生成初始子代基因序列。然后,在确定区块链上不存在初始子代基因序列时,将该初始子代基因序列作为新数字资产具有的基因序列;在确定区块链上存在初始子代基因序列时,即可按照设定的基因替换方式,并基于未被使用的随机基因序列,对初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集,以此可以有效地判断有序子代候选集是否有某一候选基因序列不存在于区块链上。如果判断有序子代候选集中的各候选基因序列均存在于区块链上,那么可以基于未被使用的随机基因序列,对初始子代基因序列进行第i+1次基因替换,直至对初始子代基因序列进行第n-1次基因替换后为止,从而可以确定出针对k个待合成的数字资产所生成的新数字资产具有的基因序列。如此,该方案由于能够满足在有确定的搜索空间内产生新数字资产具有的基因序列,且针对某一次基因替换所生成的有序子代候选集进行判断该有序子代候选集中的候选基因序列是否存在于区块链上,因此可以有效地避免出现当前生成的基因序列与之前生成的基因序列存在冲突的问题,以此可以有效地确保用户响应时间不会超时。此外,该方案由于通过客户端为各区块链节点生成相同的未被使用的随机基因序列,即可使得各区块链节点能够按照同一替换方式针对初始子代基因序列进行基因替换,因此可以有效地确保在不同区块链节点上针对生成的新数字资产具有的基因序列的执行结果是一致的,以此可以解决现有技术中因各区块链节点产生的随机数不相同而导致现有遗传算法无法应用在区块链上的问题。Among the above technical solutions, the technical solution in the present invention generates the same unused random gene sequence for each blockchain node through the client, so that each blockchain node can perform genetic modification on the initial offspring gene sequence according to the same replacement method. Replacement can avoid the situation where the genetic sequence of the new digital assets generated by each blockchain node is inconsistent due to the different random numbers generated, and can effectively ensure the uniqueness of the genetic sequence of the new digital assets generated. Specifically, for any blockchain node, when the blockchain node detects a digital asset synthesis transaction, it can perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, so as to This generates the initial progeny gene sequence. Then, when it is determined that the initial offspring gene sequence does not exist on the blockchain, the initial offspring gene sequence is used as the gene sequence of the new digital asset; when it is determined that the initial offspring gene sequence exists on the blockchain, the initial offspring gene sequence can be used as Based on the set gene replacement method, and based on the unused random gene sequence, the i-th gene replacement is performed on the initial offspring gene sequence to generate an ordered offspring candidate set belonging to the i-th gene replacement, which can effectively Determine whether a certain candidate gene sequence in the ordered descendant candidate set does not exist on the blockchain. If it is determined that each candidate gene sequence in the ordered offspring candidate set exists on the blockchain, then the i+1th gene replacement can be performed on the initial offspring gene sequence based on the unused random gene sequence until the initial After the n-1 gene replacement of the offspring gene sequence, the gene sequence of the new digital asset generated for the k digital assets to be synthesized can be determined. In this way, this scheme can generate the gene sequence of a new digital asset within a certain search space, and judge the candidate genes in the ordered descendant candidate set based on the ordered descendant candidate set generated by a certain gene replacement. Whether the sequence exists on the blockchain, this can effectively avoid the problem of conflicts between the currently generated gene sequence and the previously generated gene sequence, thus effectively ensuring that the user response time will not time out. In addition, because the client generates the same unused random gene sequence for each blockchain node, this solution enables each blockchain node to perform gene replacement for the initial offspring gene sequence according to the same replacement method, so it can effectively Ensure that the execution results of the genetic sequences of the new digital assets generated on different blockchain nodes are consistent. This can solve the problem of existing genetic algorithms caused by different random numbers generated by each blockchain node in the existing technology. Problems that cannot be applied to the blockchain.
可选地,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集,包括:Optionally, based on the unused random gene sequence, perform the i-th gene replacement on the initial progeny gene sequence to generate an ordered progeny candidate set belonging to the i-th gene replacement, including:
所述区块链节点从所述未被使用的随机基因序列中选取i个基因作为所述初始子代基因序列的替换基因;The blockchain node selects i genes from the unused random gene sequences as replacement genes for the initial offspring gene sequence;
所述区块链节点将所述未被使用的随机基因序列中的i个基因与所述初始子代基因序列中对应位置的i个基因进行互换,从而生成属于第i次基因替换的有序子代候选集。The blockchain node exchanges the i genes in the unused random gene sequence with the i genes at the corresponding positions in the initial offspring gene sequence, thereby generating the i genes belonging to the i-th gene replacement. The set of sequential descendant candidates.
上述技术方案中,由于未被使用的随机基因序列并不存在于区块链上,因此通过利用 未被使用的随机基因序列中的多个位置的基因去替换初始子代基因序列中对应位置的多个基因即可最大可能地得到不存在于区块链上的基因序列,也即是可以得到新数字资产具有的基因序列,那么也就可以有效地确保所生成的新数字资产具有的基因序列的唯一性,同时可以使得合成的新数字资产能够最大程度地继承父代属性,也即是要求合成的新数字资产继承其父代属性的概率大于随机生成,以便保留父辈基因中的稀缺特性。In the above technical solution, since the unused random gene sequence does not exist on the blockchain, the genes at multiple positions in the unused random gene sequence are used to replace the corresponding positions in the initial offspring gene sequence. Multiple genes can obtain the gene sequence that does not exist on the blockchain to the greatest extent possible, that is, the gene sequence of the new digital asset can be obtained, and then the gene sequence of the generated new digital asset can be effectively ensured. The uniqueness of the new digital asset can also enable the synthesized new digital asset to inherit the attributes of the parent to the greatest extent, that is, the probability of the synthesized new digital asset inheriting the attributes of the parent is greater than random generation, so as to retain the scarce characteristics of the parent's genes.
可选地,还包括:Optionally, also includes:
所述区块链节点若确定所述j个候选基因序列中任一候选基因序列不存在于所述区块链中,则将所述候选基因序列确定为所述新数字资产具有的基因序列。If the blockchain node determines that any candidate gene sequence among the j candidate gene sequences does not exist in the blockchain, it will determine the candidate gene sequence as the gene sequence of the new digital asset.
上述技术方案中,在判断替换后所生成的有序子代候选集中存在一个候选基因序列不存在于区块链上时,即可将该候选基因序列作为新数字资产具有的基因序列,从而可以有效地确保所生成的新数字资产具有的基因序列的唯一性,以此可以有效地避免子代与子代之间产生冲突的可能性,并可以实现将多个父辈具有的基因序列进行异或运算产生新子代具有的基因序列的目的。In the above technical solution, when it is determined that a candidate gene sequence in the ordered descendant candidate set generated after replacement does not exist on the blockchain, the candidate gene sequence can be used as the gene sequence of the new digital asset, so that it can Effectively ensure the uniqueness of the gene sequence of the new digital assets generated, which can effectively avoid the possibility of conflicts between offspring and offspring, and can realize the XOR of the gene sequences of multiple parents. The purpose of the operation is to generate a new offspring with a genetic sequence.
可选地,在对所述初始子代基因序列进行第n-1次基因替换之后,还包括:Optionally, after performing the n-1th gene replacement on the initial progeny gene sequence, it also includes:
所述区块链节点若确定针对所述初始子代基因序列进行第n-1次基因替换所生成的属于第n-1次基因替换的有序子代候选集中包括的p个候选基因序列均存在于所述区块链中,则将所述未被使用的随机基因序列确定为所述新数字资产具有的基因序列。If the blockchain node determines that the p candidate gene sequences included in the ordered offspring candidate set belonging to the n-1th gene replacement generated by performing the n-1th gene replacement on the initial offspring gene sequence are all exists in the blockchain, the unused random gene sequence is determined as the gene sequence of the new digital asset.
上述技术方案中,为了避免用户请求产生新子代具有的基因序列的响应时长过长,也即是为了有效地确保用户请求产生新子代具有的基因序列的响应时间不超时,因此会保证在有确定的搜索空间内产生新数字资产具有的基因序列,那么在针对初始子代基因序列进行第n-1次基因替换之后,如果还是未找到不存在于区块链上的候选基因序列,则就会直接将未被使用的随机基因序列作为新数字资产具有的基因序列,因为未被使用的随机基因序列是不存在于区块链上的,以此生成新的数字资产具有的基因序列,从而可以有效地确保所生成的新数字资产具有的基因序列的唯一性。In the above technical solution, in order to avoid the response time of the user's request to generate the gene sequence of the new offspring being too long, that is, to effectively ensure that the response time of the user's request to generate the gene sequence of the new offspring does not time out, it will be ensured that in There is a certain search space to generate the gene sequence of a new digital asset, then after the n-1th gene replacement of the initial offspring gene sequence, if a candidate gene sequence that does not exist on the blockchain is still not found, then The unused random gene sequence will be directly used as the gene sequence of the new digital asset, because the unused random gene sequence does not exist on the blockchain, thereby generating the gene sequence of the new digital asset. This can effectively ensure the uniqueness of the genetic sequence of the new digital assets generated.
可选地,所述区块链节点将所述未被使用的随机基因序列中的i个基因与所述初始子代基因序列中对应位置的i个基因进行互换,从而生成属于第i次基因替换的有序子代候选集,包括:Optionally, the blockchain node exchanges i genes in the unused random gene sequence with i genes at corresponding positions in the initial offspring gene sequence, thereby generating the i-th An ordered set of progeny candidates for gene replacement, including:
所述区块链节点基于所述未被使用的随机基因序列以及所述n,确定至少一个用于基因替换的基因位置序号组合;每个基因位置序号组合包括至少一个具有运算先后次序的取值集合;The blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and the n; each gene position sequence number combination includes at least one value with an operation sequence. gather;
所述区块链节点根据所述未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对所述初始子代基因序列中对应位置的i个基因进行替换,从而生成属于第i次基因替换的有序子代候选集。The blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement.
上述技术方案中,通过基于未被使用的随机基因序列以及数字资产所具有的总基因个数n,即可进行相应地运算,生成至少一个用于基因替换的基因位置序号组合,从而可以通过至少一个基因位置序号组合,将初始子代基因序列中的多个基因替换为未被使用的随机基因序列中对应位置的多个基因,从而可以实现针对初始子代基因序列的有效替换,以此为后续有效生成新数字资产具有的基因序列提供支持。In the above technical solution, based on the unused random gene sequence and the total number of genes n owned by the digital asset, corresponding calculations can be performed to generate at least one gene position sequence number combination for gene replacement, so that at least one gene position number combination can be generated. A gene position sequence number combination replaces multiple genes in the initial progeny gene sequence with multiple genes at corresponding positions in the unused random gene sequence, so that effective replacement of the initial progeny gene sequence can be achieved. Provide support for subsequent effective generation of genetic sequences for new digital assets.
可选地,所述区块链节点基于所述未被使用的随机基因序列以及所述n,确定至少一个用于基因替换的基因位置序号组合,包括:Optionally, the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n, including:
若所述i的取值为1,则所述区块链节点将所述未被使用的随机基因序列与所述n进行取余运算,确定第一数值;If the value of i is 1, then the blockchain node performs a remainder operation on the unused random gene sequence and n to determine the first value;
所述区块链节点基于所述第一数值以及所述n,确定n个具有运算先后次序的初始基因位置序号;The blockchain node determines n initial gene position numbers with operational order based on the first value and n;
所述区块链节点按照所述n个初始基因位置序号的运算先后次序,依次将n个初始基因位置序号与所述n进行取余运算,从而确定n个具有运算先后次序的第一基因位置序号;所述n个具有运算先后次序的第一基因位置序号用于构成第一基因位置序号组合;所述n个具有运算先后次序的第一基因位置序号用于辅助基因替换;The blockchain node performs a remainder operation on the n initial gene position numbers and n in sequence according to the order of operations of the n initial gene position numbers, thereby determining the n first gene positions in the order of operations. Serial number; the n first gene position serial numbers with operational order are used to form a first gene position serial number combination; the n first gene position serial numbers with operational order are used to assist gene replacement;
所述区块链节点根据所述未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对所述初始子代基因序列中对应位置的i个基因进行替换,从而生成属于第i次基因替换的有序子代候选集,包括:The blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement, including:
所述区块链节点按照所述第一基因位置序号组合中包括的n个第一基因位置序号具有的运算先后次序,依次将该n个第一基因位置序号在所述初始子代基因序列中对应的基因替换为该n个第一基因位置序号在所述未被使用的随机基因序列中对应的基因,从而生成属于第i次基因替换的有序子代候选集。The blockchain node sequentially adds the n first gene position numbers in the initial offspring gene sequence according to the order of operation of the n first gene position numbers included in the first gene position number combination. The corresponding genes are replaced with genes corresponding to the n first gene position numbers in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
上述技术方案中,在针对初始子代基因序列进行一次基因替换时,可以通过未被使用的随机基因序列与n的取余运算可以产生一个有序序列(即具有一定运算先后次序的第一数值),并基于这个有序序列即可产生具有一定确定性的多个候选新子代基因序列,如此,即可从多个候选新子代基因序列中最大可能地确定出一个具有唯一性的新数字资产具有的基因序列,从而可以使得每个区块链节点都能够产生同样的基因序列,并且可以按照同样的顺序进行判断多个候选新子代基因序列中是否存在一个候选新子代基因序列不存在于区块链上。In the above technical solution, when performing a gene replacement for the initial offspring gene sequence, an ordered sequence (i.e., the first numerical value with a certain order of operations) can be generated through the remainder operation of the unused random gene sequence and n. ), and based on this ordered sequence, multiple candidate new progeny gene sequences can be generated with a certain degree of certainty. In this way, a unique new progeny gene sequence can be determined to the greatest possible extent from multiple candidate new progeny gene sequences. Digital assets have gene sequences that enable each blockchain node to generate the same gene sequence and determine whether there is a candidate new child gene sequence among multiple candidate new child gene sequences in the same order. Does not exist on the blockchain.
可选地,所述区块链节点基于所述未被使用的随机基因序列以及所述n,确定至少一个用于基因替换的基因位置序号组合,包括:Optionally, the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n, including:
若所述i的取值大于等于2,所述区块链节点基于第1次基因替换对应的n个具有运算先后次序的第一基因位置序号,确定除第1次基因替换对应的一个基因之外的其它i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号;If the value of i is greater than or equal to 2, the blockchain node determines, based on the n first gene position numbers with operational order corresponding to the first gene replacement, except one gene corresponding to the first gene replacement. The other i-1 genes each correspond to the q second gene position numbers in the order of operation;
所述区块链节点根据所述n个具有运算先后次序的第一基因位置序号以及所述i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号,确定多个用于基因替换的第二基因位置序号组合;The blockchain node determines a plurality of genes for use based on the n first gene position numbers with operational order and the q second gene position numbers with operational order corresponding to each of the i-1 genes. The second gene position sequence number combination of gene replacement;
所述区块链节点根据所述未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对所述初始子代基因序列中对应位置的i个基因进行替换,从而生成属于第i次基因替换的有序子代候选集,包括:The blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement, including:
针对每个第二基因位置序号组合,若所述第二基因位置序号组合中存在至少一个取值集合为空集,则所述区块链节点不针对所述初始子代基因序列进行基因替换;For each second gene position sequence number combination, if at least one value set in the second gene position sequence number combination is an empty set, the blockchain node does not perform gene replacement for the initial offspring gene sequence;
若所述第二基因位置序号组合中不存在任何一个取值集合为空集,则所述区块链节点依次将所述初始子代基因序列中所述第二基因位置序号组合包括的至少一个基因位置序号对应的基因替换为所述未被使用的随机基因序列中所述至少一个基因位置序号对应的基因,从而生成属于第i次基因替换的有序子代候选集。If there is no value set in the second gene position sequence number combination that is an empty set, the blockchain node will sequentially add at least one value set included in the second gene position sequence number combination in the initial offspring gene sequence. The gene corresponding to the gene position number is replaced with the gene corresponding to at least one gene position number in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
上述技术方案中,在针对初始子代基因序列进行多次基因替换时,就会很大可能产生 更多的候选新子代基因序列,使得新子代可能具有的基因序列变多,可选择性也变多,那么就会有很大可能从更多的候选新子代基因序列中确定出一个具有唯一性的新数字资产具有的基因序列,从而就会很大可能在有确定的搜索空间内产生出新数字资产具有的基因序列,因此可以使得每个区块链节点都要遍历所有可以产生的子代,并且可以确保每个区块链节点的遍历顺序一致,以此可以有效地确保合成出来的子代具有的基因序列也是一致的。In the above technical solution, when multiple gene replacements are performed on the initial progeny gene sequence, it is very likely that more candidate new progeny gene sequences will be generated, so that the new progeny may have more gene sequences and be selective. also increases, then it will be very likely to determine the gene sequence of a unique new digital asset from more candidate new offspring gene sequences, so it will be very likely to be within a certain search space. Generate the genetic sequence of a new digital asset, so each blockchain node can traverse all the descendants that can be generated, and ensure that the traversal order of each blockchain node is consistent, thus effectively ensuring synthesis The offspring that come out have the same genetic sequence.
可选地,在确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列之后,还包括:Optionally, after determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized, it also includes:
将所述新数字资产具有的基因序列的使用状态标记为已使用,并将标记为已使用的所述新数字资产具有的基因序列上传至所述区块链进行保存。Mark the usage status of the gene sequence of the new digital asset as used, and upload the gene sequence of the new digital asset marked as used to the blockchain for storage.
上述技术方案中,为了有效避免后续生成的子代与之前生成的子代之间产生冲突的可能性,并为了有效地确保所生成的新数字资产具有的基因序列的唯一性,因此在生成新数字资产具有的基因序列后,会将新数字资产具有的基因序列的使用状态标记为已使用,并会将标记为已使用的新数字资产具有的基因序列上传至区块链,以便后续在生成新子代具有的基因序列后及时准确地通过区块链判断区块链上是否存在该生成的新子代具有的基因序列。In the above technical solution, in order to effectively avoid the possibility of conflicts between subsequently generated offspring and previously generated offspring, and in order to effectively ensure the uniqueness of the genetic sequence of the generated new digital assets, it is necessary to generate new After the genetic sequence of the digital asset is obtained, the usage status of the genetic sequence of the new digital asset will be marked as used, and the genetic sequence of the new digital asset marked as used will be uploaded to the blockchain for subsequent generation. After the gene sequence of the new offspring is determined in a timely and accurate manner through the blockchain, whether the gene sequence of the generated new offspring exists on the blockchain.
第二方面,本发明实施例还提供了一种基于区块链的数字资产合成装置,适用于具有m个区块链节点的区块链网络,所述装置包括:In a second aspect, embodiments of the present invention also provide a blockchain-based digital asset synthesis device, which is suitable for a blockchain network with m blockchain nodes. The device includes:
生成单元,用于针对任一区块链节点,在检测到数字资产合成交易时,对所述数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,生成初始子代基因序列;所述数字资产合成交易是客户端基于k个待合成的数字资产具有的基因序列以及所述客户端生成的一个未被使用的随机基因序列确定的;每个待合成的数字资产具有的基因序列以及所述未被使用的随机基因序列中均包括n个基因;The generation unit is used for any blockchain node, when a digital asset synthesis transaction is detected, to perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, and generate an initial offspring. Gene sequence; the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized has The gene sequence and the unused random gene sequence include n genes;
处理单元,用于在确定区块链上存在所述初始子代基因序列时,按照设定的基因替换方式,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集;所述属于第i次基因替换的有序子代候选集包括j个候选基因序列;若确定所述j个候选基因序列均存在于所述区块链中,则基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i+1次基因替换,直至对所述初始子代基因序列进行第n-1次基因替换后为止,从而确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列。A processing unit configured to perform a third process on the initial offspring gene sequence based on the unused random gene sequence according to the set gene replacement method when it is determined that the initial offspring gene sequence exists on the blockchain. The i-th gene replacement generates an ordered progeny candidate set belonging to the i-th gene replacement; the ordered progeny candidate set belonging to the i-th gene replacement includes j candidate gene sequences; if the j candidate genes are determined If the sequences all exist in the blockchain, then based on the unused random gene sequence, the i+1th gene replacement is performed on the initial offspring gene sequence until the initial offspring gene sequence is After the n-1th gene replacement, the gene sequence of the new digital asset generated for the k digital assets to be synthesized is determined.
第三方面,本发明实施例提供一种计算设备,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行上述第一方面任意所述的基于区块链的数字资产合成方法。In a third aspect, embodiments of the present invention provide a computing device, including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processing The server executes any of the blockchain-based digital asset synthesis methods described in the first aspect above.
第四方面,本发明实施例提供一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述第一方面任意所述的基于区块链的数字资产合成方法。In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium that stores a computer program that can be executed by a computing device. When the program is run on the computing device, the computing device executes the above-mentioned first step. The blockchain-based digital asset synthesis method described in any aspect.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的 附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings needed to describe the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. Those of ordinary skill in the art can also obtain other drawings based on these drawings without exerting creative efforts.
图1为本发明实施例提供的一种可能的系统架构示意图;Figure 1 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention;
图2为本发明实施例提供的一种基于区块链的数字资产合成方法的流程示意图;Figure 2 is a schematic flow chart of a blockchain-based digital asset synthesis method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种基于区块链的数字资产合成装置的结构示意图;Figure 3 is a schematic structural diagram of a blockchain-based digital asset synthesis device provided by an embodiment of the present invention;
图4为本发明实施例提供的一种计算设备的结构示意图。Figure 4 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
下面首先对本发明实施例中涉及的部分用语进行解释说明,以便于本领域技术人员进行理解。Some terms involved in the embodiments of the present invention are first explained below to facilitate understanding by those skilled in the art.
(1)区块链:区块链是一种由多个节点共同维护的及信任的分布式存储系统。区块链底层是由一系列区块组成的一条链,每个块上除了记录本块的数据还会记录上一块的哈希值,通过这种方式组成链式的数据结构。一个区块由块头和块体组成,其中块头定义包括该区块高度、上一个区块的哈希值等重要字段,而块体主要存储交易数据。区块链利用密码学的方式保证数据传输和访问的安全,并利用链式结构保证链上数据不可被篡改。(1) Blockchain: Blockchain is a distributed storage system that is jointly maintained and trusted by multiple nodes. The bottom layer of the blockchain is a chain composed of a series of blocks. In addition to recording the data of the current block, each block also records the hash value of the previous block. In this way, a chain-like data structure is formed. A block consists of a block header and a block body. The block header definition includes important fields such as the height of the block and the hash value of the previous block. The block body mainly stores transaction data. Blockchain uses cryptography to ensure the security of data transmission and access, and uses a chain structure to ensure that the data on the chain cannot be tampered with.
(2)节点:在区块链中,一个节点是指一个具有唯一身份的参与者,该节点具有一份完整的账本拷贝,具有参与区块链网络共识和维护账本的能力。(2) Node: In the blockchain, a node refers to a participant with a unique identity. This node has a complete copy of the ledger and has the ability to participate in the consensus of the blockchain network and maintain the ledger.
(3)智能合约:智能合约是运行在区块链系统之上的一份代码和数据的集合,其中代码负责实现智能合约的功能,数据负责存储智能合约状态,智能合约可以接收和发送信息。(3) Smart contract: A smart contract is a collection of code and data running on the blockchain system. The code is responsible for realizing the functions of the smart contract, the data is responsible for storing the status of the smart contract, and the smart contract can receive and send information.
(4)交易:在区块链中,任何操作(部署合约、调用合约接口等)都是通过发送交易的方式进行。交易由用户发起,并通过客户端发送至区块链节点。区块链节点在收到交易后,会将交易打包为区块并执行。(4) Transaction: In the blockchain, any operation (deploying a contract, calling a contract interface, etc.) is performed by sending a transaction. Transactions are initiated by users and sent to blockchain nodes through the client. After receiving the transaction, the blockchain node will package the transaction into a block and execute it.
(5)数字资产:区块链上具有唯一标识的非同质资产。(5) Digital assets: non-homogeneous assets with unique identifiers on the blockchain.
(6)遗传算法(Genetic Algorithm,GA):是模拟达尔文生物进化论的自然选择和遗传学机理的生物进化过程的计算模型,是一种通过模拟自然进化过程搜索最优解的方法。(6) Genetic Algorithm (GA): It is a computational model of the biological evolution process that simulates the natural selection and genetic mechanisms of Darwin's biological evolution theory. It is a method of searching for optimal solutions by simulating the natural evolution process.
如上介绍了本发明实施例中涉及的部分用语,下面对本发明实施例涉及的技术特征进行介绍。As mentioned above, some terms involved in the embodiments of the present invention are introduced, and the technical features involved in the embodiments of the present invention are introduced below.
为了便于理解本发明实施例,首先以图1中示出的一种可能的系统架构为例说明适用于本发明实施例的基于区块链的数字资产合成系统架构。如图1所示,该系统架构可以包括客户端100和区块链网络200。其中,区块链网络200可以包括至少一个区块链节点,比如区块链节点201、区块链节点202、区块链节点203和区块链节点204等,至少一个节点中任意两个区块链节点可以通信连接;客户端100与区块链网络200中的任一区块链节点可以通过有线方式进行通信连接,或者可以通过无线方式进行通信连接,本发明实施 例对此并不作限定。In order to facilitate understanding of the embodiments of the present invention, first, a possible system architecture shown in Figure 1 is taken as an example to illustrate the blockchain-based digital asset synthesis system architecture applicable to the embodiments of the present invention. As shown in Figure 1, the system architecture may include a client 100 and a blockchain network 200. Among them, the blockchain network 200 may include at least one blockchain node, such as blockchain node 201, blockchain node 202, blockchain node 203, blockchain node 204, etc., and any two zones in at least one node Blockchain nodes can be communicated and connected; the client 100 and any blockchain node in the blockchain network 200 can be communicated and connected through wired means, or can be communicated and connected through wireless means, which is not limited in the embodiment of the present invention. .
示例性地,客户端存在有通过多个父代数字资产合成新的数字资产的需求时,会生成一个未被使用的随机基因序列,该未被使用的随机基因序列以及每个父代数字资产都有相同数量的基因,并基于未被使用的随机基因序列以及多个父代数字资产,生成一个数字资产合成交易,然后,向区块链网络200中的任一区块链节点(比如区块链节点201)提交该数字资产合成交易,或者可以向区块链网络200中的各节点提交该数字资产合成交易。以区块链网络200中的任一区块链节点(比如节点区块链201)提交该数字资产合成交易为例,区块链节点201在接收到该数字资产合成交易后,即会向区块链网络200中的其它区块链节点同步该数字资产合成交易,每个区块链节点都会将该数字资产合成交易存储至自己的交易池中。然后,出块节点会将该数字资产合成交易打包为区块,并发起针对该区块的共识流程,比如采用拜占庭容错算法或工作量证明共识算法等,并在该区块共识成功后,将该区块进行上链。其中,每个区块链节点会按照相同的数字资产合成交易执行规则进行执行该区块中的数字资产合成交易,然后,判断各区块链节点针对数字资产合成交易的执行结果是否一致,或者达成一致的数量是否满足第一设定数量阈值(比如三分之二数量的区块链节点的执行结果一致)时,即可认可该执行结果。最后,即可确认某一基因序列作为新数字资产具有的基因序列,并可以将该基因序列的使用状态标记为已使用,同时将标记为已使用的该基因序列上传至区块链。For example, when the client needs to synthesize new digital assets from multiple parent digital assets, an unused random gene sequence will be generated, and the unused random gene sequence and each parent digital asset will be generated. All have the same number of genes, and based on the unused random gene sequence and multiple parent digital assets, a digital asset synthesis transaction is generated, and then, to any blockchain node in the blockchain network 200 (such as the district The blockchain node 201) submits the digital asset synthesis transaction, or may submit the digital asset synthesis transaction to each node in the blockchain network 200. Taking any blockchain node (such as node blockchain 201) in the blockchain network 200 to submit the digital asset synthesis transaction as an example, after receiving the digital asset synthesis transaction, the blockchain node 201 will Other blockchain nodes in the blockchain network 200 synchronize the digital asset synthesis transaction, and each blockchain node stores the digital asset synthesis transaction in its own transaction pool. Then, the block-producing node will package the digital asset synthetic transaction into a block and initiate a consensus process for the block, such as using a Byzantine fault-tolerant algorithm or a proof-of-work consensus algorithm, etc., and after the block consensus is successful, The block is uploaded to the chain. Among them, each blockchain node will execute the digital asset synthesis transaction in the block according to the same digital asset synthesis transaction execution rules, and then determine whether the execution results of each blockchain node for the digital asset synthesis transaction are consistent or reach an agreement. When the consistent number meets the first set quantity threshold (for example, two-thirds of the blockchain nodes have consistent execution results), the execution result can be recognized. Finally, a certain gene sequence can be confirmed as a new digital asset, and the usage status of the gene sequence can be marked as used, and the gene sequence marked as used can be uploaded to the blockchain.
需要说明的是,上述图1所示的系统架构仅是一种示例,本发明实施例对此不做限定。It should be noted that the system architecture shown in FIG. 1 is only an example, and the embodiment of the present invention is not limited thereto.
基于上述描述,图2示例性的示出了本发明实施例提供的一种基于区块链的数字资产合成方法的流程,该流程可以由基于区块链的数字资产合成装置执行。其中,本发明实施例中的基于区块链的数字资产合成方法适用于具有m个区块链节点的区块链网络;基于区块链的数字资产合成装置可以是服务设备或者也可以是能够支持服务设备实现该方法所需的功能的部件(比如芯片或集成电路)等,当然也可以是其它具有实现该方法所需的功能的电子设备。其中,m为大于1的整数。Based on the above description, Figure 2 exemplarily shows the process of a blockchain-based digital asset synthesis method provided by an embodiment of the present invention. This process can be executed by a blockchain-based digital asset synthesis device. Among them, the blockchain-based digital asset synthesis method in the embodiment of the present invention is suitable for a blockchain network with m blockchain nodes; the blockchain-based digital asset synthesis device may be a service device or may be a capable The components (such as chips or integrated circuits) that support the service device to implement the functions required by the method may of course also be other electronic devices with the functions required to implement the method. Among them, m is an integer greater than 1.
如图2所示,该流程具体包括:As shown in Figure 2, the process specifically includes:
步骤201,针对任一区块链节点,所述区块链节点在检测到数字资产合成交易时,对所述数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,生成初始子代基因序列。 Step 201, for any blockchain node, when the blockchain node detects a digital asset synthesis transaction, it performs an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, Generate initial progeny gene sequences.
本发明实施例中,数字资产合成交易是客户端基于k个待合成的数字资产具有的基因序列以及客户端生成的一个未被使用的随机基因序列确定的;每个待合成的数字资产具有的基因序列以及未被使用的随机基因序列中均包括n个基因。其中,k为大于等于1的整数;n为大于等于1的整数。In the embodiment of the present invention, the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized has The gene sequence and the unused random gene sequence include n genes. Among them, k is an integer greater than or equal to 1; n is an integer greater than or equal to 1.
其中,在属于区块链网络内的某一用户具有合成新数字资产的需求时,该用户会基于该数字资产具有的基因属性,通过某一终端设备(比如智能手机、平板电脑、笔记本电脑、台式电脑等)上安装的客户端生成一个未被使用的随机基因序列,该未被使用的随机基因序列具有的基因数量与该数字资产具有的基因数量是相同的,如此,通过客户端生成的未被使用的随机基因序列,可以在区块链上存在异或运算产生的初始子代基因序列时,使得各区块链节点都基于该未被使用的随机基因序列最大可能地产生新数字资产具有的基因序列,从而可以避免区块链上无法使用随机数,同时可以确保区块链上各个区块链节点针对合成新数字资产的执行结果基本保持一致。然后,客户端基于未被使用的随机基因序列 以及k个待合成的数字资产具有的基因序列生成数字资产合成交易,并向区块链网络中任一区块链节点提交数字资产合成交易,或者可以向区块链网络中各区块链节点分别提交数字资产合成交易。或者,该用户可以通过在终端设备的客户端上基于未被使用的随机基因序列以及k个待合成的数字资产具有的基因序列生成数字资产合成请求,并通过该终端设备的客户端将该数字资产合成请求以交易的形式发送给区块链网络中的任一区块链节点,或者,将该数字资产合成请求以交易的形式分别发送给区块链网络中的各区块链节点。任一区块链节点在接收到数字资产合成交易后,即可针对数字资产合成交易进行相应地处理,比如可以针对数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,以此生成初始子代基因序列,或者也可以将数字资产合成交易存储至本地的交易池中,然后,区块链网络中某一区块链节点被确定为出块节点(也即是主节点),则该区块链节点会将本地的交易池中的数字资产合成交易打包为区块,并将该区块发送给区块链网络中除该区块链节点以外的其它区块链节点进行共识,在确定该区块共识成功后将该区块进行上链。也即是,在针对该区块进行共识的流程中,每个区块链节点都会执行该区块,也就是执行该区块中的数字资产合成交易,比如针对数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,以此生成初始子代基因序列。Among them, when a user within the blockchain network has the need to synthesize a new digital asset, the user will use a certain terminal device (such as a smartphone, tablet, laptop, etc.) based on the genetic attributes of the digital asset. The client installed on a desktop computer, etc.) generates an unused random gene sequence. The number of genes of the unused random gene sequence is the same as the number of genes of the digital asset. In this way, the number of genes generated by the client is Unused random gene sequences can be used when there is an initial descendant gene sequence generated by an XOR operation on the blockchain, so that each blockchain node can generate new digital assets based on the unused random gene sequence to the greatest extent possible. The genetic sequence can avoid the inability to use random numbers on the blockchain, and at the same time ensure that the execution results of each blockchain node on the blockchain for synthesizing new digital assets are basically consistent. Then, the client generates a digital asset synthesis transaction based on the unused random gene sequence and the gene sequences of k digital assets to be synthesized, and submits the digital asset synthesis transaction to any blockchain node in the blockchain network, or Digital asset synthesis transactions can be submitted to each blockchain node in the blockchain network. Alternatively, the user can generate a digital asset synthesis request on the client of the terminal device based on an unused random gene sequence and the gene sequences of k digital assets to be synthesized, and use the client of the terminal device to generate the digital asset synthesis request. The asset synthesis request is sent to any blockchain node in the blockchain network in the form of a transaction, or the digital asset synthesis request is sent to each blockchain node in the blockchain network in the form of a transaction. After receiving the digital asset synthesis transaction, any blockchain node can process the digital asset synthesis transaction accordingly. For example, it can perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction. , to generate the initial offspring gene sequence, or the digital asset synthetic transaction can be stored in the local transaction pool. Then, a certain blockchain node in the blockchain network is determined as the block producing node (that is, the main node), the blockchain node will package the digital asset synthetic transactions in the local transaction pool into blocks, and send the blocks to other blockchains in the blockchain network other than the blockchain node. The nodes carry out consensus, and after confirming that the block consensus is successful, the block will be uploaded to the chain. That is to say, in the consensus process for the block, each blockchain node will execute the block, that is, execute the digital asset synthesis transaction in the block, such as for k pending digital asset synthesis transactions. The gene sequence of the synthesized digital asset is XORed to generate the initial offspring gene sequence.
示例性地,以福虎数字资产为例,每个数字资产在区块链上都是唯一的,具有其自身的唯一编号。因此可以使用福虎数字资产具有的唯一编号作为福虎数字资产的基因序列的表示,假设福虎有6个属性,每个属性有16种可能,使用32位的正整数来表示每个福虎的唯一编号,那么可以将其中的24位作为老虎的6个属性,如表1所示,每4位表示一种属性。Illustratively, taking Fuhu Digital Assets as an example, each digital asset is unique on the blockchain and has its own unique number. Therefore, the unique number of Fuhu digital assets can be used as the representation of the gene sequence of Fuhu digital assets. Assume that Fuhu has 6 attributes, each attribute has 16 possibilities, and a 32-bit positive integer is used to represent each Fuhu. The unique number, then 24 bits can be used as the tiger's 6 attributes. As shown in Table 1, every 4 bits represent an attribute.
0-30-3 4-74-7 8-118-11 12-1512-15 16-1916-19 20-2320-23 24-3224-32
属性1Property 1 属性2Property 2 属性3Property 3 属性4Property 4 属性5Property 5 属性6Property 6 其它other
16种16 kinds 16种16 kinds 16种16 kinds 16种16 kinds 16种16 kinds 16种16 kinds 256256
在需要将多个福虎合成产生一只新的福虎时,为了使得新产生的福虎能够继承用于合成的多个福虎的部分属性,需要一种算法能够产生一只新的唯一编号的福虎。由于智能合约中不能使用随机数,并且为了保证用户响应时间不超时,这种合成算法还需要有确定的搜索空间且在不同机器(或节点)上执行结果一致。因此,可以通过确定性遗传算法产生有序的子代候选集,逐个遍历有序子代候选集中的子代,直到找到不在区块链上的子代。When multiple Fuhus need to be synthesized to produce a new Fuhu, in order for the newly generated Fuhu to inherit some attributes of the multiple Fuhus used for synthesis, an algorithm is needed to generate a new unique number. Fuhu. Since random numbers cannot be used in smart contracts, and in order to ensure that the user response time does not time out, this synthetic algorithm also needs to have a determined search space and consistent execution results on different machines (or nodes). Therefore, an ordered descendant candidate set can be generated by a deterministic genetic algorithm, and the descendants in the ordered descendant candidate set can be traversed one by one until a descendant that is not on the blockchain is found.
此外,假设每个数字资产的属性,由N个基因决定,每个基因有K种可能,使用M个父辈数字资产合成一新的数字资产,要求合成的新的数字资产其继承父代属性的概率要大于随机生成。比如,使用M=3只福虎合成新的福虎,每个福虎一共有N=6种属性,每个属性有K=16种可能,福虎的唯一编号由其6个属性构成,则可以按照下述方式搜索产生新的合成福虎。比如输入:M个父辈数字资产的基因序列x1,x2,…,xM和一个未被使用的随机基因序列G0,对应到例子中则有M=3只父辈老虎的属性分别为x1=0001 0101 0110 0110 1011 0011、x2=0100 1110 1101 0011 1000 1000、x3=1000 1010 0100 0010 1110 1011,传入的未被使用的随机基因序列G0=0010 1000 1100 0110 1010 1101。输出:新的数字资产具有的基因序列,比如新的福虎数字资产具有的基因序列。其中,以M=3只福虎为例,某一用户通过所使用的终端设备上安装的客户端针对3只福虎数字资产以及未被使用的随机基因序列G0生成数字资产合成交易,并将该数字资产合成交易提交给区块链网络的任一区块链节点,任一区块链节点在针对该数字资产合成交易进行同步后,出块节点在将该数 字资产合成交易打包为区块,并发起针对区块的共识流程后,每个区块链节点都会执行区块中的数字资产合成交易,即将3只福虎具有的基因序列进行异或运算,即可产生基因序列G1,如果G1在区块链上不存在,则G1即为新合成的子代福虎具有的基因序列,确定性遗传算法终止;此处选择异或运算作为基因的合成算法,异或运算相当于是不进位的加法,通过异或运算操作能够最大程度上获得与所有父辈有关联的基因序列,保留父辈基因中的稀缺特性。那么使用3只福虎数字资产的基因序列进行异或运算,即可得到初始子代基因序列
Figure PCTCN2022122796-appb-000001
In addition, assuming that the attributes of each digital asset are determined by N genes, each gene has K possibilities, using M digital assets of the parent to synthesize a new digital asset, it is required that the synthesized new digital asset inherits the attributes of the parent. The probability is greater than random generation. For example, use M = 3 Fuhu to synthesize a new Fuhu. Each Fuhu has a total of N = 6 attributes, and each attribute has K = 16 possibilities. The unique number of the Fuhu is composed of its 6 attributes, then You can search for new synthetic Fuhu as follows. For example, input: M gene sequences x1, x2,..., xM of parent digital assets and an unused random gene sequence G0. Corresponding to the example, there are M = 3 parent tigers whose attributes are x1 = 0001 0101 0110. 0110 1011 0011, x2 = 0100 1110 1101 0011 1000 1000, X3 = 1000 1010 0100 0010 1110 1011, the unused random gene sequence G0 = 0010 1000 1100 0110 1010 1101. Output: The genetic sequence of the new digital asset, such as the genetic sequence of the new Fuhu digital asset. Among them, taking M = 3 Fuhu as an example, a user generates a digital asset synthesis transaction for the 3 Fuhu digital assets and the unused random gene sequence G0 through the client installed on the terminal device used, and The digital asset synthesis transaction is submitted to any blockchain node in the blockchain network. After any blockchain node synchronizes the digital asset synthesis transaction, the block producing node packages the digital asset synthesis transaction into a block. , and after initiating the consensus process for the block, each blockchain node will execute the digital asset synthesis transaction in the block, that is, perform an XOR operation on the gene sequences of the three Fu tigers to generate the gene sequence G1. If If G1 does not exist on the blockchain, then G1 is the gene sequence of the newly synthesized offspring Fuhu, and the deterministic genetic algorithm terminates; here, the XOR operation is selected as the gene synthesis algorithm, and the XOR operation is equivalent to no carry The addition, through the XOR operation, can obtain the gene sequences related to all parents to the greatest extent, retaining the scarce characteristics of the genes of the parents. Then use the gene sequences of the three Fuhu digital assets to perform an XOR operation to get the initial offspring gene sequence.
Figure PCTCN2022122796-appb-000001
步骤202,所述区块链节点在确定区块链上存在所述初始子代基因序列时,按照设定的基因替换方式,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集。Step 202: When the blockchain node determines that the initial offspring gene sequence exists on the blockchain, it will replace the initial offspring with the unused random gene sequence in accordance with the set gene replacement method. The gene sequence undergoes the i-th gene replacement to generate an ordered set of offspring candidates belonging to the i-th gene replacement.
步骤203,所述区块链节点若确定所述j个候选基因序列均存在于所述区块链中,则基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i+1次基因替换,直至对所述初始子代基因序列进行第n-1次基因替换后为止,从而确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列。Step 203: If the blockchain node determines that the j candidate gene sequences all exist in the blockchain, then based on the unused random gene sequence, the initial offspring gene sequence is processed for the first time. i+1 gene replacements, until the n-1th gene replacement is performed on the initial offspring gene sequence, thereby determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized. .
本发明实施例中,由于未被使用的随机基因序列并不存在于区块链上,因此通过利用未被使用的随机基因序列中的多个位置的基因去替换初始子代基因序列中对应位置的多个基因即可最大可能地得到不存在于区块链上的基因序列,也即是可以得到新数字资产具有的基因序列,那么也就可以有效地确保所生成的新数字资产具有的基因序列的唯一性,同时可以使得合成的新数字资产能够最大程度地继承父代属性,以便保留父辈基因中的稀缺特性。具体地,针对每个区块链节点,该区块链节点在针对k个待合成的数字资产具有的基因序列进行异或运算后,即可产生初始子代基因序列,并在确定区块链上存在初始子代基因序列后,即可针对初始子代基因序列中的至少一个基因进行相应地替换。如果该区块链节点确定区块链上不存在初始子代基因序列,则可以直接将初始子代基因序列作为k个待合成的数字资产生成的新数字资产具有的基因序列。也即是,该区块链节点从未被使用的随机基因序列中选取i个基因作为初始子代基因序列的替换基因,并将未被使用的随机基因序列中的i个基因与初始子代基因序列中对应位置的i个基因进行互换,从而生成属于第i次基因替换。其中,属于第i次基因替换的有序子代候选集包括j个候选基因序列。如果该区块链节点确定j个候选基因序列中任一候选基因序列不存在于区块链中,则可以将该候选基因序列确定为新数字资产具有的基因序列。如果该区块链节点确定j个候选基因序列均存在于区块链中,则需要基于未被使用的随机基因序列,对初始子代基因序列进行第i+1次基因替换。其中,i为大于等于1的整数;j为大于等于1的整数。In the embodiment of the present invention, since the unused random gene sequence does not exist on the blockchain, the corresponding positions in the initial offspring gene sequence are replaced by genes at multiple positions in the unused random gene sequence. Multiple genes can obtain the gene sequence that does not exist on the blockchain to the greatest extent, that is, the gene sequence of the new digital asset can be obtained, and then the gene sequence of the new digital asset generated can be effectively ensured. The uniqueness of the sequence can also enable the synthesized new digital assets to inherit the attributes of the parent to the greatest extent, so as to retain the scarce characteristics of the parent's genes. Specifically, for each blockchain node, after performing an XOR operation on the gene sequences of k digital assets to be synthesized, the blockchain node can generate the initial offspring gene sequence, and determine the blockchain After the initial progeny gene sequence exists on the original progeny gene sequence, at least one gene in the initial progeny gene sequence can be replaced accordingly. If the blockchain node determines that the initial offspring gene sequence does not exist on the blockchain, the initial offspring gene sequence can be directly used as the gene sequence of the new digital asset generated by the k digital assets to be synthesized. That is, the blockchain node selects i genes from the unused random gene sequence as replacement genes for the initial offspring gene sequence, and combines i genes from the unused random gene sequence with the initial offspring The i genes at corresponding positions in the gene sequence are exchanged, thereby generating the i-th gene replacement. Among them, the ordered offspring candidate set belonging to the i-th gene replacement includes j candidate gene sequences. If the blockchain node determines that any of the j candidate gene sequences does not exist in the blockchain, the candidate gene sequence can be determined as the gene sequence of the new digital asset. If the blockchain node determines that j candidate gene sequences all exist in the blockchain, it is necessary to perform the i+1th gene replacement on the initial offspring gene sequence based on unused random gene sequences. Among them, i is an integer greater than or equal to 1; j is an integer greater than or equal to 1.
其中,该区块链节点通过基于未被使用的随机基因序列以及数字资产所具有的总基因个数n,即可进行相应地运算,生成至少一个用于基因替换的基因位置序号组合,从而可以通过至少一个基因位置序号组合,将初始子代基因序列中的多个基因替换为未被使用的随机基因序列中对应位置的多个基因,从而可以实现针对初始子代基因序列的有效替换,以此为后续有效生成新数字资产具有的基因序列提供支持。也即是,该区块链节点基于未被使用的随机基因序列以及n,确定至少一个用于基因替换的基因位置序号组合,每个基因位置序号组合包括至少一个具有运算先后次序的取值集合。然后,根据未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对初始子代基因序列中对应位置的i个基因进行替换,从而生成属于第i次基因替换的有序子代候选集。具体地,在 针对初始子代基因序列进行一次基因替换时,可以通过未被使用的随机基因序列与n的取余运算可以产生一个有序序列(即具有一定运算先后次序的第一数值),并基于这个有序序列即可产生具有一定确定性的多个候选新子代基因序列,如此,即可从多个候选新子代基因序列中最大可能地确定出一个具有唯一性的新数字资产具有的基因序列,从而可以使得每个区块链节点都能够产生同样的基因序列。比如,如果i的取值为1,则区块链节点可以将未被使用的随机基因序列与n进行取余运算,即可确定第一数值,并基于第一数值以及n,即可确定n个具有运算先后次序的初始基因位置序号。然后,按照n个初始基因位置序号的运算先后次序,依次将n个初始基因位置序号与n进行取余运算,从而即可确定n个具有运算先后次序的第一基因位置序号。其中,该n个具有运算先后次序的第一基因位置序号用于构成第一基因位置序号组合;该n个具有运算先后次序的第一基因位置序号用于辅助基因替换。最后,按照第一基因位置序号组合中包括的n个第一基因位置序号具有的运算先后次序,依次将该n个第一基因位置序号在初始子代基因序列中对应的基因替换为该n个第一基因位置序号在未被使用的随机基因序列中对应的基因,从而即可生成属于第i次基因替换的有序子代候选集。其中,n为大于等于1的整数。Among them, the blockchain node can perform corresponding calculations based on the unused random gene sequence and the total number of genes n possessed by the digital asset to generate at least one gene position sequence number combination for gene replacement, so that it can Through at least one combination of gene position numbers, multiple genes in the initial progeny gene sequence are replaced with multiple genes at corresponding positions in the unused random gene sequence, so that effective replacement of the initial progeny gene sequence can be achieved. This provides support for the subsequent effective generation of genetic sequences for new digital assets. That is, the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n. Each gene position sequence number combination includes at least one value set with an operation sequence. . Then, based on the i genes in the unused random gene sequence and at least one combination of gene position numbers, the i genes at the corresponding positions in the initial offspring gene sequence are replaced, thereby generating the i-th gene replacement. An ordered set of descendant candidates. Specifically, when performing a gene replacement for the initial offspring gene sequence, an ordered sequence (i.e., the first value with a certain order of operations) can be generated through the remainder operation of the unused random gene sequence and n. And based on this ordered sequence, multiple candidate new progeny gene sequences can be generated with a certain degree of certainty. In this way, a unique new digital asset can be determined to the greatest extent possible from multiple candidate new progeny gene sequences. With the genetic sequence, each blockchain node can produce the same genetic sequence. For example, if the value of i is 1, the blockchain node can perform a remainder operation on the unused random gene sequence and n to determine the first value, and based on the first value and n, n can be determined An initial gene position sequence number with a sequence of operations. Then, according to the order of operation of the n initial gene position numbers, the n initial gene position numbers and n are sequentially subjected to a remainder operation, so that n first gene position numbers with the order of operation can be determined. Among them, the n first gene position numbers with operation order are used to form a first gene position number combination; the n first gene position numbers with operation order are used to assist gene replacement. Finally, according to the order of operations of the n first gene position numbers included in the first gene position number combination, the genes corresponding to the n first gene position numbers in the initial offspring gene sequence are sequentially replaced with the n The first gene position sequence number corresponds to the gene in the unused random gene sequence, so that an ordered descendant candidate set belonging to the i-th gene replacement can be generated. Among them, n is an integer greater than or equal to 1.
此外,针对初始子代基因序列进行多次基因替换时,就会很大可能产生更多的候选新子代基因序列,使得新子代可能具有的基因序列变多,可选择性也变多,那么就会有很大可能从更多的候选新子代基因序列中确定出一个具有唯一性的新数字资产具有的基因序列,从而就会很大可能在有确定的搜索空间内产生出新数字资产具有的基因序列,因此可以使得每个区块链节点都要遍历所有可以产生的子代,并且可以确保每个区块链节点的遍历顺序一致。比如,如果i的取值大于等于2,则该区块链节点基于第1次基因替换对应的n个具有运算先后次序的第一基因位置序号,即可确定除第1次基因替换对应的一个基因之外的i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号,并根据n个具有运算先后次序的第一基因位置序号以及其它i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号,即可确定多个用于基因替换的第二基因位置序号组合。然后,针对每个第二基因位置序号组合,如果该第二基因位置序号组合中存在至少一个取值集合为空集,则可以不针对初始子代基因序列进行基因替换,如果第二基因位置序号组合中不存在任何一个取值集合为空集,则可以依次将该初始子代基因序列中该第二基因位置序号组合包括的至少一个基因位置序号对应的基因替换为未被使用的随机基因序列中该至少一个基因位置序号对应的基因,从而即可生成属于第i次基因替换的有序子代候选集。其中,q为大于等于1的整数。In addition, when multiple gene replacements are performed on the initial progeny gene sequence, it is very likely that more candidate new progeny gene sequences will be generated, making the new progeny likely to have more gene sequences and more selectivity. Then it will be very likely to determine the gene sequence of a unique new digital asset from more candidate new offspring gene sequences, so it will be very likely to generate new numbers within a certain search space. The genetic sequence of the asset allows each blockchain node to traverse all the descendants that can be generated, and ensures that the traversal order of each blockchain node is consistent. For example, if the value of i is greater than or equal to 2, then the blockchain node can determine the n first gene position numbers in the order of operation based on the n corresponding to the first gene replacement, except the one corresponding to the first gene replacement. The i-1 genes other than the gene each correspond to q second gene position numbers in the order of operation, and based on the n first gene position numbers in the order of operation and the q corresponding to each of the other i-1 genes A plurality of second gene position sequence numbers with operational sequence can be used to determine multiple second gene position sequence number combinations for gene replacement. Then, for each second gene position sequence number combination, if at least one value set in the second gene position sequence number combination is an empty set, gene replacement may not be performed for the initial offspring gene sequence. If the second gene position sequence number If there is no value set in the combination and is an empty set, the gene corresponding to at least one gene position number included in the second gene position number combination in the initial offspring gene sequence can be replaced with an unused random gene sequence. The gene corresponding to the sequence number of the at least one gene in the gene can be generated, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement. Among them, q is an integer greater than or equal to 1.
再者,需要说明的是,为了避免用户请求产生新子代具有的基因序列的响应时长过长,也即是为了有效地确保用户请求产生新子代具有的基因序列的响应时间不超时,因此会保证在有确定的搜索空间内产生新数字资产具有的基因序列,那么在对初始子代基因序列进行第n-1次基因替换之后,如果确定针对初始子代基因序列进行第n-1次基因替换所生成的属于第n-1次基因替换的有序子代候选集中包括的p个候选基因序列均存在于区块链中,则可以将未被使用的随机基因序列确定为新数字资产具有的基因序列,从而可以有效地确保所生成的新数字资产具有的基因序列的唯一性。另外,为了有效避免后续生成的子代与之前生成的子代之间产生冲突的可能性,并为了有效地确保所生成的新数字资产具有的基因序列的唯一性,那么在确定出针对k个待合成的数字资产所生成的新数字资产具有的基因序列之后,将新数字资产具有的基因序列的使用状态标记为已使用,并将标记为已使用 的所述新数字资产具有的基因序列上传至区块链进行保存,以便后续在生成新子代具有的基因序列后及时准确地通过区块链判断区块链上是否存在该生成的新子代具有的基因序列。其中,p为大于等于1的整数。Furthermore, it should be noted that in order to avoid the response time of the user's request to generate the gene sequence of the new offspring being too long, that is, to effectively ensure that the response time of the user's request to generate the gene sequence of the new offspring does not time out, therefore It will ensure that the gene sequence of the new digital asset will be generated within a certain search space. Then, after the n-1th gene replacement of the initial offspring gene sequence, if it is determined that the n-1th gene replacement of the initial offspring gene sequence will be performed If the p candidate gene sequences included in the ordered progeny candidate set belonging to the n-1th gene replacement generated by gene replacement all exist in the blockchain, then the unused random gene sequences can be determined as new digital assets. It has a genetic sequence, which can effectively ensure the uniqueness of the generated new digital asset. In addition, in order to effectively avoid the possibility of conflict between subsequently generated offspring and previously generated offspring, and in order to effectively ensure the uniqueness of the genetic sequence of the generated new digital assets, then after determining the k After the gene sequence of the new digital asset generated from the digital asset to be synthesized, the usage status of the gene sequence of the new digital asset is marked as used, and the gene sequence of the new digital asset marked as used is uploaded. Save it to the blockchain so that after the gene sequence of the new offspring is generated, it can be timely and accurately determined through the blockchain whether the gene sequence of the generated new offspring exists on the blockchain. Among them, p is an integer greater than or equal to 1.
示例性地,假设未被使用的随机基因序列为G0,并假设初始子代基因序列G1在区块链上存在,则可以在先针对初始子代基因序列G1进行一次基因替换,即从未被使用的随机基因序列G0中选择1个基因作为初始子代基因序列G1的突变基因,将初始子代基因序列G1中的第i1个基因使用未被使用的随机基因序列G0的第i1个基因替代,其中i1取{I,I+1,…,I+N-1}%N中的各数值,I=G0%N,一共有
Figure PCTCN2022122796-appb-000002
种可能,如此即可生成属于第一次基因替换的有序子代候选集,其中,按照i1取值的顺序进行遍历,以此检查有序子代候选集中的每个候选基因序列是否在区块链上存在,如果不存在即为新合成的子代数字资产具有的基因序列,确定性遗传算法终止;此处由于智能合约中不能产生不确定的随机数,所以使用I=G0%N来产生一个从I开始的有序序列,基于这个有序序列,在N为6时,能够产生确定的
Figure PCTCN2022122796-appb-000003
个新的子代基因,使得每个区块链节点都能够产生同样的基因序列,并且按照同样的顺序检查子代基因序列是否可用。例如,继续以上述3只福虎合成新的福虎为例,假设未被使用的随机基因序列G0=0010 1000 1100 0110 1010 1101,并假设初始子代基因序列G1=1101 0001 1111 0111 1101 0000在区块链上存在,则可以计算I=G0%N=0010 1000 1100 0110 1010 1101%6=3,所以i1的值集为{3,4,5,0,1,2},使用G0的第i1个基因替换G1的对应位置基因,i1取{3,4,5,0,1,2},产生下述属于第一次基因替换的有序子代候选集,按序检查有序子代候选集中的每个候选基因序列是否在区块链上已经存在,如果不存在则将该候选基因序列标注为存在(或标注为已使用)并返回,同时将标注后的该候选基因序列上传至区块链,如果全部存在则继续下一步。其中,产生的属于第一次基因替换的有序子代候选集为:
For example, assuming that the unused random gene sequence is G0, and assuming that the initial descendant gene sequence G1 exists on the blockchain, a gene replacement can be performed on the initial descendant gene sequence G1, that is, it has never been used. Select one gene from the used random gene sequence G0 as the mutant gene of the initial offspring gene sequence G1, and replace the i1th gene in the initial offspring gene sequence G1 with the i1th gene of the unused random gene sequence G0. , where i1 takes each value in {I, I+1,...,I+N-1}%N, I=G0%N, there are
Figure PCTCN2022122796-appb-000002
This is a possibility, so that an ordered descendant candidate set belonging to the first gene replacement can be generated. Among them, traversal is performed in the order of i1 values to check whether each candidate gene sequence in the ordered descendant candidate set is in the region. exists on the blockchain. If it does not exist, it is the genetic sequence of the newly synthesized offspring digital assets, and the deterministic genetic algorithm terminates; here, since uncertain random numbers cannot be generated in smart contracts, I=G0%N is used. Generate an ordered sequence starting from I. Based on this ordered sequence, when N is 6, a certain
Figure PCTCN2022122796-appb-000003
A new progeny gene enables each blockchain node to generate the same gene sequence and check whether the progeny gene sequence is available in the same order. For example, continue to use the above three Fuhu to synthesize new Fuhu as an example. Assume that the unused random gene sequence G0=0010 1000 1100 0110 1010 1101, and assume that the initial offspring gene sequence G1=1101 0001 1111 0111 1101 0000 in exists on the blockchain, you can calculate I=G0%N=0010 1000 1100 0110 1010 1101%6=3, so the value set of i1 is {3,4,5,0,1,2}, using the G0th i1 genes replace the corresponding genes of G1, and i1 takes {3,4,5,0,1,2} to generate the following ordered offspring candidate set belonging to the first gene replacement, and check the ordered offspring in order Whether each candidate gene sequence in the candidate set already exists on the blockchain, if not, mark the candidate gene sequence as existing (or mark as used) and return, and upload the marked candidate gene sequence to Blockchain, if all exist continue to the next step. Among them, the resulting ordered set of offspring candidates belonging to the first gene replacement is:
1101 0001 1111 0110 1101 00001101 0001 1111 0110 1101 0000
1101 0001 1111 0111 1010 00001101 0001 1111 0111 1010 0000
1101 0001 1111 0111 1101 11011101 0001 1111 0111 1101 1101
0010 0001 1111 0111 1101 00000010 0001 1111 0111 1101 0000
1101 1000 1111 0111 1101 00001101 1000 1111 0111 1101 0000
1101 0001 0110 0111 1101 00001101 0001 0110 0111 1101 0000
比如,假设属于第一次基因替换的有序子代候选集中的一个候选基因序列1101 0001 1111 0111 1010 0000不存在于区块链上,则可以将该候选基因序列1101 0001 1111 0111 1010 0000作为新福虎数字资产具有的基因序列。For example, assuming that a candidate gene sequence 1101 0001 1111 0111 1010 0000 belonging to the ordered offspring candidate set of the first gene replacement does not exist on the blockchain, the candidate gene sequence 1101 0001 1111 0111 1010 0000 can be used as a new Fuhu digital assets have the genetic sequence.
如果上述各候选基因序列均不存在于区块链上,则可以针对初始子代基因序列G1进行第2次基因替换,即,从未被使用的随机基因序列G0中选择2个基因作为初始子代基因序列G1的突变基因,将初始子代基因序列G1中的第i1、第i2个基因使用未被使用的随机基因序列G0的第i1、第i2个基因替代,其中i1取{I,I+1,…,I+N-1}%N的各数值,I=G0%N,i2∈{i1+1,…,N-1},一共有
Figure PCTCN2022122796-appb-000004
种可能,如此即可生成属于第二次基因替换的有序子代候选集。其中,按照i1,i2取值的顺序进行遍历,检查有序子代候选集中的每个候选基因序列是否在区块链上存在,如果不存在即为新合成的子代数字资产具有的基因序列,确定性遗传算法终止;这里选择这种取值方式是需要每个区块链节点都要遍历所有可以产生的子代,并且需要保证每个节点的遍历顺序一致,从而最后合成出来的子代数字资产具 有的基因序列是一致的。例如,继续以上述3只福虎合成新的福虎为例,假设未被使用的随机基因序列G0=0010 1000 1100 0110 1010 1101,并假设初始子代基因序列G1=1101 0001 1111 0111 1101 0000在区块链上存在,则可以计算I=G0%N=0010 1000 1100 0110 1010 1101%6=3,所以i1的值集为{3,4,5,0,1,2},i2取[i1+1,N-1],使用未被使用的随机基因序列G0中的两个基因去替换初始子代基因序列G1的对应位置的两个基因,使用未被使用的随机基因序列G0中的第i1个基因和第i2个基因去替换初始子代基因序列G1的对应位置的两个基因,以此可以产生下述有序子代候选集,按序检查有序子代候选集中的每个候选基因序列是否在区块链上已经存在,如果不存在则将该候选基因序列标注为存在(或标注为已使用)并返回,同时将标注后的该候选基因序列上传至区块链,如果全部存在则继续下一步。其中,产生的属于第二次基因替换的有序子代候选集为:
If none of the above candidate gene sequences exist on the blockchain, the second gene replacement can be performed on the initial offspring gene sequence G1, that is, two genes are selected from the unused random gene sequence G0 as the initial offspring. The mutant gene of the generation gene sequence G1 is replaced by the i1th and i2th genes in the initial offspring gene sequence G1 with the i1th and i2th genes of the unused random gene sequence G0, where i1 is {I,I +1,…,I+N-1}%N, I=G0%N, i2∈{i1+1,…,N-1}, there are a total of
Figure PCTCN2022122796-appb-000004
possibility, so that an ordered set of offspring candidates belonging to the second gene replacement can be generated. Among them, traverse in the order of values of i1 and i2, and check whether each candidate gene sequence in the ordered descendant candidate set exists on the blockchain. If it does not exist, it is the gene sequence of the newly synthesized descendant digital asset. , the deterministic genetic algorithm terminates; choosing this value method here requires each blockchain node to traverse all the descendants that can be generated, and it is necessary to ensure that the traversal order of each node is consistent, so that the final synthesized descendants Digital assets have the same genetic sequence. For example, continue to use the above three Fuhu to synthesize new Fuhu as an example. Assume that the unused random gene sequence G0=0010 1000 1100 0110 1010 1101, and assume that the initial offspring gene sequence G1=1101 0001 1111 0111 1101 0000 in exists on the blockchain, you can calculate I=G0%N=0010 1000 1100 0110 1010 1101%6=3, so the value set of i1 is {3,4,5,0,1,2}, i2 takes [i1 +1, N-1], use the two genes in the unused random gene sequence G0 to replace the two genes at the corresponding positions of the initial descendant gene sequence G1, and use the unused random gene sequence G0 to replace the two genes at the corresponding positions. The i1 gene and the i2-th gene are used to replace the two genes at the corresponding positions of the initial descendant gene sequence G1. In this way, the following ordered descendant candidate set can be generated, and each candidate in the ordered descendant candidate set is checked in order. Whether the gene sequence already exists on the blockchain, if not, mark the candidate gene sequence as existing (or mark as used) and return, and upload the marked candidate gene sequence to the blockchain. If all If it exists, continue to the next step. Among them, the resulting ordered set of offspring candidates belonging to the second gene replacement is:
i1=3,i2的值集为{4,5}时,替换后形成的候选基因序列有:When i1=3 and the value set of i2 is {4,5}, the candidate gene sequences formed after replacement are:
1101 0001 1111 0110 1010 00001101 0001 1111 0110 1010 0000
1101 0001 1111 0110 1101 11011101 0001 1111 0110 1101 1101
i1=4,i2的值集为{5}时,替换后形成的候选基因序列有:When i1=4 and the value set of i2 is {5}, the candidate gene sequences formed after replacement are:
1101 0001 1111 0111 1010 11011101 0001 1111 0111 1010 1101
i1=5,i2的值集为空集{},此情况无值可取。i1=5, the value set of i2 is the empty set {}, and there is no value to take in this case.
i1=0,i2的值集为{1,2,3,4,5}时,替换后形成的候选基因序列有:When i1=0 and the value set of i2 is {1,2,3,4,5}, the candidate gene sequences formed after replacement are:
0010 1000 1111 0111 1101 00000010 1000 1111 0111 1101 0000
0010 0001 0110 0111 1101 00000010 0001 0110 0111 1101 0000
0010 0001 1111 0110 1101 00000010 0001 1111 0110 1101 0000
0010 0001 1111 0111 1010 00000010 0001 1111 0111 1010 0000
0010 0001 1111 0111 1101 11010010 0001 1111 0111 1101 1101
i1=1,i2的值集为{2,3,4,5}时,替换后形成的候选基因序列有:When i1=1 and the value set of i2 is {2,3,4,5}, the candidate gene sequences formed after replacement are:
1101 1000 0110 0111 1101 00001101 1000 0110 0111 1101 0000
1101 1000 1111 0110 1101 00001101 1000 1111 0110 1101 0000
1101 1000 1111 0111 1010 00001101 1000 1111 0111 1010 0000
1101 1000 1111 0111 1101 11011101 1000 1111 0111 1101 1101
i1=2,i2的值集为{3,4,5}时,替换后形成的候选基因序列有:When i1=2 and the value set of i2 is {3,4,5}, the candidate gene sequences formed after replacement are:
1101 0001 0110 0110 1101 00001101 0001 0110 0110 1101 0000
1101 0001 0110 0111 1010 00001101 0001 0110 0111 1010 0000
1101 0001 0110 0111 1101 11011101 0001 0110 0111 1101 1101
比如,假设属于第二次基因替换的有序子代候选集中的一个候选基因序列1101 1000 1111 0110 1101 0000不存在于区块链上,则可以将该候选基因序列1101 1000 1111 0110 1101 0000作为新福虎数字资产具有的基因序列。For example, assuming that a candidate gene sequence 1101 1000 1111 0110 1101 0000 that belongs to the ordered offspring candidate set of the second gene replacement does not exist on the blockchain, the candidate gene sequence 1101 1000 1111 0110 1101 0000 can be used as a new Fuhu digital assets have the genetic sequence.
如果上述各候选基因序列均不存在于区块链上,则可以针对初始子代基因序列G1进行第3次基因替换,即,重复上述操作,直到从未被使用的随机基因序列G0中选择N-1个基因作为初始子代基因序列G1的突变基因,将初始子代基因序列G1中的第i1,i2,…,i(N-1)个基因使用未被使用的随机基因序列G0的第i1,i2,…,i(N-1)个基因替代,其中,i1取{I,I+1,…,I+N-1}%N中的各数值,I=G0%N,i2∈{i_1+1,…,N-1},…,i(N-1)∈{i(N-2)+1,…,N-1},一共有
Figure PCTCN2022122796-appb-000005
种可能,如此即可生成属于第三次基因替换的有序子代候选 集,其中,按照i1取值的顺序进行遍历,以此检查有序子代候选集中的每个候选基因序列是否在区块链上存在,如果不存在即为新合成的子代数字资产具有的基因序列,确定性遗传算法终止。比如,使用未被使用的随机基因序列G0中的3个基因替换初始子代基因序列G1的对应位置基因,第i1、i2、i3个基因替换G1的对应位置基因,i1取[3,4,5,0,1,2],i2取[i1+1,5],i3取[i2+1,5],即可产生下述有序子代候选集,按序检查有序子代候选集中的每个候选基因序列是否在区块链上已经存在,如果不存在则将该候选基因序列标注为存在(或标注为已使用)并返回,同时将标注后的该候选基因序列上传至区块链,如果全部存在则继续下一步。其中,产生的属于第三次基因替换的有序子代候选集为:
If none of the above candidate gene sequences exist on the blockchain, the third gene replacement can be performed on the initial descendant gene sequence G1, that is, the above operations are repeated until N is selected from the unused random gene sequence G0 -1 gene is used as the mutant gene of the initial descendant gene sequence G1, and the i1, i2,...,i(N-1)th gene in the initial descendant gene sequence G1 is used as the unused random gene sequence G0. i1,i2,…,i(N-1) gene substitutions, where i1 takes each value in {I,I+1,…,I+N-1}%N, I=G0%N, i2∈ {i_1+1,…,N-1},…,i(N-1)∈{i(N-2)+1,…,N-1}, there are
Figure PCTCN2022122796-appb-000005
This is a possibility, so that an ordered descendant candidate set belonging to the third gene replacement can be generated. Among them, traversal is performed in the order of i1 values to check whether each candidate gene sequence in the ordered descendant candidate set is in the region. exists on the blockchain. If it does not exist, it is the genetic sequence of the newly synthesized offspring digital asset, and the deterministic genetic algorithm terminates. For example, use 3 genes in the unused random gene sequence G0 to replace the corresponding position genes of the initial descendant gene sequence G1. The i1, i2, and i3th genes replace the corresponding position genes of G1. i1 takes [3,4, 5,0,1,2], i2 takes [i1+1,5], and i3 takes [i2+1,5], the following ordered descendant candidate set can be generated, and the ordered descendant candidate set is checked in order Whether each candidate gene sequence already exists on the blockchain, if not, mark the candidate gene sequence as existing (or mark as used) and return, and upload the marked candidate gene sequence to the block. chain, if all exist continue to the next step. Among them, the generated candidate set of ordered offspring belonging to the third gene replacement is:
i1=3,i2=4,i3=5时,替换后形成的候选基因序列有:When i1=3, i2=4, and i3=5, the candidate gene sequences formed after replacement are:
1101 0001 1111 0110 1010 11011101 0001 1111 0110 1010 1101
i1=4,i2=5,i3={},i3是空集{}。i1=4, i2=5, i3={}, i3 is the empty set {}.
i1=5,i2={},i3={},i2和i3是空集{}。i1=5, i2={}, i3={}, i2 and i3 are empty sets {}.
i1=0,i2=1,i3={2,3,4,5}时,替换后形成的候选基因序列有:When i1=0, i2=1, i3={2,3,4,5}, the candidate gene sequences formed after replacement are:
0010 1000 0110 0111 1101 00000010 1000 0110 0111 1101 0000
0010 1000 1111 0110 1101 00000010 1000 1111 0110 1101 0000
0010 1000 1111 0111 1010 00000010 1000 1111 0111 1010 0000
0010 1000 1111 0111 1101 11010010 1000 1111 0111 1101 1101
i1=0,i2=2,i3={3,4,5}时,替换后形成的候选基因序列有:When i1=0, i2=2, i3={3,4,5}, the candidate gene sequences formed after replacement are:
0010 0001 0110 0110 1101 00000010 0001 0110 0110 1101 0000
0010 0001 0110 0111 1010 00000010 0001 0110 0111 1010 0000
0010 0001 0110 0111 1101 11010010 0001 0110 0111 1101 1101
i1=0,i2=3,i3={4,5}时,替换后形成的候选基因序列有:When i1=0, i2=3, i3={4,5}, the candidate gene sequences formed after replacement are:
0010 0001 1111 0110 1010 00000010 0001 1111 0110 1010 0000
0010 0001 1111 0110 1101 11010010 0001 1111 0110 1101 1101
i1=0,i2=4,i3=5时,替换后形成的候选基因序列有:When i1=0, i2=4, and i3=5, the candidate gene sequences formed after replacement are:
0010 0001 1111 0111 1010 11010010 0001 1111 0111 1010 1101
i1=0,i2=5,i3={},i3是空集{}。i1=0, i2=5, i3={}, i3 is the empty set {}.
i1=1,i2=2,i3={3,4,5}时,替换后形成的候选基因序列有:When i1=1, i2=2, i3={3,4,5}, the candidate gene sequences formed after replacement are:
1101 1000 0110 0110 1101 00001101 1000 0110 0110 1101 0000
1101 1000 0110 0111 1010 00001101 1000 0110 0111 1010 0000
1101 1000 0110 0111 1101 11011101 1000 0110 0111 1101 1101
i1=1,i2=3,i3={4,5}时,替换后形成的候选基因序列有:When i1=1, i2=3, i3={4,5}, the candidate gene sequences formed after replacement are:
1101 1000 1111 0110 1010 00001101 1000 1111 0110 1010 0000
1101 1000 1111 0110 1101 11011101 1000 1111 0110 1101 1101
i1=1,i2=4,i3=5时,替换后形成的候选基因序列有:When i1=1, i2=4, and i3=5, the candidate gene sequences formed after replacement are:
1101 1000 1111 0111 1010 11011101 1000 1111 0111 1010 1101
i1=1,i2=5,i3={},i3是空集{}。i1=1, i2=5, i3={}, i3 is the empty set {}.
i1=2,i2=3,i3={4,5}时,替换后形成的候选基因序列有:When i1=2, i2=3, i3={4,5}, the candidate gene sequences formed after replacement are:
1101 0001 0110 0110 1010 00001101 0001 0110 0110 1010 0000
1101 0001 0110 0110 1101 11011101 0001 0110 0110 1101 1101
i1=2,i2=4,i3=5时,替换后形成的候选基因序列有:When i1=2, i2=4, and i3=5, the candidate gene sequences formed after replacement are:
1101 0001 0110 0111 1010 11011101 0001 0110 0111 1010 1101
i1=2,i2=5,i3={},i3是空集{}。i1=2, i2=5, i3={}, i3 is the empty set {}.
比如,假设属于第三次基因替换的有序子代候选集中的一个候选基因序列1101 1000 0110 0111 1010 0000不存在于区块链上,则可以将该候选基因序列1101 1000 0110 0111 1010 0000作为新福虎数字资产具有的基因序列。For example, assuming that a candidate gene sequence 1101 1000 0110 0111 1010 0000 belonging to the ordered offspring candidate set of the third gene replacement does not exist on the blockchain, the candidate gene sequence 1101 1000 0110 0111 1010 0000 can be used as a new Fuhu digital assets have the genetic sequence.
如果上述各候选基因序列均不存在于区块链上,则可以针对初始子代基因序列G1进行第4次基因替换,即,从未被使用的随机基因序列G0中选择4个基因作为初始子代基因序列G1的突变基因,也即是,使用未被使用的随机基因序列G0中的4个基因去替换初始子代基因序列G1中的对应位置基因,使用未被使用的随机基因序列G0的第i1、i2、i3、i4个基因去替换初始子代基因序列G1的对应位置基因,i1取[3,4,5,0,1,2],i2取[i1+1,5],i3取[i2+1,5],i4取[i3+1,5],即可产生下述属于第四次基因替换的有序子代候选集,按序检查有序子代候选集中的每个候选基因序列是否在区块链上已经存在,如果不存在则将该候选基因序列标注为存在(或标注为已使用)并返回,同时将标注后的该候选基因序列上传至区块链,如果全部存在则继续下一步。其中,产生的属于第四次基因替换的有序子代候选集为:If none of the above candidate gene sequences exist on the blockchain, the fourth gene replacement can be performed on the initial offspring gene sequence G1, that is, 4 genes are selected from the unused random gene sequence G0 as the initial offspring. The mutant gene of the generation gene sequence G1, that is, using 4 genes in the unused random gene sequence G0 to replace the corresponding position genes in the initial offspring gene sequence G1, using the unused random gene sequence G0 The i1, i2, i3, and i4th genes are used to replace the corresponding position genes of the initial offspring gene sequence G1. i1 takes [3,4,5,0,1,2], i2 takes [i1+1,5], and i3 Taking [i2+1,5] and taking [i3+1,5] for i4, the following ordered descendant candidate set belonging to the fourth gene replacement can be generated. Each of the ordered descendant candidate sets is checked in order. Whether the candidate gene sequence already exists on the blockchain, if not, mark the candidate gene sequence as existing (or mark as used) and return, and upload the marked candidate gene sequence to the blockchain. If If all exist, continue to the next step. Among them, the resulting ordered set of offspring candidates belonging to the fourth gene replacement is:
i1=3,i2=4,i3=5,i4是空集{}。i1=3, i2=4, i3=5, i4 is the empty set {}.
i1=3,i2=5,i3、i4均是空集{}。i1=3, i2=5, i3 and i4 are both empty sets {}.
i1=4,i2=5,i3、i4均是空集{}。i1=4, i2=5, i3 and i4 are both empty sets {}.
i1=5,i2,i3,i4是空集{}。i1=5, i2, i3, i4 are empty sets {}.
i1=0,i2=1,i3=2,i4={3,4,5}时,替换后形成的候选基因序列有:When i1=0, i2=1, i3=2, i4={3,4,5}, the candidate gene sequences formed after replacement are:
0010 1000 0110 0110 1101 00000010 1000 0110 0110 1101 0000
0010 1000 0110 0111 1010 00000010 1000 0110 0111 1010 0000
0010 1000 0110 0111 1101 11010010 1000 0110 0111 1101 1101
i1=0,i2=1,i3=3,i4={4,5}时,替换后形成的候选基因序列有:When i1=0, i2=1, i3=3, i4={4,5}, the candidate gene sequences formed after replacement are:
0010 1000 1111 0110 1010 00000010 1000 1111 0110 1010 0000
0010 1000 1111 0110 1101 11010010 1000 1111 0110 1101 1101
i1=0,i2=1,i3=4,i4=5时,替换后形成的候选基因序列有:When i1=0, i2=1, i3=4, i4=5, the candidate gene sequences formed after replacement are:
0010 1000 1111 0111 1010 11010010 1000 1111 0111 1010 1101
i1=0,i2=2,i3=3,i4={4,5}时,替换后形成的候选基因序列有:When i1=0, i2=2, i3=3, i4={4,5}, the candidate gene sequences formed after replacement are:
0010 0001 0110 0110 1010 00000010 0001 0110 0110 1010 0000
0010 0001 0110 0110 1101 11010010 0001 0110 0110 1101 1101
i1=0,i2=2,i3=4,i4=5时,替换后形成的候选基因序列有:When i1=0, i2=2, i3=4, i4=5, the candidate gene sequences formed after replacement are:
0010 0001 0110 0111 1010 11010010 0001 0110 0111 1010 1101
i1=0,i2=2,i3=5,i4是空集{}。i1=0, i2=2, i3=5, i4 is the empty set {}.
i1=0,i2=3,i3=4,i4=5时,替换后形成的候选基因序列有:When i1=0, i2=3, i3=4, i4=5, the candidate gene sequences formed after replacement are:
0010 0001 1111 0110 1010 11010010 0001 1111 0110 1010 1101
i1=0,i2=4,i3,i4是空集{}。i1=0, i2=4, i3, i4 are empty sets {}.
i1=1,i2=2,i3=3,i4={4,5}时,替换后形成的候选基因序列有:When i1=1, i2=2, i3=3, i4={4,5}, the candidate gene sequences formed after replacement are:
1101 1000 0110 0110 1010 00001101 1000 0110 0110 1010 0000
1101 1000 0110 0110 1101 11011101 1000 0110 0110 1101 1101
i1=1,i2=2,i3=4,i4=5时,替换后形成的候选基因序列有:When i1=1, i2=2, i3=4, i4=5, the candidate gene sequences formed after replacement are:
1101 1000 0110 0111 1010 11011101 1000 0110 0111 1010 1101
i1=1,i2=3,i3=4,i4=5时,替换后形成的候选基因序列有:When i1=1, i2=3, i3=4, and i4=5, the candidate gene sequences formed after replacement are:
1101 1000 1111 0110 1010 11011101 1000 1111 0110 1010 1101
i1=2,i2=3,i3=4,i4=5时,替换后形成的候选基因序列有:When i1=2, i2=3, i3=4, i4=5, the candidate gene sequences formed after replacement are:
1101 0001 0110 0110 1010 11011101 0001 0110 0110 1010 1101
比如,假设属于第四次基因替换的有序子代候选集中的一个候选基因序列0010 0001 1111 0110 1010 1101不存在于区块链上,则可以将该候选基因序列0010 0001 1111 0110 1010 1101作为新福虎数字资产具有的基因序列。For example, assuming that a candidate gene sequence 0010 0001 1111 0110 1010 1101 belonging to the ordered offspring candidate set of the fourth gene replacement does not exist on the blockchain, the candidate gene sequence 0010 0001 1111 0110 1010 1101 can be used as a new Fuhu digital assets have the genetic sequence.
如果上述各候选基因序列均不存在于区块链上,则可以针对初始子代基因序列G1进行第5次基因替换,即,从未被使用的随机基因序列G0中选择5个基因作为初始子代基因序列G1的突变基因,也即是,使用未被使用的随机基因序列G0中的5个基因去替换初始子代基因序列G1中的对应位置基因,使用未被使用的随机基因序列G0的第i1、i2、i3、i4、i5个基因去替换初始子代基因序列G1的对应位置基因,i1取[3,4,5,0,1,2],i2取[i1+1,5],i3取[i2+1,5],i4取[i3+1,5],i5取[i4+1,5],即可产生下述属于第五次基因替换的有序子代候选集,按序检查有序子代候选集中的每个候选基因序列是否在区块链上已经存在,如果不存在则将该候选基因序列标注为存在(或标注为已使用)并返回,同时将标注后的该候选基因序列上传至区块链,如果全部存在则继续下一步。其中,产生的属于第五次基因替换的有序子代候选集为:If none of the above candidate gene sequences exist on the blockchain, the fifth gene replacement can be performed on the initial offspring gene sequence G1, that is, 5 genes are selected from the unused random gene sequence G0 as the initial offspring. The mutated gene of the generation gene sequence G1, that is, using 5 genes in the unused random gene sequence G0 to replace the corresponding position genes in the initial offspring gene sequence G1, using the unused random gene sequence G0 The i1, i2, i3, i4, and i5th genes are used to replace the corresponding position genes of the initial offspring gene sequence G1. i1 takes [3,4,5,0,1,2], and i2 takes [i1+1,5]. , i3 takes [i2+1,5], i4 takes [i3+1,5], and i5 takes [i4+1,5], the following ordered offspring candidate set belonging to the fifth gene replacement can be generated, Check in order whether each candidate gene sequence in the ordered descendant candidate set already exists on the blockchain. If it does not exist, mark the candidate gene sequence as existing (or marked as used) and return, and at the same time, mark the following The candidate gene sequences are uploaded to the blockchain, and if all exist, continue to the next step. Among them, the generated candidate set of ordered offspring belonging to the fifth gene replacement is:
i1=3,i2=4,i3=5,i4、i5是空集{}。i1=3, i2=4, i3=5, i4 and i5 are empty sets {}.
i1=4,i2=5,i3、i4、i5均是空集{}。i1=4, i2=5, i3, i4, and i5 are all empty sets {}.
i1=5,i2、i3、i4、i5均是空集{}。i1=5, i2, i3, i4, and i5 are all empty sets {}.
i1=0,i2=1,i3=2,i4={3},i5={4,5}时,替换后形成的候选基因序列有:When i1=0, i2=1, i3=2, i4={3}, i5={4,5}, the candidate gene sequences formed after replacement are:
0010 1000 0110 0110 1010 00000010 1000 0110 0110 1010 0000
0010 1000 0110 0110 1101 11010010 1000 0110 0110 1101 1101
i1=0,i2=1,i3=2,i4={4},i5={5}时,替换后形成的候选基因序列有:When i1=0, i2=1, i3=2, i4={4}, i5={5}, the candidate gene sequences formed after replacement are:
0010 1000 0110 0111 1010 11010010 1000 0110 0111 1010 1101
i1=0,i2=1,i3=2,i4={5},i5是空集{}。i1=0, i2=1, i3=2, i4={5}, i5 is the empty set {}.
i1=0,i2=1,i3=3,i4={4},i5={5}时,替换后形成的候选基因序列有:When i1=0, i2=1, i3=3, i4={4}, i5={5}, the candidate gene sequences formed after replacement are:
0010 1000 1111 0110 1010 11010010 1000 1111 0110 1010 1101
i1=0,i2=2,i3=3,i4={4},i5={5}时,替换后形成的候选基因序列有:When i1=0, i2=2, i3=3, i4={4}, i5={5}, the candidate gene sequences formed after replacement are:
0010 0001 0110 0110 1010 11010010 0001 0110 0110 1010 1101
i1=1,i2=2,i3=3,i4={4},i5={5}时,替换后形成的候选基因序列有:When i1=1, i2=2, i3=3, i4={4}, i5={5}, the candidate gene sequences formed after replacement are:
1101 1000 0110 0110 1010 11011101 1000 0110 0110 1010 1101
i1=2,i2=3,i3=4,i4=5,i5是空集{}。i1=2, i2=3, i3=4, i4=5, i5 is the empty set {}.
比如,假设属于第五次基因替换的有序子代候选集中的一个候选基因序列0010 1000 0110 0110 1101 1101不存在于区块链上,则可以将该候选基因序列0010 1000 0110 0110 1101 1101作为新福虎数字资产具有的基因序列。如果上述产生的属于第五次基因替换的有序子代候选集中各候选基因序列均不存在于区块链上,则可以直接将未被使用的随机基因 序列G0=0010 1000 1100 0110 1010 1101作为新福虎数字资产具有的基因序列,因为未被使用的随机基因序列是不存在于区块链上的,以此生成新的数字资产具有的基因序列,确定性遗传算法终止,同时将该未被使用的随机基因序列标注为存在(或者标注为已使用)并上传至区块链。如此,该方案能够满足在有确定的搜索空间内产生新数字资产具有的基因序列,并可以有效地确保所生成的新数字资产具有的基因序列的唯一性。For example, assuming that a candidate gene sequence 0010 1000 0110 0110 1101 1101 belonging to the ordered offspring candidate set of the fifth gene replacement does not exist on the blockchain, the candidate gene sequence 0010 1000 0110 0110 1101 1101 can be used as a new The genetic sequence of Fuhu digital assets. If each candidate gene sequence in the ordered descendant candidate set generated above for the fifth gene replacement does not exist on the blockchain, the unused random gene sequence G0=0010 1000 1100 0110 1010 1101 can be directly used as The gene sequence of the new Fuhu digital asset, because the unused random gene sequence does not exist on the blockchain, is used to generate the gene sequence of the new digital asset. The deterministic genetic algorithm terminates and the unused gene sequence is The used random gene sequence is marked as present (or marked as used) and uploaded to the blockchain. In this way, this solution can meet the requirement of generating the genetic sequence of a new digital asset within a certain search space, and can effectively ensure the uniqueness of the genetic sequence of the generated new digital asset.
上述实施例表明,本发明中的技术方案通过客户端为各区块链节点生成相同的未被使用的随机基因序列,即可使得各区块链节点能够按照同一替换方式针对初始子代基因序列进行基因替换,从而可以避免出现因产生的随机数不同导致各区块链节点生成的新数字资产具有的基因序列不一致的情况,并可以有效地确保所生成的新数字资产具有的基因序列的唯一性。具体来说,针对任一区块链节点,区块链节点在检测到数字资产合成交易时,即可对数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,以此生成初始子代基因序列。然后,在确定区块链上不存在初始子代基因序列时,将该初始子代基因序列作为新数字资产具有的基因序列;在确定区块链上存在初始子代基因序列时,即可按照设定的基因替换方式,并基于未被使用的随机基因序列,对初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集,以此可以有效地判断有序子代候选集是否有某一候选基因序列不存在于区块链上。如果判断有序子代候选集中的各候选基因序列均存在于区块链上,那么可以基于未被使用的随机基因序列,对初始子代基因序列进行第i+1次基因替换,直至对初始子代基因序列进行第n-1次基因替换后为止,从而可以确定出针对k个待合成的数字资产所生成的新数字资产具有的基因序列。如此,该方案由于能够满足在有确定的搜索空间内产生新数字资产具有的基因序列,且针对某一次基因替换所生成的有序子代候选集进行判断该有序子代候选集中的候选基因序列是否存在于区块链上,因此可以有效地避免出现当前生成的基因序列与之前生成的基因序列存在冲突的问题,以此可以有效地确保用户响应时间不会超时。此外,该方案由于通过客户端为各区块链节点生成相同的未被使用的随机基因序列,即可使得各区块链节点能够按照同一替换方式针对初始子代基因序列进行基因替换,因此可以有效地确保在不同区块链节点上针对生成的新数字资产具有的基因序列的执行结果是一致的,以此可以解决现有技术中因各区块链节点产生的随机数不相同而导致现有遗传算法无法应用在区块链上的问题。The above embodiments show that the technical solution in the present invention generates the same unused random gene sequence for each blockchain node through the client, so that each blockchain node can perform genetic modification on the initial offspring gene sequence according to the same replacement method. Replacement can avoid the situation where the genetic sequence of the new digital assets generated by each blockchain node is inconsistent due to the different random numbers generated, and can effectively ensure the uniqueness of the genetic sequence of the new digital assets generated. Specifically, for any blockchain node, when the blockchain node detects a digital asset synthesis transaction, it can perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, so as to This generates the initial progeny gene sequence. Then, when it is determined that the initial offspring gene sequence does not exist on the blockchain, the initial offspring gene sequence is used as the gene sequence of the new digital asset; when it is determined that the initial offspring gene sequence exists on the blockchain, the initial offspring gene sequence can be used as Based on the set gene replacement method, and based on the unused random gene sequence, the i-th gene replacement is performed on the initial offspring gene sequence to generate an ordered offspring candidate set belonging to the i-th gene replacement, which can effectively Determine whether a certain candidate gene sequence in the ordered descendant candidate set does not exist on the blockchain. If it is determined that each candidate gene sequence in the ordered offspring candidate set exists on the blockchain, then the i+1th gene replacement can be performed on the initial offspring gene sequence based on the unused random gene sequence until the initial After the n-1 gene replacement of the offspring gene sequence, the gene sequence of the new digital asset generated for the k digital assets to be synthesized can be determined. In this way, this scheme can generate the gene sequence of a new digital asset within a certain search space, and judge the candidate genes in the ordered descendant candidate set based on the ordered descendant candidate set generated by a certain gene replacement. Whether the sequence exists on the blockchain, this can effectively avoid the problem of conflicts between the currently generated gene sequence and the previously generated gene sequence, thus effectively ensuring that the user response time will not time out. In addition, because the client generates the same unused random gene sequence for each blockchain node, this solution enables each blockchain node to perform gene replacement for the initial offspring gene sequence according to the same replacement method, so it can effectively Ensure that the execution results of the genetic sequences of the new digital assets generated on different blockchain nodes are consistent. This can solve the problem of existing genetic algorithms caused by different random numbers generated by each blockchain node in the existing technology. Problems that cannot be applied to the blockchain.
基于相同的技术构思,图3示例性的示出了本发明实施例提供的一种基于区块链的数字资产合成装置,该装置可以执行基于区块链的数字资产合成方法的流程。其中,本发明实施例中的基于区块链的数字资产合成方法适用于具有m个区块链节点的区块链网络;基于区块链的数字资产合成装置可以是服务设备或者也可以是能够支持服务设备实现该方法所需的功能的部件(比如芯片或集成电路)等,当然也可以是其它具有实现该方法所需的功能的电子设备。其中,m为大于1的整数。Based on the same technical concept, Figure 3 exemplarily shows a blockchain-based digital asset synthesis device provided by an embodiment of the present invention. The device can execute the process of the blockchain-based digital asset synthesis method. Among them, the blockchain-based digital asset synthesis method in the embodiment of the present invention is suitable for a blockchain network with m blockchain nodes; the blockchain-based digital asset synthesis device may be a service device or may be a capable The components (such as chips or integrated circuits) that support the service device to implement the functions required by the method may of course also be other electronic devices with the functions required to implement the method. Among them, m is an integer greater than 1.
如图3所示,该装置包括:As shown in Figure 3, the device includes:
生成单元301,用于针对任一区块链节点,在检测到数字资产合成交易时,对所述数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,生成初始子代基因序列;所述数字资产合成交易是客户端基于k个待合成的数字资产具有的基因序列以及所述客户端生成的一个未被使用的随机基因序列确定的;每个待合成的数字资产具有的基因序列以及所述未被使用的随机基因序列中均包括n个基因;The generation unit 301 is used for any blockchain node, when a digital asset synthesis transaction is detected, to perform an XOR operation on the gene sequences of k digital assets to be synthesized in the digital asset synthesis transaction, and generate an initial sub- generation gene sequence; the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized Both the existing gene sequence and the unused random gene sequence include n genes;
处理单元302,用于在确定区块链上存在所述初始子代基因序列时,按照设定的基因 替换方式,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集;所述属于第i次基因替换的有序子代候选集包括j个候选基因序列;若确定所述j个候选基因序列均存在于所述区块链中,则基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i+1次基因替换,直至对所述初始子代基因序列进行第n-1次基因替换后为止,从而确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列。The processing unit 302 is configured to, when it is determined that the initial offspring gene sequence exists on the blockchain, perform a genetic modification on the initial offspring gene sequence based on the unused random gene sequence according to the set gene replacement method. The i-th gene replacement generates an ordered set of offspring candidates belonging to the i-th gene replacement; the ordered set of offspring candidates belonging to the i-th gene replacement includes j candidate gene sequences; if the j candidates are determined If all gene sequences exist in the blockchain, then based on the unused random gene sequence, the i+1th gene replacement is performed on the initial offspring gene sequence until the initial offspring gene sequence is Until the n-1th gene replacement is performed, the gene sequence of the new digital asset generated for the k digital assets to be synthesized is determined.
可选地,所述处理单元302具体用于:Optionally, the processing unit 302 is specifically used to:
从所述未被使用的随机基因序列中选取i个基因作为所述初始子代基因序列的替换基因;Select i genes from the unused random gene sequences as replacement genes for the initial offspring gene sequence;
将所述未被使用的随机基因序列中的i个基因与所述初始子代基因序列中对应位置的i个基因进行互换,从而生成属于第i次基因替换的有序子代候选集。The i genes in the unused random gene sequence are exchanged with the i genes at corresponding positions in the initial offspring gene sequence, thereby generating an ordered offspring candidate set belonging to the i-th gene replacement.
可选地,所述处理单元302还用于:Optionally, the processing unit 302 is also used to:
若确定所述j个候选基因序列中任一候选基因序列不存在于所述区块链中,则将所述候选基因序列确定为所述新数字资产具有的基因序列。If it is determined that any candidate gene sequence among the j candidate gene sequences does not exist in the blockchain, then the candidate gene sequence is determined to be the gene sequence possessed by the new digital asset.
可选地,所述处理单元302还用于:Optionally, the processing unit 302 is also used to:
在对所述初始子代基因序列进行第n-1次基因替换之后,若确定针对所述初始子代基因序列进行第n-1次基因替换所生成的属于第n-1次基因替换的有序子代候选集中包括的p个候选基因序列均存在于所述区块链中,则将所述未被使用的随机基因序列确定为所述新数字资产具有的基因序列。After the n-1th gene replacement is performed on the initial progeny gene sequence, if it is determined that the n-1th gene replacement generated on the initial progeny gene sequence belongs to the n-1th gene replacement. If the p candidate gene sequences included in the descendant candidate set all exist in the blockchain, then the unused random gene sequence is determined to be the gene sequence of the new digital asset.
可选地,所述处理单元302具体用于:Optionally, the processing unit 302 is specifically used to:
基于所述未被使用的随机基因序列以及所述n,确定至少一个用于基因替换的基因位置序号组合;每个基因位置序号组合包括至少一个具有运算先后次序的取值集合;Based on the unused random gene sequence and the n, determine at least one gene position sequence number combination for gene replacement; each gene position sequence number combination includes at least one value set with an operation sequence;
根据所述未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对所述初始子代基因序列中对应位置的i个基因进行替换,从而生成属于第i次基因替换的有序子代候选集。According to the i genes in the unused random gene sequence, and through at least one gene position number combination, the i genes at the corresponding positions in the initial offspring gene sequence are replaced, thereby generating the i-th gene An ordered set of descendant candidates for replacement.
可选地,所述处理单元302具体用于:Optionally, the processing unit 302 is specifically used to:
若所述i的取值为1,则将所述未被使用的随机基因序列与所述n进行取余运算,确定第一数值;If the value of i is 1, perform a remainder operation on the unused random gene sequence and n to determine the first value;
基于所述第一数值以及所述n,确定n个具有运算先后次序的初始基因位置序号;Based on the first numerical value and the n, determine n initial gene position numbers with operational order;
按照所述n个初始基因位置序号的运算先后次序,依次将n个初始基因位置序号与所述n进行取余运算,从而确定n个具有运算先后次序的第一基因位置序号;所述n个具有运算先后次序的第一基因位置序号用于构成第一基因位置序号组合;所述n个具有运算先后次序的第一基因位置序号用于辅助基因替换;According to the order of operation of the n initial gene position numbers, the n initial gene position numbers and the n are sequentially subjected to a remainder operation, thereby determining n first gene position numbers with the order of operation; the n The first gene position numbers with the order of operations are used to form the first gene position number combination; the n first gene position numbers with the order of operations are used to assist gene replacement;
所述处理单元302具体用于:The processing unit 302 is specifically used to:
按照所述第一基因位置序号组合中包括的n个第一基因位置序号具有的运算先后次序,依次将该n个第一基因位置序号在所述初始子代基因序列中对应的基因替换为该n个第一基因位置序号在所述未被使用的随机基因序列中对应的基因,从而生成属于第i次基因替换的有序子代候选集。According to the order of operation of the n first gene position numbers included in the first gene position number combination, the genes corresponding to the n first gene position numbers in the initial offspring gene sequence are sequentially replaced with The n first gene position numbers correspond to genes in the unused random gene sequence, thereby generating an ordered set of offspring candidates belonging to the i-th gene replacement.
可选地,所述处理单元302具体用于:Optionally, the processing unit 302 is specifically used to:
若所述i的取值大于等于2,基于第1次基因替换对应的n个具有运算先后次序的第 一基因位置序号,确定除第1次基因替换对应的一个基因之外的其它i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号;If the value of i is greater than or equal to 2, based on the n first gene position numbers with operational order corresponding to the first gene replacement, determine other i-1 except the one gene corresponding to the first gene replacement. The q second gene position numbers corresponding to each gene have the order of operation;
根据所述n个具有运算先后次序的第一基因位置序号以及所述其它i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号,确定多个用于基因替换的第二基因位置序号组合;According to the n first gene position numbers with operation order and the q second gene position numbers with operation order corresponding to the other i-1 genes, a plurality of second gene position numbers for gene replacement are determined. Gene position sequence number combination;
所述处理单元302具体用于:The processing unit 302 is specifically used to:
针对每个第二基因位置序号组合,若所述第二基因位置序号组合中存在至少一个取值集合为空集,则不针对所述初始子代基因序列进行基因替换;For each second gene position sequence number combination, if at least one value set in the second gene position sequence number combination is an empty set, gene replacement will not be performed for the initial offspring gene sequence;
若所述第二基因位置序号组合中不存在任何一个取值集合为空集,则所依次将所述初始子代基因序列中所述第二基因位置序号组合包括的至少一个基因位置序号对应的基因替换为所述未被使用的随机基因序列中所述至少一个基因位置序号对应的基因,从而生成属于第i次基因替换的有序子代候选集。If there is no value set in the second gene position sequence number combination and is an empty set, then the sequence corresponding to at least one gene position sequence number included in the second gene position sequence number combination in the initial offspring gene sequence is The gene is replaced with a gene corresponding to the position number of the at least one gene in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
可选地,所述处理单元302还用于:Optionally, the processing unit 302 is also used to:
在确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列之后,将所述新数字资产具有的基因序列的使用状态标记为已使用,并将标记为已使用的所述新数字资产具有的基因序列上传至所述区块链进行保存。After determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized, the usage status of the gene sequence of the new digital asset is marked as used, and the gene sequence is marked as used. The genetic sequence of the new digital asset is uploaded to the blockchain for storage.
基于相同的技术构思,本发明实施例还提供了一种计算设备,如图4所示,包括至少一个处理器401,以及与至少一个处理器连接的存储器402,本发明实施例中不限定处理器401与存储器402之间的具体连接介质,图4中处理器401和存储器402之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。Based on the same technical concept, an embodiment of the present invention also provides a computing device, as shown in Figure 4, including at least one processor 401 and a memory 402 connected to the at least one processor. The processing is not limited in the embodiment of the present invention. The specific connection medium between the processor 401 and the memory 402 is as follows. In Figure 4, the processor 401 and the memory 402 are connected through a bus as an example. The bus can be divided into address bus, data bus, control bus, etc.
在本发明实施例中,存储器402存储有可被至少一个处理器401执行的指令,至少一个处理器401通过执行存储器402存储的指令,可以执行前述的基于区块链的数字资产合成方法中所包括的步骤。In this embodiment of the present invention, the memory 402 stores instructions that can be executed by at least one processor 401. By executing the instructions stored in the memory 402, at least one processor 401 can execute the aforementioned blockchain-based digital asset synthesis method. steps included.
其中,处理器401是计算设备的控制中心,可以利用各种接口和线路连接计算设备的各个部分,通过运行或执行存储在存储器402内的指令以及调用存储在存储器402内的数据,从而实现数据处理。可选的,处理器401可包括一个或多个处理单元,处理器401可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理下发指令。可以理解的是,上述调制解调处理器也可以不集成到处理器401中。在一些实施例中,处理器401和存储器402可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。Among them, the processor 401 is the control center of the computing device. It can use various interfaces and lines to connect various parts of the computing device, and implement data by running or executing instructions stored in the memory 402 and calling data stored in the memory 402. deal with. Optionally, the processor 401 may include one or more processing units. The processor 401 may integrate an application processor and a modem processor. The application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor The debugging processor mainly handles issuing instructions. It can be understood that the above modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 can be implemented on the same chip, and in some embodiments, they can also be implemented on separate chips.
处理器401可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合基于区块链的数字资产合成方法实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。The processor 401 may be a general processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps and logical block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the blockchain-based digital asset synthesis method can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
存储器402作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器402可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储 器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器402是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器402还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。As a non-volatile computer-readable storage medium, the memory 402 can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Memory, Disk , CD, etc. Memory 402 is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 402 in the embodiment of the present invention can also be a circuit or any other device capable of realizing a storage function, used to store program instructions and/or data.
基于相同的技术构思,本发明实施例还提供了一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述基于区块链的数字资产合成方法的步骤。Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium that stores a computer program that can be executed by a computing device. When the program is run on the computing device, the computing device causes the computing device to Execute the steps of the blockchain-based digital asset synthesis method described above.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the invention 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, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art will be able to make additional changes and modifications to these embodiments once the basic inventive concepts are apparent. Therefore, it is intended that the appended claims be construed to include the preferred embodiments and all changes and modifications that fall within the scope of the invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of this application and equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (11)

  1. 一种基于区块链的数字资产合成方法,其特征在于,适用于具有m个区块链节点的区块链网络,所述方法包括:A blockchain-based digital asset synthesis method, characterized in that it is suitable for a blockchain network with m blockchain nodes, and the method includes:
    针对任一区块链节点,所述区块链节点在检测到数字资产合成交易时,对所述数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,生成初始子代基因序列;所述数字资产合成交易是客户端基于k个待合成的数字资产具有的基因序列以及所述客户端生成的一个未被使用的随机基因序列确定的;每个待合成的数字资产具有的基因序列以及所述未被使用的随机基因序列中均包括n个基因;For any blockchain node, when the blockchain node detects a digital asset synthesis transaction, it performs an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction to generate an initial sub- generation gene sequence; the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized Both the existing gene sequence and the unused random gene sequence include n genes;
    所述区块链节点在确定区块链上存在所述初始子代基因序列时,按照设定的基因替换方式,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集;所述属于第i次基因替换的有序子代候选集包括j个候选基因序列;When the blockchain node determines that the initial progeny gene sequence exists on the blockchain, it will perform the initial progeny gene sequence on the set gene replacement method based on the unused random gene sequence. The i-th gene replacement generates an ordered progeny candidate set belonging to the i-th gene replacement; the ordered progeny candidate set belonging to the i-th gene replacement includes j candidate gene sequences;
    所述区块链节点若确定所述j个候选基因序列均存在于所述区块链中,则基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i+1次基因替换,直至对所述初始子代基因序列进行第n-1次基因替换后为止,从而确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列。If the blockchain node determines that the j candidate gene sequences all exist in the blockchain, then based on the unused random gene sequence, the i+1th process is performed on the initial offspring gene sequence. times of gene replacement until the n-1th gene replacement is performed on the initial offspring gene sequence, thereby determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized.
  2. 如权利要求1所述的方法,其特征在于,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集,包括:The method according to claim 1, characterized in that, based on the unused random gene sequence, the i-th gene replacement is performed on the initial progeny gene sequence to generate an ordered gene belonging to the i-th gene replacement. The set of proxy candidates includes:
    所述区块链节点从所述未被使用的随机基因序列中选取i个基因作为所述初始子代基因序列的替换基因;The blockchain node selects i genes from the unused random gene sequences as replacement genes for the initial offspring gene sequence;
    所述区块链节点将所述未被使用的随机基因序列中的i个基因与所述初始子代基因序列中对应位置的i个基因进行互换,从而生成属于第i次基因替换的有序子代候选集。The blockchain node exchanges the i genes in the unused random gene sequence with the i genes at the corresponding positions in the initial offspring gene sequence, thereby generating the i genes belonging to the i-th gene replacement. The set of sequential descendant candidates.
  3. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    所述区块链节点若确定所述j个候选基因序列中任一候选基因序列不存在于所述区块链中,则将所述候选基因序列确定为所述新数字资产具有的基因序列。If the blockchain node determines that any candidate gene sequence among the j candidate gene sequences does not exist in the blockchain, it will determine the candidate gene sequence as the gene sequence of the new digital asset.
  4. 如权利要求1所述的方法,其特征在于,在对所述初始子代基因序列进行第n-1次基因替换之后,还包括:The method according to claim 1, characterized in that, after performing the n-1th gene replacement on the initial progeny gene sequence, it further includes:
    所述区块链节点若确定针对所述初始子代基因序列进行第n-1次基因替换所生成的属于第n-1次基因替换的有序子代候选集中包括的p个候选基因序列均存在于所述区块链中,则将所述未被使用的随机基因序列确定为所述新数字资产具有的基因序列。If the blockchain node determines that the p candidate gene sequences included in the ordered offspring candidate set belonging to the n-1th gene replacement generated by performing the n-1th gene replacement on the initial offspring gene sequence are all exists in the blockchain, the unused random gene sequence is determined as the gene sequence of the new digital asset.
  5. 如权利要求2所述的方法,其特征在于,所述区块链节点将所述未被使用的随机基因序列中的i个基因与所述初始子代基因序列中对应位置的i个基因进行互换,从而生成属于第i次基因替换的有序子代候选集,包括:The method of claim 2, wherein the blockchain node compares i genes in the unused random gene sequence with i genes at corresponding positions in the initial offspring gene sequence. Interchange, thereby generating an ordered set of offspring candidates belonging to the i-th gene replacement, including:
    所述区块链节点基于所述未被使用的随机基因序列以及所述n,确定至少一个用于基因替换的基因位置序号组合;每个基因位置序号组合包括至少一个具有运算先后次序的取值集合;The blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and the n; each gene position sequence number combination includes at least one value with an operation sequence. gather;
    所述区块链节点根据所述未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对所述初始子代基因序列中对应位置的i个基因进行替换,从而生成属 于第i次基因替换的有序子代候选集。The blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement.
  6. 如权利要求5所述的方法,其特征在于,所述区块链节点基于所述未被使用的随机基因序列以及所述n,确定至少一个用于基因替换的基因位置序号组合,包括:The method of claim 5, wherein the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n, including:
    若所述i的取值为1,则所述区块链节点将所述未被使用的随机基因序列与所述n进行取余运算,确定第一数值;If the value of i is 1, then the blockchain node performs a remainder operation on the unused random gene sequence and n to determine the first value;
    所述区块链节点基于所述第一数值以及所述n,确定n个具有运算先后次序的初始基因位置序号;The blockchain node determines n initial gene position numbers with operational order based on the first value and n;
    所述区块链节点按照所述n个初始基因位置序号的运算先后次序,依次将n个初始基因位置序号与所述n进行取余运算,从而确定n个具有运算先后次序的第一基因位置序号;所述n个具有运算先后次序的第一基因位置序号用于构成第一基因位置序号组合;所述n个具有运算先后次序的第一基因位置序号用于辅助基因替换;The blockchain node performs a remainder operation on the n initial gene position numbers and n in sequence according to the order of operations of the n initial gene position numbers, thereby determining the n first gene positions in the order of operations. Serial number; the n first gene position serial numbers with operational order are used to form a first gene position serial number combination; the n first gene position serial numbers with operational order are used to assist gene replacement;
    所述区块链节点根据所述未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对所述初始子代基因序列中对应位置的i个基因进行替换,从而生成属于第i次基因替换的有序子代候选集,包括:The blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement, including:
    所述区块链节点按照所述第一基因位置序号组合中包括的n个第一基因位置序号具有的运算先后次序,依次将该n个第一基因位置序号在所述初始子代基因序列中对应的基因替换为该n个第一基因位置序号在所述未被使用的随机基因序列中对应的基因,从而生成属于第i次基因替换的有序子代候选集。The blockchain node sequentially adds the n first gene position numbers in the initial offspring gene sequence according to the order of operation of the n first gene position numbers included in the first gene position number combination. The corresponding genes are replaced with genes corresponding to the n first gene position numbers in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
  7. 如权利要求6所述的方法,其特征在于,所述区块链节点基于所述未被使用的随机基因序列以及所述n,确定至少一个用于基因替换的基因位置序号组合,包括:The method of claim 6, wherein the blockchain node determines at least one gene position sequence number combination for gene replacement based on the unused random gene sequence and n, including:
    若所述i的取值大于等于2,所述区块链节点基于第1次基因替换对应的n个具有运算先后次序的第一基因位置序号,确定除第1次基因替换对应的一个基因之外的其它i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号;If the value of i is greater than or equal to 2, the blockchain node determines, based on the n first gene position numbers with operational order corresponding to the first gene replacement, except one gene corresponding to the first gene replacement. The other i-1 genes each correspond to the q second gene position numbers in the order of operation;
    所述区块链节点根据所述n个具有运算先后次序的第一基因位置序号以及所述其它i-1个基因各自对应的q个具有运算先后次序的第二基因位置序号,确定多个用于基因替换的第二基因位置序号组合;The blockchain node determines a plurality of user genes based on the n first gene position numbers in the order of operations and the q second gene position numbers in the order of operations corresponding to the other i-1 genes. Second gene position sequence number combination based on gene replacement;
    所述区块链节点根据所述未被使用的随机基因序列中的i个基因,并通过至少一个基因位置序号组合,对所述初始子代基因序列中对应位置的i个基因进行替换,从而生成属于第i次基因替换的有序子代候选集,包括:The blockchain node replaces the i genes at the corresponding positions in the initial offspring gene sequence based on the i genes in the unused random gene sequence and through at least one gene position number combination, thereby Generate an ordered set of offspring candidates belonging to the i-th gene replacement, including:
    针对每个第二基因位置序号组合,若所述第二基因位置序号组合中存在至少一个取值集合为空集,则所述区块链节点不针对所述初始子代基因序列进行基因替换;For each second gene position sequence number combination, if at least one value set in the second gene position sequence number combination is an empty set, the blockchain node does not perform gene replacement for the initial offspring gene sequence;
    若所述第二基因位置序号组合中不存在任何一个取值集合为空集,则所述区块链节点依次将所述初始子代基因序列中所述第二基因位置序号组合包括的至少一个基因位置序号对应的基因替换为所述未被使用的随机基因序列中所述至少一个基因位置序号对应的基因,从而生成属于第i次基因替换的有序子代候选集。If there is no value set in the second gene position sequence number combination that is an empty set, the blockchain node will sequentially add at least one value set included in the second gene position sequence number combination in the initial offspring gene sequence. The gene corresponding to the gene position number is replaced with the gene corresponding to at least one gene position number in the unused random gene sequence, thereby generating an ordered descendant candidate set belonging to the i-th gene replacement.
  8. 如权利要求1所述的方法,其特征在于,在确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列之后,还包括:The method according to claim 1, characterized in that, after determining the gene sequence of the new digital asset generated for the k digital assets to be synthesized, it further includes:
    将所述新数字资产具有的基因序列的使用状态标记为已使用,并将标记为已使用的所述新数字资产具有的基因序列上传至所述区块链进行保存。Mark the usage status of the gene sequence of the new digital asset as used, and upload the gene sequence of the new digital asset marked as used to the blockchain for storage.
  9. 一种基于区块链的数字资产合成装置,其特征在于,适用于具有m个区块链节点 的区块链网络,所述装置包括:A digital asset synthesis device based on blockchain, which is characterized in that it is suitable for a blockchain network with m blockchain nodes. The device includes:
    生成单元,用于针对任一区块链节点,在检测到数字资产合成交易时,对所述数字资产合成交易中k个待合成的数字资产具有的基因序列进行异或运算,生成初始子代基因序列;所述数字资产合成交易是客户端基于k个待合成的数字资产具有的基因序列以及所述客户端生成的一个未被使用的随机基因序列确定的;每个待合成的数字资产具有的基因序列以及所述未被使用的随机基因序列中均包括n个基因;The generation unit is used for any blockchain node, when a digital asset synthesis transaction is detected, to perform an XOR operation on the gene sequences of the k digital assets to be synthesized in the digital asset synthesis transaction, and generate an initial offspring. Gene sequence; the digital asset synthesis transaction is determined by the client based on the gene sequences of k digital assets to be synthesized and an unused random gene sequence generated by the client; each digital asset to be synthesized has The gene sequence and the unused random gene sequence include n genes;
    处理单元,用于在确定区块链上存在所述初始子代基因序列时,按照设定的基因替换方式,基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i次基因替换,生成属于第i次基因替换的有序子代候选集;所述属于第i次基因替换的有序子代候选集包括j个候选基因序列;若确定所述j个候选基因序列均存在于所述区块链中,则基于所述未被使用的随机基因序列,对所述初始子代基因序列进行第i+1次基因替换,直至对所述初始子代基因序列进行第n-1次基因替换后为止,从而确定出针对所述k个待合成的数字资产所生成的新数字资产具有的基因序列。A processing unit configured to perform a third process on the initial offspring gene sequence based on the unused random gene sequence according to the set gene replacement method when it is determined that the initial offspring gene sequence exists on the blockchain. The i-th gene replacement generates an ordered progeny candidate set belonging to the i-th gene replacement; the ordered progeny candidate set belonging to the i-th gene replacement includes j candidate gene sequences; if the j candidate genes are determined If the sequences all exist in the blockchain, then based on the unused random gene sequence, the i+1th gene replacement is performed on the initial offspring gene sequence until the initial offspring gene sequence is After the n-1th gene replacement, the gene sequence of the new digital asset generated for the k digital assets to be synthesized is determined.
  10. 一种计算设备,其特征在于,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行权利要求1至8任一项所述的方法。A computing device, characterized by comprising at least one processor and at least one memory, wherein the memory stores a computer program, which when executed by the processor causes the processor to execute claim 1 The method described in any one of to 8.
  11. 一种计算机可读存储介质,其特征在于,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行权利要求1至8任一项所述的方法。A computer-readable storage medium, characterized in that it stores a computer program that can be executed by a computing device, and when the program is run on the computing device, the computing device executes any one of claims 1 to 8 the method described.
PCT/CN2022/122796 2022-06-29 2022-09-29 Blockchain-based digital asset synthesis method and apparatus WO2024000897A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210762540.8 2022-06-29
CN202210762540.8A CN115048462A (en) 2022-06-29 2022-06-29 Block chain-based digital asset synthesis method and device

Publications (1)

Publication Number Publication Date
WO2024000897A1 true WO2024000897A1 (en) 2024-01-04

Family

ID=83164838

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/122796 WO2024000897A1 (en) 2022-06-29 2022-09-29 Blockchain-based digital asset synthesis method and apparatus

Country Status (2)

Country Link
CN (1) CN115048462A (en)
WO (1) WO2024000897A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115048462A (en) * 2022-06-29 2022-09-13 深圳前海微众银行股份有限公司 Block chain-based digital asset synthesis method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019027457A1 (en) * 2017-08-02 2019-02-07 Intuit Inc. Genetic algorithms in blockchain space
US20200076798A1 (en) * 2018-08-28 2020-03-05 Ofer A. LIDSKY Systems and methods for user authentication based on a genetic sequence
CN111143747A (en) * 2019-12-30 2020-05-12 山东爱城市网信息技术有限公司 Block chain-based news content production method, equipment and medium
CN113396388A (en) * 2018-12-07 2021-09-14 耐克创新有限合伙公司 System and method for providing encrypted secure digital assets
CN113656768A (en) * 2021-10-20 2021-11-16 浙江中科华知科技股份有限公司 Method, system and storage medium for tracking digital asset flow direction in block chain
CN113822974A (en) * 2021-11-24 2021-12-21 支付宝(杭州)信息技术有限公司 Method, apparatus, electronic device, medium, and program for generating avatar
CN115048462A (en) * 2022-06-29 2022-09-13 深圳前海微众银行股份有限公司 Block chain-based digital asset synthesis method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019027457A1 (en) * 2017-08-02 2019-02-07 Intuit Inc. Genetic algorithms in blockchain space
US20200076798A1 (en) * 2018-08-28 2020-03-05 Ofer A. LIDSKY Systems and methods for user authentication based on a genetic sequence
CN113396388A (en) * 2018-12-07 2021-09-14 耐克创新有限合伙公司 System and method for providing encrypted secure digital assets
CN111143747A (en) * 2019-12-30 2020-05-12 山东爱城市网信息技术有限公司 Block chain-based news content production method, equipment and medium
CN113656768A (en) * 2021-10-20 2021-11-16 浙江中科华知科技股份有限公司 Method, system and storage medium for tracking digital asset flow direction in block chain
CN113822974A (en) * 2021-11-24 2021-12-21 支付宝(杭州)信息技术有限公司 Method, apparatus, electronic device, medium, and program for generating avatar
CN115048462A (en) * 2022-06-29 2022-09-13 深圳前海微众银行股份有限公司 Block chain-based digital asset synthesis method and device

Also Published As

Publication number Publication date
CN115048462A (en) 2022-09-13

Similar Documents

Publication Publication Date Title
CN107577427B (en) data migration method, device and storage medium for blockchain system
TWI731595B (en) Block chain state data storage method and device, and electronic equipment
TWI732463B (en) Block chain state data recovery method and device, and electronic equipment
US20200356901A1 (en) Target variable distribution-based acceptance of machine learning test data sets
WO2018157778A1 (en) Method and apparatus for writing service data into block chain and method for determining service subset
TWI712976B (en) Asset management system, method and device, electronic equipment
US20200167345A1 (en) Method and apparatus for storing blockchain state data and electronic device
WO2020238254A1 (en) Data storage method and node
EP4254183A1 (en) Transaction processing method and apparatus, computer device, and storage medium
TW201823988A (en) Block data checking method and device
TWI730690B (en) Method and device for simultaneously executing transactions in block chain, computer readable storage medium and computing equipment
TWI742659B (en) Block chain-based method and device for obtaining evidence of infringement, electronic equipment, and storage media
US10108658B1 (en) Deferred assignments in journal-based storage systems
TW202024984A (en) Data reading and writing method and device and electronic equipment
US10795882B2 (en) Blockchain-based data compression and searching
TW202025057A (en) Field updating method and device and electronic equipment
WO2019211057A1 (en) Methods and systems for simplified graphical depictions of bipartite graphs
CN104361119A (en) Data cleaning method and system
WO2024000897A1 (en) Blockchain-based digital asset synthesis method and apparatus
US20210311916A1 (en) Blockchain-based hierarchical data storage
US10599614B1 (en) Intersection-based dynamic blocking
TW202030658A (en) Data structure reading method and apparatus, data structure updating method and apparatus, and electronic device
CN105677645B (en) A kind of tables of data comparison method and device
WO2023184052A1 (en) Data processing method, blockchain node and blockchain system
CN109710698B (en) Data aggregation method and device, electronic equipment and 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: 22948985

Country of ref document: EP

Kind code of ref document: A1