CN111324645A - Data processing method and device for block chain - Google Patents

Data processing method and device for block chain Download PDF

Info

Publication number
CN111324645A
CN111324645A CN201811532778.1A CN201811532778A CN111324645A CN 111324645 A CN111324645 A CN 111324645A CN 201811532778 A CN201811532778 A CN 201811532778A CN 111324645 A CN111324645 A CN 111324645A
Authority
CN
China
Prior art keywords
data
intelligent contract
expression rule
interface function
identifier
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.)
Granted
Application number
CN201811532778.1A
Other languages
Chinese (zh)
Other versions
CN111324645B (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

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a data processing method and a device of a block chain, wherein the method comprises the following steps: and performing service processing according to an interface function in the intelligent contract to generate service data. And 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. According to the embodiment, the interface function and the data are analyzed according to a uniform format through the interface function expression rule and the data item expression rule, and the flexibility of the block chain system is improved.

Description

Data processing method and device for block chain
Technical Field
The present invention relates to computer technologies, and in particular, to a data processing method and apparatus for a block chain.
Background
With the development of the blockchain technology, the application scenarios of the blockchain are more and more extensive, and the blockchain provides a reliable distributed accounting mechanism for the transaction through a cryptography technology, a consensus mechanism and an exquisite blockchain data structure, wherein a large amount of service data are stored in the blockchain.
In the prior art, when business data is stored, a storage rule of the business data is usually built in a bottom system of a block chain, so that storage formats of the business data in different block chain systems are greatly different.
However, different storage rules may cause the service data not to be parsed according to a uniform format, thereby resulting in a reduced flexibility of the blockchain system.
Disclosure of Invention
The embodiment of the invention provides a data processing method and a data processing device for a block chain, which are used for improving the flexibility of a block chain system.
In a first aspect, an embodiment of the present invention provides a data processing method for a block chain, including:
performing service processing according to an interface function in the intelligent contract to generate service data;
and 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.
In one possible design, the generating the service data by performing service processing according to an interface function in the intelligent 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 to generate service data according to the function identifier of the interface function to be called, 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 rule in the intelligent contract includes:
acquiring data identification 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 formatting each data according to the data format corresponding to each data identifier to obtain the formatted data.
In one possible design, the data identification indicated by the data item expression rule includes at least one of:
a data item name, a data item type, a set of data serialization options, or a set of child data items.
In one possible design, after the converting the business data into formatted data according to the data item expression rule in the intelligent 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 includes:
acquiring a data acquisition request sent by a service library, wherein the data acquisition request carries a data identifier;
acquiring formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identification to the service library.
In one possible design, the format of the interface function in the intelligent contract is determined according to an interface function expression rule.
In a second aspect, an embodiment of the present invention provides a data processing apparatus for a block chain, including:
the generating module is used for processing the service 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 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.
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 to generate service data according to the function identifier of the interface function to be called, 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 data identification 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 formatting each data according to the data format corresponding to each data identifier to obtain the formatted data.
In one possible design, the data identification indicated by the data item expression rule includes at least one of:
a data item name, a data item type, a set of data serialization options, or a set of child data items.
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 rule in the intelligent contract, generating a block in a block chain according to the formatted data, wherein the formatted data are stored in the block.
In one possible design, further comprising: an acquisition module;
the acquisition module is used for acquiring a data acquisition request sent by a service library, wherein the data acquisition request carries a data identifier;
acquiring formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identification to the service library.
In one possible design, the format of the interface function in the intelligent contract is determined according to an interface function expression rule.
In a third aspect, an embodiment of the present invention provides a data processing apparatus for a block chain, 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 as described above in the first aspect and any one of the various possible designs of the first aspect when the program is executed.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including instructions, which, when executed on a computer, cause the computer to perform the method as described above in the first aspect and any one of various possible designs of the first aspect.
The embodiment of the invention provides a data processing method and a device of a block chain, wherein the method comprises the following steps: and performing service processing according to an interface function in the intelligent contract to generate service data. And 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. The service data is generated through the interface function, and is further converted 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 block chain system is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a first system diagram illustrating a data processing method for a block chain according to an embodiment of the present invention;
fig. 2 is a first flowchart of a data processing method of a block chain according to an embodiment of the present invention;
fig. 3 is a second flowchart of a data processing method of a block chain according to an embodiment of the present invention;
fig. 4 is a system diagram of a data processing method of a block chain according to an embodiment of the present invention;
fig. 5 is a system diagram of a data processing method of a block chain according to an embodiment of the present invention;
fig. 6 is a first schematic structural diagram of a data processing apparatus of a block chain according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data processing apparatus of a block chain according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a hardware structure of a data processing device of a block chain according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a system diagram of a block chain data processing method according to an embodiment of the present invention, as shown in fig. 1, including: intelligent contracts 101, contract code 102, and expression rules 103.
The intelligent contract 101 is a computer protocol aiming at propagating, verifying or executing contracts in an informatization mode, wherein the intelligent contract 101 allows credible transactions without a third party, the transactions can be tracked and can not be reversed, in a colloquial way, the specific content of a multiparty contract is stored into a computer in a coding mode by the intelligent contract 101, the intelligent contract 101 sets a trigger condition, and when the trigger condition of the intelligent contract 101 is judged to be met by the machine, the protocol content specified by the intelligent contract is executed.
Specifically, the intelligent contract 101 may be stored in a blockchain manner, where the blockchain is a special distributed database, any data may be written into the blockchain, or may be read from the blockchain, where any user may join the blockchain by using a terminal device of the user to become one node of the blockchain, and the blockchain has the characteristics of decentralization, distrust, and data tamper-free. Further, a block is a basic unit in a block chain and is used for storing information related to a transaction.
In this embodiment, when a transaction occurs, a block for an intelligent contract 101 is generated according to transaction-related information, specifically, the intelligent contract 101 includes a contract code 102, and the contract code 102 may be used, for example, to store transaction-related data, and may also execute, for example, a business logic specified by the intelligent contract 101, so as to generate business data according to the transaction-related data.
Further, there is service data in the execution process of the contract code 102, and it is difficult to implement intercommunication based on the lack of flexibility in the processing manner of the service data in the prior art, an 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 a specific implementation manner of the expression rule 103 is not particularly limited in the embodiment of the present invention.
In this embodiment, the contract code 102 and the expression rule 103 are associated with each other and built in the intelligent contract 101, and are located under the same access authorization policy without changing the underlying system of the blockchain, where the association manner of the contract code 102 and the expression rule may be set as required, and is not limited herein.
The following describes the data processing method of the block chain according to the present invention in detail with reference to specific embodiments, and first with reference to fig. 2.
Fig. 2 is a first flowchart of a data processing method of a block chain according to an embodiment of the present invention. As shown in fig. 2, the method includes:
s201, performing service processing according to an interface function in the intelligent contract to generate service data.
Specifically, the intelligent contract includes a contract code, the contract code includes a series of interface functions, and the interface functions are used for performing service processing according to transaction related data, where the interface functions may be used, for example, to verify the authenticity of transaction data of a payer, and may also be used, for example, to execute a transaction operation according to a verification result of a node in a blockchain, and send digital assets of the payer to a payee, and the like.
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 processing the transaction related data by the interface function, and a person skilled in the art does not make any particular limitation on the service data.
S202, 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.
In this embodiment, a data item expression rule is set, where the data item expression rule is used to indicate a data format of each data in the business data, where the data item expression rule may include, for example, a data item name and also may include, for example, a data item type, and the data item expression rule is set to a format of the data item name and the data item type, so as to implement the indication of the data format of the business data.
Further, after the data item expression rule is set, the service data is converted 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, the data item name and the data item type of the service data are obtained, and the data item name and the data item type are stored according to a mode specified by the data item expression rule, so as to obtain the formatted data.
The data processing method of the block chain provided by the embodiment of the invention comprises the following steps: and performing service processing according to an interface function in the intelligent contract to generate service data. And 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. The service data is generated through the interface function, and is further converted 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 block chain system is improved.
Based on the above embodiments, the following describes in detail the data processing method of the block chain according to the embodiment of the present invention with reference to fig. 3.
Fig. 3 is a second flowchart of a data processing method of a block chain 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, where the address of the intelligent contract can uniquely identify the intelligent contract, and the address of the intelligent contract corresponds to, for example, a mark of the intelligent contract may be stored, and also, for example, a function identifier of an interface function included in the intelligent contract may be stored.
In this embodiment, when an intelligent contract is generated in a block chain, 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 for executing contract content defined by the intelligent contract, 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 stored in the expression rule.
S302, according to the function identification of the interface function to be called, calling the interface function in the intelligent contract to perform service processing 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.
The format of the interface function in the intelligent 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 the logic functions of the contract code, specifically, the interface functions are provided with function identifiers, where the function identifiers may be, for example, function names, and also may be, for example, numbers, letters, and the like corresponding to the function names.
Further, the format of the interface function in the intelligent contract is determined according to an interface function expression rule, where the interface function expression rule is used to implement formatting of the interface function, so as to ensure that the interface function can be analyzed according to a uniform format, and the interface function expression rule may be, for example:
the interface function expresses the rule: < function name, input data, output data >
The format of the input data and the output data of the interface function is determined according to the data item expression rule, the function name is the name of the interface function, and may be "add", "find", and the like, for example, where the input data is an input parameter of the interface function, and may be, for example, transaction-related data, and may also be, for example, transaction-related data processed by the interface function, and the like, and the output data may be, for example, business data, and may also be, for example, transaction-related data processed by the interface function, and the like.
Further, when a block corresponding to the intelligent contract is generated, an interface function expression rule of an interface function contained in the contract code is correspondingly generated, the expression rule of the interface function to be called is obtained according to the function identifier of the interface function to be called, and further, the block chain analyzes the interface function according to the expression rule of the interface function to be called, so that a logic function corresponding to the interface function is executed, namely, the interface function in the intelligent contract is called for service processing, and service data are generated.
The interface function is analyzed through the interface function expression rule, standardization and universalization of the interface function and input data and output data of the interface function are achieved, and therefore flexibility of a block chain system is improved.
S303, acquiring data identification of each data in the service data.
Further, the service data includes a plurality of data, each data has its own data identifier, where the data identifier may be, for example, a data name, and may also be, for example, a letter, a number, and the like corresponding to the data name one to 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 a contract code is generated in a 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 specify business data and transaction related data according to the corresponding data format, where the data identifier indicated by the data item expression rule includes at least one of the following: the data item name, the data item type, the data serialization option set, or the sub data item set, 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 service data stored in the computer, for example, the data item type may be an integer type, further, for example, a floating point type, further, for example, a character type, and the like, and the data serialization option is used to indicate an option included in serializing the data, specifically, the data serialization is data analysis, and the data serialization is 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, an encoding rule, an encryption algorithm, and the like, and the data serialization set is not particularly limited in the embodiment of the present invention, and those skilled in the art can understand that all parameters, operations, or related extension contents related to data serialization may be stored in the data serialization option set. Furthermore, the subdata item set is a subdata set corresponding to the current service data, wherein the subdata is also subjected to specification according to a data item expression rule, so that nested service data expression is formed.
The above description is only an exemplary description, and is not an exclusive implementation manner, for example, the order of the above description may be adjusted, or a required additional data identifier may be added, and the implementation manner of the data item expression rule is not particularly limited in the embodiment of the present invention.
Specifically, a data item expression rule is searched according to each data identifier, for example, a data name of data exists as "age", a data item expression rule corresponding to "age" is searched in the data item expression rule according to the data name, which is described above only as an exemplary description, and further, a data format corresponding to the data identifier is obtained, where the data format corresponding to the data identifier indicates how to perform specification on the data.
S305, formatting each data according to the data format corresponding to each data identifier to obtain formatted data.
Further, according to the data format corresponding to each acquired data identifier, formatting is performed on each data, and the formatting process is a process of stipulating transaction related data processed by the service data or the interface function, so as to obtain formatted data.
In the embodiment, the business data and the transaction related data processed by the interface function are subjected to stipulation through the data item expression rule, so that the data expression modes in different systems are unified, and the flexibility of the blockchain system is improved.
S306, generating a block in the block chain according to the formatted data, wherein the block stores the formatted data.
Further, the formatted data is stored in the block chain, so that the blocks in the block chain are obtained, wherein the data and the interface functions of the blocks use a unified protocol mode, and therefore the unification of data analysis modes in different block chain systems is guaranteed.
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 to generate service data according to the function identifier of the interface function to be called, 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 identifier of each data in the service data. And 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 formatting 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 block stores the formatted data. Interface functions in the intelligent contract are stipulated by setting an interface function expression rule, so that the unification of interface function expression modes in different blockchain systems is realized, the unification of business data and transaction related data processed by the interface functions is realized by setting a data item expression rule, the expression rule is set in the intelligent contract, the bottom layer system of the blockchain is not required to be considered, and the flexibility of the blockchain system is improved.
On the basis of the foregoing embodiment, the data processing method for a block chain according to an 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 acquiring formatted data corresponding to the data identification.
Specifically, the service library is arranged in the block and used for storing the service data, and the service library includes the data name, the data content, and the like of the service data.
Further, a data acquisition request sent by the service library is acquired, where the data acquisition request carries a data identifier for instructing to perform a specification on the service data according to the data identifier, specifically, a corresponding data format is searched in the data item expression rule according to the data identifier, and corresponding formatted data is obtained according to the data format.
Fig. 4 is a system diagram of a data processing method of a block chain according to an embodiment of the present invention, which is described in further detail below with reference to fig. 4. As shown in fig. 4, the relation between block data and service data in a block chain and an expression rule is exemplarily shown in fig. 4, where fig. 4 includes block data 401, where the block data 401 includes transaction-related data, i.e., request data in fig. 4, where the block data 401 further includes transaction-related data processed by an interface function, i.e., active data in fig. 4, and the block data shown in fig. 4 includes a plurality of data contents, which is merely an exemplary description and is not a unique implementation manner, and the block data 401 is not particularly limited in the embodiment of the present invention.
Further, the expression rules 402 include interface function expression rules and data item expression rules, and the business data 403 is business data generated during the transaction process and stored in a business library, which is described in detail below.
In an embodiment of the present invention, the smart contract flag in the block data 401 is used to uniquely identify one smart contract, and further, each smart contract has a corresponding expression rule, where the interface function expression rule is used to specify each interface function in the contract code, and the data item expression rule is used to specify each data item in the contract code.
Specifically, the method includes the steps of corresponding to an expression rule of an intelligent contract according to an intelligent contract identifier, further, enabling a one-to-one corresponding relation to exist between a function identifier and an interface function expression rule according to the rule, obtaining an expression rule corresponding to an interface function to be called in the interface function expression rule according to the function identifier, further, enabling a parameter set in block data 401 to be input data of the interface function, obtaining the corresponding interface function expression rule according to the function identifier, further executing a function of the interface function according to the input data, executing content specified by the intelligent contract, and executing the interface function to obtain output data.
Specifically, the output data is the response result in the block data 401, in this embodiment, both the parameter set (input data) and the response result (output data) are specified according to the data item expression rule, specifically, the data identifier in the block data 401 is used to identify the transaction-related data, the parameter set, and the response result, and the data format corresponding to the data identifier can be found by searching in the data item expression rule according to the data identifier, and further, each data is specified according to the data format to obtain formatted data, which is stored in the block data 401, so as to obtain the block.
Optionally, the data item expression rule may also be searched according to the data name of the service data 403, and after the data item expression rule corresponding to the data name is found, the data is reduced according to the corresponding data format, so as to obtain formatted data.
The embodiment of the invention associates the block data and the service data with the expression rule, 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 above embodiment, the following describes the data processing method of the block chain provided in the embodiment of the present invention in further detail with reference to a specific process example, and with reference to fig. 5, fig. 5 is a system diagram three of the data processing method of the block chain provided in the embodiment of the present invention.
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 query service 504, and an expression rule management component 505.
The data parsing controller 501 is configured to control a data parsing process in a block chain, for example, data to be parsed may be received, and for example, an instruction for expressing rule query is sent, where the data parsing controller 501 is not limited to this, where the expression rule loader 502 is configured to load an 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 label, and the expression rule loader 502 sends a request for expressing rule query to the expression rule query service 504 according to a data identifier, where the request carries the data identifier.
Further, the expression rule query service 504 queries a corresponding interface function expression rule or data item expression rule from the expression rule management component 505 according to the data identifier, the expression rule loader 502 sends the expression rule obtained by querying the expression rule query 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 specification executor 503, the instruction carries the data to be analyzed and the corresponding expression rule, 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 present embodiment further includes an intelligent contract manager, where the intelligent contract manager is configured to add a package deployment support of a data protocol on the basis of an original contract management module in the blockchain base platform.
According to the data processing method of the block chain, provided by the embodiment of the invention, the specification and analysis of the data can be realized efficiently and orderly through the cooperative cooperation among the components, so that a set of complete flow is adopted in different block chain systems, the specification of the data and the interface functions according to the same format is ensured, and the flexibility of the block chain system is improved.
Fig. 6 is a first schematic structural diagram of a data processing apparatus of a block chain according to an embodiment of the present invention. As shown in fig. 6, the data processing apparatus 60 of the block chain includes: a generation module 601 and a conversion module 602.
A generating module 601, configured to perform service processing according to an interface function in an intelligent contract to generate service data;
the conversion module 602 is configured to convert the business data into formatted data according to a data item expression rule in the intelligent contract, where the data item expression rule is used to indicate a data format of each data in the business 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 to generate service data according to the function identifier of the interface function to be called, 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 data identification 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 formatting each data according to the data format corresponding to each data identifier to obtain formatted data.
In one possible design, the data identification indicated by the data item expression rule includes at least one of:
a data item name, a data item type, a set of data serialization options, or a set of child data items.
In one possible design, the generating module 601 is further configured to:
after the business data are converted into the formatted data according to the data item expression rule in the intelligent contract, generating a block in a block chain according to the formatted data, wherein the block stores the formatted data.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a data processing apparatus of a block chain according to an embodiment of the present invention. As shown in fig. 7, this embodiment further includes, on the basis of the embodiment in fig. 6: an obtaining module 703.
In a possible design, the obtaining module 703 is configured to obtain a data obtaining request sent by a service library, where the data obtaining request carries a data identifier;
acquiring formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identification to the service library.
In one possible design, the format of the interface function in the intelligent contract is determined according to the interface function expression rule.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 8 is a schematic diagram of a hardware structure of a data processing device of a block chain according to an embodiment of the present invention, and as shown in fig. 8, a data processing device 80 of a block chain according to this embodiment includes: a processor 801 and a memory 802; wherein
A memory 802 for storing computer-executable instructions;
the processor 801 is configured to execute the computer executable instructions stored in the memory to implement the steps performed by the data processing method of the blockchain in the above embodiments. Reference may be made in particular to the description relating to the method embodiments 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 block chain further includes a bus 803 for connecting the memory 802 and the processor 801.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer executable instruction is stored in the computer-readable storage medium, and when a processor executes the computer executable instruction, the method for processing data of a blockchain is implemented as the method for processing data of a blockchain executed by the data processing device of the blockchain.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. 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, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures 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 non-volatile 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 disks. 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 understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (16)

1. A method for processing data in a blockchain, comprising:
performing service processing according to an interface function in the intelligent contract to generate service data;
and 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.
2. The method of claim 1, wherein the generating the service data by performing service processing according to the interface function in the intelligent 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 to generate service data according to the function identifier of the interface function to be called, 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 the converting the business data into formatted data according to the data item expression rules in the intelligent contract comprises:
acquiring data identification 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 formatting each data according to the data format corresponding to each data identifier to obtain the formatted data.
4. The method of claim 3, wherein the data identification indicated by the data item expression rule comprises at least one of the following:
a data item name, a data item type, a set of data serialization options, or a set of child data items.
5. The method of claim 1, wherein after converting the business data into formatted data according to the data item expression rules in the intelligent contract, further comprising:
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 of claim 1, further comprising:
acquiring a data acquisition request sent by a service library, wherein the data acquisition request carries a data identifier;
acquiring formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identification to the service library.
7. The method of any of claims 1 to 6, wherein the format of the interface function in the intelligent contract is determined according to interface function expression rules.
8. A block chain data processing apparatus, comprising:
the generating module is used for processing the service 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 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.
9. The apparatus of claim 8, wherein the generation 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 to generate service data according to the function identifier of the interface function to be called, wherein the formats of the input data and the output data of the interface function are determined according to the data item expression rule.
10. The apparatus of claim 8, wherein the conversion module is specifically configured to:
acquiring data identification 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 formatting each data according to the data format corresponding to each data identifier to obtain the formatted data.
11. The apparatus according to claim 10, wherein the data identification indicated by the data item expression rule comprises at least one of the following:
a data item name, a data item type, a set of data serialization options, or a set of child data items.
12. The apparatus of claim 8, wherein the generating module is further configured to:
and after the business data are converted into formatted data according to the data item expression rule in the intelligent contract, generating a block in a block chain according to the formatted data, wherein the formatted data are stored in the block.
13. The apparatus of claim 8, further comprising: an acquisition module;
the acquisition module is used for acquiring a data acquisition request sent by a service library, wherein the data acquisition request carries a data identifier;
acquiring formatted data corresponding to the data identifier;
and returning the formatted data corresponding to the data identification to the service library.
14. The apparatus according to any one of claims 8 to 13, wherein the format of the interface function in the intelligent contract is determined according to an interface function expression rule.
15. A data processing apparatus for a blockchain, comprising:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being configured to perform the method of any of claims 1 to 7 when the program is executed.
16. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 7.
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 true CN111324645A (en) 2020-06-23
CN111324645B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131298A (en) * 2020-11-19 2020-12-25 支付宝(杭州)信息技术有限公司 Data conversion method and device based on block chain
US20210319438A1 (en) * 2020-08-31 2021-10-14 Alipay (Hangzhou) Information Technology Co., Ltd. Methods, blockchain nodes, and storage media for deploying smart contract

Citations (14)

* 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.
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
US20170201582A1 (en) * 2015-06-15 2017-07-13 Graduate School At Shenzhen, Tsinghua University Cross-protocol distributed cloud storage system and data management method based on operation control unit
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

Patent Citations (14)

* 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.
US20170201582A1 (en) * 2015-06-15 2017-07-13 Graduate School At Shenzhen, Tsinghua University Cross-protocol distributed cloud storage system and data management method based on operation control unit
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
黄天开: ""区块链与大数据结合既安全又高效——区块链与大数据结合的研究"", 《信息工程》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210319438A1 (en) * 2020-08-31 2021-10-14 Alipay (Hangzhou) Information Technology Co., Ltd. Methods, blockchain nodes, and storage media for deploying smart contract
US11551206B2 (en) * 2020-08-31 2023-01-10 Alipay (Hangzhou) Information Technology Co., Ltd. Methods, blockchain nodes, and storage media for deploying smart contract
CN112131298A (en) * 2020-11-19 2020-12-25 支付宝(杭州)信息技术有限公司 Data conversion method and device based on block chain
CN112131298B (en) * 2020-11-19 2021-06-29 支付宝(杭州)信息技术有限公司 Data conversion method and device based on block chain

Also Published As

Publication number Publication date
CN111324645B (en) 2023-05-30

Similar Documents

Publication Publication Date Title
CN108846659B (en) Block chain-based transfer method and device and storage medium
EP3591510B1 (en) Method and device for writing service data in block chain system
US11356282B2 (en) Sending cross-chain authenticatable messages
CN111428462A (en) Communication protocol template construction method and terminal equipment
WO2018210096A1 (en) Rule engine-based rule configuration method, terminal and device, and storage medium
CN106325870B (en) Method and device for realizing dynamic form API (application program interface)
CN110765067A (en) Data processing method and device
CN110737425B (en) Method and device for establishing application program of charging platform system
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
CN109271564A (en) Declaration form querying method and equipment
CN111324645B (en) Block chain data processing method and device
CN114781007A (en) Tree-based document batch signature and signature verification method and system
CN116502283A (en) Privacy data processing method and device
CN113360043B (en) Service processing method and equipment
CN116993523A (en) Configurable account checking method, device, equipment and storage medium
CN111177099A (en) Data processing method and device of business system, electronic equipment and storage medium
CN115904317A (en) Method, device, equipment and storage medium for uniformly calling front-end interface and back-end interface
CN110930253A (en) Intelligent contract internal main key generation method and device, computer equipment and storage medium
CN115460265A (en) Interface calling method, device, equipment and medium
CN115391343A (en) Bill data processing method and device, electronic equipment and storage medium
CN112650763A (en) Configuration method of product quota, related equipment and storage medium
CN113448960A (en) Method and device for importing form file
CN114398376A (en) Data processing method and device and readable storage medium
CN111061576A (en) Method and system for creating entity object

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