Block chain data coding and decoding method, device, equipment and medium based on GEP
1. A block chain data coding method based on GEP is characterized by comprising the following steps:
converting the target transaction information into a transaction expression by using a GEP coding mode based on a preset coding space and a preset coding rule;
converting the transaction expression containing the target transaction information into an ORF expression according to the encoding rule;
drawing an expression tree according to the encoding rule and the ORF expression containing the target transaction information;
according to the coding rule, sequencing the ORF expression containing the target transaction information, and converting the ORF expression into a gene unit, wherein the gene unit only represents one piece of target transaction information and comprises a gene head and a gene tail, and the gene head stores block chain transaction service processing logic; the tail part of the gene stores a block chain transaction business object;
packaging the gene units or gene segments formed by sequencing a plurality of gene units into a block data structure of a block chain, adding the gene or gene segment into a credible chromosome in a sequencing mode after the blocks are added into the block chain for storage, and forming the block chain under the block chain technical condition, wherein the chromosome is an information collection obtained after sequencing and integrating all the genes or gene segments in a sequencing mode.
2. The GEP-based block chain data encoding method of claim 1, wherein the pre-determined process of the coding space comprises:
setting a function character set and a terminal character set, wherein the step of setting the function character set comprises the following steps: determining the conversion relation between all the related intelligent contracts and the corresponding symbols or functions; the step of setting the terminal set includes: and determining the conversion relation between all the related business objects and the corresponding variables, constants or object parameters.
3. The GEP-based blockchain data encoding method according to claim 2, wherein the predetermined procedure of the encoding rule comprises:
setting the logic sequence of all symbols or functions in the function symbol set;
setting the logic sequence of all variables, constants or object parameters in the terminal character set;
setting a sequencing rule for converting an ORF expression into a gene unit, converting a gene unit into a gene fragment or a chromosome, comprising: one gene unit includes the number of sequence numbers, the number of gene units included in one gene fragment, the number of gene units included in one chromosome, and the number of gene units or gene fragments included in one block.
4. A block chain data decoding method based on GEP is characterized by comprising the following steps:
converting a target gene or an expression tree in the coded data into an ORF expression based on a preset coding and decoding space and a coding and decoding rule;
converting the ORF expression into a transaction expression according to the coding and decoding space and the coding and decoding rule;
and restoring the terminal character set and the function character set in the transaction expression according to the coding and decoding space to obtain actual transaction information.
5. The GEP-based blockchain data decoding method according to claim 1, wherein the pre-setting process of the coding space comprises:
setting a function character set and a terminal character set, wherein the step of setting the function character set comprises the following steps: determining the conversion relation between all the related intelligent contracts and the corresponding symbols or functions; the step of setting the terminal set includes: and determining the conversion relation between all the related business objects and the corresponding variables, constants or object parameters.
6. The GEP-based blockchain data decoding method according to claim 1, wherein the pre-setting process of the coding and decoding rules comprises:
setting the logic sequence of all symbols or functions in the function symbol set;
setting the logic sequence of all variables, constants or object parameters in the terminal character set;
the sequencing rules for converting a gene or expression tree into an ORF expression are determined.
7. An apparatus for GEP-based blockchain data encoding, comprising:
the transaction expression conversion module is used for converting the target transaction information into a transaction expression by using a GEP coding mode based on a coding space and a coding rule programmed by a preset gene expression;
the ORF expression conversion module is used for converting the transaction expression containing the target transaction information into the ORF expression according to the coding rule;
the expression tree drawing module is used for drawing an expression tree according to the encoding rule and the ORF expression containing the target transaction information;
the gene unit conversion module is used for carrying out serialization processing on the ORF expression containing the target transaction information according to the coding rule and converting the ORF expression into a gene unit, wherein the gene unit only represents one piece of target transaction information and comprises a gene head and a gene tail, and the gene head stores block chain transaction service processing logic; the tail part of the gene stores a block chain transaction business object;
the system comprises a sequencing coding module, a block chain data structure and a block chain data structure, wherein the sequencing coding module is used for packaging the gene units or gene fragments formed by sequencing a plurality of gene units into the block data structure of the block chain, and after the blocks are added to the block chain for storage, the genes or the gene fragments are added to a credible chromosome in a sequencing mode to form the block chain under the block chain technical condition, wherein the chromosome is an information collection obtained by sequencing and integrating all the genes or the gene fragments in a sequencing mode.
8. An apparatus for decoding block chain data based on GEP, comprising:
the ORF expression analysis module is used for analyzing the target gene or the expression tree in the coded data into an ORF expression based on a preset coding and decoding space and a coding and decoding rule;
the transaction expression analysis module is used for analyzing the ORF expression into a transaction expression according to the coding and decoding space and the coding and decoding rule;
and the actual transaction information analyzing module is used for analyzing the terminal character set and the function character set in the transaction expression into actual transaction information according to the coding and decoding space.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 6 when executing the program.
10. A storage medium comprising a stored program which, when executed, controls an apparatus in which the storage medium is located to perform the steps of the method according to any one of claims 1 to 6.
Background
In the prior art of block chain, for encoding and verifying the data structure, the merkel tree and the hash algorithm (usually SHA256, so the hash algorithm is referred to as SHA256) are commonly used, and there are many problems with the above method:
firstly, in block chain transaction serialization and query use of the mercker tree, the SHA256 hash algorithm is generally used, the calculation amount is large, more calculation power consumption of the whole network is caused, and the efficiency of data storage and serialization encoding is reduced. Secondly, the result calculated by the SHA256 hash algorithm has a large number of characters, so that the hash value needs to spend more storage space when constructing the merkel tree and storing data, and the data reading and writing pressure of the storage system is increased. Most importantly, the hash algorithm or other improved hash algorithm used in the mercker tree is a universal hash algorithm completely independent of the content, structure and form of data, and the encoding process does not involve a block chain and its unique data structure, so that the deep fusion of the encoding algorithm and the data structure cannot be realized, thereby resulting in more redundant computation and additional data storage. This is the main cause of various efficiency problems. Based on this, the combined use of the merkel tree and the block chain technique also has a problem in the verification step. Due to the universality characteristic of the verification and query realized by the Mercker tree, an optimal method under other use environments needs to be met, so that hash calculation needs to be repeatedly carried out in the step of block chain transaction query and verification, and the hash of a plurality of nodes needs to be verified and compared, so that the target data can be determined to exist in the existing data structure, the verification process is complex, the calculation amount is large, the efficiency of the whole verification process is low, and technical innovation cannot be realized aiming at the characteristics of the block chain transaction data.
Disclosure of Invention
One aspect of the present application provides a block chain data encoding method based on GEP, so as to solve the technical problem of low efficiency caused by the need of more redundant computation and additional data storage in the existing encoding method.
The application is realized by the following scheme:
a block chain data coding method based on GEP comprises the following steps:
converting the target transaction information into a transaction expression by using a GEP coding mode based on a preset coding space and a preset coding rule;
converting the transaction expression containing the target transaction information into an ORF expression according to the encoding rule;
drawing an expression tree according to the encoding rule and the ORF expression containing the target transaction information;
according to the coding rule, sequencing the ORF expression containing the target transaction information, and converting the ORF expression into a gene unit, wherein the gene unit only represents one piece of target transaction information and comprises a gene head and a gene tail, and the gene head stores block chain transaction service processing logic; the tail part of the gene stores a block chain transaction business object;
packaging the gene units or gene segments formed by sequencing a plurality of gene units into a block data structure of a block chain, adding the gene or gene segment into a credible chromosome in a sequencing mode after the blocks are added into the block chain for storage, and forming the block chain under the block chain technical condition, wherein the chromosome is an information collection obtained after sequencing and integrating all the genes or gene segments in a sequencing mode.
Another aspect of the present application further provides a block chain data decoding method based on GEP, including the steps of:
converting a target gene or an expression tree in the coded data into an ORF expression based on a preset coding and decoding space and a coding and decoding rule;
converting the ORF expression into a transaction expression according to the coding and decoding space and the coding and decoding rule;
and restoring the terminal character set and the function character set in the transaction expression according to the coding and decoding space to obtain actual transaction information.
Another aspect of the present application further provides a block chain data encoding apparatus based on GEP, including:
the transaction expression conversion module is used for converting the target transaction information into a transaction expression by using a GEP coding mode based on a coding space and a coding rule programmed by a preset gene expression;
the ORF expression conversion module is used for converting the transaction expression containing the target transaction information into the ORF expression according to the coding rule;
the expression tree drawing module is used for drawing an expression tree according to the encoding rule and the ORF expression containing the target transaction information;
the gene unit conversion module is used for carrying out serialization processing on the ORF expression containing the target transaction information according to the coding rule and converting the ORF expression into a gene unit, wherein the gene unit only represents one piece of target transaction information and comprises a gene head and a gene tail, and the gene head stores block chain transaction service processing logic; the tail part of the gene stores a block chain transaction business object;
the system comprises a sequencing coding module, a block chain data structure and a block chain data structure, wherein the sequencing coding module is used for packaging the gene units or gene fragments formed by sequencing a plurality of gene units into the block data structure of the block chain, and after the blocks are added to the block chain for storage, the genes or the gene fragments are added to a credible chromosome in a sequencing mode to form the block chain under the block chain technical condition, wherein the chromosome is an information collection obtained by sequencing and integrating all the genes or the gene fragments in a sequencing mode.
Another aspect of the present application further provides a block chain data decoding apparatus based on GEP, including:
the ORF expression analysis module is used for analyzing the target gene or the expression tree in the coded data into an ORF expression based on a preset coding and decoding space and a coding and decoding rule;
the transaction expression analysis module is used for analyzing the ORF expression into a transaction expression according to the coding and decoding space and the coding and decoding rule;
and the actual transaction information analyzing module is used for analyzing the terminal character set and the function character set in the transaction expression into actual transaction information according to the coding and decoding space.
In another aspect, the present application further provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method.
In another aspect, the present application further provides a storage medium including a stored program, where the program, when executed, controls a device on which the storage medium is located to perform the steps of the method.
Compared with the prior art, the method has the following beneficial effects:
compared with the prior art, on one hand, the invention expects to realize the deep fusion and technical innovation of a GEP coding mode and a block chain technology at a data level by adopting a new GEP-based data coding mode, construct corresponding function character sets and terminal character sets by combining the actual transaction data content and related data coding requirements in a block chain transaction network and the operation types of related intelligent contracts, so as to realize the substitution of related parameters, variables and intelligent contract operation types involved in the block chain transaction, realize the innovation of data coding and verification modes in the traditional block chain technology, really realize the fit and adaptation with the block chain technology from the data and data structure level, and improve the rationality of the logic and expression modes of a data coding process, the data circulation and circulation efficiency in the block chain technology are enhanced. On the other hand, the coding mode with high adaptability replaces the coding and verification mode of the Hash algorithm and the Mercker tree used in the prior block chain technology, therefore, the problems of redundant calculation and low efficiency generated in the process of realizing data coding by the hash algorithm are simplified and overcome, the original logic of transaction data is expressed by using a simpler data volume, and the data coding method still has the corresponding information summarization and data rewriting capabilities, therefore, the problems of low efficiency, redundant calculation, redundant storage, slow response and the like generated by a Hash algorithm and a Mercker tree structure are solved, the operation efficiency of a block chain on a data coding layer is improved, the data mobility and the data transparency of the whole network are enhanced, the support of more high-performance, high-concurrency and extensible query algorithms and management components is expected to be realized, and the operation efficiency and the multifunctional business expansion of the block chain network are further improved.
Drawings
Fig. 1 is a flowchart illustrating a block chain data encoding method based on GEP according to a preferred embodiment of the present application.
FIG. 2 is a diagram illustrating the correspondence between related biological concepts and related concepts in the blockchain technique.
FIG. 3 is a schematic representation of a genotype of a preferred embodiment of the present application.
FIG. 4 is a gene diagram of a preferred embodiment of the present application.
FIG. 5 is a schematic representation of a chromosome in a preferred embodiment of the present application.
FIG. 6 is a schematic representation of one ORF expression in a preferred embodiment of the present application.
FIG. 7 is a diagram of an expression tree in a preferred embodiment of the present application.
Fig. 8 is a schematic diagram illustrating the encoding process of transaction information according to the preferred embodiment of the present application.
Fig. 9 is a schematic diagram of a block chain data decoding method based on GEP in the preferred embodiment of the present application.
Fig. 10 is a schematic diagram illustrating a decoding process of transaction information according to the preferred embodiment of the present application.
FIG. 11 is a schematic flow chart of the process of querying specific target transaction information on a target chromosome in the preferred embodiment of the present application.
Fig. 12 is a schematic diagram of the verification process of the transaction information in the chromosome according to the preferred embodiment of the present application.
Fig. 13 is a block diagram of a block chain data coding device based on GEP according to the preferred embodiment of the present application.
Fig. 14 is a block diagram of a block chain data decoding device based on GEP according to the preferred embodiment of the present application.
FIG. 15 is a block diagram of an electronic device entity in accordance with a preferred embodiment of the present application.
Fig. 16 is an internal structural view of a computer device according to a preferred embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
For the sake of understanding, related art terms referred to in this application will be explained first.
The block chain technology, also called decentralized distributed ledger technology, is a new technology based on communication network and making network participants participate in 'accounting' together and maintaining a complete public ledger database together. Due to the special data structure used by the block chain technology, the block chain technology has the characteristics of decentralization, openness and transparency and information anti-counterfeiting, so that the block chain technology has wide application in many fields. And different intelligent contracts are combined, so that various intelligent transactions of credible safety data can be realized on the premise of combining specific requirements of application scenes, and the service efficiency of various industries is improved.
An intelligent contract is essentially a program which supports multiple computing programming languages and is designed and written in advance, and the program cannot be maliciously changed after being written in general. According to different application scenes or different specific service requirements, diversified intelligent contracts with different operation logics can be designed and edited. An intelligent contract represents the business object processing logic under the business scenario in which the contract is used. Therefore, the intelligent contract not only realizes intelligent calculation and processing in the application flow, but also represents the functional requirements and logic design of the target business.
The Hash Algorithm (Secure Hash Algorithm, abbreviated SHA, also known as Hash Algorithm), also known as Secure Hash Algorithm, is a FIPS certified Secure Hash Algorithm. The Hash algorithm is essentially a Hash algorithm, which can map a plaintext character string with any length into a shorter character string (Hash value ) with a fixed length, and different plaintexts are difficult to map into the same Hash value. Therefore, irreversible summarization or summarization of the complex content is realized, and thus, whether two complex files have consistency or not is quickly verified without completely comparing the two complex files. By summarizing the complex information through the Hash algorithm, the consistency of simply comparing the information can be realized under the condition of not reading the original information, and the protection of information privacy and the verification of information safety can be realized.
The merkel tree (Merkle tree) is a hash binary tree invented by Ralph Merkle in 1979, and the principle is to store data in leaf nodes of a tree structure and ensure the non-tamper property of the data through the step-by-Step Hash Algorithm (SHA) calculation of the data. The merkel tree is essentially a tree-like data structure, consisting of target data, leaf nodes, intermediate nodes, and root nodes. The data coding method comprises the steps of firstly carrying out hash algorithm calculation on target data to form leaf nodes containing calculation results (hash values), then carrying out hash calculation on data contained in two leaf nodes to obtain intermediate nodes containing calculation results of two leaf sub-nodes, carrying out hash calculation on the two intermediate nodes, waiting until a new intermediate node containing calculation results of the two intermediate nodes is iterated, carrying out hash calculation on the two intermediate nodes continuously to realize aggregation and iteration of data contents, finally obtaining only one hash calculation result (hash value), enabling the node containing the hash value to be a root node, and enabling the final hash value to be called root hash, so that a data coding process for integrating and summarizing a plurality of target data is completed.
In principle, the root hash contains hash values from all the target data. Any change in the target data causes the hash value of the leaf node to change, and the change is gradually transmitted to the node at the previous stage and finally reflected in the root hash. The process of the hash operation is irreversible, that is, the data can obtain the hash value through the hash operation, but the original operation data can not be deduced through the hash value. The merkel tree can be used to ensure data security privacy and to verify data accuracy and integrity.
Gene Expression Programming (hereinafter, GEP) is a novel algorithm invented based on biological Gene structure and function, and is used for creating computer programs or mathematical models. Typically these computer programs are complex tree structured data that implement learning and adaptation at the algorithm level by varying the size, shape and composition of these data streams. GEP is a novel genetic algorithm proposed in 2001 by the grape dentist Candida Ferreira. GEP is characterized by the separation of genotype and phenotype. Specifically, a chromosome containing target information is used as a genotype, and an expression tree constructed based on the chromosome is used as a phenotype, and the core-genotype-phenotype system of the GEP is constructed through the two data bearing types. The decoding is a process of converting the linear character string into the chromosome, similarly. The GEP can convert the target information in the application environment into a form of a mathematical expression through the gene coding process, so that the target information is stored and transmitted, the application environment is explored and adapted, and the GEP has the characteristics of simplicity, linearity, compactness, easiness in optimization operation and the like. Gene expression programming has been developed based on genetic algorithms. It adopts a brand-new individual description method different from genetic algorithm, and its essence is to use generalized hierarchical data structure to describe target information. The practical application direction of the GEP comprises two parts, namely GEP optimization algorithm application and GEP information coding application, and the application focuses on the innovative use of the GEP information coding application process rather than the innovative use of the GEP optimization algorithm.
Genotype, in GEP, refers to a linear string of fixed length symbols consisting of one or more genes of the same size. These symbol strings, called genotypes, have fixed length coding constraints, each memory character corresponds to a respective sequence, and the conversion of the target information is achieved by coding with values of different sizes and symbols of different shapes. Further, the genotype may also be converted into an expression tree or chromosome for target information storage.
The gene contains two parts, a Head (Head) containing a set of functions and a Tail (Tail) containing a set of terminators. A function set (generally denoted by F) is used to include a predefined function or other operator with computation logic, and is a collection of symbols or functions involved in the computation manner or processing logic involved in the expression. While a terminal set (usually denoted by T) usually includes relevant inputs of a gene expression in the encoding process, such as constants, variables, or functions without parameters, etc., i.e., various types of parameters and values can be considered as inputs.
Chromosomes (chromosomes) chromosomes can be considered as a serialized collection of genes in the same category in GEP. The same type of information is processed in a GEP coding mode to obtain the serialized genes, and all the genes are sequenced and integrated in a serialization conforming mode to obtain an information collection which is the chromosome. From a conceptual perspective, a chromosome contains the information content of all encoded target information in the same category.
The concept of the expression of the ORF, also called the K expression in GEP, derives from the concept of Open Reading Frames (ORFs) in biology. Open reading frames are the means used in biology to encode a polypeptide chain or a base sequence of a protein. In GEP, however, it is a coding concept for programming gene expressions for target information. The ORF expression is a mathematical expression having a logical structure but not yet serialized, is an important component of the genotype, and in practical GEP applications, the character size of the ORF expression is usually less than or equal to the gene, i.e., the character length of the ORF may be less than the length of the stored gene. And the ORF expression after serialization and sequencing is the gene. Therefore, the ORF expression is obtained by converting the existing process into a transaction expression (intermediate form) and further converting the transaction expression into the ORF expression, thereby constructing an expression tree and a chromosome.
The expression pattern is the result of structural logic expression of a symbol string included in the genotype. It converts the expression of genotype (containing the target information) into a hierarchical and visual diagram structure with operational logic. In GEP, the expression type is created mainly in an expression tree.
An Expression Tree, also called Expression Tree or ET in GEP, refers to a Tree-like data structure consisting of elements represented by circles and branches represented by connecting lines. Circles may be used to represent a set of functions or a set of terminators, with one circle being used to represent only one element. And the expression tree strictly adheres to certain serialization rules, such as top-to-bottom, left-to-right, etc. Logical relationships between elements are given by this unique sequence rule. Thus, the expression tree is also a proof that the expression type has logical meaning, and is an expression mode for endowing the gene and ORF expression with logical meaning.
The existing block chain technology coding, decoding and verification methods depend on the merkel tree and the hash algorithm to realize, but because of the universality of the hash algorithm, the efficiency optimization under the block chain technology condition cannot be realized, so that the two technical problems which are expected to be solved by the application are as follows:
1. block data structure innovation based on GEP coding and decoding mode
The existing GEP algorithm is used based on an optimization algorithm and comprises the processes of mutation, recombination, string insertion and the like so as to realize data change, so that iteration and optimization are carried out on a mathematical model and a description expression. The application hopes to reserve a genotype-phenotype system and a data encoding and decoding mode of the GEP, optimizes and reforms the encoding process of the GEP, realizes the fusion of the GEP and a data structure under the technical condition of a block chain, provides a new encoding and decoding mode, and constructs a new block data structure based on the new encoding and decoding mode, thereby improving the conformity of the block chain technology, realizing the innovation of the block chain data structure, constructing a new block data encoding and decoding flow and a query flow, and realizing the independent research and development of the innovative block chain data structure in China.
2. The existing hash algorithm and the merkel tree structure are replaced, and the efficiency of data storage and data calculation is improved
The existing hash algorithm and the merkel tree structure are used for solving other universality problems, are not used for supporting and serving the blockchain technology, and are not optimized methods for the data storage efficiency under the condition of the blockchain technology. The GEP-based coding and decoding mode provided by the application is used for replacing the existing hash algorithm and the Mercker tree structure, the efficiency optimization problem of the traditional block chain coding and decoding and verification mode and the problems of technical adaptability and fusion degree are hopefully solved, the data storage efficiency under the block chain technical condition is improved, and the storage space is saved. And the data calculation capacity under the condition of the block chain technology is enhanced, and the whole network calculation capacity efficiency is enhanced.
In view of one of the above drawbacks in the prior art, as shown in fig. 1, a preferred embodiment of the present application provides a block chain data encoding method based on GEP, including the steps of:
s1, presetting a coding space, wherein the presetting process of the coding space comprises the following steps:
setting a function character set and a terminal character set, wherein the step of setting the function character set comprises the following steps: determining the conversion relation between all the related intelligent contracts and the corresponding symbols or functions; the step of setting the terminal set includes: determining the conversion relation between all the related business objects and the corresponding variables, constants or object parameters;
s2, presetting an encoding rule, wherein the presetting process of the encoding rule comprises the following steps:
setting the logic sequence of all symbols or functions in the function symbol set;
setting the logic sequence of all variables, constants or object parameters in the terminal character set;
setting a sequencing rule for converting an ORF expression into a gene, converting a gene into a gene fragment or a chromosome, comprising: one gene unit includes the number of sequence numbers, the number of gene units included in one gene fragment, the number of gene units included in one chromosome, the number of gene units or gene fragments included in one block;
s3, converting the target transaction information into a transaction expression by using a GEP coding mode based on a preset coding space and a preset coding rule;
s4, converting the transaction expression containing the target transaction information into an ORF expression according to the encoding rule;
s5, drawing an expression tree according to the encoding rule and the ORF expression containing the target transaction information;
s6, according to the coding rule, sequencing the ORF expression containing the target transaction information, and converting the ORF expression into a gene unit, wherein the gene unit only represents one piece of target transaction information and comprises a gene head and a gene tail, and the gene head stores block chain transaction service processing logic; the tail part of the gene stores a block chain transaction business object;
s7, packaging the gene units or the gene segments formed by the serialization of a plurality of gene units into a block data structure of a block chain, adding the gene or the gene segments into a credible chromosome in a serialization manner after the blocks are added into the block chain for storage, and forming the block chain under the block chain technical condition, wherein the chromosome is an information collection obtained after all the genes or the gene segments are sequenced and integrated in a serialization manner, and the decoding process is ended.
The application establishes a genotype-phenotype coding and decoding system based on a GEP coding mode, and comprises three structures of chromosomes and genes as genotypes and expression trees as phenotypes. The genotype comprises both chromosome and gene structures, and the phenotype comprises an expression tree structure. Further, the chromosome contains a plurality of genes of the same category, and the genes can be divided into a head portion containing the function set and a tail portion containing the terminal set. And a single gene can realize the logic expression of transaction information by being converted into a logic data structure of an expression tree, thereby forming the whole encoding and decoding mode and the data structure.
Meanwhile, the application also constructs the corresponding relation from the biological concept to the block chain technology through GEP coding and decoding, realizes the correspondence between the biological data form and the concept of the information science, embodies the innovativeness of integrating the biological data management into the information science, and realizes the revolution application of the biological genetics in the field of the information science. FIG. 2 shows the correspondence between related biological concepts in the present application and related concepts in the blockchain technique.
The concept of transaction in the blockchain technology corresponds to the concept of gene unit in the present application. The concept of a gene unit is defined in the present application (see below for a detailed explanation of the concept term). Each transaction request is converted into a gene unit through the encoding and decoding rules defined by the application, namely, one gene unit only contains one transaction, and the gene unit is a basic unit in the whole invention and the block chain technical concept. Further, gene segments and chromosomes can be further composed by gene units, which corresponds to the concept of block and block chain in the concept of block chain technology.
The concept of blocks in the block chain technology corresponds to the concept of gene fragments in the present application. Particularly, according to different practical situations, when a block contains a transaction, the corresponding block only contains a gene unit code, and the gene fragment structure is not applicable; when a block contains multiple transactions, the corresponding block contains multiple gene unit codes, and the gene units form a structure of a gene segment according to a serialization rule, namely, the block in the block chain technology concept corresponds to the concept of the gene segment in the application under the condition that a block contains multiple transactions. They are an integrated collection of partially serialized information.
The concept of blockchain in blockchain technology corresponds to the concept of chromosome in this application. The chain structure formed by the persistent storage of the blocks of the same category by serialization is a block chain, and similarly, the chromosome is a result of a collection of genes (gene units or gene fragments) of the same category after serialization, and is used for the long-term stable storage of the genes. Both realize the persistent storage characteristic and the serialization characteristic of the former component, and embody the relationship innovation and the structural improvement of the existing block chain data coding and decoding mode by the new coding and decoding mode.
The following explanation of specific terms and related concepts involved in the above embodiments is as follows:
(1) genotype(s)
In this application, genotype refers to a linear string of fixed length symbols that have a strict serialization and logistical structure and contain specific encoded transaction information. The serialization number of a genotype is referred to as the genotype element position, and the expression element after serialization is referred to as the genotype element value. The main function of the genotype structure is to realize the conversion of target transaction information by coding through numbers with different sizes and symbols with different shapes. Genotypes comprise two existing forms: genes and chromosomes. In the design concept of the present application, the genotypes are the parts of the data storage under the condition of the blockchain technology, i.e. the block (corresponding gene) and the blockchain (corresponding chromosome), and an example of one genotype is shown in fig. 3, which includes two parts of the gene and the chromosome.
(2) Gene
In this application, a gene refers to a string of characters after being encoded and serialized. The main function of the structure of the gene is to encode and store the transaction information through numbers with different sizes and symbols with different shapes, thereby realizing the encoding and decoding conversion of the transaction information.
Specifically, a gene unit contains only one transaction request. In this application, a gene unit is defined as the most basic unit of measure in the entire genotype. According to the actual requirement, the character quantity of the sequence number can be adjusted to integrate a plurality of gene units into one gene fragment. Further, the basic unit of data division in the block chain may be one gene unit or may be a gene fragment including the same number of gene units as the correspondence of one block, in combination with the actual block chain technical conditions. This means that the blockchain can create a block with only one gene unit, and then construct the blockchain; it is also possible to create a block with one gene fragment and then construct a chain of blocks.
Meanwhile, a gene comprises two structures, a head and a tail. In the present application, the gene corresponds to the transaction information under the condition of blockchain technology, i.e. the part of the transaction information that needs to be stored after the encoding process. An example of a gene is shown in FIG. 4, in which the head and tail have been labeled, and includes both types of gene units and gene fragments.
(2.1) Gene header (data processing method including Intelligent contract)
In the present application, a header (Head) refers to a portion containing a predefined function or other operator having calculation logic in a character string constituting a gene. The set of operators is called a function set (denoted by F), and is a collection of symbols or functions involved in the calculation method or processing logic involved in the related expression. In the application, the function character set comprises the predefined intelligent contract operation types, and the intelligent contract operations of the same kind are replaced in the form of various operators or functions, so that the actual transaction information types are converted into the form of character strings for recording. The genetic header can also be said to store part of the blockchain transaction processing logic.
(2.2) Gene tails
In the present application, the Tail (Tail) refers to a portion of a character string constituting a gene, which includes constants, variables, object parameters, and the like, and indicates a data processing object. These values or sets of function objects or transaction inputs, called Terminal sets (denoted T), are the operation objects of the computation and business processes involved in the relevant expressions. In the application, the terminal character set comprises the predefined intelligent contract operation object, and the business object related to the related transaction is replaced in the form of various variables or constants or object parameters, so that the actual transaction object is converted into the form of character strings for recording. It can also be said that the gene tail is the part for storing the blockchain transaction business object.
(3) Chromosome
In the present application, chromosomes (chromosomes) are a serialized collection of genes in the same category. The same type of information is processed in a GEP coding mode to obtain the serialized genes, and all the genes are sequenced and integrated in a serialization conforming mode to obtain an information collection which is the chromosome.
In particular, in the present application, since a chromosome is composed of genes (or gene fragments) in the same category after being serialized, the chromosome corresponds to a block chain under the condition of the block chain technology, that is, a set including all transaction information in the same category or the same channel, regardless of whether the block creation unit is a gene or a gene fragment. From a conceptual perspective, the chromosome contains the information content of all the encoded transaction information within the same category.
So far, the whole phenotype system and the related concepts and data structures in the blockchain technology realize one-to-one correspondence, provide an alternative basis for the application of the GEP codec in the blockchain technology, and also reflect the high conformity of the GEP codec to the blockchain technology, wherein an example of one chromosome is as shown in fig. 5.
(4) ORF expression
In the present application, the ORF expression is a coding/decoding concept for programming a gene expression for target information, is a character string for transaction information conversion, is a mathematical expression having a logical structure but not yet serialized, and is an important component of a genotype. An example of the ORF expression after sequencing and sorting, i.e. the gene or gene fragment, is shown in FIG. 6.
(4.1) transaction expressions
In the present application, a class of Transaction Expressions (TEFs) is also defined. The transaction expression is an intermediate form between the target transaction information and the ORF expression. In the practical application environment, one transaction information can not be directly converted into ORF expression for data encoding and decoding and data storage, so that the problem is solved by setting an intermediate form. Firstly, a function character set and a terminal character set are preset to determine the mode and set for converting transaction information into character strings, and then the transaction type and the transaction object contained in the transaction information are replaced by elements contained in the function character set and the terminal character set, so that the preliminary coding and decoding process of the transaction information is realized. The intermediate form of the transaction expression is used, so that the fault tolerance of the transaction data encoding and decoding process is improved, the system modularization characteristic is enriched, the operability of the encoding and decoding algorithm is enhanced, the customization space of the encoding and decoding algorithm is widened, and the subsequent research and development of the encoding and decoding algorithm and programs are facilitated.
Therefore, in the actual encoding process, the target transaction information is converted into a transaction expression (intermediate form) and further converted into an ORF expression, and then the genotype and the chromosome are constructed after the target transaction information is serialized. Specifically, the rule for converting the transaction expression into the ORF expression is: and extracting function symbols in the transaction expression according to a predetermined function symbol set logic sequence to serialize to form a head. And extracting parameters and variables in the transaction expression according to a predetermined logic sequence of the terminal character set to serialize to form a tail.
(5) Expression type
In the present application, the expression pattern is the result of structural logic expression of a symbol sequence included in a genotype. It converts the expression of genotype (containing the target information) into a hierarchical and visual diagram structure with operational logic. In the present application, the expression type is created mainly in an expression tree.
(6) Expression tree
In the present application, an Expression Tree (ET) is a Tree-shaped data structure composed of elements represented by circles and branches represented by connecting lines. Circles may be used to represent a set of functions or a set of terminators, with one circle being used to represent only one element. And the expression tree strictly adheres to a specific serialization rule, such as from top to bottom, from left to right, and the like, and the specific serialization rule depends on the actual application requirement. Logical relationships between elements are given by this unique sequence rule. Thus, the expression tree is also a proof that the expression type has logical meaning, and is the expression mode that gives the logical meaning to the genotype and ORF expressions, and an example of the expression tree is shown in FIG. 7.
It can be understood that, in the present application, by improving the GEP coding manner, structures such as Transaction Expression (TEF), ORF Expression, Expression Tree (ET), gene, chromosome, and the like are established. The application improvement details include: the GEP coded function set is used for storing the related algorithm of the intelligent contract, the transaction object is set as the terminal set, so that the space of data coding is established, and the data coding space is associated with the business object related to the block chain, so that a transaction is recorded by using the coding mode instead of using a Hash algorithm (Hash). The method also carries out standardized improvement on the serialization mode of the genotype, removes the steps of changing the content of coding and decoding information such as recombination and mutation in the original GEP coding mode, fixes the sequence number of the gene in advance, and cancels the condition that the original gene and ORF expression do not correspond in character quantity, thereby realizing the standardized conversion from transaction information to the genotype, ensuring that the content of the information is not lost, not missed and unchanged, reasonably combining and utilizing the original GEP coding mode, reducing the complexity of the block chain data coding process, and improving the efficiency of data coding and the convenience of data storage. And finally, establishing a data storage structure in the block chain by constructing corresponding phenotype and genotype to replace a Mercker tree, thereby completing the replacement of the data structure and the coding mode under the current block chain technical condition.
The flow of encoding is explained below using a practical example, and fig. 8 shows a flow of encoding transaction information, including:
first, a set of functions and a set of terminators are determined. The function set comprises { +, x } and the terminal set comprises { A, B, at1, at2 }.
And secondly, converting the target transaction information into a transaction expression according to the function character set and the terminal character set. As shown, the transaction information ASSET1 transferred to B is converted to the transaction expression at1 x B.
Then, the target transaction expression is converted into an ORF expression. As shown, the trade expression { at1 x B } is converted to the ORF expression { x at 1B }.
Next, the ORF expression is converted into an expression tree. The expression tree results are shown.
Next, the ORF expression was sequenced and converted into a gene, and as shown in FIG. 8, the ORF expression was converted into gene 1.
Finally, gene 1 is added to the chromosome. As a result, gene 1 was added to chromosome 1 as shown.
In summary, on one hand, in the present embodiment, it is expected that a new data coding manner based on the GEP is adopted to implement deep fusion and technical innovation of the GEP coding manner and the blockchain technology in the data plane, and in combination with actual transaction data content and related data coding requirements in the blockchain transaction network and operation types of related intelligent contracts, corresponding function character sets and terminal character sets are constructed to implement substitution of related parameters, variables and intelligent contract operation types involved in the blockchain transaction, and to implement innovation of the data coding and verification manner in the conventional blockchain technology, so that it is really achieved that the data and data structure plane implements engagement and adaptation with the blockchain technology, and the rationality of the data coding process and the expression manner are improved, and the circulation and circulation efficiency of the data in the blockchain technology are enhanced. On the other hand, the embodiment replaces the hash algorithm and the encoding and verifying method of the merkel tree used in the existing block chain technology by the high-adaptability encoding method, therefore, the problems of redundant calculation and low efficiency generated in the process of realizing data coding by the hash algorithm are simplified and overcome, the original logic of transaction data is expressed by using a simpler data volume, and the data coding method still has the corresponding information summarization and data rewriting capabilities, therefore, the problems of low efficiency, redundant calculation, redundant storage, slow response and the like generated by a Hash algorithm and a Mercker tree structure are solved, the operation efficiency of a block chain on a data coding layer is improved, the data mobility and the data transparency of the whole network are enhanced, the support of more high-performance, high-concurrency and extensible query algorithms and management components is expected to be realized, and the operation efficiency and the multifunctional business expansion of the block chain network are further improved.
As shown in fig. 9, a block chain data decoding method based on GEP includes the steps of:
s1, presetting a coding and decoding space, wherein the presetting process of the coding and decoding space comprises the following steps:
setting a function character set and a terminal character set, wherein the step of setting the function character set comprises the following steps: determining the conversion relation between all the related intelligent contracts and the corresponding symbols or functions; the step of setting the terminal set includes: determining the conversion relation between all the related business objects and the corresponding variables, constants or object parameters;
s2, presetting a coding and decoding rule, wherein the presetting process of the coding and decoding rule comprises the following steps:
setting the logic sequence of all symbols or functions in the function symbol set;
setting the logic sequence of all variables, constants or object parameters in the terminal character set;
the sequencing rules for converting a gene or expression tree into an ORF expression are determined.
S3, converting the target gene or expression tree in the coded data into an ORF expression based on the preset coding and decoding space and coding and decoding rules;
s4, converting the ORF expression into a transaction expression according to the coding and decoding space and the coding and decoding rule;
and S5, restoring the terminal character set and the function character set in the transaction expression according to the coding and decoding space to obtain actual transaction information, and ending the decoding process.
The decoding flow of this embodiment is summarized as follows: firstly, determining whether an object to be converted is a gene or an expression tree, and determining a function character set, a terminal character set and a coding and decoding rule so as to establish a decoding space; secondly, converting the target gene into an ORF expression which is not serialized; if the tree is an expression tree, converting the target tree structure into an ORF expression according to the logic sequence; thirdly, converting the ORF Expression into a Transaction Expression (Transaction Expression Function) according to the decoding space; and thirdly, decoding the transaction expression into actual transaction information according to the corresponding relation in the decoding space. By this point, the decoding process ends.
The following explains the decoding process using a practical example, and fig. 10 shows a decoding process of transaction information:
first, a set of functions and a set of terminators are determined. As shown in FIG. 10, the function set comprises { +, x } and the terminal set comprises { A, B, at1, at2 }.
And secondly, converting the target gene or the expression tree into an ORF expression according to the function character set and the terminal character set. As shown, Gene 1 and the expression tree are converted to the ORF expression { x at 1B }.
Again, the target ORF expression is converted to a transaction expression. As shown in FIG. 10, the ORF expression { x at 1B } is converted into the transaction expression { at1 x B }.
Again, the transaction expression is converted to specific transaction content. The decoding is completed. As shown, the transaction expression { at1 x B } is converted to transaction content { ASSET1 transitions to B }.
The following describes the data verification method in detail.
The specific verification process of the application is summarized as follows: firstly, determining target transactions needing to be verified and inquired target chromosomes, and determining a function character set and a terminal character set as well as a coding rule so as to establish a coding space; secondly, converting the target Transaction content into a Transaction Expression (Transaction Expression Function) according to the coding space; thirdly, converting the transaction expression into an ORF expression; thirdly, converting the ORF expression into a gene according to a predetermined serialization rule; finally, whether the target chromosome contains genes meeting the conditions is searched; if the target gene can be inquired, the verification is passed, and if the target gene is not inquired, the verification is not passed, so far, the verification process is finished.
As shown in fig. 11, in the present application, the complete steps for querying the specific target transaction information on the target chromosome are as follows:
s1, setting the function symbol set and the terminal symbol set, determining the encoding/decoding space, the process of determining the function symbol set includes: the conversion relation between all the involved intelligent contracts and the corresponding symbols or functions is determined. The process of determining the set of terminators comprises: and determining the conversion relation between all the related business objects and the corresponding variables, constants or object parameters.
S2, determining the encoding and decoding rule, the process of determining the encoding and decoding rule includes: determining the logic sequence of all symbols or functions in the function symbol set; determining the logic sequence of all variables, constants or object parameters in the terminal character set; the sequencing rules for converting the ORF expression into a gene, converting a gene into a gene fragment or chromosome are determined (including determining the number of sequence numbers contained in one gene unit; determining the number of gene units contained in one gene fragment, etc.).
S3, determining specific target transaction information needing to be inquired, and converting the target transaction information into a transaction expression according to the coding and decoding space and the coding and decoding rule.
And S4, determining a transaction expression containing target transaction information, and converting the target transaction expression into an ORF expression according to the encoding and decoding rules.
And S5, determining the ORF expression containing the target transaction information, carrying out serialization processing according to the encoding and decoding rules, and converting the ORF expression into gene units.
S6, identifying the gene unit containing the target transaction information, searching on the chromosome to be queried, and searching whether the same gene character string as the target gene unit exists.
S7, if the same gene unit is inquired, the verification is passed, and the target chromosome contains the specific transaction information; if not, the verification is not passed, and the verification process is ended.
The flow of verification is explained using a practical example.
FIG. 12 shows a verification process for transaction information in a chromosome:
first, a set of functions and a set of terminators are determined. As shown, the function set comprises { +, x } and the terminal set comprises { A, B, at1, at2 }.
And secondly, converting the target transaction information into a transaction expression according to the function character set and the terminal character set. As shown, the transaction information { A transfers ASSET1 to B } is converted into a transaction expression { at1 x B }.
Again, the target trading expression is converted to an ORF expression. As shown, the trade expression { at1 x B } is converted to the ORF expression { x at 1B }.
The ORF expression was then serialized and converted into a gene. As shown, the ORF expression { x at 1B } is converted into a gene.
Again, the target query chromosome is checked for the inclusion of the gene sequence. If so, the verification is passed, and if not, the verification is not passed. In the figure, the query gene exists on the queried chromosome, so that the chromosome can be regarded as the existence of the target query transaction information.
As shown in fig. 13, another preferred embodiment of the present application provides a GEP-based blockchain data encoding apparatus, including:
the transaction expression conversion module is used for converting the target transaction information into a transaction expression by using a GEP coding mode based on a coding space and a coding rule programmed by a preset gene expression;
the ORF expression conversion module is used for converting the transaction expression containing the target transaction information into the ORF expression according to the coding rule;
the expression tree drawing module is used for drawing an expression tree according to the encoding rule and the ORF expression containing the target transaction information;
the gene unit conversion module is used for carrying out serialization processing on the ORF expression containing the target transaction information according to the coding rule and converting the ORF expression into a gene unit, wherein the gene unit only represents one piece of target transaction information and comprises a gene head and a gene tail, and the gene head stores block chain transaction service processing logic; the tail part of the gene stores a block chain transaction business object;
the system comprises a sequencing coding module, a block chain data structure and a block chain data structure, wherein the sequencing coding module is used for packaging the gene units or gene fragments formed by sequencing a plurality of gene units into the block data structure of the block chain, and after the blocks are added to the block chain for storage, the genes or the gene fragments are added to a credible chromosome in a sequencing mode to form the block chain under the block chain technical condition, wherein the chromosome is an information collection obtained by sequencing and integrating all the genes or the gene fragments in a sequencing mode.
As shown in fig. 14, another preferred embodiment of the present application is a GEP-based block chain data decoding apparatus, including:
the ORF expression analysis module is used for analyzing the target gene or the expression tree in the coded data into an ORF expression based on a preset coding and decoding space and a coding and decoding rule;
the transaction expression analysis module is used for analyzing the ORF expression into a transaction expression according to the coding and decoding space and the coding and decoding rule;
and the actual transaction information analyzing module is used for analyzing the terminal character set and the function character set in the transaction expression into actual transaction information according to the coding and decoding space.
The various modules in the above-described apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
As shown in fig. 15, the preferred embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the GEP-based block chain data encoding or decoding method in the foregoing embodiments.
As shown in fig. 16, the preferred embodiment of the present application also provides a computer device, which may be a terminal or a biopsy server, and the internal structure thereof may be as shown in fig. 16. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with other external computer devices through network connection. The computer program is executed by a processor to implement the above-mentioned GEP-based blockchain data encoding or decoding method.
Those skilled in the art will appreciate that the configuration shown in fig. 16 is a block diagram of only a portion of the configuration associated with the embodiment, and does not constitute a limitation on the computer device to which the embodiment is applied, and a specific computer device may include more or less devices than those shown in the figure, or may combine some devices, or have a different arrangement of devices.
The preferred embodiment of the present application further provides a storage medium, where the storage medium includes a stored program, and when the program runs, the device where the storage medium is located is controlled to execute the block chain data encoding or decoding method based on GEP in the foregoing embodiment.
In summary, compared with the prior art, the application has the following key innovation points:
1. combining gene expression programming and block chain technology, innovatively provides a new block data structure
At present, the gene expression programming technology is only applied in the field of optimization algorithms, and innovation and application are not realized aiming at the block chain technology. The method has the advantages that the GEP coding mode in gene expression programming is innovated and modified, the original coding mode of biological genetic information is reserved, the data structure rich in logicality is integrated, the methods such as variation and recombination which are unfavorable for data storage are eliminated, and a new data coding mode and a new data structure which are suitable for a block chain technology are created for the first time. Meanwhile, the composition elements of the GEP coding mode are improved, the GEP coding mode comprises a function character set, a terminal character set, an expression tree and other structures, the new data coding mode is more consistent with parameter configuration and service logic under the block chain technical condition, the data coding is not only used for carrying out sequence on original information, but also used for writing the logic contained in the original data into a sequence character, the new data coding mode has the logic connotation of the block chain service characteristic, the unique coding requirement of block chain transaction is more met, and the conformity of the data coding mode and the block chain operation mode is improved.
2. Substitution of gene expression programming on the existing Mercker tree improves the data calculation and storage efficiency of the original block chain
The new data coding mode created by the application not only contains a serialization coding method (genotype) required by data coding, but also contains a data logic hierarchy structure (phenotype), and the existing hash algorithm and the merkel tree data structure can be completely replaced at the layer of block chain data coding. Through a more simplified serialization coding method and a more concise and more logical expression tree structure, the problems of computational redundancy and the like caused by using a universal method (namely a Hash algorithm and a Mercker tree) can be solved, the operation efficiency of a block chain on a data coding layer is improved, the data mobility and the data transparency of the whole network are enhanced, and the support of more high-performance, high-concurrency and extensible query algorithms and management components is hopefully realized, so that the operation efficiency and the multifunctional service expansion of the block chain network are further improved.
3. Intersection of biological conceptual models with information science data structures
From the macroscopic perspective, the application firstly integrates the biological data form into the information technology data application science, integrates the structure and the function based on the biological gene into the data processing and coding process in the block chain technology, simulates the process of genetic information coding and expression logic transmission in the natural world by artificially constructing a target symbol set, utilizes a predetermined serialization mode to effectively serialize and efficiently search the coding parameter space formed by the target symbol set, better applies the coding form of the biological genetics into the data processing process in the existing information technology science by transformation and innovation, realizes the breakthrough of the data form and the data application in the cross-domain integration aspect, is beneficial to the application of the new biological data form in the fields of neural network, machine learning and other information technology sciences, and further is beneficial to the innovative development of the block chain technology in the bottom data level, and a brand-new high-efficiency operation and autonomous controllable new block chain technology is realized.
The functions of the method of the present embodiment, if implemented in the form of software functional units and sold or used as independent products, may be stored in one or more storage media readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:获取单号的方法、装置及系统