CN111324645B - Block chain data processing method and device - Google Patents

Block chain data processing method and device Download PDF

Info

Publication number
CN111324645B
CN111324645B CN201811532778.1A CN201811532778A CN111324645B CN 111324645 B CN111324645 B CN 111324645B CN 201811532778 A CN201811532778 A CN 201811532778A CN 111324645 B CN111324645 B CN 111324645B
Authority
CN
China
Prior art keywords
data
interface function
expression rule
identifier
intelligent contract
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811532778.1A
Other languages
Chinese (zh)
Other versions
CN111324645A (en
Inventor
马超
杨业飞
王帅俭
王�义
刘春伟
孙海波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Wodong Tianjun Information Technology Co Ltd
Priority to CN201811532778.1A priority Critical patent/CN111324645B/en
Publication of CN111324645A publication Critical patent/CN111324645A/en
Application granted granted Critical
Publication of CN111324645B publication Critical patent/CN111324645B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The embodiment of the invention provides a data processing method and device of a block chain, wherein the method comprises the following steps: and carrying out service processing according to the interface function in the intelligent contract to generate service data. And converting the business data into formatted data according to the data item expression rules in the intelligent contract, wherein the data item expression rules are used for indicating the data format of each data in the business data. According to the embodiment, the interface function expression rule and the data item expression rule are adopted, so that the interface function and the data are analyzed according to the unified format, and the flexibility of the block chain system is improved.

Description

Block chain data processing method and device
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a method and an apparatus for processing data of a blockchain.
Background
With the development of the blockchain technology, the application scene of the blockchain is also wider and wider, and the blockchain provides a reliable distributed accounting mechanism for the transaction through the cryptography technology, a consensus mechanism and an exquisite blockchain data structure, wherein a large amount of business data is stored in the blockchain.
In the prior art, when the service data is stored, the storage rule of the service data is generally built in the bottom layer system of the block chain, so that the storage formats of the service data in different block chain systems are greatly different.
However, different storage rules may cause that the service data cannot be parsed according to a uniform format, thereby resulting in reduced flexibility of the blockchain system.
Disclosure of Invention
The embodiment of the invention provides a data processing method and device of a block chain, which are used for improving the flexibility of the block chain system.
In a first aspect, an embodiment of the present invention provides a data processing method for a blockchain, including:
business processing is carried out according to the interface function in the intelligent contract to generate business data;
and converting the business data into formatted data according to the data item expression rules in the intelligent contract, wherein the data item expression rules are used for indicating the data format of each data in the business data.
In one possible design, the generating the service data according to the service processing according to the interface function in the smart contract includes:
acquiring an intelligent contract according to the address of the intelligent contract;
and calling the interface function in the intelligent contract to perform service processing according to the function identification of the interface function to be called to generate service data, wherein the formats of the input data and the output data of the interface function are determined according to the data item expression rule.
In one possible design, the converting the business data into formatted data according to the data item expression rules in the smart contract includes:
acquiring a data identifier of each data in the service data;
searching the data item expression rule according to each data identifier to obtain a data format corresponding to the data identifier, wherein the data item expression rule is specifically used for indicating the data format corresponding to each data identifier;
and carrying out formatting processing on each data according to the data format corresponding to each data identifier to obtain the formatted data.
In one possible design, the data item expression rule for indicating the data identification includes at least one of:
a data item name, a data item type, a data serialization option set, or a sub-data item set.
In one possible design, after the converting the business data into the formatted data according to the data item expression rule in the smart contract, the method further includes:
and generating a block in a block chain according to the formatted data, wherein the formatted data is stored in the block.
In one possible design, the method further comprises:
acquiring a data acquisition request sent by a service library, wherein the data acquisition request carries a data identifier;
obtaining formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identifier to the service library.
In one possible design, the format of the interface functions in the smart contract is determined according to interface function expression rules.
In a second aspect, an embodiment of the present invention provides a data processing apparatus for a blockchain, including:
the generating module is used for carrying out service processing according to the interface function in the intelligent contract to generate service data;
and the conversion module is used for converting the business data into formatted data according to the data item expression rules in the intelligent contract, wherein the data item expression rules are used for indicating the data format of each data in the business data.
In one possible design, the generating module is specifically configured to:
acquiring an intelligent contract according to the address of the intelligent contract;
and calling the interface function in the intelligent contract to perform service processing according to the function identification of the interface function to be called to generate service data, wherein the formats of the input data and the output data of the interface function are determined according to the data item expression rule.
In one possible design, the conversion module is specifically configured to:
acquiring a data identifier of each data in the service data;
searching the data item expression rule according to each data identifier to obtain a data format corresponding to the data identifier, wherein the data item expression rule is specifically used for indicating the data format corresponding to each data identifier;
and carrying out formatting processing on each data according to the data format corresponding to each data identifier to obtain the formatted data.
In one possible design, the data item expression rule for indicating the data identification includes at least one of:
a data item name, a data item type, a data serialization option set, or a sub-data item set.
In one possible design, the generating module is further configured to:
and after the business data are converted into formatted data according to the data item expression rules in the intelligent contract, generating blocks in a block chain according to the formatted data, wherein the formatted data are stored in the blocks.
In one possible design, the method further comprises: an acquisition module;
the acquisition module is used for acquiring a data acquisition request sent by the service library, wherein the data acquisition request carries a data identifier;
obtaining formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identifier to the service library.
In one possible design, the format of the interface functions in the smart contract is determined according to interface function expression rules.
In a third aspect, an embodiment of the present invention provides a data processing apparatus of a blockchain, including:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being adapted to perform the method of the first aspect and any of the various possible designs of the first aspect as described above when the program is executed.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect above and any of the various possible designs of the first aspect.
The embodiment of the invention provides a data processing method and device of a block chain, wherein the method comprises the following steps: and carrying out service processing according to the interface function in the intelligent contract to generate service data. And converting the business data into formatted data according to the data item expression rules in the intelligent contract, wherein the data item expression rules are used for indicating the data format of each data in the business data. And generating service data through the interface function, and further converting the service data into formatted data according to the data item expression rule, so that the service data in the intelligent contract is analyzed according to a uniform format, and the flexibility of the blockchain system is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a first system diagram of a data processing method for a blockchain according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for processing data of a blockchain according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a method for processing data of a blockchain according to an embodiment of the present invention;
FIG. 4 is a second system diagram of a method for processing data of a blockchain according to the embodiment of the present invention;
FIG. 5 is a third system diagram of a method for processing data of a blockchain according to the embodiment of the present invention;
FIG. 6 is a block chain data processing apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a block chain data processing apparatus according to a second embodiment of the present invention;
FIG. 8 is a block chain data processing apparatus according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a first system schematic diagram of a data processing method of a blockchain according to an embodiment of the present invention, as shown in fig. 1, including: intelligent contracts 101, contract codes 102, and expression rules 103.
Wherein the smart contract 101 is a computer protocol intended to propagate, verify or execute contracts in an informative manner, wherein the smart contract 101 allows trusted transactions to be made without third parties, which transactions are traceable and irreversible, and in colloquial terms, the smart contract 101 stores the specific content of the multiparty contract in the computer in an encoded manner, the smart contract 101 sets a trigger condition, and when the machine determines that the trigger condition of the smart contract 101 is met, the protocol content specified by the smart contract is executed.
Specifically, the intelligent contract 101 can be stored in a blockchain in a manner of a block, wherein the blockchain is a special distributed database, any data can be written into the blockchain and also can be read from the blockchain, any user can use own terminal equipment to join the blockchain to become a node, and the blockchain has the characteristics of decentralization, decrustation and data cannot be tampered. Further, a chunk is a basic unit in a blockchain for storing transaction related information.
In this embodiment, when a transaction occurs, a block for the smart contract 101 is generated according to the transaction related information, specifically, the smart contract 101 includes a contract code 102, and the contract code 102 may be used to store transaction related data, for example, and may further execute business logic specified by the smart contract 101, so as to generate business data according to the transaction related data.
Further, in the process of executing the contract code 102, service data exists, and based on the lack of flexibility in the processing manner of the service data in the prior art, it is difficult to implement intercommunication, and the embodiment of the present invention provides the expression rule 103, where the expression rule 103 may be used to specify the expression manner of the service data, and the embodiment of the present invention does not particularly limit the specific implementation manner of the expression rule 103.
In this embodiment, the contract code 102 and the expression rule 103 are mutually associated and built in the smart contract 101 and are located under the same access authorization policy without changing the underlying system of the blockchain, wherein the association manner of the contract code 102 and the expression rule can be set as required, and the present invention is not limited thereto.
The data processing method of the blockchain provided by the present invention is described in detail below with reference to specific embodiments, and first described with reference to fig. 2.
FIG. 2 is a flowchart illustrating a method for processing data of a blockchain according to an embodiment of the present invention. As shown in fig. 2, the method includes:
s201, business processing is carried out according to an interface function in the intelligent contract to generate business data.
Specifically, the intelligent contract includes a contract code, the contract code includes a series of interface functions, the interface functions are used for performing business processing according to transaction related data, wherein the interface functions can be used for verifying the authenticity of transaction data of a payor, for example, the interface functions can also be used for executing transaction operation according to a verification result of a node in a blockchain and sending digital assets of the payor to a payee, etc., the specific implementation of the interface functions is not particularly limited, and those skilled in the art can understand that the specific implementation of the interface functions can be designed according to contents specified by the intelligent contract.
Further, the interface function performs service processing on the transaction related data, and the process of performing service processing is to execute a logic function specified by the interface function, so as to generate service data, where the service data is related data generated in the process of performing the interface function on the transaction related data, and the service data is not particularly limited by those skilled in the art.
S202, converting the business data into formatted data according to the data item expression rules in the intelligent contract, wherein the data item expression rules are used for indicating the data format of each data in the business data.
In this embodiment, a data item expression rule is provided, where the data item expression rule is used to indicate a data format of each data in the service data, where the data item expression rule may include, for example, a data item name, and may further include, for example, a data item type, and the data item expression rule is set to be a data item name and a format of a data item type, so as to implement an indication of a data format of the service data, and the foregoing is merely an exemplary description, and a specific implementation manner of the data item expression rule is not limited in this embodiment, and it will be understood by those skilled in the art that the data item expression rule may be designed according to needs.
Further, after setting the data item expression rule, converting the service data into the formatted data according to the data item expression rule, specifically, for example, when the data item expression rule includes a data item name and a data item type, acquiring the data item name and the data item type of the service data, and storing the data item name and the data item type according to a mode specified by the data item expression rule, thereby obtaining the formatted data.
The data processing method of the block chain provided by the embodiment of the invention comprises the following steps: and carrying out service processing according to the interface function in the intelligent contract to generate service data. And converting the business data into formatted data according to the data item expression rules in the intelligent contract, wherein the data item expression rules are used for indicating the data format of each data in the business data. And generating service data through the interface function, and further converting the service data into formatted data according to the data item expression rule, so that the service data in the intelligent contract is analyzed according to a uniform format, and the flexibility of the blockchain system is improved.
Based on the foregoing embodiments, a data processing method of a blockchain according to an embodiment of the present invention is described in further detail below with reference to fig. 3.
FIG. 3 is a second flowchart of a data processing method of a blockchain according to an embodiment of the present invention. As shown in fig. 3, the method includes:
s301, acquiring the intelligent contract according to the address of the intelligent contract.
Specifically, when an intelligent contract is generated according to transaction related data and contract content, an address of the intelligent contract is obtained, wherein the address of the intelligent contract can uniquely identify the intelligent contract, a mark of the intelligent contract can be stored corresponding to the address of the intelligent contract, a function identifier of an interface function contained in the intelligent contract can be stored, and the like.
In this embodiment, when generating the intelligent contract in the blockchain, a contract code and an expression rule are correspondingly generated, where the contract code and the expression rule are under the same access authorization, the contract code includes an interface function and transaction related data, and is used to execute contract content specified by the intelligent contract, and further, the expression rule includes a data item expression rule and an interface function expression rule, and specifically, the data item expression rule and the function expression rule are generated according to the interface function and the transaction related data in the contract code and are stored in the expression rule.
S302, calling an interface function in the intelligent contract to perform service processing according to the function identification of the interface function to be called to generate service data, wherein the formats of input data and output data of the interface function are determined according to the data item expression rule.
Wherein the format of the interface function in the smart contract is determined according to the interface function expression rule.
Specifically, the intelligent contract includes a plurality of interface functions, the interface functions are used for executing logic functions of contract codes, and specifically, the interface functions are provided with function identifiers, wherein the function identifiers can be, for example, function names, and also can be identifiers such as numbers and letters corresponding to the function names.
Further, the format of the interface function in the intelligent contract is determined according to the expression rule of the interface function, where the expression rule of the interface function is used to implement formatting of the interface function, so as to ensure that the interface function can be parsed according to a unified format, and the expression rule of the interface function may be, for example:
the interface function expresses rules: < function name, input data, output data >
The formats of the input data and the output data of the interface function are determined according to the data item expression rule, the function name is the name of the interface function, for example, the function name can be "add", "find", etc., the input data can be the input parameter of the interface function, for example, transaction related data after processing the interface function, etc., the output data can be, for example, service data, transaction related data after processing the interface function, etc., which is not limited by the embodiment of the invention, the above is only an exemplary description, not a unique implementation, for example, the function name can be a function identifier, etc., those skilled in the art can be fierce, and the specific implementation of the interface function expression rule can be set according to needs.
Further, when generating the block corresponding to the intelligent contract, correspondingly generating the interface function expression rule of the interface function contained in the contract code, obtaining the expression rule of the interface function to be called according to the function identification of the interface function to be called, and further, analyzing the interface function by the block chain according to the expression rule of the interface function to be called, so as to execute the logic function corresponding to the interface function, namely calling the interface function in the intelligent contract to perform service processing, and generating service data.
The interface function is analyzed through the interface function expression rule, so that standardization and generalization of the interface function and input data and output data of the interface function are realized, and the flexibility of the block chain system is improved.
S303, acquiring the data identification of each data in the service data.
Further, the service data includes a plurality of data, each data has a respective data identifier, where the data identifier may be, for example, a data name, or may be, for example, a letter, a number, etc. corresponding to the data name one by one.
S304, searching a data item expression rule according to each data identifier, and acquiring a data format corresponding to the data identifier, wherein the data item expression rule is specifically used for indicating the data format corresponding to each data identifier.
In this embodiment, when generating the contract code in the blockchain, a data item expression rule is correspondingly generated, where the data item expression rule is specifically used to indicate a data format corresponding to each data identifier, and reduce service data and transaction related data according to the corresponding data format, and the data identifier indicated by the data item expression rule includes at least one of the following: the data item name, data item type, data serialization option set or sub data item set, and specifically, the data item expression rule may be, for example:
< data item name, data item type, data serialization option set or sub-data item set)
The data item type is a type corresponding to the corresponding business data when being stored in a computer, for example, the data item type can be integer type, floating point type, character type and the like, and the method is not limited herein, wherein the data serialization option is used for indicating options included in the process of serializing the data, specifically, the data serialization is data analysis, and the data serialization refers to a process of converting state information of the data into a form capable of being stored or transmitted.
Specifically, the data serialization option set may include, for example, a serialization name, a serialization frame, a coding rule, an encryption algorithm, and the like, and the embodiment of the present invention does not particularly limit the data serialization option set, and those skilled in the art can understand that any parameter, operation, or related extension related to data serialization may be stored in the data serialization option set. Further, the sub data item set is a sub data set corresponding to the current service data, wherein the sub data is also subjected to reduction according to the data item expression rule, so that nested service data expression is formed.
The foregoing is merely illustrative, and is not a unique implementation, for example, the order of the implementation may be adjusted, or additional data identifiers may be added as needed, and the implementation of the data item expression rule according to the embodiments of the present invention is not particularly limited.
Specifically, the data item expression rule is searched according to each data identifier, for example, the data name of the existing data is "age", and then the data item expression rule corresponding to the "age" is searched in the data item expression rule according to the data name, which is only described as an example, further, the data format corresponding to the data identifier is obtained, wherein the data format corresponding to the data identifier indicates how to implement the reduction on the data.
And S305, formatting the data according to the data format corresponding to the data identifiers to obtain formatted data.
Further, according to the data format corresponding to each obtained data identifier, formatting is performed on each data, wherein the formatting process is a process of performing a protocol on transaction related data processed by service data or interface functions, so as to obtain formatted data.
According to the embodiment, business data and transaction related data processed by the interface function are regulated through the data item expression rules, so that unification of data expression modes in different systems is realized, and the flexibility of the block chain system is improved.
S306, generating blocks in the block chain according to the formatted data, wherein the formatted data are stored in the blocks.
Further, the formatted data is stored in the blockchain, so that blocks in the blockchain are obtained, wherein the data and the interface function of the blocks use a unified protocol mode, and therefore the unification of the data analysis modes in different blockchain systems is ensured.
The data processing method of the block chain provided by the embodiment of the invention comprises the following steps: and acquiring the intelligent contract according to the address of the intelligent contract. And calling the interface function in the intelligent contract to perform service processing according to the function identification of the interface function to be called to generate service data, wherein the formats of the input data and the output data of the interface function are determined according to the data item expression rule. And acquiring the data identification of each data in the service data. And searching a data item expression rule according to each data identifier, and acquiring a data format corresponding to the data identifier, wherein the data item expression rule is specifically used for indicating the data format corresponding to each data identifier. And carrying out formatting processing on each data according to the data format corresponding to each data identifier to obtain formatted data. And generating a block in the block chain according to the formatted data, wherein the formatted data is stored in the block. Interface functions in the intelligent contract are regulated by setting interface function expression rules, so that unification of interface function expression modes in different blockchain systems is realized, business data and transaction related data processed by the interface functions are unified by setting data item expression rules, wherein the expression rules are set in the intelligent contract without considering a bottom layer system of a blockchain, and therefore, the flexibility of the blockchain system is improved.
Based on the above embodiments, the data processing method for a blockchain provided by the embodiment of the present invention further includes:
and acquiring a data acquisition request sent by the service library, wherein the data acquisition request carries a data identifier.
And obtaining formatted data corresponding to the data identifier.
Specifically, the service library is set in the block for storing service data, and the service library includes a data name, a data content, and the like of the service data.
Further, a data acquisition request sent by the service library is acquired, wherein the data acquisition request carries a data identifier and is used for indicating to carry out reduction on service data according to the data identifier, specifically, a corresponding data format is searched in a data item expression rule according to the data identifier, and corresponding formatted data is obtained according to the data format.
Fig. 4 is a second system schematic diagram of a data processing method of a blockchain according to an embodiment of the present invention. As shown in fig. 4, the block data and the relationship between the traffic data and the expression rule in the blockchain are shown by way of example in fig. 4, and the block data 401 is included in fig. 4, where the block data 401 includes transaction related data, that is, request data in fig. 4, and the block data 401 further includes transaction related data processed by an interface function, that is, active data in fig. 4, and the block data shown in fig. 4 includes a plurality of data contents, which is only an exemplary description and not a unique implementation, and the embodiment of the present invention does not limit the block data 401 in particular.
Further, the expression rules 402 include interface function expression rules and data item expression rules, and the service data 403 is service data generated in the transaction process and is stored in a service library, which will be described in detail below.
In the embodiment of the present invention, the intelligent contract flag in the block data 401 is used to uniquely identify a piece of intelligent contract, further, each piece of intelligent contract has a respective corresponding expression rule, where the interface function expression rule is used to implement a protocol for each interface function in the contract code, and the data item expression rule is used to implement a protocol for each data item in the contract code.
Specifically, according to the expression rule corresponding to the intelligent contract identifier, further, a one-to-one correspondence exists between the function identifier and the interface function expression according to the rule, the expression rule corresponding to the interface function to be called is obtained in the interface function expression rule according to the function identifier, further, the parameter set in the block data 401 is input data of the interface function, the corresponding interface function expression rule is obtained according to the function identifier, and further, the function of the interface function is executed according to the input data, so that the content specified by the intelligent contract is executed, and the output data is obtained after the interface function is executed.
Specifically, the output data is a response result in the block data 401, in this embodiment, the parameter set (input data) and the response result (output data) are both reduced according to the data item expression rule, specifically, the data identifier in the block data 401 is used for identifying the transaction related data, the parameter set and the response result, searching is performed in the data item expression rule according to the data identifier, and a data format corresponding to the data identifier can be found, further, each data is reduced according to the data format, so as to obtain formatted data, and the formatted data is stored in the block data 401, so as to obtain a block.
Optionally, the data item expression rule corresponding to the data name of the service data 403 may be found by searching the data item expression rule according to the data name of the service data 403, and then the data is reduced according to the corresponding data format, so as to obtain the formatted data.
The embodiment of the invention associates the block data and the business data with the expression rules, thereby realizing the unification of the expression modes of each data and each interface function in different block chain systems without changing the bottom layer system of the block chain, and further improving the flexibility of the block chain system.
Based on the foregoing embodiments, a detailed description of a data processing method of a blockchain according to an embodiment of the present invention is further provided below with reference to a specific process example, and fig. 5 is a system schematic diagram three of the data processing method of the blockchain according to the embodiment of the present invention with reference to fig. 5.
As shown in FIG. 5, in one possible design, an embodiment of the present invention includes a data parsing controller 501, an expression rule loader 502, a data specification executor 503, an expression rule polling service 504, and an expression rule management component 505.
The data parsing controller 501 is configured to control a data parsing process in the blockchain, for example, may accept data to be parsed, and also, for example, send an instruction for querying an expression rule, where the instruction is not limited herein, and the expression rule loader 502 is configured to load the expression rule according to the instruction sent by the data parsing controller 501, specifically, the expression rule load sent by the data parsing controller 501 carries a data tag, and the expression rule loader 502 sends a request for querying the expression rule to the expression rule query service 504 according to a data identifier, where the request carries the data identifier.
Further, the expression rule polling service 504 queries the corresponding interface function expression rule or the data item expression rule from the expression rule management component 505 according to the data identifier, the expression rule loader 502 sends the corresponding expression rule obtained by querying the expression rule polling service 504 from the expression rule management component 505 to the data analysis controller 501, the data analysis controller 501 analyzes the data to be analyzed according to the obtained expression rule, specifically, the data analysis controller 501 sends a data analysis instruction to the data protocol executor 503, the instruction carries the data to be analyzed and the corresponding expression rule thereof, the data analysis controller 501 further analyzes the data to obtain formatted data, and then sends the result of the formatted data to the data analysis controller 501.
Optionally, the embodiment further includes an intelligent contract manager, where the intelligent contract manager is configured to add package deployment support of data protocols based on an original contract management module in the blockchain base platform.
According to the data processing method of the blockchain, the protocol and the analysis of the data can be efficiently and orderly realized through the cooperation among the components, so that a set of complete flow is adopted in different blockchain systems, the protocol of each data and each interface function according to the same format is ensured, and the flexibility of the blockchain system is improved.
FIG. 6 is a schematic diagram illustrating a block chain data processing apparatus according to an embodiment of the present invention. As shown in fig. 6, the data processing apparatus 60 of the blockchain includes: the generation module 601 and the conversion module 602.
A generating module 601, configured to perform service processing according to an interface function in the intelligent contract to generate service data;
the conversion module 602 is configured to convert the service data into formatted data according to a data item expression rule in the smart contract, where the data item expression rule is used to indicate a data format of each data in the service data.
In one possible design, the generating module 601 is specifically configured to:
acquiring an intelligent contract according to the address of the intelligent contract;
and calling the interface function in the intelligent contract to perform service processing according to the function identification of the interface function to be called to generate service data, wherein the formats of the input data and the output data of the interface function are determined according to the data item expression rule.
In one possible design, the conversion module 602 is specifically configured to:
acquiring a data identifier of each data in the service data;
searching a data item expression rule according to each data identifier to obtain a data format corresponding to the data identifier, wherein the data item expression rule is specifically used for indicating the data format corresponding to each data identifier;
and carrying out formatting processing on each data according to the data format corresponding to each data identifier to obtain formatted data.
In one possible design, the data item expression rules for indicating data identification include at least one of:
a data item name, a data item type, a data serialization option set, or a sub-data item set.
In one possible design, the generating module 601 is further configured to:
after converting the business data into formatted data according to the data item expression rules in the intelligent contract, generating blocks in the block chain according to the formatted data, wherein the formatted data is stored in the blocks.
The device provided in this embodiment may be used to implement the technical solution of the foregoing method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
FIG. 7 is a schematic diagram of a block chain data processing apparatus according to an embodiment of the present invention. As shown in fig. 7, this embodiment further includes, on the basis of the embodiment of fig. 6: and an acquisition module 703.
In one possible design, the acquiring module 703 is configured to acquire a data acquisition request sent by the service library, where the data acquisition request carries a data identifier;
obtaining formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identifier to the service library.
In one possible design, the format of the interface function in the smart contract is determined based on the interface function expression rules.
The device provided in this embodiment may be used to implement the technical solution of the foregoing method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
Fig. 8 is a schematic hardware structure of a blockchain data processing device according to an embodiment of the present invention, and as shown in fig. 8, a blockchain data processing device 80 according to the present embodiment includes: a processor 801 and a memory 802; wherein the method comprises the steps of
A memory 802 for storing computer-executable instructions;
the processor 801 is configured to execute computer-executable instructions stored in a memory to implement the steps performed by the data processing method for a block chain in the above-described embodiment. Reference may be made in particular to the relevant description of the embodiments of the method described above.
Alternatively, the memory 802 may be separate or integrated with the processor 801.
When the memory 802 is provided separately, the data processing apparatus of the blockchain further includes a bus 803 for connecting the memory 802 and the processor 801.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and when a processor executes the computer execution instructions, the data processing method of the blockchain executed by the data processing device of the blockchain is realized.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple modules may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The integrated modules, which are implemented in the form of software functional modules, may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform some of the steps of the methods described in the embodiments of the present application.
It should be understood that the above processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile memory NVM, such as at least one magnetic disk memory, and may also be a U-disk, a removable hard disk, a read-only memory, a magnetic disk or optical disk, etc.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (14)

1. A method of data processing for a blockchain, comprising:
business processing is carried out according to the interface function in the intelligent contract to generate business data;
converting the business data into formatted data according to a data item expression rule in the intelligent contract, wherein the data item expression rule is used for indicating the data format of each data in the business data; wherein the intelligent contract includes an expression rule including the data item expression rule and an interface function expression rule for determining a format of the interface function.
2. The method of claim 1, wherein the generating business data from business processing according to the interface function in the smart contract comprises:
acquiring an intelligent contract according to the address of the intelligent contract;
and calling the interface function in the intelligent contract to perform service processing according to the function identification of the interface function to be called to generate service data, wherein the formats of the input data and the output data of the interface function are determined according to the data item expression rule.
3. The method of claim 1, wherein said converting said business data into formatted data according to data item expression rules in said smart contract comprises:
acquiring a data identifier of each data in the service data;
searching the data item expression rule according to each data identifier to obtain a data format corresponding to the data identifier, wherein the data item expression rule is specifically used for indicating the data format corresponding to each data identifier;
and carrying out formatting processing on each data according to the data format corresponding to each data identifier to obtain the formatted data.
4. A method according to claim 3, wherein the data item expression rules for indicated data identification comprise at least one of:
a data item name, a data item type, a data serialization option set, or a sub-data item set.
5. The method of claim 1, wherein said converting said business data into formatted data according to data item expression rules in said smart contract further comprises:
and generating a block in a block chain according to the formatted data, wherein the formatted data is stored in the block.
6. The method according to claim 1, wherein the method further comprises:
acquiring a data acquisition request sent by a service library, wherein the data acquisition request carries a data identifier;
obtaining formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identifier to the service library.
7. A blockchain data processing device, comprising:
the generating module is used for carrying out service processing according to the interface function in the intelligent contract to generate service data;
the conversion module is used for converting the business data into formatted data according to a data item expression rule in the intelligent contract, wherein the data item expression rule is used for indicating the data format of each data in the business data; wherein the intelligent contract includes an expression rule including the data item expression rule and an interface function expression rule for determining a format of the interface function.
8. The apparatus of claim 7, wherein the generating module is specifically configured to:
acquiring an intelligent contract according to the address of the intelligent contract;
and calling the interface function in the intelligent contract to perform service processing according to the function identification of the interface function to be called to generate service data, wherein the formats of the input data and the output data of the interface function are determined according to the data item expression rule.
9. The apparatus of claim 7, wherein the conversion module is specifically configured to:
acquiring a data identifier of each data in the service data;
searching the data item expression rule according to each data identifier to obtain a data format corresponding to the data identifier, wherein the data item expression rule is specifically used for indicating the data format corresponding to each data identifier;
and carrying out formatting processing on each data according to the data format corresponding to each data identifier to obtain the formatted data.
10. The apparatus of claim 9, wherein the data item expression rules for indicated data identification comprise at least one of:
a data item name, a data item type, a data serialization option set, or a sub-data item set.
11. The apparatus of claim 7, wherein the generating module is further configured to:
and after the business data are converted into formatted data according to the data item expression rules in the intelligent contract, generating blocks in a block chain according to the formatted data, wherein the formatted data are stored in the blocks.
12. The apparatus as recited in claim 7, further comprising: an acquisition module;
the acquisition module is used for acquiring a data acquisition request sent by the service library, wherein the data acquisition request carries a data identifier;
obtaining formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identifier to the service library.
13. A blockchain data processing device, comprising:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being for performing the method of any one of claims 1 to 6 when the program is executed.
14. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 6.
CN201811532778.1A 2018-12-14 2018-12-14 Block chain data processing method and device Active CN111324645B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811532778.1A CN111324645B (en) 2018-12-14 2018-12-14 Block chain data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811532778.1A CN111324645B (en) 2018-12-14 2018-12-14 Block chain data processing method and device

Publications (2)

Publication Number Publication Date
CN111324645A CN111324645A (en) 2020-06-23
CN111324645B true CN111324645B (en) 2023-05-30

Family

ID=71163351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811532778.1A Active CN111324645B (en) 2018-12-14 2018-12-14 Block chain data processing method and device

Country Status (1)

Country Link
CN (1) CN111324645B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111768187A (en) * 2020-08-31 2020-10-13 支付宝(杭州)信息技术有限公司 Method for deploying intelligent contract, block chain node and storage medium
CN112131298B (en) * 2020-11-19 2021-06-29 支付宝(杭州)信息技术有限公司 Data conversion method and device based on block chain

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976231A (en) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 Asset management method based on intelligent block chain contracts and nodes
CN106775497A (en) * 2017-01-19 2017-05-31 郑志超 Distributed storage method and equipment based on block chain
CN106874087A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain intelligence contract timed task dispatching method
CN107038242A (en) * 2017-04-24 2017-08-11 杭州趣链科技有限公司 It is a kind of towards the global intelligent contract business datum analytic method of block chain
CN107193490A (en) * 2017-05-16 2017-09-22 北京中星仝创科技有限公司 A kind of distributed data-storage system and method based on block chain
KR101781583B1 (en) * 2016-08-31 2017-09-27 서강대학교산학협력단 File management and search system based on block chain and file management and search method
CN107330026A (en) * 2017-06-22 2017-11-07 物链(北京)科技有限公司 A kind of method and system of compatible isomery block platform chain
CN107622096A (en) * 2017-08-31 2018-01-23 上海保险交易所股份有限公司 Asynchronous multiparty data exchange method and storage medium based on block catenary system
CN107688927A (en) * 2017-09-19 2018-02-13 中国银行股份有限公司 A kind of method and system for calling the intelligent contract on block chain
CN107943950A (en) * 2017-11-24 2018-04-20 中钞信用卡产业发展有限公司杭州区块链技术研究院 The method and system that data intelligence contract generates in a kind of block chain
CN108647964A (en) * 2018-05-02 2018-10-12 郑杰骞 A kind of block chain data processing method, device and computer readable storage medium
CN108765158A (en) * 2018-05-31 2018-11-06 杭州秘猿科技有限公司 A kind of intelligent contract automotive engine system and its contract execution method based on block chain

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150379510A1 (en) * 2012-07-10 2015-12-31 Stanley Benjamin Smith Method and system to use a block chain infrastructure and Smart Contracts to monetize data transactions involving changes to data included into a data supply chain.
CN104935657A (en) * 2015-06-15 2015-09-23 清华大学深圳研究生院 Method for actively pushing information and embedded node operating system

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976231A (en) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 Asset management method based on intelligent block chain contracts and nodes
KR101781583B1 (en) * 2016-08-31 2017-09-27 서강대학교산학협력단 File management and search system based on block chain and file management and search method
CN106775497A (en) * 2017-01-19 2017-05-31 郑志超 Distributed storage method and equipment based on block chain
CN106874087A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain intelligence contract timed task dispatching method
CN107038242A (en) * 2017-04-24 2017-08-11 杭州趣链科技有限公司 It is a kind of towards the global intelligent contract business datum analytic method of block chain
CN107193490A (en) * 2017-05-16 2017-09-22 北京中星仝创科技有限公司 A kind of distributed data-storage system and method based on block chain
CN107330026A (en) * 2017-06-22 2017-11-07 物链(北京)科技有限公司 A kind of method and system of compatible isomery block platform chain
CN107622096A (en) * 2017-08-31 2018-01-23 上海保险交易所股份有限公司 Asynchronous multiparty data exchange method and storage medium based on block catenary system
CN107688927A (en) * 2017-09-19 2018-02-13 中国银行股份有限公司 A kind of method and system for calling the intelligent contract on block chain
CN107943950A (en) * 2017-11-24 2018-04-20 中钞信用卡产业发展有限公司杭州区块链技术研究院 The method and system that data intelligence contract generates in a kind of block chain
CN108647964A (en) * 2018-05-02 2018-10-12 郑杰骞 A kind of block chain data processing method, device and computer readable storage medium
CN108765158A (en) * 2018-05-31 2018-11-06 杭州秘猿科技有限公司 A kind of intelligent contract automotive engine system and its contract execution method based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"区块链与大数据结合既安全又高效——区块链与大数据结合的研究";黄天开;《信息工程》;20180715;全文 *

Also Published As

Publication number Publication date
CN111324645A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
WO2020233048A1 (en) Customized software generation method and system, and electronic device and storage medium
CN111428462B (en) Communication protocol template construction method and terminal equipment
CN110601880B (en) Cloud platform, service processing method, command interface and computer equipment
CN110032599B (en) Data structure reading and updating method and device, and electronic equipment
CN111767143A (en) Transaction data processing method, device, equipment and system
CN110597814B (en) Structured data serialization and deserialization method and device
CN114500690B (en) Interface data processing method and device, electronic equipment and storage medium
CN109617647A (en) Message forwarding method, device, computer equipment and computer readable storage medium
CN109146095A (en) The treating method and apparatus of multiservice system problem
CN111143446A (en) Data structure conversion processing method and device of data object and electronic equipment
WO2023124425A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN110765067A (en) Data processing method and device
CN111324645B (en) Block chain data processing method and device
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN111338716A (en) Data processing method and device based on rule engine and terminal equipment
CN112181542A (en) Function calling method and device, electronic equipment and storage medium
CN110737425B (en) Method and device for establishing application program of charging platform system
CN112363997B (en) Data version management method, device and storage medium
CN116993523A (en) Configurable account checking method, device, equipment and storage medium
CN115904317A (en) Method, device, equipment and storage medium for uniformly calling front-end interface and back-end interface
CN102612683A (en) Maintaining data integrity across execution environments
US9189299B2 (en) Framework for system communication for handling data
CN115460265A (en) Interface calling method, device, equipment and medium
CN111580799A (en) Domain specific language script assembling method and system
CN112235409A (en) File uploading method and device, electronic equipment and computer readable storage medium

Legal Events

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