CN109886694B - Data processing method and device based on block chain and electronic equipment - Google Patents

Data processing method and device based on block chain and electronic equipment Download PDF

Info

Publication number
CN109886694B
CN109886694B CN201910234317.4A CN201910234317A CN109886694B CN 109886694 B CN109886694 B CN 109886694B CN 201910234317 A CN201910234317 A CN 201910234317A CN 109886694 B CN109886694 B CN 109886694B
Authority
CN
China
Prior art keywords
transaction
dimension
intelligent contract
data
historical
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
CN201910234317.4A
Other languages
Chinese (zh)
Other versions
CN109886694A (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.)
Ant Chain Technology Co ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN202110667738.3A priority Critical patent/CN113421088B/en
Priority to CN201910234317.4A priority patent/CN109886694B/en
Publication of CN109886694A publication Critical patent/CN109886694A/en
Application granted granted Critical
Publication of CN109886694B publication Critical patent/CN109886694B/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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

An embodiment of the present specification provides a data processing method and apparatus based on a block chain, and an electronic device, where the method includes: receiving a transaction which is initiated by a service party and carries out multi-dimensional processing aiming at target data; responding to the transaction, and inquiring an intelligent contract corresponding to each dimension; calling data processing logic declared in the intelligent contract corresponding to the inquired dimensions; wherein the data processing logic comprises: acquiring target data of a current dimension and historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension.

Description

Data processing method and device based on block chain and electronic equipment
Technical Field
The embodiment of the specification relates to the technical field of block chains, in particular to a data processing method and device based on a block chain and an electronic device.
Background
The block chain technology, also called distributed ledger technology, is an emerging technology in which several computing devices participate in "accounting" together, and a complete distributed database is maintained together. The blockchain technology has characteristics of decentralization, public transparency, participation of each computing device in database recording, and rapid data synchronization among the computing devices, so that the blockchain technology is widely applied in many fields.
Disclosure of Invention
An embodiment of the present specification provides a data processing method and apparatus based on a block chain, and an electronic device:
according to a first aspect of embodiments herein, there is provided a method of data processing based on a blockchain,
receiving a transaction which is initiated by a service party and carries out multi-dimensional processing aiming at target data;
responding to the transaction, and inquiring an intelligent contract corresponding to each dimension;
calling data processing logic declared in the intelligent contract corresponding to the inquired dimensions; wherein the data processing logic comprises:
acquiring target data of a current dimension and historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension.
Optionally, the historical data of the current dimension in the historical transaction is associated by a digital summary of the historical transaction;
the acquiring of the historical data of the current dimension in the historical transaction specifically includes:
acquiring a digital abstract of a parent transaction recorded in an intelligent contract corresponding to the current dimension; wherein the parent transaction is a historical latest transaction of a current dimension;
and acquiring historical data corresponding to the digital abstract from historical data.
Optionally, the digital summary of the parent transaction includes:
and performing hash calculation on the historical data of the current dimension in the parent transaction to obtain a hash value.
Optionally, the method further includes:
calculating a digital summary of the target data of the current dimension;
and updating the digital abstract of the parent transaction recorded in the intelligent contract under the current dimension into the digital abstract of the target data.
Optionally, the calculating the digital summary of the target data of the current dimension specifically includes:
performing hash calculation on the target data of the current dimension;
and determining the hash value obtained by the hash calculation as a digital abstract.
Optionally, the querying, in response to the transaction, an intelligent contract corresponding to each dimension specifically includes:
and responding to the transaction, calling a routing logic declared in a master control intelligent contract issued in the block chain, and inquiring an intelligent contract corresponding to the dimension parameter carried in the transaction.
Optionally, the block chain is a federation chain.
Optionally, the method further includes:
receiving an intelligent contract corresponding to any dimension created by any alliance party in the alliance chain;
invoking voting logic declared in a smart contract published on the federation chain; wherein the voting logic is:
writing a voting event in a transaction log, and submitting voting transaction to the intelligent contract after a coalition party of the coalition chain monitors the voting event; and the intelligent contract collects and sorts the voting transactions to obtain an auditing result of the intelligent contract corresponding to any dimension.
According to a second aspect of embodiments herein, there is provided a block chain based data processing apparatus,
the receiving unit is used for receiving the transaction which is initiated by the service party and carries out multi-dimensional processing aiming at the target data;
the query unit is used for responding to the transaction and querying the intelligent contract corresponding to each dimension;
the processing unit is used for calling the data processing logic declared in the intelligent contract corresponding to each inquired dimension; wherein the data processing logic comprises: acquiring target data of a current dimension and historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension.
Optionally, the historical data of the current dimension in the historical transaction is associated by a digital summary of the historical transaction;
the acquiring of the historical data of the current dimension in the historical transaction specifically includes:
acquiring a digital abstract of a parent transaction recorded in an intelligent contract corresponding to the current dimension; wherein the parent transaction is a historical latest transaction of a current dimension;
and acquiring historical data corresponding to the digital abstract from historical data.
Optionally, the apparatus further comprises:
the calculation subunit calculates a digital abstract of the target data of the current dimension;
and the updating subunit is used for updating the digital abstract of the parent transaction recorded in the intelligent contract under the current dimensionality into the digital abstract of the target data.
Optionally, the querying unit specifically includes:
and responding to the transaction, calling a routing logic declared in a master control intelligent contract issued in the block chain, and inquiring an intelligent contract corresponding to the dimension parameter carried in the transaction.
Optionally, the block chain is a federation chain.
Optionally, the apparatus further comprises:
receiving an intelligent contract corresponding to any dimension created by any alliance party in the alliance chain;
invoking voting logic declared in a smart contract published on the federation chain; wherein the voting logic is:
writing a voting event in a transaction log, and submitting voting transaction to the intelligent contract after a coalition party of the coalition chain monitors the voting event; and the intelligent contract collects and sorts the voting transactions to obtain an auditing result of the intelligent contract corresponding to any dimension.
According to a third aspect of embodiments herein, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured as any one of the above block chain based data processing methods.
The embodiment of the specification provides a data processing scheme based on a block chain, and an intelligent contract corresponding to each dimension required for multi-dimensional data processing is issued in the block chain in advance; after a business party initiates a transaction for carrying out multi-dimensional processing on target data, a data processing logic declared in an intelligent contract corresponding to each dimension is called, and the target data and the historical data of each dimension are processed. The description also provides an association structure of the uplink transaction, wherein the hash value calculated according to the parent transaction content is used as the digital abstract of the sub-transaction, so that the transactions in all dimensions are connected in series, and the digital abstract of the latest transaction is recorded in the intelligent contract of the corresponding dimension; therefore, when the target data is processed, historical data of each dimension can be obtained based on the parent transaction digital abstract recorded in the intelligent contract of each dimension. On one hand, the multi-dimensional data processing based on the block chain can be realized, and the validity of the data processing is ensured due to the fact that the block chain cannot be tampered; on the other hand, the block chains are transparent in disclosure, so that data processing results can be shared in the whole network, and the data circulation efficiency is improved.
Drawings
Fig. 1 is a schematic diagram of an association structure of history data with the same dimension between different blocks in a block chain according to an embodiment of the present specification;
fig. 2 is a flowchart illustrating a data processing method based on a blockchain according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow diagram of creating an intelligent contract for multidimensional data processing provided by an embodiment of the present description;
fig. 4 is a hardware configuration diagram of a data processing apparatus based on a block chain according to an embodiment of the present specification;
fig. 5 is a block diagram of a data processing apparatus based on a blockchain according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Data processing generally refers to a process of processing target data according to a certain processing rule. For example, data analysis is to analyze target data based on preset rules to obtain an analysis result.
Most of the traditional data processing is private; that is, the enterprise uses its own data processing system to process data, and the processing result is also private. Because the data processing system is customized for the user's private, the final data processing result can only be private and is difficult to share publicly. For example, for internet finance companies, the credit scoring system and the user portrait of the internet finance companies are owned respectively.
Private data processing is realized in an enterprise; the method is not disclosed externally, and no external supervision exists; the lack of disclosure and regulatory mechanisms presents the problem of being untrusted by the enterprise.
The embodiment of the specification provides a data processing scheme based on a block chain, and an intelligent contract corresponding to each dimension required for multi-dimensional data processing is issued in the block chain in advance; after a business party initiates a transaction for carrying out multi-dimensional processing on target data, a data processing logic declared in an intelligent contract corresponding to each dimension is called, and the target data and the historical data of each dimension are processed. The description also provides an association structure of the uplink transaction, wherein the hash value calculated according to the parent transaction content is used as the digital abstract of the sub-transaction, so that the transactions in all dimensions are connected in series, and the digital abstract of the latest transaction is recorded in the intelligent contract of the corresponding dimension; therefore, when the target data is processed, historical data of each dimension can be obtained based on the parent transaction digital abstract recorded in the intelligent contract of each dimension. On one hand, the multi-dimensional data processing based on the block chain can be realized, and the validity of the data processing is ensured due to the fact that the block chain cannot be tampered; on the other hand, the block chains are transparent in disclosure, so that data processing results can be shared in the whole network, and the data circulation efficiency is improved.
It should be noted that the association structure of the uplink transaction provided in the present specification may refer to an association relationship between historical data of the same dimension in the transaction of the evidence stored in the block chain. In this way, the association between the multidimensional data is realized and the data cannot be tampered.
Please refer to fig. 1, which is a schematic diagram illustrating an association structure of history data with the same dimension between different blocks in a block chain. In fig. 1, tile 0, tile 1, tile …, tile N-1, and tile N are generated according to the conventional tile generation method in the tile chain. The block header of the block is the hash value of the block body of the previous block. For example, the block header of block 1 is the hash value calculated from the block body hash of block 0; as indicated by the solid arrows in fig. 1.
The historical transactions are typically recorded within the tile body of the tile. A transaction may include multiple dimensions of data. Assume that data Tx 1 belongs to the first dimension, data Tx 2 belongs to the second dimension, and data Tx N belongs to the third dimension in block 0. In fig. 1, the data belonging to the first dimension includes Tx 1 in block 0, Tx 1 in block 1, Tx 1 in block N-1 and Tx 2 in block N, and the data of the first dimension is related to each other by a dashed arrow 1;
similarly, the data belonging to the second dimension includes Tx 2 in block 0, Tx N in block 1, Tx 2 in block N-1 and Tx 1 in block N, and the data of the second dimension are related to each other by a dashed arrow 2;
the data belonging to the third dimension includes Tx N in block 0, Tx 2 in block 1, Tx N in block N-1 and Tx N in block N, and the data of the third dimension is related to each other by a dotted arrow 3.
It should be noted that fig. 1 is for convenience of understanding, one datum corresponds to only one dimension, and in practical applications, one datum may correspond to multiple dimensions.
In particular, the dashed arrows actually represent the digital abstract. For example, in the first dimension, the association relationship between Tx 1 of block 0 and Tx 2 of block 1 is actually:
the digital digest of Tx 2 of block 1 includes a hash value calculated for the content hash of Tx 1 of block 0; 0 denotes a block, and Tx 1 denotes data. The digital digest of Tx 2 of block N is the hash value calculated for the content hash of Tx 1 of block N-1.
Similarly, in the second dimension, the digital digest of Tx N of block 1 is a hash value calculated for the content hash of Tx 2 of block 0; etc. will not be described in detail.
And the hash value calculated according to the parent transaction content is used as the digital abstract of the child transaction, so that the transactions in all dimensions are connected in series, and the digital abstract of the latest transaction is recorded in the intelligent contract of the corresponding dimension.
Taking the first dimension as an example, when there is no historical transaction, the digital abstract of the parent transaction in the intelligent contract corresponding to the first dimension is null; when the first block 0 appears, the digital abstract of the parent transaction recorded in the intelligent contract is updated to hash (0, Tx 1), wherein 0 can represent the parent transaction (block), and Tx 1 represents data; when the second block 1 appears, the second block is updated to hash (1, Tx 1) again; when the (N-1) th block appears, the block is updated to be hash (N-1, Tx 1); when the nth block occurs, the hash is updated to be (N, Tx 2).
The following is a flow chart of a data processing method based on block chains as proposed in the present specification, which is described with reference to fig. 2. The method comprises the following steps:
step 110: receiving a transaction which is initiated by a service party and carries out multi-dimensional processing aiming at target data;
step 120: responding to the transaction, and inquiring an intelligent contract corresponding to each dimension;
step 130: calling data processing logic declared in the intelligent contract corresponding to the inquired dimensions; wherein the data processing logic comprises: acquiring target data of a current dimension and historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension.
The blockchain described in this specification may specifically include a private chain, a common chain, a federation chain, and the like, and is not particularly limited in this specification.
For example, in one scenario, the block chain may specifically be a federation chain formed by enterprises performing data processing as federation members; the operator of the alliance chain can deploy corresponding business by relying on the alliance chain; the enterprise described above as a member of the federation may act as a service node for the service. Each service node can issue the generated or received service data in the form of transaction in the alliance chain, and after the transaction is subjected to consensus processing of the consensus nodes in the alliance chain, the transaction data is stored in a distributed database in the alliance chain, and uplink storage of the transaction information is completed.
It should be noted that the Transaction (Transaction) described in this specification refers to a piece of data created by a client of a blockchain and needs to be finally issued to a distributed database of the blockchain.
Transactions in a blockchain, generally have a narrow sense of transaction and a broad sense of transaction score. A narrowly defined transaction refers to a transfer of value issued by a user to a blockchain; for example, in a conventional bitcoin blockchain network, the transaction may be a transfer initiated by the user in the blockchain. The broad transaction refers to a piece of business data with business intention, which is issued to the blockchain by a user; for example, an operator may build a federation chain based on actual business requirements, relying on the federation chain to deploy some other types of online services (e.g., a credentialing service, a data processing service, etc.) unrelated to value transfer, and in such federation chain, a transaction may be a business message or business request issued by a user in the federation chain with a business intent.
The client may include any type of upper layer application that uses the bottom layer service data stored in the blockchain as a data support to implement a specific service function.
In block chain techniques, nodes in a block chain typically need to rely on a corresponding Smart contract (Smart contract) to operate on the block. Operations such as storing, modifying, deleting, etc. in a blockchain all need to rely on smart contracts. The intelligent contract may be a computer protocol intended for application to propagate, verify, or execute contracts in an informational manner that may be deployed on a blockchain. Performing the corresponding operation can be realized by declaring the business logic in the smart contract. Smart contracts allow trusted transactions to be conducted without third parties. These transactions are traceable and irreversible. Smart contracts can provide security over traditional contract methodologies and reduce other transaction costs associated with contracts. In general, the intelligent contracts can be deployed locally at the block link points, and when the nodes need to execute a certain action, the corresponding intelligent contracts can be called, and the intelligent contracts are operated to execute the service logic stated in the intelligent contracts, so that the execution result is obtained.
The intelligent contracts for each dimension in the blockchain in this specification may be created by any federation party. Specifically, in an embodiment, the method further includes:
receiving an intelligent contract corresponding to any dimension created by any alliance party in the alliance chain;
invoking voting logic declared in a smart contract published on the federation chain; wherein the voting logic is:
writing a voting event in a transaction log, and submitting voting transaction to the intelligent contract after a coalition party of the coalition chain monitors the voting event; and the intelligent contract collects and sorts the voting transactions to obtain an auditing result of the intelligent contract corresponding to any dimension.
A federation party (also referred to as a federation node) in any one federation chain may initiate a transaction to the federation chain that creates an intelligent contract for multidimensional data processing. Each party in the chain of the alliances to be waited to examine the created intelligent contract and return a voting result; and if the statistical voting result meets the preset condition, the created intelligent contract takes effect.
A schematic flow diagram for creating an intelligent contract for multidimensional data processing is described below in conjunction with fig. 3.
1. The alliance chain initializes the general control intelligent contract.
And the master control intelligent contract is used for routing to the intelligent contract with the corresponding dimension according to the transaction submitted by the service party.
2. The federation chain initializes a voting intelligence contract.
The voting intelligence industry is used for voting by all alliance parties in an alliance chain to determine whether the created intelligent contract is effective.
3. Federation party a in the federation chain initiates a transaction to create an intelligent contract for multidimensional data processing.
A coalition party may submit multiple intelligent contracts, each representing one dimension of data processing.
And 3.1, after the intelligent contract is successfully created, returning a creation result and a contract address to the alliance party.
If intelligent contracts are chained, each intelligent contract can be assigned a unique contract address, and can be routed to the stored intelligent contracts according to the contract addresses.
4. The alliance party A initiates a registration request of the created intelligent contract;
and 4.1, registering the intelligent contract by the master control intelligent contract and recording the contract address.
The general control intelligent contract records the contract address of the intelligent contract so as to carry out subsequent routing.
And 4.2, returning a registration result to the alliance party A.
5. The alliance chain broadcasts a notice to the whole network to inform all alliance parties to vote on the intelligent contract.
6. And each alliance party audits the intelligent contract and submits the voting result to the voting contract.
7. And (4) counting the voting result by the voting contract of the alliance chain, and if the voting result reaches a preset condition, informing the alliance party A that the intelligent contract takes effect.
The preset condition may include that the number of votes that pass the audit reaches a threshold, and the votes are considered to pass. The threshold value can be flexibly adjusted according to requirements, and if the auditing tends to be strict, the threshold value can be set to be 90% of the number of the parties in the coalition; if the auditing tends to be relaxed, the threshold may be set to 50% of the federating party's quantity.
Therefore, the intelligent contract for multi-dimensional data processing is effective, and the service of multi-dimensional data processing can be provided for business parties.
In an embodiment, the querying, in response to the transaction, an intelligent contract corresponding to each dimension specifically includes:
and responding to the transaction, calling a routing logic declared in a master control intelligent contract issued in the block chain, and inquiring an intelligent contract corresponding to the dimension parameter carried in the transaction.
In practical application, if a business party needs to call a target intelligent contract, the contract address of the target intelligent contract needs to be written in a transaction; however, in practical applications, since the number of intelligent contracts is large, especially the intelligent contracts of multidimensional data processing shown in this specification, one dimension corresponds to one intelligent contract, and many intelligent contracts are created by a coalition party, and if a business party needs to memorize the contract address of each intelligent contract, the cost is high. Therefore, the specification provides a general control intelligent contract for routing, a business party only needs to write dimension parameters needing to be executed in transaction submission, and the comprehensive intelligent contract can be automatically routed to the intelligent contract with the corresponding dimension according to the dimension parameters.
Furthermore, whether the inquired intelligent contract takes effect or not can be judged, and the data processing logic declared in the intelligent contract which takes effect and corresponding to each inquired dimension is called.
As shown in fig. 3, after the intelligent contract is created, the coalition parties are required to perform audit voting, and the intelligent contract can take effect only when the voting passes. Therefore, only valid smart contracts can be invoked even when data processing is performed.
The digital digest described in this specification may be a hash value obtained by performing hash (hash, also referred to as hash) calculation on original data.
In an embodiment, the acquiring historical data of a current dimension in historical transactions specifically includes:
acquiring a digital abstract of a parent transaction recorded in an intelligent contract corresponding to the current dimension; wherein the parent transaction is a historical latest transaction of a current dimension;
and acquiring historical data corresponding to the digital abstract from historical data.
Wherein the digital summary of the parent transaction comprises:
and performing hash calculation on the historical data of the current dimension in the parent transaction to obtain a hash value.
In an embodiment, the method further comprises:
calculating a digital summary of the target data of the current dimension;
and updating the digital abstract of the parent transaction recorded in the intelligent contract under the current dimension into the digital abstract of the target data.
The calculating the digital summary of the target data of the current dimension specifically includes:
performing hash calculation on the target data of the current dimension;
and determining the hash value obtained by the hash calculation as a digital abstract.
As shown in fig. 1, the historical data of the current dimension in the historical transaction is related by the digital summary of the historical transaction.
In the execution process of the intelligent contract of each dimension, a digital abstract of a parent transaction recorded in the intelligent contract can be obtained;
assembling a new transaction according to the summary data of the parent transaction;
and after the transaction assembly is completed, calculating the digital abstract of the current transaction, and updating the digital abstract of the parent transaction.
After the new transaction is assembled and generated and the intelligent contract is executed, the new transaction is generated independently to complete the execution process of the intelligent contract.
Similarly, the master control intelligent contract can call the registered and effective intelligent contract of each dimension to perform the same operation.
To sum up, the embodiments of the present specification provide a data processing scheme based on a block chain, and issue, in advance, an intelligent contract corresponding to each dimension required for performing multidimensional data processing in the block chain; after a business party initiates a transaction for carrying out multi-dimensional processing on target data, a data processing logic declared in an intelligent contract corresponding to each dimension is called, and the target data and the historical data of each dimension are processed. The description also provides an association structure of the uplink transaction, wherein the hash value calculated according to the parent transaction content is used as the digital abstract of the sub-transaction, so that the transactions in all dimensions are connected in series, and the digital abstract of the latest transaction is recorded in the intelligent contract of the corresponding dimension; therefore, when the target data is processed, historical data of each dimension can be obtained based on the parent transaction digital abstract recorded in the intelligent contract of each dimension. On one hand, the multi-dimensional data processing based on the block chain can be realized, and the validity of the data processing is ensured due to the fact that the block chain cannot be tampered; on the other hand, the block chains are transparent in disclosure, so that data processing results can be shared in the whole network, and the data circulation efficiency is improved.
Corresponding to the foregoing embodiments of the data processing method based on a blockchain, the present specification also provides embodiments of a data processing apparatus based on a blockchain. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer business program instructions in the nonvolatile memory into the memory for operation through the processor of the device in which the device is located. From a hardware aspect, as shown in fig. 4, the hardware structure diagram of the device in which the data processing apparatus based on the blockchain is located in this specification is shown, except for the processor, the network interface, the memory, and the nonvolatile memory shown in fig. 4, the device in which the apparatus is located in the embodiment may also include other hardware generally according to the actual function of data processing based on the blockchain, which is not described again.
Referring to fig. 5, a block diagram of a data processing apparatus based on a blockchain according to an embodiment of the present disclosure is provided, where the apparatus corresponds to the embodiment shown in fig. 2, and the apparatus includes:
the receiving unit 310 receives a transaction initiated by a service party and performing multidimensional processing on target data;
the query unit 320 is used for responding to the transaction and querying the intelligent contract corresponding to each dimension;
the processing unit 330 is used for calling data processing logic declared in the intelligent contract corresponding to the inquired dimensions; wherein the data processing logic comprises: acquiring target data of a current dimension and historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension.
Optionally, the historical data of the current dimension in the historical transaction is associated by a digital summary of the historical transaction;
the acquiring of the historical data of the current dimension in the historical transaction specifically includes:
acquiring a digital abstract of a parent transaction recorded in an intelligent contract corresponding to the current dimension; wherein the parent transaction is a historical latest transaction of a current dimension;
and acquiring historical data corresponding to the digital abstract from historical data.
Optionally, the digital summary of the parent transaction includes:
and performing hash calculation on the historical data of the current dimension in the parent transaction to obtain a hash value.
Optionally, the apparatus further comprises:
the calculation subunit calculates a digital abstract of the target data of the current dimension;
and the updating subunit is used for updating the digital abstract of the parent transaction recorded in the intelligent contract under the current dimensionality into the digital abstract of the target data.
Optionally, the calculating the digital summary of the target data of the current dimension specifically includes:
performing hash calculation on the target data of the current dimension;
and determining the hash value obtained by the hash calculation as a digital abstract.
Optionally, the querying unit specifically includes:
and responding to the transaction, calling a routing logic declared in a master control intelligent contract issued in the block chain, and inquiring an intelligent contract corresponding to the dimension parameter carried in the transaction.
Optionally, the block chain is a federation chain.
Optionally, the apparatus further comprises:
receiving an intelligent contract corresponding to any dimension created by any alliance party in the alliance chain;
invoking voting logic declared in a smart contract published on the federation chain; wherein the voting logic is:
writing a voting event in a transaction log, and submitting voting transaction to the intelligent contract after a coalition party of the coalition chain monitors the voting event; and the intelligent contract collects and sorts the voting transactions to obtain an auditing result of the intelligent contract corresponding to any dimension.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
Fig. 5 above describes the internal functional modules and the structural schematic of the data processing apparatus based on the block chain, and the substantial execution subject thereof may be an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving a transaction which is initiated by a service party and carries out multi-dimensional processing aiming at target data;
responding to the transaction, and inquiring an intelligent contract corresponding to each dimension;
calling data processing logic declared in the intelligent contract corresponding to the inquired dimensions; wherein the data processing logic comprises:
acquiring target data of a current dimension and historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension.
Optionally, the historical data of the current dimension in the historical transaction is associated by a digital summary of the historical transaction;
the acquiring of the historical data of the current dimension in the historical transaction specifically includes:
acquiring a digital abstract of a parent transaction recorded in an intelligent contract corresponding to the current dimension; wherein the parent transaction is a historical latest transaction of a current dimension;
and acquiring historical data corresponding to the digital abstract from historical data.
Optionally, the digital summary of the parent transaction includes:
and performing hash calculation on the historical data of the current dimension in the parent transaction to obtain a hash value.
Optionally, the method further includes:
calculating a digital summary of the target data of the current dimension;
and updating the digital abstract of the parent transaction recorded in the intelligent contract under the current dimension into the digital abstract of the target data.
Optionally, the calculating the digital summary of the target data of the current dimension specifically includes:
performing hash calculation on the target data of the current dimension;
and determining the hash value obtained by the hash calculation as a digital abstract.
Optionally, the querying, in response to the transaction, an intelligent contract corresponding to each dimension specifically includes:
and responding to the transaction, calling a routing logic declared in a master control intelligent contract issued in the block chain, and inquiring an intelligent contract corresponding to the dimension parameter carried in the transaction.
Optionally, the block chain is a federation chain.
Optionally, the method further includes:
receiving an intelligent contract corresponding to any dimension created by any alliance party in the alliance chain;
invoking voting logic declared in a smart contract published on the federation chain; wherein the voting logic is:
writing a voting event in a transaction log, and submitting voting transaction to the intelligent contract after a coalition party of the coalition chain monitors the voting event; and the intelligent contract collects and sorts the voting transactions to obtain an auditing result of the intelligent contract corresponding to any dimension.
In the above embodiments of the electronic device, it should be understood that the Processor may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the aforementioned memory may be a read-only memory (ROM), a Random Access Memory (RAM), a flash memory, a hard disk, or a solid state disk. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiment of the electronic device, since it is substantially similar to the embodiment of the method, the description is simple, and for the relevant points, reference may be made to part of the description of the embodiment of the method.
Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

Claims (13)

1. A method of data processing based on blockchains, the method comprising:
receiving a transaction which is initiated by a service party and carries out multi-dimensional processing aiming at target data;
after the consensus nodes in the block chain pass the transaction consensus, responding to the transaction and inquiring the intelligent contract corresponding to each dimension;
calling data processing logic declared in the intelligent contract corresponding to the inquired dimensions; the data processing logic comprises:
acquiring target data of a current dimension, historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension;
the method for acquiring the historical data of the current dimension in the historical transaction by the digital abstract correlation of the historical transaction comprises the following steps:
acquiring a digital abstract of a father transaction recorded in an intelligent contract corresponding to a current dimension, and acquiring historical data corresponding to the digital abstract from historical data; the parent transaction is the historical most recent transaction for the current dimension.
2. The method of claim 1, the digital summary of the parent transaction, comprising:
and performing hash calculation on the historical data of the current dimension in the parent transaction to obtain a hash value.
3. The method of claim 1, further comprising:
calculating a digital summary of the target data of the current dimension;
and updating the digital abstract of the parent transaction recorded in the intelligent contract under the current dimension into the digital abstract of the target data.
4. The method according to claim 3, wherein the calculating the digital summary of the target data of the current dimension specifically includes:
performing hash calculation on the target data of the current dimension;
and determining the hash value obtained by the hash calculation as a digital abstract.
5. The method according to claim 1, wherein the querying, in response to the transaction, for the smart contract corresponding to each dimension specifically includes:
and responding to the transaction, calling a routing logic declared in a master control intelligent contract issued in the block chain, and inquiring an intelligent contract corresponding to the dimension parameter carried in the transaction.
6. The method of any of claims 1-5, the blockchain is a federation chain.
7. The method of claim 6, further comprising:
receiving an intelligent contract corresponding to any dimension created by any alliance party in the alliance chain;
invoking voting logic declared in a smart contract published on the federation chain; wherein the voting logic is:
writing a voting event in a transaction log, and submitting voting transaction to the intelligent contract after a coalition party of the coalition chain monitors the voting event; and the intelligent contract collects and sorts the voting transactions to obtain an auditing result of the intelligent contract corresponding to any dimension.
8. A blockchain-based data processing apparatus, the apparatus comprising:
the receiving unit is used for receiving the transaction which is initiated by the service party and carries out multi-dimensional processing aiming at the target data;
the query unit is used for responding to the transaction and querying the intelligent contract corresponding to each dimension after the consensus node in the block chain passes the transaction consensus;
the processing unit is used for calling the data processing logic declared in the intelligent contract corresponding to each inquired dimension; the data processing logic comprises: acquiring target data of a current dimension, historical data of the current dimension in historical transactions, and processing the target data and the historical data of the current dimension;
the method for acquiring the historical data of the current dimension in the historical transaction by the digital abstract correlation of the historical transaction comprises the following steps:
acquiring a digital abstract of a father transaction recorded in an intelligent contract corresponding to a current dimension, and acquiring historical data corresponding to the digital abstract from historical data; the parent transaction is the historical most recent transaction for the current dimension.
9. The apparatus of claim 8, the apparatus further comprising:
the calculation subunit calculates a digital abstract of the target data of the current dimension;
and the updating subunit is used for updating the digital abstract of the parent transaction recorded in the intelligent contract under the current dimensionality into the digital abstract of the target data.
10. The apparatus according to claim 8, wherein the query unit specifically includes:
and responding to the transaction, calling a routing logic declared in a master control intelligent contract issued in the block chain, and inquiring an intelligent contract corresponding to the dimension parameter carried in the transaction.
11. The apparatus of any of claims 8-10, the blockchain is a federation chain.
12. The apparatus of claim 11, the apparatus further comprising:
receiving an intelligent contract corresponding to any dimension created by any alliance party in the alliance chain;
invoking voting logic declared in a smart contract published on the federation chain; wherein the voting logic is:
writing a voting event in a transaction log, and submitting voting transaction to the intelligent contract after a coalition party of the coalition chain monitors the voting event; and the intelligent contract collects and sorts the voting transactions to obtain an auditing result of the intelligent contract corresponding to any dimension.
13. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured as the method of any of the preceding claims 1-7.
CN201910234317.4A 2019-03-26 2019-03-26 Data processing method and device based on block chain and electronic equipment Active CN109886694B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110667738.3A CN113421088B (en) 2019-03-26 Block chain-based data processing method and device and electronic equipment
CN201910234317.4A CN109886694B (en) 2019-03-26 2019-03-26 Data processing method and device based on block chain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910234317.4A CN109886694B (en) 2019-03-26 2019-03-26 Data processing method and device based on block chain and electronic equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202110667738.3A Division CN113421088B (en) 2019-03-26 Block chain-based data processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109886694A CN109886694A (en) 2019-06-14
CN109886694B true CN109886694B (en) 2021-04-27

Family

ID=66934561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910234317.4A Active CN109886694B (en) 2019-03-26 2019-03-26 Data processing method and device based on block chain and electronic equipment

Country Status (1)

Country Link
CN (1) CN109886694B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110348825A (en) * 2019-06-26 2019-10-18 阿里巴巴集团控股有限公司 Electronic bill delivery method and device and electronic equipment based on block chain
US10936581B2 (en) 2019-08-30 2021-03-02 Advanced New Technologies Co., Ltd. Blockchain transaction processing method and apparatus
CN110633309A (en) * 2019-08-30 2019-12-31 阿里巴巴集团控股有限公司 Block chain transaction processing method and device
CN110708371A (en) * 2019-09-27 2020-01-17 支付宝(杭州)信息技术有限公司 Data processing method, device and system based on block chain and electronic equipment
CN111475849B (en) * 2019-11-08 2024-03-12 支付宝(杭州)信息技术有限公司 Private data query method and device based on blockchain account
CN110874365B (en) * 2019-11-20 2023-11-17 深圳市迅雷网络技术有限公司 Information query method and related equipment thereof
CN111178710B (en) * 2019-12-18 2022-09-30 北京航天智造科技发展有限公司 Block chain-based performance capability authentication system and method
CN111475578B (en) * 2020-04-21 2022-12-13 布谷维客科技有限公司 Uplink voting method and system for intelligent contract in credit investigation union chain
CN112818414B (en) * 2021-04-16 2021-07-13 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108765001A (en) * 2018-05-28 2018-11-06 江苏荣泽信息科技股份有限公司 Commercial real estate value analysis system and method based on block chain
CN108805707A (en) * 2018-05-21 2018-11-13 阿里巴巴集团控股有限公司 Works copyright revenue distribution method and device based on block chain
CN108898390A (en) * 2018-06-27 2018-11-27 阿里巴巴集团控股有限公司 Intelligent contract call method and device, electronic equipment based on block chain
CN109003078A (en) * 2018-06-27 2018-12-14 阿里巴巴集团控股有限公司 Intelligent contract call method and device, electronic equipment based on block chain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273759B (en) * 2017-05-08 2020-07-14 上海点融信息科技有限责任公司 Method, apparatus, and computer-readable storage medium for protecting blockchain data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805707A (en) * 2018-05-21 2018-11-13 阿里巴巴集团控股有限公司 Works copyright revenue distribution method and device based on block chain
CN108765001A (en) * 2018-05-28 2018-11-06 江苏荣泽信息科技股份有限公司 Commercial real estate value analysis system and method based on block chain
CN108898390A (en) * 2018-06-27 2018-11-27 阿里巴巴集团控股有限公司 Intelligent contract call method and device, electronic equipment based on block chain
CN109003078A (en) * 2018-06-27 2018-12-14 阿里巴巴集团控股有限公司 Intelligent contract call method and device, electronic equipment based on block chain

Also Published As

Publication number Publication date
CN113421088A (en) 2021-09-21
CN109886694A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
CN109886694B (en) Data processing method and device based on block chain and electronic equipment
US11088857B2 (en) Blockchain timestamp agreement
CN110033244B (en) Intelligent contract execution method and device based on block chain and electronic equipment
US10805094B2 (en) Blockchain timestamp agreement
US11924360B2 (en) Blockchain timestamp agreement
CN110163755B (en) Block chain-based data compression and query method and device and electronic equipment
JP7352622B2 (en) Blockchain timestamp agreement
CN107633016B (en) Data processing method and device and electronic equipment
EP3905178A1 (en) Blockchain-based resource allocation method and apparatus, and electronic device
CN112966311B (en) Intelligent contract checking method and device and electronic equipment
CN110060155B (en) Intelligent contract execution method and device of block chain and electronic equipment
CN109886695A (en) Information sharing method and device and electronic equipment between different blocks chain
TW202026971A (en) Method and device for invoice correction based on blockchain, and electronic equipment
CN112822267B (en) Data processing method and device based on block chain
WO2023165271A1 (en) Knowledge graph construction and graph calculation
CN110009497B (en) Block chain-based decision method and device and electronic equipment
Garcia Bringas et al. BlockChain platforms in financial services: current perspective
US10942916B2 (en) Fraud prevention via database referencing
CN113421088B (en) Block chain-based data processing method and device and electronic equipment
CN113902415A (en) Financial data checking method and device, computer equipment and storage medium
CN116703184B (en) Data processing method, data processing device, electronic equipment and readable storage medium
US20240152918A1 (en) Distributed database with inter-related records relating to a vehicle
CN116703505A (en) Order information judging method and device
CN117952748A (en) Smart contract processing method, smart contract processing device, smart contract processing apparatus, smart contract processing device, smart contract processing program product, and smart contract processing program product
CN116797366A (en) Transaction processing method, device, electronic equipment and 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
TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240928

Address after: Guohao Times City # 20-01, 128 Meizhi Road, Singapore

Patentee after: Ant Chain Technology Co.,Ltd.

Country or region after: Singapore

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Innovative advanced technology Co.,Ltd.

Country or region before: Cayman Islands