CN117495473A - Block chain-based data processing method, device, equipment and readable storage medium - Google Patents

Block chain-based data processing method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN117495473A
CN117495473A CN202311424842.5A CN202311424842A CN117495473A CN 117495473 A CN117495473 A CN 117495473A CN 202311424842 A CN202311424842 A CN 202311424842A CN 117495473 A CN117495473 A CN 117495473A
Authority
CN
China
Prior art keywords
resource
information
exchange
resource exchange
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.)
Pending
Application number
CN202311424842.5A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311424842.5A priority Critical patent/CN117495473A/en
Publication of CN117495473A publication Critical patent/CN117495473A/en
Pending legal-status Critical Current

Links

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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • Bioethics (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Business, Economics & Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method, a device, equipment and a readable storage medium based on a blockchain, wherein the method comprises the following steps: converting M historical resource exchange transaction information in the blockchain into M historical resource exchange information with a target information structure; when the blockchain network is detected to carry out uplink processing on the target resource exchange transaction, target resource exchange transaction information corresponding to the target resource exchange transaction is obtained, and the target resource exchange transaction information is converted into detection resource exchange information with a target information structure; adding M pieces of historical resource exchange information and detection resource exchange information into a resource exchange information set; when a historical resource value request is received, generating resource value stage data corresponding to the target digital resource type in a historical time period according to the resource exchange information set. By adopting the method and the device, the accuracy of the corresponding resource value stage data of the digital resource type in the historical time period can be ensured.

Description

Block chain-based data processing method, device, equipment and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data processing method, apparatus, device and readable storage medium based on a blockchain.
Background
Asset standards on the blockchain are various, digital resource types corresponding to digital resources communicated in the blockchain are also various, the values of the digital resources corresponding to different digital resource types are different, and the values of the digital resources corresponding to different digital resource types are also changed along with the change of supply and demand quantities of the digital resources corresponding to different digital resource types in the blockchain.
At present, when users perform the decentralized exchange of digital resources corresponding to different digital resource types, the users often know the value change of the digital resources in the last period through the market data provided by the decentralized resource exchange. However, the market data provided by the decentralized resource exchange is only derived from the transaction data generated by the decentralized resource exchange, so that the decentralized resource exchange does not have historical market data of the digital resource before the decentralized resource exchange is online, and the market data provided by the decentralized resource exchange just online can also cause inaccurate problems due to too little transaction data.
Disclosure of Invention
The embodiment of the application provides a data processing method, device and equipment based on a blockchain and a readable storage medium, which can ensure the accuracy of the data of a digital resource type in a resource value stage in a historical time period.
An aspect of an embodiment of the present application provides a data processing method based on a blockchain, including:
obtaining M pieces of historical resource exchange transaction information in a blockchain, carrying out structural information conversion processing on the M pieces of historical resource exchange transaction information to obtain M pieces of historical resource exchange information with target information structures, and adding the M pieces of historical resource exchange information into a resource exchange information set; m is a positive integer; the historical resource exchange transaction information is used for recording the processing result of the blockchain network for calling the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
when detecting that the blockchain network carries out uplink processing on target resource exchange transaction, obtaining target resource exchange transaction information corresponding to the target resource exchange transaction, carrying out structural information conversion processing on the target resource exchange transaction information to obtain detection resource exchange information with a target information structure, and adding the detection resource exchange information into a resource exchange information set; a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
When a historical resource value request containing a target digital resource type and a historical time period is received, generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set; the resource value phase data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to a historical time period; the target digital resource type belongs to a set of target digital resource types.
An aspect of an embodiment of the present application provides a data processing apparatus based on a blockchain, including:
the acquisition module is used for acquiring M historical resource exchange transaction information in the blockchain;
the structure conversion module is used for carrying out structural information conversion processing on M pieces of historical resource exchange transaction information to obtain M pieces of historical resource exchange information with target information structures, and adding the M pieces of historical resource exchange information into a resource exchange information set; m is a positive integer; the historical resource exchange transaction information is used for recording the processing result of the blockchain network for calling the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
The detection conversion module is used for acquiring target resource exchange transaction information corresponding to target resource exchange transaction when detecting that the blockchain network carries out uplink processing on the target resource exchange transaction, carrying out structural information conversion processing on the target resource exchange transaction information to obtain detection resource exchange information with a target information structure, and adding the detection resource exchange information into a resource exchange information set; a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
the generation module is used for generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set when receiving the historical resource value request containing the target digital resource type and the historical time period; the resource value phase data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to a historical time period; the target digital resource type belongs to a set of target digital resource types.
Wherein, acquire the module, include:
the height determining unit is used for sending a block height query request for the block chain to the block chain link point and receiving the maximum block height returned by the block chain node according to the block height query request;
the block acquisition unit is used for traversing the block inquiry request aiming at the kth block to the block chain link point and receiving the kth block returned by the block chain node according to the block inquiry request aiming at the kth block; k is a positive integer less than the maximum block height;
a transaction acquisition unit, configured to acquire block resource exchange transaction information associated with both the target digital resource type set and the decentralized resource exchange contract set in the kth block;
and the information determining unit is used for determining the block resource exchange transaction information acquired from each block as M historical resource exchange transaction information until each block in the block chain is traversed.
Wherein the kth block contains N transaction messages; one transaction information includes a contract address, an event signature, and transaction execution data;
a transaction acquisition unit comprising:
the traversing subunit is used for traversing the N transaction information and sequentially acquiring the j transaction information; j is a positive integer less than or equal to N;
A first determining subunit, configured to determine a relationship result between the jth transaction information and the decentralized resource exchange contract set according to the contract address and the event signature included in the jth transaction information;
the first execution subunit is configured to continuously obtain the j+1th transaction information if the relationship result between the j-th transaction information and the decentralized resource exchange contract set is a non-association result;
the second determining subunit is configured to determine, if the relationship result between the jth transaction information and the decentralized resource exchange contract set is an association result, a relationship result between the jth transaction information and the target digital resource type set according to transaction execution data included in the jth transaction information;
the second execution subunit is configured to continuously obtain the j+1th transaction information if the relationship result between the j-th transaction information and the target digital resource type set is a non-association result;
and the second execution subunit is further configured to, if the relationship result between the jth transaction information and the target digital resource type set is an association result, mark the jth transaction information, continuously obtain the jth+1th transaction information until the N transaction information is traversed, and determine the transaction execution data included in the marked transaction information as block resource exchange transaction information in the kth block, where the block resource exchange transaction information is associated with both the target digital resource type set and the decentralized resource exchange contract set.
The decentralized resource exchange contract set comprises L decentralized resource exchange contracts, wherein L is a positive integer;
the first determining subunit is specifically further configured to obtain a contract address included in the jth transaction information, and obtain decentralized compound contract addresses corresponding to the L decentralized resource switching contracts respectively; if the L decentralised compound contract addresses do not have the same contract address as the contract address contained in the j transaction information, determining that the relation result of the j transaction information and the decentralised resource exchange contract set is an unassociated result; if the L decentralized compound contract addresses contain the decentralized compound contract addresses which are the same as the contract addresses contained in the j transaction information, acquiring a resource exchange event corresponding to the contract addresses contained in the j transaction information, and determining an event hash corresponding to the resource exchange event; if the event hash is not equal to the event signature contained in the j transaction information, determining that the relation result of the j transaction information and the decentralised resource exchange contract set is an unassociated result; if the event hash is equal to the event signature contained in the j transaction information, determining the relation result of the j transaction information and the decentralised resource exchange contract set as the association result.
The target digital resource type set comprises H digital resource types, wherein H is a positive integer;
the second determining subunit is specifically configured to perform resource type search on transaction execution data included in the jth transaction information to obtain an exchange digital resource type; if the H digital resource types do not have the same digital resource types as the exchange digital resource types, determining that the relation result of the j transaction information and the target digital resource type set is an unassociated result; if the H digital resource types have the same digital resource types as the exchange digital resource types, determining the relation result of the j transaction information and the target digital resource type set as the association result.
Wherein the M historical resource exchange transaction information comprises historical resource exchange transaction information M i I is a positive integer less than or equal to M;
a fabric conversion module comprising:
a contract determining unit for determining transaction information M exchanged with historical resources i Corresponding associated decentralized resource exchange contracts; the associated decentralized resource exchange contract belongs to a decentralized resource exchange contract set;
a data analysis unit for exchanging transaction information M for historical resources through a binary contract interface corresponding to the associated decentralized resource exchanging contract i Data analysis is carried out to obtain historical resource exchange transaction information M i Exchanging information by corresponding analysis resources; the analysis resource exchange information comprises object attribute data corresponding to at least two information object attributes;
a data filtering unit for filtering the attribute of the analysis resource exchange information according to the attribute of the target information object corresponding to the target information structure to obtain the historical resource exchange transaction information M i Corresponding historical resource exchange information, exchanging transaction information M for the historical resource i The corresponding historical resource exchange information is added to the resource exchange information set.
Wherein, above-mentioned data processing apparatus still includes:
the first detection module is used for acquiring the block to be uplinked when the block chain network is determined to pass through the consensus of the block to be uplinked;
the first detection module is further used for carrying out transaction inquiry processing on the block to be uplink according to the decentralised resource exchange contract set and the target digital resource type set to obtain a transaction inquiry result;
the first detection module is further configured to determine that the blockchain network is detected to perform uplink processing on the target resource exchange transaction if the transaction query result indicates that the target resource exchange transaction is included in the block to be uplink.
Wherein, above-mentioned data processing apparatus still includes:
the second detection module is used for synchronizing the decentralized resource exchange event information corresponding to the decentralized resource exchange event when detecting that the target decentralized resource exchange contract generates the decentralized resource exchange event according to the blockchain transaction through the contract event detector; the decentralized resource exchange event information comprises an event resource exchange type; the target decentralised resource exchange contract belongs to a decentralised resource exchange contract set;
and the second detection module is further used for taking the blockchain transaction as a target resource exchange transaction if the event resource exchange type belongs to the target digital resource type set, and determining that the blockchain network is detected to perform uplink processing on the target resource exchange transaction.
Wherein, above-mentioned data processing apparatus still includes:
the detector configuration module is used for receiving the decentralization configuration request; the decentralised configuration request comprises a decentralised compound contract address corresponding to a decentralised resource exchange contract contained in the decentralised resource exchange contract set;
the detector configuration module is also used for generating a contract event detector corresponding to the decentralized resource exchange contract set according to the decentralized contract address; the contract event detector is used for synchronizing the decentralized resource exchange event information corresponding to the decentralized resource exchange event when detecting that the decentralized resource exchange contract contained in the decentralized resource exchange contract set generates the decentralized resource exchange event.
Each resource exchange information contained in the resource exchange information set contains a resource exchange type and exchange occurrence time;
a generation module, comprising:
the screening unit is used for screening out the resource exchange information with the exchange occurrence time in the historical time period from the primary screening resource exchange information as the primary screening resource exchange information when receiving the historical resource value request containing the target digital resource type and the historical time period;
the classification unit is used for classifying the primary screening resource exchange information according to the exchange occurrence time to obtain at least two classified resource exchange information sets; the exchange occurrence time contained in the primary screening resource exchange information belonging to the same classified resource exchange information set is the same;
the data statistics unit is used for respectively carrying out resource exchange statistics processing on at least two classified resource exchange information sets and determining resource value data corresponding to the target digital resource types respectively at least two exchange occurrence times;
the data statistics unit is further used for determining the resource value data corresponding to the occurrence time of at least two exchanges as at least two historical resource value data and determining the at least two historical resource value data as resource value stage data.
Wherein, above-mentioned data processing apparatus still includes:
the map rendering module is used for receiving a resource value change map request aiming at the resource value stage data; the resource value change map request contains a resource value change map type;
the map rendering module is also used for determining a map rendering mode and map rendering data attribute matched with the resource value change map type;
and the map rendering module is also used for generating map rendering resource change data corresponding to the map rendering data attribute according to the resource value stage data, and performing image rendering on the map rendering resource change data according to a map rendering mode to obtain a resource value change map corresponding to the resource value change map type.
In one aspect, a computer device is provided, including: a processor, a memory, a network interface;
the processor is connected to the memory and the network interface, where the network interface is used to provide a data communication network element, the memory is used to store a computer program, and the processor is used to call the computer program to execute the method in the embodiment of the present application.
In one aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, the computer program being adapted to be loaded by a processor and to perform a method according to embodiments of the present application.
In one aspect, the embodiments of the present application provide a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, where the computer instructions are stored in a computer readable storage medium, and where a processor of a computer device reads the computer instructions from the computer readable storage medium, and where the processor executes the computer instructions, so that the computer device performs a method in an embodiment of the present application.
In the embodiment of the application, M pieces of historical resource exchange transaction information in a blockchain are firstly obtained, structural information conversion processing is carried out on the M pieces of historical resource exchange transaction information, M pieces of historical resource exchange information with target information structures are obtained, and the M pieces of historical resource exchange information are added into a resource exchange information set; then, each time when the blockchain network is detected to carry out uplink processing on the target resource exchange transaction, target resource exchange transaction information corresponding to the target resource exchange transaction is obtained, structural information conversion processing is carried out on the target resource exchange transaction information, detection resource exchange information with a target information structure is obtained, and the detection resource exchange information is added into a resource exchange information set; and finally, when receiving a historical resource value request containing the target digital resource type and the historical time period, generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set. Wherein M is a positive integer; the historical resource exchange transaction information is used for recording the processing result of the blockchain network for calling the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set; a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set; the resource value phase data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to a historical time period; the target digital resource type belongs to a set of target digital resource types. It can be seen that, by the method provided by the embodiment of the present application, the history resource exchange transaction information in the generated block is firstly obtained and converted into the history resource exchange information with the unified structure, then the target resource exchange transaction information is obtained in real time by the detection mode and converted into the detection resource exchange information with the same structure, and by integrating the history resource exchange information and the detection resource exchange information corresponding to different decentralized resource exchange contracts, more accurate resource value stage data of the digital resource of the target digital resource type can be generated in any current history time period after the block chain starts to exchange.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a network architecture according to an embodiment of the present application;
FIG. 2a is a schematic diagram of a scenario for historical resource exchange information generation provided in an embodiment of the present application;
fig. 2b is a schematic diagram of a scenario for detecting generation of resource exchange information according to an embodiment of the present application;
FIG. 2c is a schematic view of a resource value change query according to an embodiment of the present application;
FIG. 3 is a flowchart of a data processing method based on a blockchain according to an embodiment of the present disclosure;
FIG. 4a is a schematic view of a scenario illustrating a resource value change chart according to an embodiment of the present disclosure;
FIG. 4b is a schematic diagram of a scenario illustrating a resource value change table according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a data processing method for obtaining block resource exchange transaction information according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of generating a resource value change chart according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a block chain based data processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Referring to fig. 1, fig. 1 is a schematic diagram of a network architecture according to an embodiment of the present application. The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like, and is mainly used for sorting data according to time sequence, encrypting the data into an account book, preventing the account book from being tampered and forged, and simultaneously verifying, storing and updating the data. A blockchain is essentially a de-centralized database in which each node stores an identical blockchain, and a blockchain network can distinguish nodes into consensus nodes and service nodes, wherein the consensus nodes are responsible for the consensus of the blockchain's entire network. The process for transaction data to be written into the ledger in the blockchain network may be: the client sends the transaction data to the service nodes, then the transaction data is transmitted between the service nodes in the blockchain network in a baton mode until the consensus node receives the transaction data, the consensus node packages the transaction data into blocks, performs consensus among other consensus nodes, and writes the blocks carrying the transaction data into an account book after the consensus passes.
It will be appreciated that a Block (Block) is a packet of data carrying transaction data (i.e., transaction traffic) over a blockchain network, and is a data structure that is time stamped and hashed with the previous Block, and that the Block is authenticated by the network's consensus mechanism and determines the transactions in the Block.
It will be appreciated that a hash value, also referred to as an information feature value or a feature value, is generated by converting input data of an arbitrary length into a password through a hash algorithm and performing a fixed output, and cannot retrieve the original input data by decrypting the hash value, which is a one-way encryption function. In the blockchain, each block (except the initial block) contains the hash value of the successor block, which is referred to as the parent block of the current block. Hash value is the potential core foundation and most important aspect in blockchain technology, which preserves the authenticity of the recorded and viewed data, as well as the integrity of the blockchain as a whole.
It will be appreciated that a blockchain system may include a smart contract that is understood in the blockchain system to be a type of code that each node of the blockchain (including the consensus node) may understand and execute, and that may execute any logic and obtain a result. The user can call the intelligent contract which is already deployed on the blockchain by means of the client initiating a transaction service request, then the service node on the blockchain can send the transaction service request to the consensus nodes, and each consensus node on the blockchain can respectively run the intelligent contract. It should be appreciated that one or more intelligent contracts may be included in the blockchain that may be distinguished by an identification number (Identity document, ID) or name, and that the client-initiated transaction request may also carry the identification number or name of the intelligent contract, thereby specifying the intelligent contract that the blockchain is to operate. If the intelligent contract appointed by the client is the contract needing to read the data, each consensus node accesses the local account book to read the data, and finally each consensus node verifies whether the execution results are consistent (i.e. performs consensus), if so, the execution results can be stored in the local account book, and the execution results are returned to the client.
As shown in fig. 1, the network architecture may include a blockchain node cluster 1000, a traffic server (server) cluster 100, and a terminal device (client) cluster 10, where the blockchain node cluster 1000 may include at least two blockchain nodes. As shown in fig. 1, the block link point cluster 1000 may include block link points 1000a, block link points 1000b, …, and block link points 1000n, the service server cluster 100 may include service servers 100a, 100b, …, and 100n, and the terminal device cluster 10 may include terminal devices 10a, 10b, …, and 10n.
As shown in fig. 1, the terminal device 10a, the terminal devices 10b, …, and the terminal device 10n may respectively perform data connection with the service server 100a, the service servers 100b, …, and the service server 100n, so that the terminal device may perform data interaction with the service server through the data connection; service servers 100a, 100b, …, 100n may be in data connection with block link point 1000a, block link points 1000b, …, block chain node 1000n, respectively, so that the service servers may interact with the block chain node through the data connection; the blockchain points 1000a, the blockchain points 1000b, …, and the blockchain node 1000n are interconnected so that data interaction between the blockchain nodes is possible.
It will be appreciated that data or block transfer may be performed between the blockchain nodes via the data connections described above. The blockchain network may implement data connection between blockchain nodes based on node identifiers, and for each blockchain node in the blockchain network, each blockchain node may have a node identifier corresponding to the blockchain node, and each blockchain node may store node identifiers of other blockchain nodes having a connection relationship with the blockchain node, so as to broadcast the acquired data or generated blocks to other blockchain nodes according to the node identifiers of the other blockchain nodes, for example, the blockchain node 1000a may maintain a node identifier list as shown in table 1, where the node identifier list stores node names and node identifiers of the other nodes:
TABLE 1
Node name Node identification
Blockchain node 1000a AAA.AAA.AAA.AAA
Block chain node 1000b BBB.BBB.BBB.BBB
Block chain node 1000n CCC.CCC.CCC.CCC
The node identifier may be any protocol (Internet Protocol, IP) address of the interconnection between networks, and any other information that can be used to identify the blockchain node in the blockchain network, and the IP address is only illustrated in table 1. For example, block link point 1000a may send information (e.g., transaction data) to block link point 1000b by node identification bbb.bbb.bbb.bbb, and block link point 1000b may determine that the information was sent by block link point 1000a by node identification aaa.aaa.aaa.
In a blockchain, a block must be consensus-passed through consensus nodes in the blockchain network before the block is uplink, and the block can be added to the blockchain after the consensus passes. It will be appreciated that when a blockchain is used in some contexts of a government or commercial establishment, not all participating nodes in the blockchain (i.e., blockchain nodes in blockchain node cluster 1000 described above) have sufficient resources and necessity to become consensus nodes of the blockchain. For example, in the blockchain node cluster 1000 shown in fig. 1, blocklink points 1000a, blocklink points 1000b, and blocklink points 1000n may be considered common nodes in the blockchain node cluster. The consensus nodes in the block link point cluster 1000 participate in consensus, that is, consensus a block (including a batch of transactions), including generating a block, voting on the block; while non-consensus nodes do not participate in consensus, but will help propagate block and vote messages, and synchronize status with each other, etc.
It should be understood that the above data connection is not limited to a connection manner, and may be directly or indirectly connected through a wired communication manner, may be directly or indirectly connected through a wireless communication manner, and may also be connected through other connection manners, which is not limited herein.
It is understood that the data processing method based on the blockchain provided in the embodiments of the present application may be executed by a computer device, where the computer device includes, but is not limited to, the blockchain node (may be a terminal or a server), a service server, and a terminal device. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms. The terminal device may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc.
It is to be appreciated that embodiments of the present application may be applied to a variety of scenarios including, but not limited to, cloud technology, artificial intelligence, intelligent transportation, assisted driving, and the like.
It will be appreciated that in the specific embodiments of the present application, related data such as transaction data is referred to, and when the above embodiments of the present application are applied to specific products or technologies, user permissions or consents are required, and the collection, use and processing of related data is required to comply with relevant laws and regulations and standards of the relevant countries and regions.
As shown in fig. 1, each terminal device in the terminal device cluster may be provided with a service application client, and when the service application client runs in each terminal device, data interaction may be performed between service background servers corresponding to the service application client, so that the service background servers may receive service data from each terminal device. The service background server corresponding to the service application client may be any service server in the service server cluster 100. The application client can be an application client with data information functions of displaying words, images, audio and video, such as a game application, a video editing application, a social application, an instant messaging application, a live broadcast application, a short video application, a music application, a shopping application, a novel application, a payment application, a browser and the like. The service application client may be an independent client, or may be an embedded sub-client integrated in a certain client (such as an instant messaging client, a social client, a video client, etc.), which is not limited herein.
As shown in fig. 1, each terminal device in the terminal device cluster may also be installed with a resource client, where the resource client is a tool for managing and storing digital resources of a user, for example, the digital resources may be transferred to other accounts based on the resource client, and for example, the digital resources transferred to other accounts may be received based on the resource client. The resource client may be a hardware device or a software program. In the application, the resource client of the target object can establish communication connection with the service application client so as to realize related operations such as authorized login of the target object. The resource client may be an independent client or an embedded sub-client integrated in the service application client, which is not limited herein. Wherein a digital resource may be used to represent ownership of an under-chain asset stored on a blockchain, i.e., when an object has some digital resource in possession of the digital resource in the blockchain, it can be verified that the under-chain asset to which the digital resource is bound belongs to the object. The under-chain assets can be media data such as pictures, videos, music, game props and the like, and can also be physical articles such as houses, vehicles and the like.
It can be appreciated that the target object may be transferred between digital resources of the same digital resource type by the resource client, and may also be exchanged between digital resources of different digital resource types by the resource client, e.g. the target object has a digital resource a, and the target object may be exchanged with the decentralized resource exchange by the resource client for a digital resource B, where the digital resource a and the digital resource B correspond to different digital resource types. The method comprises the steps that a centralized resource exchange station is arranged in a block chain network, an object can store digital resources in a chain address or an intelligent contract, when the digital resources are required to be used, only transactions are required to be initiated, and the centralized resource exchange station responds to the use requirements of the object according to the transactions, and the transaction record chain is searchable and transparent in disclosure.
It should be noted that, the resource values corresponding to different digital resource types are different, where the resource value corresponding to one digital resource type refers to the resource value corresponding to one digital resource corresponding to the digital resource type. It will be appreciated that the value of a resource may be used to represent how much of a digital resource corresponding to that digital resource type can be swapped in a resource swap to other digital resource types, the value typically being measured by a recognized standard resource, e.g., when the standard resource is a generic asset, the value is the price. For example, the value of the digital resource type a corresponds to 100 (i.e., corresponding to 100 standard resources, and vice versa), which means that the value of the digital resource of one digital resource type is 100, and the sum of the values of the digital resources of two digital resource types is 200. In addition, the resource value corresponding to the digital resource type is also continuously changed along with the supply-demand relationship of the digital resource corresponding to the digital resource type in the blockchain, if the target object cannot know the latest resource value of the digital resource type A and the digital resource type B in the decentralized resource exchange in time, certain loss is likely to occur in the process of the decentralized resource exchange, for example, the resource value corresponding to the digital resource type A in the current blockchain network can be 200, the resource value corresponding to the digital resource type B can be 100, and if the target object has 5 digital resources of the digital resource type A, the digital resource of the digital resource type B is reasonably replaced by 10 digital resource types.
At present, the target object can only inquire the resource value data corresponding to a certain digital resource type from the decentralized resource exchange, but the resource value data generated by the decentralized resource exchange is generated based on transaction data generated by the target object, so the target object can only acquire the resource value data of the digital resource type to be inquired after the decentralized resource exchange is online, and the resource value data provided by a single decentralized resource exchange can only accurately reflect the resource value condition of the digital resource type in the decentralized resource exchange, and the overall resource value condition of all the decentralized resource exchanges in the blockchain network may have a little difference with the digital resource type.
Therefore, in order to provide a better decentralized resource exchange experience for the target object and ensure the resource exchange rights of the target object, in the present application, the detection server (may be the service background server or any service server in the service server cluster 100 shown in fig. 1) may first obtain M historical resource exchange transaction information in the blockchain, perform structural information conversion processing on the M historical resource exchange transaction information, obtain M historical resource exchange information with a target information structure, and add the M historical resource exchange information to the resource exchange information set. Wherein M is a positive integer, and a history resource exchange transaction message is used for recording a processing result of the resource exchange processing of the digital resources of different digital resource types in the target digital resource type set by the decentralized resource exchange contract in the decentralized resource exchange contract set called by the blockchain network. Wherein the set of target digital resource types may comprise at least two digital resource types and the set of decentralized resource switching contracts may comprise one or more decentralized resource switching contracts. Then, the detection server can continuously detect the transaction uplink condition in the blockchain network, when the blockchain network is detected to carry out uplink processing on the target resource exchange transaction, the target resource exchange transaction information corresponding to the target resource exchange transaction is obtained, the structured information conversion processing is carried out on the target resource exchange transaction information, the detection resource exchange information with a target information structure is obtained, and the detection resource exchange information is added into the resource exchange information set. The target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to conduct resource exchange processing on the digital resources of different digital resource types in the target digital resource type set.
That is, the detecting server traverses and acquires the historical resource exchange transaction information recorded in the blockchain, then collates the historical resource exchange transaction information into the historical resource exchange information with the target information structure, then detects and acquires the latest generated target resource exchange transaction information in real time, collates the latest generated target resource exchange transaction information into the detected resource exchange information with the target information structure, and thus, the resource exchange information of all time periods from the running of the blockchain network to the present of the digital resource can be obtained. Therefore, when the detection server receives the historical resource value request containing the target digital resource type and the historical time period, the resource value stage data corresponding to the target digital resource type in the historical time period can be generated according to the historical resource exchange information and the detection resource exchange information in the resource exchange information set. The resource value stage data may include at least two historical resource value data, where one historical resource value data is used to characterize a resource value condition corresponding to a target digital resource type at a historical time node, the historical time node belongs to a historical time period, and the target digital resource type belongs to a target digital resource type set.
For easy understanding of the above process, please refer to fig. 2 a-2 c, wherein the detection server 20 shown in fig. 2 a-2 c may be any one of the service servers in the service server cluster 100 shown in fig. 1, for example, the detection server 20 may be the service server 100b; the blockchain network 21 as shown in fig. 2 a-2 c may be a blockchain network that is commonly formed by the blockchain node clusters 1000 shown in fig. 1, and the blockchain nodes 22 in the blockchain network 21 may be any blockchain node in the blockchain node clusters 1000 shown in fig. 1, e.g., the blockchain node 22 is the blockchain node 1000a; the terminal device 23 as shown in fig. 2 a-2 c may be any of the terminal devices of the terminal device cluster 10 shown in fig. 1 described above, e.g. the terminal device 23 may be the terminal device 10a.
Referring to fig. 2a, fig. 2a is a schematic diagram of a scenario for generating historical resource exchange information according to an embodiment of the present application. The data provider wants to provide the blockchain user with the resource exchange information which can reflect that the digital resource corresponding to a certain digital resource type runs from the blockchain network 21 to any historical time in the current time, and in the whole blockchain, the data provider needs to be able to acquire all generated resource exchange information corresponding to the digital resource type, and can continuously acquire the resource exchange information generated in real time corresponding to the digital resource type, so that the most accurate resource value stage data can be generated when the blockchain user inquires.
Assuming that the data provider has an association with the detection server 20, the detection server 20 may send a block acquisition request to any of the blockchain nodes in the blockchain network 21, such as the blockchain node 22, in response to a data acquisition operation of the data provider, as shown in fig. 2 a. It will be appreciated that each blockchain node in the blockchain network 21 stores a same blockchain that includes all blocks that have been generated and executed in the blockchain network 21, e.g., the blockchain node 22 may store the blockchain 24, and the blockchain 24 may include the block 0, the block 1, the block …, and the block n, and it will be appreciated that a plurality of transactions and corresponding transaction information after the transaction is executed may be included in the blocks in the blockchain 24. The blockchain node 22 sends blocks in the blockchain 24 to the detection server in response to a block acquisition request from the detection server 20.
As shown in fig. 2a, after acquiring the blocks in the blockchain 24, the detection server 20 traverses the blocks in the blockchain 24 to find and acquire the historical resource exchange transaction information contained in each block, and it is assumed that the historical resource exchange transaction information 25a, … and the historical resource exchange transaction information 25m are obtained. Wherein, a historical resource exchange transaction information is used for recording a processing result of performing resource exchange processing on digital resources of different digital resource types in the target digital resource type set by using the decentralized resource exchange contract in the decentralized resource exchange contract set called by the blockchain network, for example, the processing result recorded by the historical resource exchange transaction information 25a may include the following information: the method comprises the steps that 16 days of 10 months and 16 days of 00, a blockchain network calls a decentralised resource exchange contract 1 in a decentralised resource exchange contract set to perform resource exchange processing on digital resources corresponding to 5 digital resource types 1 and digital resources corresponding to 10 digital resource types 2; the processing result recorded by the history resource exchange transaction information 25m may include information as follows: the block chain network calls the decentralized resource exchanging contract 2 in the decentralized resource exchanging contract set to exchange the resources for the digital resources corresponding to the 6 digital resource types 1 and the digital resources corresponding to the 11 digital resource types 2 in 10 months and 16 days. Then, the detection server 20 may perform the structured information conversion process on each of the history resource exchange transaction information, and convert the history resource exchange transaction information into history resource exchange information having the target information structure, for example, convert the history resource exchange transaction information 25a into history resource exchange information 27a, convert the history resource exchange transaction information 25m into history resource exchange information 27m, and the detection server 20 may add the converted history resource exchange information 27a, … and history resource exchange information 27m to the resource exchange information set 26. The essence of the structured information conversion process is data format adjustment and data filtering, that is, extracting useful data from the historical resource exchange transaction information, and storing the useful data according to a preset format, for example, the above-mentioned historical resource exchange transaction information 25a is subjected to structured information conversion processing, where the obtained historical resource exchange information 27a may be: exchange occurrence time: exchange call contract for 10 months 16 days 16:00: decentralised resource exchange contract 1, first exchange resource type: digital resource type 1, first switching resource number: 5, second switching resource type: digital resource type 2, second switching resource amount: 10]; for the above-mentioned history resource exchange transaction information 25m, the structured information conversion process is performed on the history resource exchange transaction information, and the obtained history resource exchange information 27m may be: exchange occurrence time: exchange call contract: decentralised resource exchange contract 2, first exchange resource type: digital resource type 1, first switching resource number: 6, second switching resource type: digital resource type 2, second switching resource amount: 11]. Therefore, after the structured information conversion processing, each historical resource exchange information has the same information structure, which is conducive to data statistics and arrangement of all the historical resource exchange information so as to quickly obtain the historical resource value data corresponding to the digital resource type.
It may be appreciated that by traversing the already-uplink block, the detection server 20 may obtain the exchange information corresponding to the resource exchange processing that has already occurred in the blockchain network, and then the detection server 20 may start to continuously detect a new transaction in the blockchain network, and when detecting that the blockchain network performs the uplink processing on the target resource exchange transaction, obtain the target resource exchange transaction information corresponding to the target resource exchange transaction. For ease of understanding, please refer to fig. 2b together, fig. 2b is a schematic diagram of a scenario for detecting generation of resource exchange information according to an embodiment of the present application.
As shown in fig. 2b, the detection server 20 continuously detects the transaction in the blockchain network 21 that is being processed in the uplink, i.e. whether the transaction in the continuous blockchain network that is being processed in the uplink is a target resource exchange transaction. The target resource exchange transaction is a transaction for instructing the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set. Assuming that 10 months and 17 days are 12:00, when blockchain user A wants to convert 6 digital resources of digital resource type 1 to 12 digital resources of digital resource type 2 through decentralizing resource exchange contract 1, blockchain user A can perform a resource exchange operation through an associated terminal device, which can respond to the resource exchange operation, generate a resource exchange transaction 201, and then send the resource exchange transaction 201 to any blockchain node in blockchain network 21, such as blockchain node 22. Upon receipt of resource exchange transaction 201, blockchain node 22 may transact its execution and uplink processing by deploying decentralized resource exchange contract 202.
It will be appreciated that resource exchange transaction 1 is used to instruct blockchain network call decentralized resource exchange contract 1 to perform resource exchange processing on digital resources of 6 digital resource types 1 and 12 digital resource types 2, assuming that decentralized resource exchange contract 1 belongs to the decentralized resource exchange contract set, and thus resource exchange transaction 1 is a target resource exchange transaction. Therefore, when the blockchain node 22 performs the uplink processing on the resource exchange transaction 1, the detection server 20 may determine that the blockchain network is detected to perform the uplink processing on the target resource exchange transaction, so the detection server 20 may acquire the target resource exchange transaction information corresponding to the resource exchange transaction 201, and then perform the structured information conversion processing on the target resource exchange transaction information, to convert the target resource exchange transaction information into the detection resource exchange information 28 having the same target information structure as the historical resource exchange information, and the detection resource exchange information 28 may be: exchange occurrence time: 10 months 17 days 12:16, exchange call contracts: decentralised resource exchange contract 1, first exchange resource type: digital resource type 1, first switching resource number: 6, second switching resource type: digital resource type 2, second switching resource amount: 12], wherein the exchange occurrence time may be obtained by obtaining the time of executing the transaction or the time of generating the transaction, and the time of executing the transaction is selected as the exchange occurrence time.
As shown in fig. 2b, after obtaining the detection resource exchange information 28, the detection server 20 adds the detection resource exchange information 28 to the resource exchange information set. In this way, the resource exchange information set includes all the resource exchange information for the target digital resource type set associated by the decentralised resource exchange contract in the decentralised resource exchange contract set so far after the blockchain network 21 starts to run, so that the resource value stage data of any digital resource type in the target digital resource type set in any historical time period can be generated. The resource value stage data comprises at least two historical resource value data, wherein one historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node belonging to a historical time period. Wherein, the historical time period refers to any time period from the beginning of the operation of the blockchain network 21 to the current time. It can be appreciated that the greater the number of decentralized resource exchange contracts included in the decentralized resource exchange contract set and the more the decentralized resource exchange contracts are invoked by the blockchain user, the more accurate the resource value condition reflected by the historical resource value data is obtained, i.e., the closer to the overall resource value condition in the blockchain network.
Further, referring to fig. 2c, fig. 2c is a schematic view of a resource value change query according to an embodiment of the present application. As shown in fig. 2b, the terminal device 23 has an association relationship with the object H, the above-mentioned service application client 29 is installed in the terminal device 23, and the object H having the authority to log in the service application client 29 can call the resource client through the service application client 29 to manage its own digital resource. Assuming that on day 10 and day 19, the object H wants to exchange the digital resources of the 10 digital resource types 1 of the object H into the digital resources of other digital resource types through the decentralized resource exchange contract 3 on line 10 and day 18 in the blockchain network 21, before the digital resource exchange is performed, the object H wants to know the resource value change condition corresponding to the digital resource types 1 first, but obviously, the decentralized resource exchange contract 3 can only provide the object H with the historical resource value data corresponding to the digital resource types 1 in the period of day 10 and day 18 to day 10 and day 19, and the decentralized resource exchange contract 3 cannot provide the historical resource value data of the digital resource types 1 before day 10 and day 18. At this time, the object H transmits a history resource value request 203 to the detection server 20 through the service application client 29 running in the terminal device 20, and the history resource value request 203 includes the target digital resource type (digital resource type 1) and the history period (assuming 10 months 15 to 10 months 19 days, it may be defaulted that the blockchain network 21 starts running until the request is initiated).
As shown in fig. 2c, after receiving the historical resource value request 203, the detection server 20 determines the target digital resource type and the historical time period, and then obtains the resource exchange information occurring in the historical time period from the resource exchange information set 26 as the primary screening resource exchange information, where the historical resource exchange information 27a, the historical resource exchange information 27m, and the detection resource exchange information 28 belong to the primary screening resource exchange information. Then, the detection server 20 may generate historical resource value data corresponding to the digital resource type 1 at least two historical time nodes according to the primary screening resource exchange information, determine the two historical resource value data as resource value stage data, and then return the resource value stage data to the terminal device 23. Wherein the historical time node is determined by the exchange occurrence time contained in the resource exchange information. Alternatively, in order to make the object H more intuitively aware of the decentralised resource value change situation corresponding to the digital resource type 1, the detection server 20 may convert the resource value phase data into a chart form, for example, the resource value change chart 210. It is to be understood that the style of the resource value change map may be set according to the actual situation, and is not limited herein, and it is assumed that the resource value change map obtained at this time is a resource value change map with a value on the horizontal axis and a time on the vertical axis. The detection server 20 then returns the resource value change map 210 to the terminal device 23, which terminal device 23 can display via the service application client 29. The object H can know the change condition of the resource value of the digital resource corresponding to the digital resource type 1 within 10 months 15-10 months 19 through going to the resource value change graph, so as to determine whether to exchange the digital resource of the digital resource type 1 owned by the object H with the digital resources of other digital resource types.
Therefore, by the method provided by the embodiment of the application, the detection server 20 can trace back the block to obtain the historical resource exchange information, and acquire the detection resource exchange information through real-time detection, so that the resource value stage data which can accurately reflect the overall resource value condition of the target digital resource type in the blockchain network in the historical time period can be obtained according to the historical resource exchange information and the detection resource exchange information, and the whole acquisition and processing process is disclosed and transparent, thereby ensuring the reliability of the resource value stage data.
Further, referring to fig. 3, fig. 3 is a flow chart of a data processing method based on a blockchain according to an embodiment of the present application. The method may be performed by a computer device (e.g., any service server in the service server cluster 100 in the embodiment corresponding to fig. 1, for example, the service server 100 a). The following description will be given by taking the method performed by a computer device as an example, wherein the blockchain-based data processing method may at least include the following steps S101 to S103:
step S101, obtaining M pieces of historical resource exchange transaction information in a blockchain, carrying out structural information conversion processing on the M pieces of historical resource exchange transaction information to obtain M pieces of historical resource exchange information with target information structures, and adding the M pieces of historical resource exchange information into a resource exchange information set; m is a positive integer.
Specifically, the decentralized resource exchange contract refers to an intelligent contract corresponding to the decentralized resource exchange in the blockchain network. The decentralised resource exchange refers to a resource exchange mode for realizing point-to-point transaction by means of a distributed ledger by means of a blockchain technology. It will be appreciated that in a decentralized resource clearinghouse, a blockchain object may store its own digital resources in its own on-chain address (the address in the blockchain network that uniquely identifies the blockchain object) or in a decentralized resource clearinghouse contract, the blockchain object has control of its own digital resources, when the blockchain object wants to use its own digital resources, a corresponding transaction may be initiated to the decentralized resource clearinghouse, i.e., the transaction is sent to a blockchain node in the blockchain network, and then completed by the blockchain node through the decentralized resource clearinghouse contract. It will be appreciated that the blockchain object may exchange digital resources of different digital resource types by de-centering the resource exchange, at this time, the blockchain object may send a resource exchange transaction to the blockchain link, where the resource exchange transaction may include a first on-chain address, a second on-chain address, a first digital resource, and a second digital resource, and after determining that a block including the resource exchange transaction passes through the consensus, the blockchain node may perform a resource exchange process on the first digital resource stored by the first on-chain address and the second digital resource stored by the second on-chain address when executing the resource exchange transaction in the block, and wait for the block to be executed, where the blockchain node may write the block and transaction execution results (including the resource exchange transaction and the processing result of the resource exchange process) corresponding to all transactions in the block together into the blockchain.
Wherein the address on the first chain may be an address on the blockchain used by a transaction initiation object (i.e., an object that initiates a resource exchange transaction) to store the first digital resource; the address on the second chain is an address on the blockchain for storing the second digital resource for the transaction interchange object (i.e., an object that interchange the digital resource with the transaction initiation object, which may be other blockchain objects, or a decentralized resource interchange contract). Wherein the resource exchange process refers to transferring a first digital resource from a first on-chain address to a second on-chain address while transferring a second digital resource from the second on-chain address to the first on-chain address. The digital resource types respectively corresponding to the first digital resource and the second digital resource are different.
Specifically, the historical resource exchange transaction information is used for recording the processing result of the resource exchange processing of the decentralized resource exchange contract in the decentralized resource exchange contract set called by the blockchain network on the digital resources of different digital resource types in the target digital resource type set, and can be understood as the transaction execution result corresponding to the resource exchange transaction already executed in the block of the blockchain. One or more decentralized resource exchange contracts may be included in the decentralized resource exchange contract set, as a plurality of decentralized resource exchange contracts may be deployed in the blockchain network. It can be appreciated that different decentralized resource exchange contracts are on-line at different times, and different decentralized resource exchanges may have different exchange proportions about to be used when digital resources are exchanged, so that resource exchange information corresponding to different decentralized resource exchange contracts may be complementary, and some decentralized resource exchange contracts can be made up for the situation that no previous historical transaction data exists due to the later on-line time, so that all the decentralized resource exchange contracts in a plurality of mainstream or blockchain networks can be taken as the decentralized resource exchange contracts to be detected together, and added to the decentralized resource exchange contract set. One or more digital resource types can be contained in the target digital resource type set, and the digital resource types contained in the target digital resource type set are the digital resource types which can finally generate the corresponding decentralized resource value change data. It will be appreciated that the set of decentralized resource exchange contracts includes which decentralized resource exchange contracts and the set of target digital resource types includes which digital resource types may be set according to the actual circumstances, and the application is not limited herein.
Specifically, one possible implementation process for obtaining the transaction information exchanged by M historical resources in the blockchain may be: sending a block height query request for a block chain to a block chain link point, and receiving the maximum block height returned by the block chain node according to the block height query request; traversing to send a block query request for a kth block to a block chain link, and receiving the kth block returned by the block chain node according to the block query request for the kth block; k is a positive integer less than the maximum block height; obtaining block resource exchange transaction information associated with both the target digital resource type set and the decentralised resource exchange contract set in the kth block; until each block in the block chain is traversed, the block resource exchange transaction information acquired from each block is determined as M historical resource exchange transaction information. The Block Height (Block Height) refers to the position or sequence number of a Block in the blockchain, or the number of blocks between a Block and an created Block, and the created Block is the first Block on a blockchain as the name implies, and it is noted that the Block Height of the created Block is 0 instead of 1. It will be appreciated that when querying a block of information or retrieving a block, it is possible to query by its block height in addition to by its hash. The maximum block height refers to the block height corresponding to the block of the latest uplink in the current block chain. The block resource exchange transaction information corresponding to one block refers to historical resource exchange transaction information contained in the block. For example, the block C1 includes the historical resource exchange transaction information T1 and the historical resource exchange transaction information T2, and the block resource exchange transaction information corresponding to the block C1 is the historical resource exchange transaction information T1 and the historical resource exchange transaction information T2. The block resource exchange transaction information corresponding to all blocks in the block chain is summarized together, so that M historical resource exchange transaction information can be obtained.
Specifically, M historical resources exchange transaction information packetsExchange transaction information M containing historical resources i I is a positive integer less than or equal to M; the foregoing performing a structured information conversion process on the M historical resource exchange transaction information to obtain M historical resource exchange information having a target information structure, and adding the M historical resource exchange information to a feasible implementation process in the resource exchange information set may be: determining exchange of transaction information M with historical resources i Corresponding associated decentralized resource exchange contracts; the associated decentralized resource exchange contract belongs to a decentralized resource exchange contract set; exchanging transaction information M for historical resources through a binary contract interface corresponding to an associated decentralized resource exchange contract i Data analysis is carried out to obtain historical resource exchange transaction information M i Exchanging information by corresponding analysis resources; the analysis resource exchange information comprises object attribute data corresponding to at least two information object attributes; performing attribute filtering processing on the analysis resource exchange information according to the target information object attribute corresponding to the target information structure to obtain historical resource exchange transaction information M i Corresponding historical resource exchange information, exchanging transaction information M for the historical resource i The corresponding historical resource exchange information is added to the resource exchange information set.
It should be appreciated that the contract codes corresponding to the different decentralized resource exchange contracts are different, so that the format or structure of the historical resource exchange transaction information obtained when invoking the different decentralized resource exchange contracts to perform the resource exchange transaction is different, and thus the historical resource exchange transaction information M is obtained i The historical resource exchange transaction information M may then be parsed by its corresponding associated decentralized resource exchange contract corresponding binary contract interface, i.e., interface abi (Application Binary Interface ) presented by the associated decentralized resource exchange corresponding to the associated decentralized resource exchange contract i Thereby obtaining analysis resource exchange information, wherein the analysis resource exchange information comprises object attribute data corresponding to at least two information object attributes, and then filtering object attribute data corresponding to the object attributes which are not needed to be used, thereby obtaining historical resource exchange transaction information M i The corresponding historical resources exchange information.
Step S102, when detecting that the blockchain network carries out uplink processing on target resource exchange transaction, obtaining target resource exchange transaction information corresponding to the target resource exchange transaction, carrying out structural information conversion processing on the target resource exchange transaction information to obtain detection resource exchange information with the target information structure, and adding the detection resource exchange information into the resource exchange information set.
Specifically, a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set.
Optionally, one possible implementation procedure for detecting the uplink processing of the target resource exchange transaction by the blockchain network may be: the computer equipment can continuously detect block consensus or block uplink conditions in the block chain network, and acquire the block to be uplink when determining that the block chain network passes through the consensus of the block to be uplink; carrying out transaction inquiry processing on the block to be uplink according to the decentralized resource exchange contract set and the target digital resource type set to obtain a transaction inquiry result; if the transaction inquiry result indicates that the target resource exchange transaction is contained in the block to be uplink, determining that the blockchain network is detected to carry out uplink processing on the target resource exchange transaction.
Optionally, the computer device may include a contract event detector for detecting an event of the set of decentralized resource switching contracts, where the contract event detector is configured to obtain, when detecting that an decentralized resource switching contract in the set of decentralized resource switching contracts deployed in the blockchain network generates an decentralized resource switching event associated with the target set of digital resource types, decentralized resource switching event information corresponding to the decentralized resource switching event. That is, when it is detected by the contract event detector that the target decentralized resource switching contract generates a decentralized resource switching event according to the blockchain transaction, the decentralized resource switching event information corresponding to the decentralized resource switching event is synchronized; the decentralized resource exchange event information comprises an event resource exchange type; the target decentralised resource exchange contract belongs to a decentralised resource exchange contract set; if the event resource exchange type belongs to the target digital resource type set, the blockchain transaction is used as a target resource exchange transaction, and the fact that the blockchain network is detected to carry out uplink processing on the target resource exchange transaction is determined.
Alternatively, one possible generation process of the contract event detector may be: receiving a decentralised configuration request; the decentralised configuration request comprises a decentralised compound contract address corresponding to a decentralised resource exchange contract contained in the decentralised resource exchange contract set; generating a contract event detector corresponding to the decentralized resource exchange contract set according to the decentralized contract address; the contract event detector is used for synchronizing the decentralized resource exchange event information corresponding to the decentralized resource exchange event when detecting that the decentralized resource exchange contract contained in the decentralized resource exchange contract set generates the decentralized resource exchange event.
Optionally, the decentralised configuration request further comprises request initiation object information; performing configuration permission verification processing according to the request initiation object information to obtain a configuration permission verification result; if the configuration permission verification result is a configuration permission verification passing result, executing a step of generating a contract event detector corresponding to the decentralised resource exchange contract according to the decentralised compound contract address and the target digital resource type set; if the configuration permission verification result is a configuration permission verification failing result, sending permission verification failing prompt information to the second terminal. The request initiating object information refers to information for uniquely identifying the request initiating object, such as an address on a chain of the request initiating object, where the address on the chain refers to a unique address generated in the blockchain network based on a public-private key bound with the request initiating object, and is also a unique address for identifying the request initiating object on the blockchain. It is understood that not any object has configuration rights, all rights object information having management configuration contracts may be written in the blockchain ledger first, and then it is verified whether the request-initiating object information belongs to the rights object information.
Step S103, when a historical resource value request containing a target digital resource type and a historical time period is received, generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set; the resource value stage data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to the historical time period.
Specifically, the target digital resource type belongs to a target digital resource type set; each resource exchange information contained in the resource exchange information set contains a resource exchange type and exchange occurrence time; when a resource value request containing a target digital resource type and a historical time period is received, one possible implementation process of generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set may be: when a historical resource value request containing a target digital resource type and a historical time period is received, screening out resource exchange information with exchange occurrence time within the historical time period from the primary screening resource exchange information, and taking the resource exchange information as primary screening resource exchange information; classifying the primary screening resource exchange information according to the exchange occurrence time to obtain at least two classified resource exchange information sets; the exchange occurrence time contained in the primary screening resource exchange information belonging to the same classified resource exchange information set is the same; respectively carrying out resource exchange statistical processing on at least two classified resource exchange information sets, and determining resource value data respectively corresponding to the target digital resource types at least two exchange occurrence times; and determining the resource value data corresponding to the at least two exchange occurrence times as at least two historical resource value data, and determining the at least two historical resource value data as resource value stage data. The historical time period may be 3 days, one day, etc., and one period may be ten minutes, one hour, one minute, etc., which may be specifically selected according to practical situations, and if the expected time period is not set, the historical time period may be defaulted to the time when the blockchain network starts to run to the request initiation. The resource exchange statistical processing on a classified resource exchange information set refers to counting data such as the exchange quantity, the exchange proportion and the like of digital resources corresponding to each digital resource type related to the classified resource exchange information set, so as to determine the supply and demand conditions of the digital resources corresponding to each digital resource type, and further determine the resource value corresponding to each digital resource type in the current exchange occurrence time.
Optionally, the first terminal may integrate and install a service application client (i.e. the service application client described in fig. 1 above), and the blockchain object may perform the historical resource value request operation through the service application client, where the first terminal generates the historical resource value request after responding to the historical resource value request operation. In order to ensure the security of data, the historical resource value request also comprises a login state, wherein the login state can be the login state of the blockchain object in the service application client, and the request for changing the decentralized resource value aiming at the target digital resource type can be initiated only after the blockchain object passes the login authentication of the service application client; therefore, the computer equipment can perform legal verification processing on the login state carried in the historical resource value request to obtain a legal verification result; if the legal verification result indicates that the login state is legal, executing the step of generating the resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set in the step S103; if the legal verification result indicates that the login state is an illegal login state, login error prompt information is sent to the first terminal, and the login error prompt information is used for reminding the blockchain object to login the business application client.
Alternatively, assuming that the blockchain object wants to more intuitively observe the change situation of the corresponding resource value of the target digital resource type in the historical time period, the resource value change map request for the resource value stage data can be continuously sent. The computer device may receive a resource value change map request for the resource value phase data, the resource value change map request comprising a resource value change map type; then, the computer device may determine a graph rendering manner and graph rendering data attributes that match the resource value change graph type; and then generating graph rendering resource change data corresponding to the graph rendering data attribute according to the resource value stage data, and performing image rendering on the graph rendering resource change data according to a graph rendering mode to obtain a resource value change graph corresponding to the resource value change graph type. It may be understood that each historical resource value data included in the resource value stage data may include data with a plurality of data attributes, such as time, resource value, exchange number, and the like, and the graph rendering data attribute refers to a data attribute that is the same as a data attribute associated with the historical resource value data, or may be a data attribute that can be generated after the data attribute associated with the historical resource value data evolves, for example, the graph rendering data attribute may include a resource value change rate, where the resource value change rate may be obtained after corresponding data processing by using the resource value.
Optionally, the image rendering process may also be performed in the first terminal, that is, the computer device may directly send the map rendering resource change data to the first terminal, the first terminal determines a map rendering mode matched with the resource value change map type, and performs image rendering on the map rendering resource change data according to the map rendering mode, so as to obtain a resource value change map corresponding to the resource value change map type.
It can be understood that the types of graphs or tables which can reflect the resource value change situation of the digital resource are numerous, and the change key points presented by different resource value change graphs or resource value change tables are different, for example, a K line graph and a time-sharing graph, wherein the K line graph comprises four data, namely, a starting price, a highest price, a lowest price and a closing price, all K lines are unfolded around the four data to reflect the situation of great potential and price information, and if the K line graph is placed on a piece of paper every day, a daily K line graph can be obtained, and a week K line graph and a month K line graph can be drawn; the time-sharing diagram refers to a dynamic real-time (instant) time-sharing trend diagram of a large disk and a person, and is the fundamental place for instantly grasping the conversion of multiple air forces, namely the market change.
For better understanding of the effect of the resource value change chart, please refer to fig. 4a, fig. 4a is a schematic view of a scenario for displaying the resource value change chart according to an embodiment of the present application. As shown in fig. 4a, after requesting the resource value change map for the digital resource type 1 from the detection server, the terminal device 600 may receive the resource value change map returned by the detection server and the map rendering resource change data related to the digital resource type 1, and then display the resource value change map to obtain the interface 601. As can be seen from fig. 4a, the interface 601 may include a time-sharing diagram of the digital resource type 1 in the present day, and optionally, the blockchain object associated with the terminal device 600 may change the type of the resource value change diagram displayed in the interface 601 by triggering a "5 day" control, a "day k" control, etc. in the interface 601. In addition, some important information about the resource value of the digital resource type 1, such as the current value, the present-day minimum value, the present-day maximum value, the market ranking, the history maximum value, the history minimum value, and the first release time of the digital resource corresponding to the digital resource type 1, may be displayed in the interface 601, so that the blockchain object can quickly understand the change situation of the value of the digital resource type 1 from the first release to the present resource. It should be noted that, when measuring the values corresponding to a plurality of digital resource types, a standard resource is generally selected as a measurement standard, for example, the current value of the digital resource type 1 is 30266.31, which indicates that the current value of the digital resource type 1 is equal to 30266.31 standard resources, and if the current value of the digital resource type 2 is 20333, which indicates that the current value of the digital resource type 2 is equal to 20333 standard resources, the current value of the digital resource type 1 is greater than the current value of the digital resource type 2.
Similarly, the blockchain object may also continue to send resource value change table requests for the resource value phase data corresponding to the plurality of digital resource types, where the resource value change table requests may include resource value change table types, such as a resource value fluctuation statistics table. The computer device may determine a table drawing manner and a table data attribute corresponding to the resource value change table type, then generate table resource change data corresponding to the table data attribute according to the resource value stage data respectively corresponding to the plurality of digital resource types, and then perform table drawing on the table resource change data according to the table drawing manner to obtain a resource value change table corresponding to the resource value change table type. For better understanding of the role of the resource value change table, please refer to fig. 4b, fig. 4b is a schematic diagram of a scenario for displaying the resource value change table according to an embodiment of the present application. As shown in fig. 4b, after requesting the resource value change tables for a plurality of digital resource types from the detection server, the terminal device 600 may quickly understand the value change situation of the plurality of digital resource types, for example, the terminal device 600 may request the request for the resource value change tables for the digital resource types 1 to 7 from the detection server, then receive the resource value change table returned from the detection server, and then display the resource value change table to obtain the interface 602. The interface 602 can quickly understand the latest value and the rising and falling of each digital resource type 1, so as to help the blockchain object associated with the terminal device 600 quickly understand the value change situation of the digital resources corresponding to the plurality of digital resource types.
According to the method provided by the embodiment of the application, the historical resource exchange transaction information in the generated block is firstly obtained and converted into the historical resource exchange information with the uniform structure, then the target resource exchange transaction information is obtained in real time in a detection mode and converted into the detection resource exchange information with the same structure, and the historical resource exchange information and the detection resource exchange information corresponding to different decentralization resource exchange contracts are integrated, so that more accurate resource value stage data of the target digital resource type can be generated in any current historical time period from the beginning of the exchange of the block chain.
Further, referring to fig. 5, fig. 5 is a flowchart of a data processing method for obtaining block resource exchange transaction information according to an embodiment of the present application. The method may be performed by a computer device (e.g., any service server in the service server cluster 100 in the embodiment corresponding to fig. 1, for example, the service server 100 a). The following description will be given by taking the method performed by the computer device as an example, where the data processing method for obtaining the block resource exchange transaction information may at least include the following steps S201-S207:
Step S201, a kth block is acquired; k is a positive integer less than the maximum block height; the kth block contains N transaction messages; one transaction information includes a contract address, an event signature, and transaction execution data.
Specifically, the kth block may be the kth block obtained in the implementation process of step S101 in the embodiment corresponding to fig. 3, and steps S202-S207 are one implementation process of obtaining the block resource exchange transaction information associated with both the target digital resource type set and the decentralized resource exchange contract set in the kth block.
Specifically, the transaction information may include a transaction log, that is, a log generated when a transaction is executed, for recording an execution process and an execution result of the transaction, and the transaction log corresponding to the transaction may include a contract address, an event signature, and transaction execution data. Wherein, the contract Address (Address) refers to the Address of the intelligent contract called by the transaction when executing; event signature refers to the signature of the thrown event, which is usually recorded in Topic (title), and Topic is mainly used for marking the name of the event; the transaction execution Data is transaction storage Data (Data), which is actually an array, and each element in the array corresponds to a userId (object identifier), userData (object Data), and a block number (block number) value, and is mainly used for recording the execution result of the transaction.
Step S202, traversing the N transaction information and sequentially acquiring the j transaction information; j is a positive integer less than or equal to N.
Step S203, determining a relationship result between the j transaction information and the decentralized resource exchange contract set according to the contract address and the event signature included in the j transaction information.
Specifically, a feasible implementation process of determining the relationship result between the jth transaction information and the decentralized resource exchange contract set according to the contract address and the event signature contained in the jth transaction information may be: acquiring contract addresses contained in the jth transaction information, and acquiring decentralized compound contract addresses respectively corresponding to the L decentralized resource exchange contracts; if the L decentralised compound contract addresses do not have the same contract address as the contract address contained in the j transaction information, determining that the relation result of the j transaction information and the decentralised resource exchange contract set is an unassociated result; if the L decentralized compound contract addresses contain the decentralized compound contract addresses which are the same as the contract addresses contained in the j transaction information, acquiring a resource exchange event corresponding to the contract addresses contained in the j transaction information, and determining an event hash corresponding to the resource exchange event; if the event hash is not equal to the event signature contained in the j transaction information, determining that the relation result of the j transaction information and the decentralised resource exchange contract set is an unassociated result; if the event hash is equal to the event signature contained in the j transaction information, determining the relation result of the j transaction information and the decentralised resource exchange contract set as the association result. It can be understood that only when the contract address matches the event signature, it is explained that the current transaction information is the transaction information generated after the resource exchange processing is performed by calling the decentralized resource exchange contract in the decentralized resource exchange contract set, and the transaction information is the transaction information that needs to be further processed and analyzed, that is, the relationship result between the transaction information and the decentralized resource exchange contract set is the association result.
Step S204, if the relationship result between the jth transaction information and the decentralized resource exchange contract set is a non-association result, continuing to acquire the jth+1th transaction information.
Step S205, if the relationship result between the jth transaction information and the decentralized resource exchange contract set is a correlation result, determining a relationship result between the jth transaction information and the target digital resource type set according to the transaction execution data included in the jth transaction information.
Specifically, the target digital resource type set includes H digital resource types, where H is a positive integer; one possible implementation procedure for determining the relationship result between the jth transaction information and the target digital resource type set according to the transaction execution data contained in the jth transaction information may be: searching the resource type of transaction execution data contained in the j transaction information to obtain an exchange digital resource type; if the H digital resource types do not have the same digital resource types as the exchange digital resource types, determining that the relation result of the j transaction information and the target digital resource type set is an unassociated result; if the H digital resource types have the same digital resource types as the exchange digital resource types, determining the relation result of the j transaction information and the target digital resource type set as the association result. It will be appreciated that only if the exchange digital resource type belongs to the target set of digital resource types, it is indicated that the current transaction information is one that requires further processing analysis.
Step S206, if the relation result between the j transaction information and the target digital resource type set is a non-association result, continuing to acquire the j+1th transaction information.
Step S207, if the relationship result between the jth transaction information and the target digital resource type set is a correlation result, marking the jth transaction information, continuing to obtain the jth+1th transaction information until traversing the N transaction information, and determining the transaction execution data contained in the marked transaction information as block resource exchange transaction information associated with both the target digital resource type set and the decentralized resource exchange contract set in the kth block.
By the method provided by the embodiment of the application, a plurality of transaction information contained in the block can be quickly searched, the transaction information related to the decentralized resource exchange contract set is screened out, the transaction information related to the target digital resource type set is further determined, the association relation between each transaction information and the target digital resource type set and the decentralized resource exchange contract set is not required to be determined one by one, the time for determining the transaction information of the block resource exchange can be shortened, and system resources required by searching are saved.
Further, for ease of understanding, please refer to fig. 6, fig. 6 is a schematic flow chart of generating a resource value change chart according to an embodiment of the present application. As shown in fig. 6, the entire flow involves a business server 51, an object terminal device 52, a business application client 53, an access gateway service 54, a quotation service 55, a data synchronization service 56, an off-centered resource exchange contract 57, and a resource value management contract 58. The target terminal device 52 may be any terminal device in the terminal device cluster 10 shown in fig. 1, for example, the target terminal device 52 may be the terminal device 10b. The service Application Client 53 may be an applet, a native App (Application) or an H5 (Hyper Text Markup Language, hypertext markup language 5) page, and the deployment architecture may employ a C/S (Client/Server) or B/S (Browser/Server) mode, for example, the service Application Client 53 may be deployed in the object terminal device 52, which corresponds to the service Server 51 (which may also be referred to as a detection Server, i.e. any service Server in the service Server cluster 100 shown in fig. 1, for example, the service Server 100B), and the service Application Client 53 may perform data interaction with the service Server 51 when the object terminal device 52 is running. In addition, a resource client may be integrated into the business application client 53 for managing digital resources of the blockchain object. The access gateway service 54, the market place service 55, and the data synchronization service 56 may be services deployed on different servers, or may be services deployed on the same server, for example, the access gateway service 54, the market place service 55, and the data synchronization service 56 may all be deployed in a service server corresponding to the target terminal device 52. The decentralized resource exchange contract 57 and the resource value management contract 58 may be intelligent contracts deployed in a blockchain network, that is, any blockchain node in the blockchain network (may be any blockchain node in the blockchain network 1000 shown in fig. 1, for example, the blockchain node 1000 a) may be deployed with the decentralized resource number exchange contract 57 and the resource value management contract 58.
As shown in fig. 6, the whole resource value change graph generation flow includes the following steps:
in step S301, the service server 51 transmits a configuration transaction to the resource value management contract 58.
In particular, the business server 51 may respond to the business party's configuration operations by generating configuration transactions containing configuration information and then sending to the resource value management contract 58 for execution to set up a set of digital resource types and a set of decentralized resource exchange contracts in the resource value management contract 58.
In step S302, the data synchronization service 56 manages configuration information in the contract 58 according to the synchronization resource value.
In step S303, the data synchronization service 56 performs initialization configuration according to the configuration information.
Specifically, the data synchronization service 56 synchronizes configuration information in the resource value management contract 58 and then performs initialization configuration according to the configuration information.
In step S304, the data synchronization service 56 begins detecting the decentralized resource switching contract 57 based on the configuration information.
Specifically, the data synchronization service 56 may detect the resource exchange event information associated with the target digital resource type set generated by the decentralized resource exchange contract according to the decentralized compound contract address corresponding to the decentralized resource exchange contract in the decentralized resource exchange contract set, and the detailed implementation process may refer to the optional description of step S102 in the embodiment corresponding to fig. 3, which is not repeated herein. For ease of understanding, the following description will be given by way of example only in which the set of decentralized resource switching contracts includes a decentralized resource switching contract 57.
In step S305, the target terminal device 52 logs in to the service application client 53.
Specifically, the object terminal device 52 may run and log in the business application client 53 in response to a login operation of the object. It will be appreciated that after the object has completed logging on to the business application client 53, the resource client in the business application client 53 may be used to manage its own digital resources and exchange the digital resources with the decentralized resource exchange contract 57.
In step S306, the service application client 53 signs the resource exchange transaction.
Specifically, the object may initiate a resource exchange transaction on the blockchain with the decentralized resource exchange contract 57 in a resource client in the business application client 53, the business application client 53 signs the resource exchange transaction by the resource client and then sends the resource exchange transaction to the decentralized resource exchange contract 57 for execution.
In step S307, the business application client 53 sends the signed resource exchange transaction to the decentralized resource exchange contract 57.
In step S308, the decentralized resource exchange contract 57 performs a resource exchange transaction.
Specifically, the decentralized resource exchange contract 57 generates a corresponding resource exchange event when executing the resource exchange transaction, and when the data synchronization service 56 detects that the resource exchange event is generated, it may determine that the blockchain network is detected to perform uplink processing on the target resource exchange transaction, and the specific implementation may refer to the optional description of step S102 in the embodiment corresponding to fig. 3, which is not described herein again.
In step S309, the decentralized resource exchange contract 57 returns the transaction result corresponding to the resource exchange transaction to the service application client 53.
In step S310, the data synchronization service 56 obtains the detected real-time transaction data, i.e., the transaction information corresponding to the resource exchange transaction.
Specifically, the data synchronization service 56 detects the generation of the resource exchange event of the decentralized resource exchange contract 57 in real time, and when detecting the generation of the resource exchange event, obtains the transaction information corresponding to the corresponding resource exchange transaction as real-time transaction data, that is, the target resource exchange transaction information in the embodiment described in the foregoing fig. 3.
In step S311, the data synchronization service 56 loops through the acquisition history transaction data.
Specifically, the data synchronization service 56 may obtain, according to the information of the set of the decentralized resource exchange contracts, all the blocks on the blockchain from low to high, sequentially filter out all the transaction information in the set of the centralized resource exchange contracts, and analyze the filtered transaction information according to the interface of the exchange contracts to convert the filtered transaction information into the historical resource exchange information with a unified structure under the chain. The specific traversal process of the block can be referred to the description of step S202-step S207 in the embodiment corresponding to fig. 5, and the detailed description is omitted here.
In step S312, the data synchronization service 56 performs unified structural transformation on the real-time transaction data and the historical transaction data.
Specifically, the data synchronization service 56 converts the historical transaction data obtained by traversing into historical resource exchange information with a target information structure, and then converts the new real-time transaction data obtained by detecting each time into detection resource exchange information with a target information structure, and the historical resource exchange information and the detection resource exchange information are locally stored, so that the whole data obtaining process can be traced, the transparency of the obtaining process is ensured, and the reliability of the data is improved.
In step S313, the business application client 53 transmits a history resource value request to the access gateway service 54.
Specifically, to ensure that data is abused, access gateway service 54 may be configured to filter historical resource value requests, and only historical resource value requests that pass login verification may be sent to ticketing service 55.
In step S314, the access gateway service 54 verifies the login status.
In step S315, the access gateway service 54 requests the login interface of the service server 51 to verify the login status.
In step S316, the service server 51 returns a login authentication result to the access gateway service 54.
In step S317, the access network service 54 sends a request for historical resource value to the quotation service 55 after the login status is verified.
In step S318, the quotation service 55 obtains the transaction data of the unified structure from the data synchronization service 56 according to the historical resource value request.
In step S319, the quotation service 55 generates resource value stage data from the transaction data (including history and real time) of the unified structure.
In step S320, the ticker service 55 sends the resource value phase data to the business application client 53.
Alternatively, resource value change data describing a change in the digital resource market may be generated based on the resource value phase data, such as the map rendering resource change data or table resource change data described above. The implementation process of step S319 may be referred to the description of step S103 in the embodiment corresponding to fig. 3, and will not be described herein. Taking the example of generating the map rendering resource variation data, after the market service 55 generates the map rendering resource variation data according to the resource value phase data, image rendering may be performed on the map rendering resource variation data to obtain a resource value variation map, and then the resource value variation map is sent to the service application client 53. For example, the market place service 55 generates time-sharing data and K-line data from the resource value stage data, and can render a time-sharing diagram and a K-line diagram for presenting the change situation of the digital resource market place from the time-sharing data and the K-line data. Then, the object terminal device 52 can display the resource value change chart through the running service application client 53, and the blockchain object can intuitively know the resource value of the digital resource of the target digital resource type in the blockchain and the change trend of the resource value according to the resource value change chart.
According to the method provided by the embodiment of the application, firstly, the market synchronizing service acquires all blocks on the blockchain from low to high according to the information of the decentralized resource exchange contract set, sequentially filters out all transaction information corresponding to the centralized resource exchange contract set, and analyzes and converts the filtered transaction information into historical resource exchange information with a unified structure under the chain according to an interface of the decentralized resource exchange contract. When the blocks synchronized by the quotation synchronization service catch up with the latest block information, the real-time transaction information on the chain is detected, and the real-time transaction information is converted into unified detection resource exchange information under the chain according to the same logic. And finally, generating all resource value stage data corresponding to the decentralized resource exchange contract set on the chain based on the unified historical resource exchange information under the chain and the detection resource exchange information, and generating corresponding resource value change data (namely map rendering resource change data or table resource change data) based on the resource value stage data. Because the online time of the decentralized resource exchange contracts on different chains is different, the market data of the decentralized resource exchange contracts can be complemented, the situation that some decentralized resource exchange contracts have no previous historical transaction data due to the late online time can be made up, and the generated data is true and reliable because the online transaction generates the resource value change data.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a data processing apparatus based on a blockchain according to an embodiment of the present application. The data processing apparatus may be a computer program (including program code) running on a computer device, for example the data processing apparatus is an application software; the data processing apparatus 1 may be adapted to perform the respective steps of the data processing method provided in the embodiments of the present application. As shown in fig. 7, the data processing apparatus 1 may include: an acquisition module 11, a structure conversion module 12, a detection conversion module 13 and a generation module 14.
An obtaining module 11, configured to obtain M historical resource exchange transaction information in the blockchain;
the structure conversion module 12 is configured to perform structural information conversion processing on the M historical resource exchange transaction information, obtain M historical resource exchange information with a target information structure, and add the M historical resource exchange information to the resource exchange information set; m is a positive integer; the historical resource exchange transaction information is used for recording the processing result of the blockchain network for calling the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
The detection conversion module 13 is configured to obtain target resource exchange transaction information corresponding to a target resource exchange transaction when detecting that the blockchain network performs uplink processing on the target resource exchange transaction, perform structural information conversion processing on the target resource exchange transaction information, obtain detection resource exchange information with a target information structure, and add the detection resource exchange information to a resource exchange information set; a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
a generation module 14, configured to generate, when receiving a historical resource value request including a target digital resource type and a historical time period, resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set; the resource value phase data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to a historical time period; the target digital resource type belongs to a set of target digital resource types.
The specific implementation manners of the obtaining module 11, the structure converting module 12, the detecting converting module 13, and the generating module 14 may be referred to the specific description of step S101 to step S103 in the embodiment corresponding to fig. 3, which is not repeated here.
Wherein, the acquisition module 11 comprises: a height determination unit 111, a block acquisition unit 112, a transaction acquisition unit 113, and an information determination unit 114.
A height determining unit 111, configured to send a block height query request for a block chain to the block link node, and receive a maximum block height returned by the block chain node according to the block height query request;
a block obtaining unit 112, configured to send a block query request for a kth block to the block link node in a traversing manner, and receive a kth block returned by the block chain node according to the block query request for the kth block; k is a positive integer less than the maximum block height;
a transaction obtaining unit 113, configured to obtain block resource exchange transaction information associated with both the target digital resource type set and the decentralized resource exchange contract set in the kth block;
the information determining unit 114 is configured to determine, as M historical resource exchange transaction information, the block resource exchange transaction information acquired from each block until each block in the blockchain is traversed.
The specific implementation manner of the height determining unit 111, the block acquiring unit 112, the transaction acquiring unit 113, and the information determining unit 114 may be referred to the specific description of step S101 in the embodiment corresponding to fig. 3, and will not be described herein.
Wherein the kth block contains N transaction messages; one transaction information includes a contract address, an event signature, and transaction execution data;
the transaction acquisition unit 113 includes: a traversal subunit 1131, a first determination subunit 1132, a first execution subunit 1133, a second determination subunit 1134, and a second execution subunit 1135.
A traversing subunit 1131, configured to traverse the N transaction information and sequentially obtain the j transaction information; j is a positive integer less than or equal to N;
a first determining subunit 1132, configured to determine, according to the contract address and the event signature included in the jth transaction information, a relationship result between the jth transaction information and the decentralized resource exchange contract set;
the first execution subunit 1133 is configured to continuously obtain the j+1th transaction information if the relationship result between the j-th transaction information and the decentralized resource exchange contract set is a non-association result;
a second determining subunit 1134, configured to determine, if the relationship result between the jth transaction information and the decentralized resource exchange contract set is a correlation result, a relationship result between the jth transaction information and the target digital resource type set according to the transaction execution data included in the jth transaction information;
The second execution subunit 1135 is configured to continuously obtain the j+1th transaction information if the relationship result between the j-th transaction information and the target digital resource type set is a non-association result;
the second execution subunit 1135 is further configured to, if the relationship result between the jth transaction information and the target digital resource type set is an association result, mark the jth transaction information, and continuously obtain the (j+1) th transaction information until the N transaction information is traversed, and determine the transaction execution data included in the marked transaction information as block resource exchange transaction information associated with both the target digital resource type set and the decentralized resource exchange contract set in the kth block.
The specific implementation manners of the traversing subunit 1131, the first determining subunit 1132, the first executing subunit 1133, the second determining subunit 1134, and the second executing subunit 1135 may be referred to the specific description of the steps S201 to S207 in the embodiment corresponding to fig. 5, and are not repeated here.
The decentralized resource exchange contract set comprises L decentralized resource exchange contracts, wherein L is a positive integer;
the first determining subunit 1132 is specifically further configured to obtain a contract address included in the jth transaction information, and obtain decentralized compound contract addresses corresponding to the L decentralized resource exchange contracts respectively; if the L decentralised compound contract addresses do not have the same contract address as the contract address contained in the j transaction information, determining that the relation result of the j transaction information and the decentralised resource exchange contract set is an unassociated result; if the L decentralized compound contract addresses contain the decentralized compound contract addresses which are the same as the contract addresses contained in the j transaction information, acquiring a resource exchange event corresponding to the contract addresses contained in the j transaction information, and determining an event hash corresponding to the resource exchange event; if the event hash is not equal to the event signature contained in the j transaction information, determining that the relation result of the j transaction information and the decentralised resource exchange contract set is an unassociated result; if the event hash is equal to the event signature contained in the j transaction information, determining the relation result of the j transaction information and the decentralised resource exchange contract set as the association result.
The specific implementation manner of the first determining subunit 1132 may refer to the specific description of step 203 in the embodiment corresponding to fig. 5, and will not be described herein.
The target digital resource type set comprises H digital resource types, wherein H is a positive integer;
the second determining subunit 1134 is specifically configured to perform resource type search on the transaction execution data included in the jth transaction information, so as to obtain an exchange digital resource type; if the H digital resource types do not have the same digital resource types as the exchange digital resource types, determining that the relation result of the j transaction information and the target digital resource type set is an unassociated result; if the H digital resource types have the same digital resource types as the exchange digital resource types, determining the relation result of the j transaction information and the target digital resource type set as the association result.
The specific implementation manner of the second determining subunit 1134 may refer to the specific description of step S205 in the embodiment corresponding to fig. 5, which is not repeated herein.
Wherein the M historical resource exchange transaction information comprises historical resource exchange transaction information M i I is a positive integer less than or equal to M;
The structure conversion module 12 includes: contract determining section 121, data analyzing section 122, and data screening section 123.
A contract determining unit 121 for determining exchange transaction information M with historical resources i Corresponding associated decentralized resource exchange contracts; the associated decentralized resource exchange contract belongs to a decentralized resource exchange contract set;
a data parsing unit 122 for exchanging transaction information M for historical resources through a binary contract interface corresponding to the associated decentralized resource exchanging contract i Data analysis is carried out to obtain historical resource exchange transaction information M i Exchanging information by corresponding analysis resources; the analysis resource exchange information comprises object attribute data corresponding to at least two information object attributes;
a data filtering unit 123 for performing attribute filtering processing on the analysis resource exchange information according to the target information object attribute corresponding to the target information structure to obtain a history resource exchangeTrade information M i Corresponding historical resource exchange information, exchanging transaction information M for the historical resource i The corresponding historical resource exchange information is added to the resource exchange information set.
The specific implementation manner of the contract determining unit 121, the data parsing unit 122 and the data filtering unit 123 may refer to the specific description of step S101 in the embodiment corresponding to fig. 3, and will not be described herein.
Wherein, the above-mentioned data processing apparatus 1, further include: a first detection module 15.
The first detection module 15 is configured to acquire a block to be uplinked when it is determined that the blockchain network passes through consensus of the block to be uplinked;
the first detection module 15 is further configured to perform transaction inquiry processing on the to-be-uplink block according to the decentralized resource exchange contract set and the target digital resource type set, so as to obtain a transaction inquiry result;
the first detection module 15 is further configured to determine that the blockchain network is detected to perform uplink processing on the target resource exchange transaction if the transaction query result indicates that the target resource exchange transaction is included in the block to be uplink.
The specific implementation manner of the first detection module 15 may refer to the optional description of step S102 in the embodiment corresponding to fig. 3, which is not repeated here.
Wherein, the above-mentioned data processing apparatus 1, further include: a second detection module 16.
A second detection module 16, configured to synchronize, when it is detected by the contract event detector that the target decentralized resource switching contract generates a decentralized resource switching event according to a blockchain transaction, decentralized resource switching event information corresponding to the decentralized resource switching event; the decentralized resource exchange event information comprises an event resource exchange type; the target decentralised resource exchange contract belongs to a decentralised resource exchange contract set;
The second detection module 16 is further configured to determine that the blockchain network is detected to perform uplink processing on the target resource exchange transaction by using the blockchain transaction as the target resource exchange transaction if the event resource exchange type belongs to the target digital resource type set.
The specific implementation manner of the second detection module 16 may refer to the optional description of step S102 in the embodiment corresponding to fig. 3, which is not repeated here.
Wherein, the above-mentioned data processing apparatus 1, further include: the detector configuration module 17.
A detector configuration module 17 for receiving a decentralised configuration request; the decentralised configuration request comprises a decentralised compound contract address corresponding to a decentralised resource exchange contract contained in the decentralised resource exchange contract set;
the detector configuration module 17 is further configured to generate a contract event detector corresponding to the decentralized resource switching contract set according to the decentralized contract address; the contract event detector is used for synchronizing the decentralized resource exchange event information corresponding to the decentralized resource exchange event when detecting that the decentralized resource exchange contract contained in the decentralized resource exchange contract set generates the decentralized resource exchange event.
The specific implementation of the detector configuration module 17 may refer to the optional description of step S102 in the embodiment corresponding to fig. 3, which is not repeated here.
Each resource exchange information contained in the resource exchange information set contains a resource exchange type and exchange occurrence time;
the generation module 14 includes: a screening unit 141, a classifying unit 142, and a data statistics unit 143.
A screening unit 141, configured to screen, when receiving a historical resource value request including a target digital resource type and a historical time period, resource exchange information whose exchange occurrence time is within the historical time period from the primary screening resource exchange information, as primary screening resource exchange information;
a classification unit 142, configured to classify the primary screening resource exchange information according to the exchange occurrence time, to obtain at least two classified resource exchange information sets; the exchange occurrence time contained in the primary screening resource exchange information belonging to the same classified resource exchange information set is the same;
a data statistics unit 143, configured to perform resource exchange statistics processing on at least two classified resource exchange information sets, respectively, to determine resource value data corresponding to the target digital resource types at least two exchange occurrence times, respectively;
The data statistics unit 143 is further configured to determine resource value data corresponding to at least two exchange occurrence times as at least two historical resource value data, and determine the at least two historical resource value data as resource value stage data.
The specific implementation manner of the filtering unit 141, the classifying unit 142, and the data statistics unit 143 may refer to the specific description of step S103 in the embodiment corresponding to fig. 3, which is not described herein.
Wherein, the above-mentioned data processing apparatus 1, further include: the graph rendering module 18.
A graph rendering module 18 for receiving a resource value change graph request for resource value phase data; the resource value change map request contains a resource value change map type;
the graph rendering module 18 is further configured to determine a graph rendering manner and graph rendering data attribute that match the resource value change graph type;
the graph rendering module 18 is further configured to generate graph rendering resource change data corresponding to the graph rendering data attribute according to the resource value phase data, and perform image rendering on the graph rendering resource change data according to a graph rendering mode to obtain a resource value change graph corresponding to the resource value change graph type.
The specific implementation of the graph rendering module 18 may refer to the optional description of step S103 in the embodiment corresponding to fig. 3, which is not repeated here.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 8, the data processing apparatus 1 in the embodiment corresponding to fig. 7 described above may be applied to a computer device 10000, and the computer device 10000 may include: processor 1001, network interface 1004, and memory 1005, and the above-mentioned computer device 10000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 8, an operating system, a network communication module, a user interface module, and a device control application may be included in a memory 1005, which is a type of computer-readable storage medium.
In the computer device 10000 as shown in fig. 8, the network interface 1004 may provide a network communication network element; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
obtaining M pieces of historical resource exchange transaction information in a blockchain, carrying out structural information conversion processing on the M pieces of historical resource exchange transaction information to obtain M pieces of historical resource exchange information with target information structures, and adding the M pieces of historical resource exchange information into a resource exchange information set; m is a positive integer; the historical resource exchange transaction information is used for recording the processing result of the blockchain network for calling the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
when detecting that the blockchain network carries out uplink processing on target resource exchange transaction, obtaining target resource exchange transaction information corresponding to the target resource exchange transaction, carrying out structural information conversion processing on the target resource exchange transaction information to obtain detection resource exchange information with a target information structure, and adding the detection resource exchange information into a resource exchange information set; a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
When a historical resource value request containing a target digital resource type and a historical time period is received, generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set; the resource value phase data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to a historical time period; the target digital resource type belongs to a set of target digital resource types.
It should be understood that the computer device 10000 described in the embodiments of the present application may perform the description of the data processing method in any of the foregoing embodiments corresponding to fig. 3 and 5, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiments of the present application further provide a computer readable storage medium, where the computer readable storage medium stores a computer program executed by the aforementioned data processing apparatus 1, where the computer program includes program instructions, when executed by the processor, can execute the description of the data processing method in any of the corresponding embodiments of fig. 3 and 5, and therefore, the description will not be repeated herein. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
The computer readable storage medium may be the data processing apparatus provided in any one of the foregoing embodiments or an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the computer device. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
Furthermore, it should be noted here that: embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions to cause the computer device to perform the method provided by any of the corresponding embodiments of fig. 3 and 5 above.
The terms first, second and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied as electronic hardware, as a computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of network elements in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the solution. The skilled person may use different methods for implementing the described network elements for each specific application, but such implementation should not be considered beyond the scope of the present application.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (15)

1. A blockchain-based data processing method, comprising:
obtaining M pieces of historical resource exchange transaction information in a blockchain, carrying out structural information conversion processing on the M pieces of historical resource exchange transaction information to obtain M pieces of historical resource exchange information with target information structures, and adding the M pieces of historical resource exchange information into a resource exchange information set; m is a positive integer; the historical resource exchange transaction information is used for recording the processing result of the blockchain network for calling the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
when detecting that a blockchain network carries out uplink processing on target resource exchange transaction, obtaining target resource exchange transaction information corresponding to the target resource exchange transaction, carrying out structural information conversion processing on the target resource exchange transaction information to obtain detection resource exchange information with the target information structure, and adding the detection resource exchange information into the resource exchange information set; a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
When a historical resource value request containing a target digital resource type and a historical time period is received, generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set; the resource value stage data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to the historical time period; the target digital resource type belongs to the set of target digital resource types.
2. The method of claim 1, wherein the obtaining the M historical resource exchange transaction information in the blockchain comprises:
sending a block height query request for a block chain to a block chain link point, and receiving the maximum block height returned by the block chain node according to the block height query request;
traversing to send a block query request for a kth block to the blockchain node, and receiving the kth block returned by the blockchain node according to the block query request for the kth block; k is a positive integer less than the maximum block height;
Acquiring block resource exchange transaction information associated with the target digital resource type set and the decentralised resource exchange contract set in the kth block;
until each block in the block chain is traversed, determining the block resource exchange transaction information acquired from each block as M historical resource exchange transaction information.
3. The method of claim 2, wherein the kth block contains N transaction messages; one transaction information includes a contract address, an event signature, and transaction execution data;
the obtaining block resource exchange transaction information associated with the target digital resource type set and the de-centralized resource exchange contract set in the kth block includes:
traversing the N transaction information and sequentially acquiring the j transaction information; j is a positive integer less than or equal to N;
determining a relation result of the j transaction information and the decentralised resource exchange contract set according to the contract address and the event signature contained in the j transaction information;
if the relation result of the j transaction information and the decentralised resource exchange contract set is a non-association result, continuing to acquire j+1th transaction information;
If the relation result of the j transaction information and the decentralised resource exchange contract set is an association result, determining the relation result of the j transaction information and the target digital resource type set according to transaction execution data contained in the j transaction information;
if the relation result of the j transaction information and the target digital resource type set is a non-association result, continuing to acquire j+1 transaction information;
if the relation result of the j transaction information and the target digital resource type set is an association result, marking the j transaction information, continuing to acquire the j+1st transaction information until the N transaction information is traversed, and determining the transaction execution data contained in the marked transaction information as block resource exchange transaction information associated with the target digital resource type set and the decentralised resource exchange contract set in the k block.
4. The method of claim 3, wherein the set of decentralized resource exchange contracts comprises L decentralized resource exchange contracts, L being a positive integer;
the determining the relation result between the j transaction information and the decentralised resource exchange contract set according to the contract address and the event signature contained in the j transaction information comprises the following steps:
Acquiring contract addresses contained in the j transaction information, and acquiring decentralized compound contract addresses respectively corresponding to the L decentralized resource exchange contracts;
if the L decentralised compound contract addresses do not have the same contract address as the contract address contained in the j transaction information, determining that the relation result between the j transaction information and the decentralised resource exchange contract set is an unassociated result;
if the L decentralized compound contract addresses contain the decentralized compound contract addresses which are the same as the contract addresses contained in the j transaction information, acquiring a resource exchange event corresponding to the contract addresses contained in the j transaction information, and determining an event hash corresponding to the resource exchange event;
if the event hash is not equal to the event signature contained in the j-th transaction information, determining that the relation result of the j-th transaction information and the decentralised resource exchange contract set is an unassociated result;
and if the event hash is equal to the event signature contained in the jth transaction information, determining that the relation result of the jth transaction information and the decentralised resource exchange contract set is an association result.
5. The method of claim 3, wherein the set of target digital resource types comprises H digital resource types, H being a positive integer;
The determining a relationship result between the jth transaction information and the target digital resource type set according to the transaction execution data contained in the jth transaction information comprises the following steps:
searching the resource type of transaction execution data contained in the j transaction information to obtain an exchange digital resource type;
if the H digital resource types do not have the same digital resource types as the exchange digital resource types, determining that the relation result of the j transaction information and the target digital resource type set is an unassociated result;
and if the H digital resource types have the same digital resource types as the exchange digital resource types, determining that the relation result of the j transaction information and the target digital resource type set is an association result.
6. The method of claim 1, wherein the M historical resource exchange transaction information includes historical resource exchange transaction information M i I is a positive integer less than or equal to M;
the step of performing structured information conversion processing on the M historical resource exchange transaction information to obtain M historical resource exchange information with a target information structure, and adding the M historical resource exchange information to a resource exchange information set includes:
Determining exchange of transaction information M with the historical resource i Corresponding associated decentralized resource exchange contracts; the associated decentralized resource switching contract belongs to the decentralized resource switching contract set;
exchanging transaction information M for the historical resources through a binary contract interface corresponding to the associated decentralized resource exchange contract i Data analysis is carried out to obtain the historical resource exchange transaction information M i Exchanging information by corresponding analysis resources; the analysis resource exchange information comprises object attribute data corresponding to at least two information object attributes;
performing attribute filtering processing on the analysis resource exchange information according to the target information object attribute corresponding to the target information structure to obtain the historical resource exchange transaction information M i Corresponding historical resource exchange information, exchanging transaction information M for the historical resource i The corresponding historical resource exchange information is added to the resource exchange information set.
7. The method as recited in claim 1, further comprising:
when determining that a block chain network passes through the consensus of a block to be uplinked, acquiring the block to be uplinked;
carrying out transaction inquiry processing on the block to be uplink according to the decentralised resource exchange contract set and the target digital resource type set to obtain a transaction inquiry result;
And if the transaction inquiry result indicates that the block to be uplink contains the target resource exchange transaction, determining that the blockchain network is detected to perform uplink processing on the target resource exchange transaction.
8. The method as recited in claim 1, further comprising:
synchronizing the decentralized resource exchange event information corresponding to a decentralized resource exchange event when a contract event detector detects that a target decentralized resource exchange contract generates the decentralized resource exchange event according to a blockchain transaction; the decentralized resource exchange event information comprises an event resource exchange type; the target decentralised resource exchange contract belongs to the decentralised resource exchange contract set;
and if the event resource exchange type belongs to the target digital resource type set, taking the blockchain transaction as a target resource exchange transaction, and determining that the blockchain network is detected to perform uplink processing on the target resource exchange transaction.
9. The method as recited in claim 8, further comprising:
receiving a decentralised configuration request; the decentralised configuration request comprises a decentralised compound contract address corresponding to a decentralised resource exchange contract contained in a decentralised resource exchange contract set;
Generating a contract event detector corresponding to the decentralized resource exchange contract set according to the decentralized contract address; the contract event detector is used for synchronizing the decentralized resource exchange event information corresponding to the decentralized resource exchange event when detecting that the decentralized resource exchange contract contained in the decentralized resource exchange contract set generates the decentralized resource exchange event.
10. The method of claim 1, wherein each resource exchange information contained in the set of resource exchange information comprises a resource exchange type and an exchange occurrence time;
when receiving a historical resource value request containing a target digital resource type and a historical time period, generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set, wherein the resource value stage data comprises the following steps:
when a historical resource value request containing a target digital resource type and a historical time period is received, screening resource exchange information with exchange occurrence time in the historical time period from the primary screening resource exchange information, and taking the resource exchange information as primary screening resource exchange information;
Classifying the primary screening resource exchange information according to the exchange occurrence time to obtain at least two classified resource exchange information sets; the exchange occurrence time contained in the primary screening resource exchange information belonging to the same classified resource exchange information set is the same;
respectively carrying out resource exchange statistical processing on the at least two classified resource exchange information sets, and determining resource value data respectively corresponding to the target digital resource types in at least two exchange occurrence times;
and determining the resource value data corresponding to the at least two exchange occurrence times as at least two historical resource value data, and determining the at least two historical resource value data as resource value stage data.
11. The method as recited in claim 1, further comprising:
receiving a resource value change map request for the resource value phase data; the resource value change graph request comprises a resource value change graph type;
determining a graph rendering mode and graph rendering data attribute matched with the resource value change graph type;
generating graph rendering resource change data corresponding to the graph rendering data attribute according to the resource value stage data, and performing image rendering on the graph rendering resource change data according to the graph rendering mode to obtain a resource value change graph corresponding to the resource value change graph type.
12. A blockchain-based data processing device, comprising:
the acquisition module is used for acquiring M historical resource exchange transaction information in the blockchain;
the structure conversion module is used for carrying out structural information conversion processing on the M historical resource exchange transaction information to obtain M historical resource exchange information with a target information structure, and adding the M historical resource exchange information into a resource exchange information set; m is a positive integer; the historical resource exchange transaction information is used for recording the processing result of the blockchain network for calling the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
the detection conversion module is used for acquiring target resource exchange transaction information corresponding to target resource exchange transaction when detecting that the blockchain network carries out uplink processing on the target resource exchange transaction, carrying out structural information conversion processing on the target resource exchange transaction information to obtain detection resource exchange information with the target information structure, and adding the detection resource exchange information into the resource exchange information set; a target resource exchange transaction is used for indicating the blockchain network to call the decentralized resource exchange contract in the decentralized resource exchange contract set to perform resource exchange processing on the digital resources of different digital resource types in the target digital resource type set;
The generation module is used for generating resource value stage data corresponding to the target digital resource type in the historical time period according to the resource exchange information set when receiving the historical resource value request containing the target digital resource type and the historical time period; the resource value stage data comprises at least two historical resource value data; the historical resource value data is used for representing the resource value condition of the target digital resource type corresponding to a historical time node; the historical time node belongs to the historical time period; the target digital resource type belongs to the set of target digital resource types.
13. A computer device, comprising: a processor, a memory, and a network interface;
the processor is connected to the memory, the network interface for providing data communication functions, the memory for storing program code, the processor for invoking the program code to perform the method of any of claims 1-11.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded by a processor and to perform the method of any of claims 1-11.
15. A computer program product comprising computer programs/instructions which, when executed by a processor, are adapted to carry out the method of any one of claims 1-11.
CN202311424842.5A 2023-10-27 2023-10-27 Block chain-based data processing method, device, equipment and readable storage medium Pending CN117495473A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311424842.5A CN117495473A (en) 2023-10-27 2023-10-27 Block chain-based data processing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311424842.5A CN117495473A (en) 2023-10-27 2023-10-27 Block chain-based data processing method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117495473A true CN117495473A (en) 2024-02-02

Family

ID=89671809

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311424842.5A Pending CN117495473A (en) 2023-10-27 2023-10-27 Block chain-based data processing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117495473A (en)

Similar Documents

Publication Publication Date Title
CN110851879B (en) Method, device and equipment for infringement and evidence preservation based on evidence preservation block chain
CA3087297A1 (en) Blockchain-based data verification method and apparatus, and electronic device
CN113254466B (en) Data processing method and device, electronic equipment and storage medium
EP3685545B1 (en) Blockchain-based systems and methods for communicating, storing and processing data over a blockchain network
CN107798037A (en) The acquisition methods and server of user characteristic data
CN112613877B (en) Intelligent contract triggering method and device applied to block chain network and related equipment
CN111488372A (en) Data processing method, device and storage medium
CN112003940B (en) Payment network state processing method and server based on block chain and online service
CN111709817A (en) Order data processing method and device, computer readable medium and electronic equipment
CN111209339B (en) Block synchronization method, device, computer and storage medium
CN109255587A (en) A kind of cooperative processing method and device of operational data
CN115114372A (en) Data processing method, device and equipment based on block chain and readable storage medium
CN113037505B (en) Method and system for realizing trusted Web application
CN111343212B (en) Message processing method, device, equipment and storage medium
CN117495473A (en) Block chain-based data processing method, device, equipment and readable storage medium
CN116862679B (en) Block chain-based data processing method, device, equipment and readable storage medium
CN116070191A (en) Information processing method and device, storage medium, and program product
CN116028982A (en) Processing method, device and system based on non-homogeneous general evidence
KR102044394B1 (en) Method for providing lock-chain based direct mileage service from producer to end-user
Leite et al. Assuring M2M Secure Transactions via Blockchain and Smart Contracts
Detho Developing a system for securely time-stamping and visualizing the changes made to online news content
CN117014452A (en) Block chain-based data processing method and related products
CN117453654A (en) Version processing method and device based on block chain and related equipment
dos Santos DClaims: A Censorship-Resistant Web Annotations System
CN117891882A (en) Data management system, method, equipment and storage medium based on blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication