CN116862679B - 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
CN116862679B
CN116862679B CN202311129929.XA CN202311129929A CN116862679B CN 116862679 B CN116862679 B CN 116862679B CN 202311129929 A CN202311129929 A CN 202311129929A CN 116862679 B CN116862679 B CN 116862679B
Authority
CN
China
Prior art keywords
resource
digital
target
exchange
value change
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311129929.XA
Other languages
Chinese (zh)
Other versions
CN116862679A (en
Inventor
陈自民
梁军
蓝虎
莫洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202311129929.XA priority Critical patent/CN116862679B/en
Publication of CN116862679A publication Critical patent/CN116862679A/en
Application granted granted Critical
Publication of CN116862679B publication Critical patent/CN116862679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a data processing method, a device, equipment and a readable storage medium based on a blockchain, wherein the method comprises the following steps: when detecting that the decentralized resource exchange contract deployed in the blockchain network generates resource exchange event information associated with the target digital resource type set, adding the resource exchange event information into the event information set; when the information acquisition time length reaches a target period, acquiring resource exchange order information which is generated by a centralized resource exchange server in the target period and is associated with a target digital resource set; and generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in a target period according to the event information set and the resource exchange order information. The application ensures the reliability and accuracy of the resource value change data for reflecting the resource value change condition of the digital resource in the blockchain.

Description

Block chain-based data processing method, device, equipment and readable storage medium
Technical Field
The present application 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
With the development of blockchain technology, the use of blockchains is gradually increasing, people are increasingly frequently moving on blockchains, and the digital on-chain resource utilization of the under-chain assets is widely used in many fields currently, namely, the under-chain assets bind unique on-chain digital resources in a blockchain network, and the on-chain digital resources are used for proving ownership of the under-chain assets.
Asset standards on a blockchain are various, digital resource types corresponding to digital resources communicated in the blockchain are also various, and the value of the digital resources corresponding to different digital resource types is different. Users often desire to first learn about the digital resource's market during the last period of time when they are exchanging digital resources. At present, data representing quotations of digital resources are often generated by a resource exchange according to transaction conditions processed by the resource exchange and then provided for users in the form of charts and the like. However, for the decentralized resource exchange, the use threshold is generally higher, the transaction amount is smaller than that of the centralized resource exchange, and the real-time resource exchange transaction on the chain can generate larger sliding points, so that the market quotation data provided by the decentralized resource exchange can not completely reflect the market quotation of the digital resource in the whole market; while the centralized resource exchange has a large transaction amount, the market quotation reflected by the provided market quotation data can approach the whole market quotation in most cases, the provided market quotation data has the risk of being tampered because the order data of the centralized resource exchange is not transparent. That is, it is difficult for a user to obtain market data that is both ready and accurate to represent the market for digital resources across the blockchain market.
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 reliability and accuracy of resource value change data for reflecting the resource value change condition of digital resources in the blockchain.
In one aspect, an embodiment of the present application provides a data processing method based on a blockchain, including:
when detecting that the decentralized resource exchange contract deployed in the blockchain network generates resource exchange event information associated with the target digital resource type set, adding the resource exchange event information into the event information set; the resource exchange event information is used for indicating the blockchain network to exchange resources between the first digital resources stored in the address on the first chain and the second digital resources stored in the address on the second chain; the digital resource types respectively corresponding to the first digital resource and the second digital resource are different; the digital resource types respectively corresponding to the first digital resource and the second digital resource belong to a target digital resource type set;
when the information acquisition time length reaches a target period, acquiring resource exchange order information which is generated by a centralized resource exchange server in the target period and is associated with a target digital resource set; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; the types of the digital resources respectively corresponding to the third digital resource and the fourth digital resource are different; the digital resource types respectively corresponding to the third digital resource and the fourth digital resource belong to a target digital resource type set;
And generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in a target period according to the event information set and the resource exchange order information.
In one aspect, an embodiment of the present application provides a data processing apparatus based on a blockchain, including:
the first acquisition module is used for adding the resource exchange event information into the event information set when detecting that the decentralized resource exchange contract deployed in the blockchain network generates the resource exchange event information associated with the target digital resource type set; the resource exchange event information is used for indicating the blockchain network to exchange resources between the first digital resources stored in the address on the first chain and the second digital resources stored in the address on the second chain; the digital resource types respectively corresponding to the first digital resource and the second digital resource are different; the digital resource types respectively corresponding to the first digital resource and the second digital resource belong to a target digital resource type set;
the second acquisition module is used for acquiring resource exchange order information which is generated by the centralized resource exchange server in the target period and is associated with the target digital resource set when the information acquisition time length reaches the target period; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; the types of the digital resources respectively corresponding to the third digital resource and the fourth digital resource are different; the digital resource types respectively corresponding to the third digital resource and the fourth digital resource belong to a target digital resource type set;
And the generation module is used for generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in a target period according to the event information set and the resource exchange order information.
Wherein the target digital resource type set comprises a digital resource type M; the number of resource exchange order information is one or more;
a generation module, comprising:
an information acquisition unit for acquiring resource exchange event information associated with the digital resource type M from the event information set as target resource exchange event information;
the information acquisition unit is also used for acquiring the resource exchange order information related to the digital resource type M from the resource exchange order information as target resource exchange order information;
the generating unit is used for generating resource value change data of the digital resource type M in a target period according to the target resource exchange event information and the target resource exchange order information.
Wherein the generating unit includes:
the weighting subunit is used for acquiring a first weight corresponding to the decentralized resource exchange contract and acquiring a second weight corresponding to the centralized resource exchange server;
the weighting subunit is further configured to perform weighting processing on the target resource exchange event information according to the first weight, so as to obtain weighted resource exchange event information;
The weighting subunit is further used for carrying out weighting processing on the target resource exchange order information according to the second weight to obtain weighted resource exchange order information;
and the statistics subunit is used for carrying out data statistics processing on the weighted resource exchange event information and the weighted resource exchange order information to obtain resource value change data corresponding to the digital resource type M in the target period.
Wherein the target digital resource type set comprises a digital resource type N;
the above data processing apparatus further includes:
the receiving module is used for receiving a resource value change request aiming at the digital resource type N, which is sent by the first terminal; the resource value change request includes a change period;
the period acquisition module is used for determining X periods corresponding to the change time period, acquiring resource value change data corresponding to the digital resource type N in the X periods respectively, and obtaining X resource value change data; x is a positive integer;
the rendering module is used for rendering the resource value change graphs of the X resource value change data to obtain the resource value change graphs; the X periods comprise target periods; the resource value change graph is used for presenting the resource value change condition of the digital resource type N in the change time period.
Wherein the resource value change request further comprises a login state;
the above data processing apparatus further includes:
the login verification module is used for performing legal verification processing on the login state to obtain a legal verification result;
the login verification module is further used for executing the steps of determining X periods corresponding to the change time period if the login state is indicated as legal login state by the legal verification result, obtaining resource value change data corresponding to the digital resource type N in the X periods respectively, and obtaining X resource value change data;
and the login verification module is also used for sending login error prompt information to the first terminal if the login state is indicated as the illegal login state by the legal verification result.
Wherein the resource value change request further comprises a resource value change graph type; the X resource value change data comprise resource change data corresponding to Y data attributes respectively, wherein Y is a positive integer;
a rendering module, comprising:
the data determining unit is used for determining Z data attributes matched with the resource value change graph type; z is a positive integer; z data attributes belong to Y data attributes;
the data determining unit is further used for acquiring resource change data corresponding to the Z data attributes from the resource change data corresponding to the Y data attributes respectively, and taking the resource change data as target resource change data;
And the image rendering unit is used for determining an image rendering mode matched with the resource value change image type, and performing image rendering on the target resource change data according to the image rendering mode to obtain a resource value change image corresponding to the resource value change image type.
Wherein, first acquisition module includes:
a detection unit for synchronizing resource exchange event information from the decentralized resource exchange contracts by the contract event detector when the decentralized resource exchange contracts deployed in the blockchain network are detected by the contract event detector to generate resource exchange event information associated with the target digital resource type set;
and the synchronization unit is used for adding the synchronized resource exchange event information into the event information set.
Wherein, above-mentioned data processing apparatus still includes:
the first configuration module is used for receiving a decentralization configuration request sent by the second terminal; the decentralised configuration request comprises a decentralised compound contract address corresponding to the target digital resource type set and the decentralised resource exchange contract;
the first configuration module is further used for 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; the contract event detector is to synchronize the resource exchange event information upon detecting that the decentralized resource exchange contract generates resource exchange event information associated with the set of target digital resource types.
The decentralised configuration request also comprises request initiation object information; the above data processing apparatus further includes:
the permission verification module is used for carrying out configuration permission verification processing according to the request initiation object information to obtain a configuration permission verification result;
the authority verification module is further configured to execute a step of generating a contract event detector corresponding to the decentralised resource exchange contract according to the decentralised combined contract address and the target digital resource type set if the configuration authority verification result is a configuration authority verification passing result;
and the permission verification module is also used for sending permission verification failing prompt information to the second terminal if the configuration permission verification result is the configuration permission verification failing result.
Wherein, the second acquisition module includes:
when the information acquisition time length reaches a target period, reading centralized data interface information and a target digital resource type set from a configuration database;
sending a data query request for a target period to a centralized resource exchange server according to the centralized data interface information, and receiving order information generated in the target period and returned by the centralized resource exchange server;
and screening order information associated with the target digital resource type set from the order information, and taking the order information as resource exchange order information associated with the target digital resource set generated by the centralized resource exchange server in a target period.
Wherein, above-mentioned data processing apparatus still includes:
the second configuration module is used for receiving a centralized configuration request sent by the third terminal; the centralized configuration request comprises centralized data interface information and a target digital resource type set;
the second configuration module is further configured to store the centralized data interface information and the set of target digital resource types to a configuration database.
In one aspect, an embodiment of the present application provides a computer device, 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, embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium, the computer instructions being read from the computer-readable storage medium by a processor of a computer device, the computer instructions being executed by the processor, causing the computer device to perform a method according to an embodiment of the present application.
In the embodiment of the application, the decentralized resource exchange contract deployed in the blockchain network is continuously detected, and the resource exchange event information is added into the event information set every time the decentralized resource exchange contract is detected to generate the resource exchange event information related to the target digital resource type set; the resource exchange event information is used for indicating the blockchain network to exchange resources between a first digital resource stored in the address on the first chain and a second digital resource stored in the address on the second chain; then when the information acquisition time length reaches a target period, acquiring resource exchange order information which is generated by a centralized resource exchange server in the target period and is associated with a target digital resource set; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; and finally, generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in a target period according to the event information set and the resource exchange order information. Therefore, by the method provided by the embodiment of the application, the resource exchange event information generated by the decentralized resource exchange contract and the resource exchange order information of the centralized resource exchange server can be simultaneously acquired, the resource value change data of each digital resource type can be generated by integrating the resource exchange event information and the resource exchange order information, the resource value change data can be ensured to accurately reflect the resource value change condition of the digital resource in the blockchain, the data acquisition process is open and transparent, and the reliability of the resource value change data can be ensured.
Drawings
In order to more clearly illustrate the embodiments of the 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, it being obvious that the drawings in the following description are only some embodiments of the 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 generating resource value change data according to an embodiment of the present application;
FIG. 2b 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 block chain based data processing method according to an embodiment of the present application;
FIG. 4 is a flowchart of another block chain based data processing method according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of generating a resource value change chart according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 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 completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the 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
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, or may be connected through other connection manners, which is not limited herein.
It can be appreciated that the data processing method based on the blockchain provided by the embodiment 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, etc.
It will be appreciated that in the specific embodiments of the present application, related data such as transaction data is concerned, and when the above embodiments of the present application are applied to specific products or technologies, user approval or consent is required, and the collection, use and processing of related data is required to comply with the 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 business 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.
It will be appreciated that, in addition to transferring between digital resources of the same digital resource type by the resource client, the target object may also exchange 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 exchange resources by the resource client with or without a centralized resource exchange to a digital resource B, where the digital resource a and the digital resource B are of different digital resource types. The centralized resource exchange is characterized in that a third party organization is provided with a platform for providing digital resource exchange, an object is required to exchange and store own digital resources by the centralized resource exchange, and when the object needs to use the own digital resources, the object only needs to send a request to the centralized resource exchange; the essence of the decentralized resource exchange is an intelligent contract deployed in a blockchain network, an object can store digital resources in own on-chain addresses or intelligent contracts, when the digital resources are required to be used, only transactions are initiated, and the decentralized resource exchange 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 the digital resources of different digital resource types are different, and the resource values of the digital resources of the same digital resource type are also continuously changed along with the supply-demand relationship in the blockchain, if the target object cannot know the latest resource values of the digital resource a and the digital resource B in time, it is likely that a certain loss is generated in the process of resource exchange, for example, the resource value of one digital resource a in the current blockchain can be the resource values of two digital resources B, and if the target object has 5 digital resources a, it is reasonable to exchange 10 digital resources B.
Therefore, in order to provide a better resource exchange experience for the target object and ensure the resource exchange rights of the target object, in the present application, the detection server (which may be the service background server or any service server in the service server cluster 100 shown in fig. 1) may acquire resource exchange information of the digital resources associated with the target digital resource type set in the decentralized resource clearinghouse and the centralized resource clearinghouse, and then sort and generate resource value change data corresponding to each digital resource type included in the target digital resource type set, where the resource value change data corresponding to each digital resource type may be used to generate a resource value change map for reflecting the resource value change situation of the digital resource type in the blockchain. Wherein the set of target digital resource types may contain one or more digital resource types. Before the target object exchanges the digital resource of the target digital resource type through the resource client running in the terminal equipment associated with the target object, a resource value change request can be sent to a service background server through the service application client running in the terminal equipment so as to request a resource value change graph for reflecting the resource value change condition of the target digital resource type in a change time period.
Specifically, the detection server may continuously detect a call condition of an decentralized resource exchange contract corresponding to the decentralized resource exchange, and add the resource exchange event information to the event information set whenever detecting that the decentralized resource exchange contract generates resource exchange event information associated with the target digital resource type set; the resource exchange event information is used for indicating the blockchain network to exchange resources between a first digital resource stored in the address on the first chain and a second digital resource stored in the address on the second chain; then when the information acquisition time length reaches a target period, acquiring resource exchange order information which is generated by a centralized resource exchange server corresponding to the centralized resource exchange in the target period and is associated with a target digital resource set; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; and finally, generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in a target period according to the event information set and the resource exchange order information.
For easy understanding of the above process, please refer to fig. 2 a-2 b, wherein the detection server 20 shown in fig. 2 a-2 b 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 b 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 central resource exchange server 23 as shown in fig. 2 a-2 b may be any of the service servers in the service server cluster 100 shown in fig. 1 described above, e.g. the central resource exchange server 23 may be the service server 100a; the terminal device 24 as shown in fig. 2 a-2 b may be any of the terminal devices in the terminal device cluster 10 shown in fig. 1 described above, e.g. the terminal device 24 may be the terminal device 10a.
Referring to fig. 2a, fig. 2a is a schematic diagram of a scenario for generating resource value change data according to an embodiment of the present application. It will be appreciated that in order to ensure that the resource value change data reflects the resource value change of the digital resource throughout the blockchain, the detection server 20 needs to obtain the exchange condition of the digital resource at the decentralized resource clearinghouse and the exchange condition of the centralized resource clearinghouse, and then integrate the two exchange conditions to generate the resource value change data. The decentralized resource clearinghouse in the blockchain network is usually in the form of an intelligent contract, i.e. the decentralized resource clearinghouse is essentially an decentralized resource clearinghouse, so the detection server 20 can obtain the digital resource's exchange condition at the decentralized resource clearinghouse by continuously detecting the event generated by the decentralized resource clearinghouse, while the centralized resource clearinghouse often provides the data query interface of the centralized resource clearinghouse used by the centralized resource clearinghouse, and the detection server 20 can obtain the digital resource's exchange condition at the centralized resource clearinghouse according to the data query interface.
As shown in fig. 2a, 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 is understood that resource exchange transaction 201 refers to a blockchain user initiated transaction for exchanging a first digital resource owned by itself for a second digital resource corresponding to another digital resource type that matches value. When the blockchain node 22 invokes the decentralized resource exchange contract 202 to perform the resource exchange transaction 201, a resource exchange event is generated, and the blockchain node 22 performs a resource exchange process on the first digital resource stored at the address on the first chain and the second digital resource stored at the address on the second chain based on the resource exchange event. During the operation of the blockchain node 22, the detection server 20 may continuously detect the decentralized resource exchange contract 202 in the blockchain node 22, and when detecting that the decentralized resource exchange contract 202 generates a resource exchange event, acquire resource exchange event information corresponding to the resource exchange event, and assume that the event information corresponding to the resource exchange transaction 201 is event information 203, the detection server 20 may acquire the event information 203 and then add the event information 203 to the event information set 204. The event information 203 may include, among other things, resource exchange information related to the resource exchange transaction 201, such as two digital resource types exchanged, an exchange ratio, an exchange number, and so forth. It will be appreciated that the set of event information 204 may include a plurality of event information, each of which is obtained when the detection server 20 detects the generation of a new resource exchange event.
As shown in fig. 2a, when the detection server 20 determines that the information acquisition duration for the blockchain node 22 (i.e., the duration of the detection of the decentralized resource switching contract 202 in the blockchain node 22) reaches the target period, a data query request 205 may be sent to the centralized resource switching server 23, where the data query request 205 is used to request resource switching order information associated with the target digital resource set generated by the centralized resource switching server in the target period, and after the centralized resource switching server 23 responds to the data query request 205, the resource switching order information 206 is returned to the detection server 20. The resource exchange order information 206 may include a plurality of order information, where the order information refers to information corresponding to an order request sent by the blockchain user and received by the centralized resource exchange server 23 to convert a third digital resource of the first target account into a fourth digital resource of another digital resource type, and may include two converted digital resource types, a conversion ratio, a conversion number, and other information.
As shown in fig. 2a, after acquiring the resource exchange order information 206, the detection server 20 acquires the event information set 204, and then performs data weighted statistics processing on the resource exchange order information 206 and the event information set 204, so as to obtain resource value change data corresponding to the digital resource type in the target period. The specific implementation process of the data weighted statistical process may be referred to as the description of step S103 in the embodiment corresponding to fig. 3 below. The resource value change data can be used for reflecting the resource value change condition of the digital resource corresponding to the digital resource type in the target period. It will be appreciated that the period may be one hour, one day, or ten minutes, and the detection server 20 may perform data statistics once each time it determines that a period is reached, to obtain the resource value change data in the period, and then store the resource value change data, so that the blockchain user can query the resource value change condition of a certain digital resource type in any period or multiple periods at any time.
Referring to fig. 2b, fig. 2b 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 24 has an association relationship with the object H, the above-mentioned service application client 25 is installed in the terminal device 24, and the object H having the authority to log in the service application client 25 can call the resource client through the service application client 25 to manage its own digital resource. Assuming that the object H wants to know the resource value change of the digital resource corresponding to the yesterday digital resource type I, the object H may send the resource value change request 207 to the detection server 20 through the service application client 25 running in the terminal device 20, and after the detection server 20 receives the resource value change request 207, the resource value change data may be converted into a chart form, and then returned to the object H, so that the object H may more intuitively know the resource value change situation of the digital resource type I.
As shown in fig. 2b, the detection server 20 determines X periods corresponding to the change period (i.e. yesterday) of the request of the object H, and if one period is two hours, the detection server 20 may acquire the resource value change data corresponding to the digital resource type I in 12 periods from 0:00 to 24:00 yesterday (the manner of acquiring the resource value change data in each period may refer to the scenario shown in fig. 2a and will not be described in detail here), and then the detection server 20 may render the resource value change map of the acquired 12 resource value change data to obtain the resource value change map. 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 to the terminal device 24, which terminal device 24 may display via the service application client 25. The object H can know the change condition of the value of the digital resource corresponding to the digital resource type I in yesterday through the resource value change chart, so as to determine whether to exchange the digital resource of the digital resource type I 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 periodically acquire the resource exchange event information generated by the decentralized resource exchange contract 202 and the resource exchange order information processed by the centralized resource server 23, and then performs weighted data statistics on the resource exchange event information, so as to obtain the resource value change data which can accurately reflect the digital resource change condition in the whole blockchain, and the whole acquisition and statistics process is public and transparent, so that the accuracy of the resource value change data is ensured.
Further, referring to fig. 3, fig. 3 is a flowchart 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, when it is detected that the decentralized resource exchange contract deployed in the blockchain network generates resource exchange event information associated with the target digital resource type set, adding the resource exchange event information to the event information set.
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 decentralizing the resource clearinghouse, where the blockchain object may send a resource swap transaction to the blockchain link point, where the resource swap transaction may include a first on-chain address, a second on-chain address, a first digital resource, and a second digital resource, and when the blockchain link point performs the resource swap transaction, the blockchain link point generates a corresponding resource swap event by decentralizing the resource swap contract, where resource swap event information corresponding to the resource swap event information is used to instruct the blockchain network to perform a resource swap 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.
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 interchange 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. Wherein, the digital resource types respectively corresponding to the first digital resource and the second digital resource are different; the digital resource types respectively corresponding to the first digital resource and the second digital resource belong to a target digital resource type set. One or more digital resource types may be included in the target digital resource type set, and it can be understood that, because the digital resource standards on the blockchain are various, the digital resource types are also numerous, and the specific detection of which digital resource types correspond to the resource value change data can be set according to the actual situation, which is not limited in this application.
It will be appreciated that the resource exchange event information may comprise a first digital resource type of the first digital resource, a second digital resource type of the second digital resource, a number of resources of the first digital resource, a number of resources of the second digital resource, that is, a value of resources between the first digital resource type and the second digital resource type in the resource exchange transaction may be known through the resource exchange event information, for example, the first digital resource comprises 5 unit digital resources of the first digital resource type, and the second digital resource comprises 10 unit digital resources of the second digital resource type, that is, the value of resources of the unit digital resource of the first digital resource type is twice the value of resources of the unit digital resource of the second digital resource type in the resource exchange transaction.
Specifically, the computer device may include a contract event detector for detecting an event of the decentralized resource exchange contract, where the contract event detector is configured to generate a resource exchange event associated with the target digital resource type set when detecting the decentralized resource exchange contract deployed in the blockchain network, and acquire resource exchange event information corresponding to the resource exchange event. Thus, when it is detected that an off-centered resource exchange contract deployed in a blockchain network generates resource exchange event information associated with a target set of digital resource types, adding the resource exchange event information to one possible implementation in the set of event information may be: synchronizing, by the contract event detector, resource exchange event information from an decentralized resource exchange contract deployed in the blockchain network when the decentralized resource exchange contract is detected by the contract event detector to generate resource exchange event information associated with the target set of digital resource types; and adding the synchronized resource exchange event information to the event information set.
Alternatively, one possible generation process of the contract event detector may be: the computer equipment receives a decentralizing configuration request sent by a second terminal; the decentralised configuration request comprises a decentralised compound contract address corresponding to a target digital resource type set and a decentralised resource exchange contract; then, the computer equipment generates 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; the contract event detector is configured to synchronize resource exchange event information upon detecting that the decentralized resource exchange contract generates resource exchange event information associated with a target set of digital resource types.
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.
It should be noted that the number of the decentralized resource exchange contracts detected by the computer device may be one or more, that is, the computer device may detect only one decentralized resource exchange contract, or may detect multiple decentralized resource exchange contracts simultaneously, and specifically detect which decentralized resource exchange contracts may be selected according to the actual situation, which is not limited in the present application herein. In addition, the resource exchange event information generated by different decentralized resource exchange contracts is to be added to different event information sets respectively, that is, one decentralized resource exchange contract corresponds to one event information set.
Step S102, when the information acquisition time length reaches a target period, acquiring resource exchange order information which is generated by a centralized resource exchange server in the target period and is associated with the target digital resource set.
Specifically, the centralized resource exchange server refers to a server used by the centralized resource exchange station to respond to account transaction requests. The centralized resource exchange is a centralized resource exchange, and is controlled by one entity, after the blockchain object registers a centralized account in the centralized resource exchange, the blockchain object needs to store own digital resources into the centralized resource exchange, and then the blockchain object can exchange resources with the centralized resource exchange through the centralized account or other centralized accounts of the centralized resource exchange, so that it can be understood that the blockchain object usually only needs to be a number in a series of blockchain accounts in the resource exchange of the centralized resource exchange, and the blockchain object cannot directly control own digital resources. The blockchain object may send a resource exchange request to the centralized resource exchange server through the centralized account, the centralized resource exchange server may consider the resource exchange request as an order, i.e. generate an order number for the resource exchange request, and generate corresponding flow information (e.g. resource balance change information) of the decentralized account corresponding to the blockchain object in response to the resource exchange request, but the centralized resource exchange server may not transfer any of the stored digital resources requested by the blockchain object. It will be appreciated that the blockchain object may perform conversion of digital resources of different digital resource types through the centralized account, at which time the blockchain object may send a resource exchange request to the centralized resource exchange server, where the resource exchange request may include the first object account, the third digital resource, and the fourth digital resource, and the blockchain object may generate a resource exchange order based on the resource exchange request, where resource exchange order information corresponding to the resource exchange order is used to instruct the centralized resource exchange server to convert the third digital resource that the first object account has into the fourth digital resource. The first object account is a centralized account corresponding to an order initiating object, and the types of digital resources respectively corresponding to the third digital resource and the fourth digital resource are different; the digital resource types respectively corresponding to the third digital resource and the fourth digital resource belong to a target digital resource type set.
Specifically, the centralized resource exchange may provide a centralized data interface, which may be used to query order information generated by the centralized resource exchange server, and the computer device may periodically obtain the order information generated by the centralized resource exchange server through the centralized data interface. Thus, when it is determined that the information acquisition duration reaches the target period, one possible implementation procedure for acquiring the resource exchange order information associated with the target digital resource set generated by the centralized resource exchange server within the information acquisition duration may be: when the information acquisition time length reaches a target period, reading centralized data interface information and a target digital resource type set from a configuration database; sending a data query request for a target period to a centralized resource exchange server according to the centralized data interface information, and receiving order information generated in the target period and returned by the centralized resource exchange server; and screening order information associated with the target digital resource type set from the order information, and taking the order information as resource exchange order information associated with the target digital resource set generated by the centralized resource exchange server in a target period.
Optionally, receiving a centralized configuration request sent by the third terminal; the centralized configuration request comprises centralized data interface information and a target digital resource type set; the centralized data interface information and the set of target digital resource types are stored to a configuration database.
It should be noted that the number of the centralized resource exchange servers requested by the computer device may be one or more, that is, the computer device may only obtain the resource exchange order information generated by one centralized resource exchange server in the target period, or may simultaneously request the resource exchange order information generated by a plurality of centralized resource exchange servers in the target period, and specifically request which centralized resource exchange servers may be selected according to the actual situation.
Step S103, according to the event information set and the resource exchange order information, generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in the target period.
Specifically, it is assumed that the target digital resource type set contains a digital resource type M; the number of resource exchange order information is one or more; then, according to the event information set and the resource exchange order information, a feasible implementation process of generating the resource value change data of each digital resource type contained in the target digital resource type set in the information acquisition duration may be: acquiring resource exchange event information associated with the digital resource type M from the event information set as target resource exchange event information; acquiring resource exchange order information associated with the digital resource type M from the resource exchange order information, and taking the resource exchange order information as target resource exchange order information; and generating resource value change data of the digital resource type M in a target period according to the target resource exchange event information and the target resource exchange order information.
According to the target resource exchange event information and the target resource exchange order information, one possible implementation process for generating the resource value change data of the digital resource type M in the target period may be: acquiring a first weight corresponding to the decentralized resource switching contract and acquiring a second weight corresponding to the centralized resource switching server; weighting the target resource exchange event information according to the first weight to obtain weighted resource exchange event information; weighting the target resource exchange order information according to the second weight to obtain weighted resource exchange order information; and carrying out data statistics processing on the weighted resource exchange event information and the weighted resource exchange order information to obtain resource value change data corresponding to the digital resource type M in the target period. For example, if the first weight corresponding to the decentralized resource exchange contract is 0.4, the second weight corresponding to the centralized resource exchange server is 0.6, and assuming that the resource value of the unit digital resource corresponding to the digital resource type M in the target resource exchange event information is 100, and the resource value of the unit digital resource corresponding to the digital resource type M in the target resource exchange order information is 110, the weighted resource value of the unit digital resource corresponding to the digital resource type M in the weighted resource exchange event information is 100×0.6=60, the weighted resource value of the unit digital resource corresponding to the digital resource type M in the weighted resource exchange order information is 110×0.4=44, and the sum of the two values is 60+44=104, so as to obtain the resource value of the unit digital resource corresponding to the digital resource type M in the block chain. Optionally, when the number of the target resource exchange event information is multiple, summing the target resource exchange event information and then averaging to obtain average resource exchange event information, and then weighting the average resource exchange event information according to the first weight to obtain weighted resource exchange event information; similarly, when the number of the target resource exchange order information is a plurality of, the target resource exchange order information can be summed up and then averaged to obtain average resource exchange order information, and then the average resource exchange order information is weighted according to the second weight to obtain weighted resource exchange order information.
The method provided by the embodiment of the application can simultaneously acquire the resource exchange event information generated by the decentralized resource exchange contract and the resource exchange order information of the centralized resource exchange server, and generates the resource value change data of each digital resource type by integrating the resource exchange event information and the resource exchange order information, so that the resource value change data can be ensured to accurately reflect the resource value change condition of the digital resource in a block chain, the data acquisition process is open and transparent, and the reliability of the resource value change data can be ensured.
Further, referring to fig. 4, fig. 4 is a flowchart illustrating another data processing method based on 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 S201 to S203:
step S201, receiving a resource value change request for the digital resource type N sent by a first terminal; the resource value change request includes a change period.
Specifically, the computer device may obtain the resource value change data of each digital resource type in the target digital resource type set in each period by using the method according to the embodiment shown in fig. 3, and the computer device may store the resource value change data obtained in each period, so as to obtain the resource value change data of the target digital resource type, such as the digital resource type N, in X periods according to the requirement of the blockchain object, to generate a resource value change map or a resource value change table that reflects the resource value change situation of the digital resource type N in X periods.
Optionally, a service application client (i.e., the service application client described in fig. 1) may be integrally installed in the first terminal, and the blockchain object may perform a resource value change request operation through the service application client, where the first terminal may generate a resource value change request after responding to the resource value change operation. In order to ensure the security of data, the resource value change request further comprises a login state, wherein the login state can be the login state of the blockchain object in the service application client, and the resource value change request aiming at the digital resource type N 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 resource value change request to obtain a legal verification result; if the legal verification result indicates that the login state is legal, executing step 202; 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.
Step S202, determining X periods corresponding to the change time period, and obtaining resource value change data corresponding to the digital resource type N in the X periods respectively to obtain X resource value change data; x is a positive integer.
Specifically, the change period may be 3 days, one day, etc., and one period may be ten minutes, one hour, one minute, etc., and may be specifically set according to practical situations, and the present application is not limited herein. Assuming that the change period is the last 24 hours and one cycle is one hour, the computer device will determine the last 24 cycles as the corresponding 24 cycles in the change period.
Step S203, rendering a resource value change graph on the X resource value change data to obtain the resource value change graph; the X cycles comprise the target cycle; the resource value change graph is used for presenting the resource value change condition of the digital resource type N in the change time period.
Specifically, the types of graphs or tables capable of reflecting the resource value change condition 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, such as 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 condition and price information of a large potential, 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.
Specifically, the computer device may draw a plurality of resource value change graphs based on the resource value change data, and the blockchain object may want to view a resource value change graph of a certain resource value change graph type, and the resource value change request sent by the computer device may further include the resource value change graph type. It can be understood that the X resource value change data includes resource change data corresponding to Y data attributes, where Y is a positive integer; rendering the resource value change map on the X resource value change data to obtain a feasible implementation process of the resource value change map, which may be: determining Z data attributes matched with the resource value change graph type; z is a positive integer; z data attributes belong to Y data attributes; acquiring resource change data corresponding to Z data attributes from the resource change data corresponding to Y data attributes respectively, and taking the resource change data as target resource change data; determining a graph rendering mode matched with the resource value change graph type, and performing image rendering on the target resource change data according to the graph rendering mode to obtain a resource value change graph corresponding to the resource value change graph type. It can be understood that the resource value change data may include data of a plurality of data attributes, such as time, exchange proportion, exchange number, etc., and only the resource change data of a part of the data attributes need to be obtained when a resource value change map corresponding to a certain resource value change map type is generated.
Alternatively, the computer device may draw multiple resource value change tables based on the resource value change data, assuming that the blockchain object wants to view a resource value change table of a certain resource value change table type, the resource value change request sent may also contain a resource value change table type. It can be understood that the X resource value change data includes resource change data corresponding to Y data attributes, where Y is a positive integer; at this time, the computer device draws a resource value change table for the X resource value change data, so as to obtain a feasible implementation process of the resource value change table, which may be: determining U data attributes matched with the resource value change graph types; u is a positive integer; the U data attribute belongs to Y data attributes; acquiring resource change data corresponding to the U data attributes from the resource change data corresponding to the Y data attributes respectively, and taking the resource change data as table resource change data; and determining a table drawing mode matched with the resource value change table type, and performing data arrangement on the table resource change data according to the table drawing mode to obtain a resource value change table corresponding to the resource value change table type.
Optionally, the image rendering process may also be performed in the first terminal, that is, the computer device directly sends the target resource change data to the first terminal, the first terminal determines a graph rendering mode matched with the resource value change graph type, and performs image rendering on the target resource change data according to the graph rendering mode to obtain a resource value change graph corresponding to the resource value change graph type.
According to the method provided by the embodiment of the application, the computer equipment can periodically acquire the transaction data of the on-chain decentralized resource exchange and the order data of the centralized resource exchange, then acquire the resource value change data after carrying out weighted data statistics on the transaction data and the order data, and then store the resource value change data locally so as to acquire the corresponding target resource change data when a user requests, and generate a resource value change graph according to the target resource change data, thereby intuitively showing more accurate resource value change conditions of digital resources for the user.
Further, for ease of understanding, please refer to fig. 5, fig. 5 is a schematic flow chart of generating a resource value change chart according to an embodiment of the present application. As shown in fig. 5, the entire flow involves the management terminal device 51, the object terminal device 52, the business application client 53, the access gateway service 54, the quotation service 55, the data synchronization service 56, the decentralized resource exchanging contract 57, and the centralized resource exchanging server 58. The management terminal device 51 and the target terminal device 52 may be any terminal device in the terminal device cluster 10 shown in fig. 1, for example, the management terminal device 51 may be the terminal device 10a, and 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 a service backend Server (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 corresponding service backend Server 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 be deployed in a service background server corresponding to the target terminal device 52. The decentralized resource exchange contract 57 may be an intelligent contract 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 count exchange contract 57. The centralized resource exchange server 58 may be any service server in the service server cluster 100 shown in fig. 1, for example, the service server 100a.
As shown in fig. 5, the whole resource value change graph generation flow includes the following steps:
in step S301, the management terminal device 51 transmits a configuration request to the data synchronization service 56.
Specifically, the management terminal device 51 may generate a configuration request including configuration information in response to a configuration operation of the management side, and then send the configuration request to the data synchronization service 56. The configuration request may include information such as a target digital resource type set, an off-center compound contract address of an off-center resource exchange contract to be detected, and a domain name of a centralized data interface provided by a centralized resource exchange server to be synchronized.
In step S302, the data synchronization service 56 performs initialization configuration according to the configuration request.
Specifically, the data synchronization service 56 reads the configuration information in the configuration request, and performs initialization configuration according to the configuration information, that is, according to event information of the decentralized resource clearinghouse on the configuration detection chain, and order information of the request centralized resource clearinghouse.
In step S303, the data synchronization service 56 starts 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 57 according to the decentralized compound contract address, and the specific implementation process may refer to the optional description of step S101 in the embodiment corresponding to fig. 3, which is not described herein.
In step S304, the data synchronization service 56 begins synchronizing the centralized resource exchange server 58 according to the configuration information.
Specifically, the data synchronization service 56 may request the order information in the centralized resource exchange server 58 according to the centralized data interface, and the specific implementation process may participate in the optional description of step S102 in the embodiment corresponding to fig. 3, which is not described herein.
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 digital resources with the decentralized resource exchange contract 57 or the centralized resource exchange server 58.
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, when executing the resource exchange transaction, the decentralized resource exchange contract 57 generates a corresponding resource exchange event, where the resource exchange event information corresponding to the resource exchange event is used to instruct to perform resource exchange processing on the first digital resource stored in the first address chain and the second digital resource stored in the second address chain, and the specific implementation can be referred to the description of step S101 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 business application client 53 performs a transaction through the centralized resource exchange server 58.
Specifically, the blockchain object can log in the centralized account corresponding to the centralized resource exchange through the service application client 53, and then complete the exchange of the digital resource through the centralized resource exchange server 57, that is, send a resource exchange request to the centralized resource exchange server 57. It will be appreciated that this process requires only blockchain objects to log into a centralized account, and does not require signing resource exchange requests.
In step S311, the centralized resource exchange server 58 processes the resource exchange order.
Specifically, the process of the centralized resource exchange server 58 responding to the resource exchange request and performing the processing may refer to the specific description of step S102 in the embodiment corresponding to fig. 3, which is not described herein.
In step S312, the decentralized resource exchange contract 57 returns transaction data on the blockchain where the decentralized resource exchange resides to the data synchronization service 56.
Specifically, the transaction data on the blockchain where the decentralized resource exchange is located may be the resource exchange event information described in fig. 3, and the specific acquisition process may refer to the description of step S101 in the embodiment corresponding to fig. 3, which is not repeated here.
In step S313, the centralized resource exchange server 58 returns the transaction data of the centralized resource exchange to the data synchronization service 56.
Specifically, the transaction data of the centralized resource exchange may be the resource exchange order information described in fig. 3, and the specific obtaining process may refer to the description of step S102 in the embodiment corresponding to fig. 3, which is not described herein.
In step S314, the data synchronization service 56 stores the acquired decentralised transaction data and the centralised transaction data.
Specifically, each time the data synchronization service 56 obtains an off-center transaction data or a center transaction data, a transaction record is formed and stored locally, 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 S315, the data synchronization service 56 generates resource value change data.
Specifically, at intervals (or one cycle), the data synchronization service 56 may obtain from the database all of the event transaction data that the decentralized resource exchange is on the chain and the order transaction data of the centralized resource exchange server for that period, form resource change data, such as time-sharing data and K-line data, for describing the digital resource quotas from these transaction data, and store the processed resource change data locally again.
Specifically, the implementation process of step S315 may refer to the description of step S103 in the embodiment corresponding to fig. 3, which is not described herein.
In step S316, the business application client 53 transmits a resource value change request to the access gateway service 54.
Specifically, to ensure that the data is abused, access gateway service 54 may be configured to filter resource value change requests, and only resource value change requests that pass login verification may be sent to ticketing service 55.
In step S317, the access gateway service 54 verifies the login status.
Specifically, the implementation process of step S317 may refer to the optional description of step S201 in the embodiment corresponding to fig. 4, which is not described herein.
In step S318, the access network service 54 transmits a resource value change request to the ticker service 55 after the login status verification is passed.
In step S319, the quotation service 55 acquires the target resource value change data according to the resource value change request.
Specifically, the target resource value change data refers to the resource value change data corresponding to the target digital resource type requested by the blockchain object in the change period, and the specific obtaining process may refer to the optional description of step S203 in the embodiment corresponding to fig. 4.
In step S320, the ticker service 55 sends the target resource value change data to the business application client 53.
Alternatively, the quotation service 55 may perform image rendering on the target resource value change data, and then send the image data corresponding to the resource value change map to the service application client 53.
In step S321, the service application client 53 renders a resource value change map according to the target resource value change data, and then displays the resource value change map.
Specifically, after the object terminal device 52 displays the resource value change chart through the running service application client 53, the blockchain object can intuitively understand 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 method provided by the embodiment of the application, the contract address of the front-ranked decentralized resource exchange on the chain is detected, so that the transaction data of the chain decentralized resource exchange can be obtained, meanwhile, the transaction data of the centralized resource exchange is obtained through the centralized data interface provided by the centralized resource exchange and stored locally, and finally, the synchronized data are processed locally to generate resource value change data for storage, and the resource value change data are provided for a business application client to inquire and provide a full amount of chain quotation data for a blockchain object. When the resource value change data is generated, the data of the centralized resource exchange and the data of the decentralized resource exchange are complemented, so that the problems that the market data of the centralized resource exchange is opaque, the transaction amount of the decentralized resource exchange is not large, and the market data fluctuation is large are solved.
Referring to fig. 6, fig. 6 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 1 may be a computer program (comprising program code) running on a computer device, for example the data processing apparatus 1 is an application software; the data processing apparatus 1 may be adapted to perform the corresponding steps in the data processing method provided by the embodiment of the application. As shown in fig. 6, the data processing apparatus 1 may include: a first acquisition module 11, a second acquisition module 12 and a generation module 13.
A first obtaining module 11, configured to add resource exchange event information to the event information set when it is detected that an decentralized resource exchange contract deployed in the blockchain network generates resource exchange event information associated with the target digital resource type set; the resource exchange event information is used for indicating the blockchain network to exchange resources between the first digital resources stored in the address on the first chain and the second digital resources stored in the address on the second chain; the digital resource types respectively corresponding to the first digital resource and the second digital resource are different; the digital resource types respectively corresponding to the first digital resource and the second digital resource belong to a target digital resource type set;
a second obtaining module 12, configured to obtain, when it is determined that the information obtaining duration reaches the target period, resource exchange order information associated with the target digital resource set generated by the centralized resource exchange server in the target period; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; the types of the digital resources respectively corresponding to the third digital resource and the fourth digital resource are different; the digital resource types respectively corresponding to the third digital resource and the fourth digital resource belong to a target digital resource type set;
The generating module 13 is configured to generate, according to the event information set and the resource exchange order information, resource value change data corresponding to each digital resource type included in the target digital resource type set in a target period.
The specific implementation manner of the first obtaining module 11, the second obtaining module 12, and the generating module 13 may refer to the specific description of step S101 to step S103 in the embodiment corresponding to fig. 3, which is not repeated here.
Wherein the target digital resource type set comprises a digital resource type M; the number of resource exchange order information is one or more;
the generating module 13 includes: an information acquisition unit 131 and a generation unit 132.
An information acquisition unit 131 for acquiring, from the set of event information, resource exchange event information associated with the digital resource type M as target resource exchange event information;
the information obtaining unit 131 is further configured to obtain, from the resource exchange order information, resource exchange order information associated with the digital resource type M as target resource exchange order information;
the generating unit 132 is configured to perform weighted data statistics processing on the target resource exchange event information and the target resource exchange order information, so as to obtain resource value change data corresponding to the digital resource type M in the target period.
The specific implementation manner of the information obtaining unit 131 and the generating unit 132 may refer to the specific description of step S103 in the embodiment corresponding to fig. 3, which is not repeated here.
Wherein the generating unit 132 includes: weighting subunit 1321 and statistics subunit 1322.
A weighting subunit 1321, configured to obtain a first weight corresponding to the decentralized resource switching contract, and obtain a second weight corresponding to the centralized resource switching server;
the weighting subunit 1321 is further configured to perform a weighting process on the target resource exchange event information according to the first weight, so as to obtain weighted resource exchange event information;
the weighting subunit 1321 is further configured to perform a weighting process on the target resource exchange order information according to the second weight, so as to obtain weighted resource exchange order information;
the statistics subunit 1322 is configured to perform data statistics processing on the weighted resource exchange event information and the weighted resource exchange order information, so as to obtain resource value change data corresponding to the digital resource type M in the target period.
The specific implementation manner of the weighting subunit 1321 and the statistics subunit 1322 may refer to the specific description of step S103 in the embodiment corresponding to fig. 3, which is not described herein.
Wherein the target digital resource type set comprises a digital resource type N;
the data processing apparatus 1 further includes: a receiving module 14, a period acquiring module 15 and a rendering module 16.
A receiving module 14, configured to receive a resource value change request for the digital resource type N sent by the first terminal; the resource value change request includes a change period;
the period obtaining module 15 is configured to determine X periods corresponding to the change period, obtain the resource value change data corresponding to the digital resource type N in the X periods, and obtain X resource value change data; x is a positive integer;
the rendering module 16 is configured to render the resource value change map for the X resource value change data, so as to obtain the resource value change map; the X periods comprise target periods; the resource value change graph is used for presenting the resource value change condition of the digital resource type N in the change time period.
The specific implementation manner of the receiving module 14, the period obtaining module 15, and the rendering module 16 may refer to the specific description of step S201 to step S203 in the embodiment corresponding to fig. 4, and the detailed description is omitted here.
Wherein the resource value change request further comprises a login state;
The data processing apparatus 1 further includes: a login authentication module 17.
The login verification module 17 is configured to perform legal verification processing on the login status to obtain a legal verification result;
the login verification module 17 is further configured to execute determining X periods corresponding to the change period if the login status is indicated as a legal login status by the legal verification result, and obtain the resource value change data corresponding to the digital resource type N in the X periods, thereby obtaining X resource value change data;
the login verification module 17 is further configured to send a login error prompt message to the first terminal if the login status is indicated as an illegal login status by the legal verification result.
The specific implementation manner of the login authentication module 17 may refer to the optional description of step S201 in the embodiment corresponding to fig. 4, which is not described herein.
Wherein the resource value change request further comprises a resource value change graph type; the X resource value change data comprise resource change data corresponding to Y data attributes respectively, wherein Y is a positive integer;
a rendering module 16 comprising: a data determination unit 161, and a map rendering unit 162.
A data determining unit 161 for determining Z data attributes matching the resource value change graph type; z is a positive integer; z data attributes belong to Y data attributes;
The data determining unit 161 is further configured to obtain, from the resource change data corresponding to each of the Y data attributes, resource change data corresponding to each of the Z data attributes, as target resource change data;
the graph rendering unit 162 is configured to determine a graph rendering manner matched with the resource value change graph type, and perform image rendering on the target resource change data according to the graph rendering manner to obtain a resource value change graph corresponding to the resource value change graph type.
The specific implementation manner of the data determining unit 161 and the map rendering unit 162 may refer to the specific description of step S203 in the embodiment corresponding to fig. 4, and the detailed description is omitted here.
Wherein the first acquisition module 11 comprises: a detection unit 111 and a synchronization unit 112.
A detection unit 111 for synchronizing resource exchange event information from the decentralized resource exchange contracts by the contract event detector when the decentralized resource exchange contracts deployed in the blockchain network are detected by the contract event detector to generate resource exchange event information associated with the target set of digital resource types;
a synchronization unit 112, configured to add the synchronized resource exchange event information to the event information set.
The specific implementation manner of the detection unit 111 and the synchronization unit 112 may refer to the specific description of step S101 in the embodiment corresponding to fig. 3, and will not be repeated here.
Wherein, the above-mentioned data processing apparatus 1, further include: a first configuration module 18.
A first configuration module 18, configured to receive a decentralised configuration request sent by the second terminal; the decentralised configuration request comprises a decentralised compound contract address corresponding to the target digital resource type set and the decentralised resource exchange contract;
the first configuration module 18 is further configured to generate a contract event detector corresponding to the decentralized resource switching contract according to the decentralized combined contract address and the target digital resource type set; the contract event detector is to synchronize the resource exchange event information upon detecting that the decentralized resource exchange contract generates resource exchange event information associated with the set of target digital resource types.
The specific implementation manner of the first configuration module 18 may refer to the optional description of step S101 in the embodiment corresponding to fig. 3, which is not described herein.
The decentralised configuration request also comprises request initiation object information;
The data processing apparatus 1 further includes: the rights verification module 19.
The permission verification module 19 is configured to perform configuration permission verification processing according to the request initiation object information to obtain a configuration permission verification result;
the authority verification module 19 is further configured to execute a step of generating a contract event detector corresponding to the decentralised resource exchange contract according to the decentralised combined contract address and the target digital resource type set if the configuration authority verification result is a configuration authority verification passing result;
the permission verification module 19 is further configured to send permission verification failure prompt information to the second terminal if the configuration permission verification result is a configuration permission verification failure result.
The specific implementation manner of the permission verification module 19 may refer to the optional description of step S101 in the embodiment corresponding to fig. 3, which is not described herein.
Wherein the second acquisition module 12 comprises: a query unit 121 and a screening unit 122.
A query unit 121, configured to read the centralized data interface information and the target digital resource type set from the configuration database when it is determined that the information acquisition duration reaches the target period;
the query unit 121 is further configured to send a data query request for a target period to the centralized resource exchange server according to the centralized data interface information, and receive order information generated in the target period returned by the centralized resource exchange server;
And a screening unit 122, configured to screen order information associated with the target digital resource type set from the order information, as resource exchange order information associated with the target digital resource set generated by the centralized resource exchange server in the target period.
The specific implementation manner of the query unit 121 and the filtering unit 122 may refer to the specific 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 configuration module 110.
A second configuration module 110, configured to receive a centralized configuration request sent by a third terminal; the centralized configuration request comprises centralized data interface information and a target digital resource type set;
the second configuration module 110 is further configured to store the centralized data interface information and the target set of digital resource types to a configuration database.
The specific implementation manner of the second configuration module 110 may refer to the optional description of step S102 in the embodiment corresponding to fig. 3, which is not described herein.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the application. As shown in fig. 7, the data processing apparatus 1 in the embodiment corresponding to fig. 6 described above may be applied to a computer device 1000, and the computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, and in addition, the above-described computer device 1000 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. 7, 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 1000 shown in fig. 7, 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:
when detecting that the decentralized resource exchange contract deployed in the blockchain network generates resource exchange event information associated with the target digital resource type set, adding the resource exchange event information into the event information set; the resource exchange event information is used for indicating the blockchain network to exchange resources between the first digital resources stored in the address on the first chain and the second digital resources stored in the address on the second chain; the digital resource types respectively corresponding to the first digital resource and the second digital resource are different; the digital resource types respectively corresponding to the first digital resource and the second digital resource belong to a target digital resource type set;
when the information acquisition time length reaches a target period, acquiring resource exchange order information which is generated by a centralized resource exchange server in the target period and is associated with a target digital resource set; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; the types of the digital resources respectively corresponding to the third digital resource and the fourth digital resource are different; the digital resource types respectively corresponding to the third digital resource and the fourth digital resource belong to a target digital resource type set;
And generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in a target period according to the event information set and the resource exchange order information.
It should be understood that the computer device 1000 described in the embodiments of the present application may perform the description of the data processing method in any of the embodiments corresponding to the foregoing fig. 3, and will not be repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, in which the aforementioned computer program executed by the data processing apparatus 1 is stored, and 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 therefore, a detailed description will not be given here. 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 the corresponding embodiment of any of the preceding figures 3, 4.
The terms first, second and the like in the description and in the claims and drawings of embodiments of the 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 to be beyond the scope of the present application.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (14)

1. A blockchain-based data processing method, comprising:
when detecting that a decentralised resource exchange contract deployed in a blockchain network generates resource exchange event information associated with a target digital resource type set, adding the resource exchange event information into an event information set; the resource exchange event information is used for indicating the blockchain network to exchange resources between a first digital resource stored in an address on a first chain and a second digital resource stored in an address on a second chain; the digital resource types respectively corresponding to the first digital resource and the second digital resource are different; the digital resource types respectively corresponding to the first digital resource and the second digital resource belong to the target digital resource type set;
when the information acquisition time length reaches a target period, acquiring resource exchange order information which is generated by a centralized resource exchange server in the target period and is associated with the target digital resource type set; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; the third digital resource and the fourth digital resource respectively correspond to different digital resource types; the digital resource types respectively corresponding to the third digital resource and the fourth digital resource belong to the target digital resource type set;
Generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in the target period according to the event information set and the resource exchange order information; the resource value change data corresponding to one digital resource type in the target period is used for reflecting the change condition of the resource value of the digital resource corresponding to one digital resource type in the target period; the resource value is used to characterize resource exchange quotations of the digital resource in the blockchain network.
2. The method of claim 1, wherein the set of target digital resource types comprises digital resource type M; the number of the resource exchange order information is one or more;
and generating resource value change data of each digital resource type contained in the target digital resource type set in the target period according to the event information set and the resource exchange order information, wherein the resource value change data comprises the following components:
acquiring resource exchange event information associated with the digital resource type M from the event information set as target resource exchange event information;
Acquiring resource exchange order information associated with the digital resource type M from the resource exchange order information, and taking the resource exchange order information as target resource exchange order information;
and generating resource value change data of the digital resource type M in the target period according to the target resource exchange event information and the target resource exchange order information.
3. The method of claim 2, wherein generating the resource value change data for the digital resource type M over the target period based on the target resource exchange event information and the target resource exchange order information comprises:
acquiring a first weight corresponding to the decentralized resource switching contract and acquiring a second weight corresponding to the centralized resource switching server;
weighting the target resource exchange event information according to the first weight to obtain weighted resource exchange event information;
weighting the target resource exchange order information according to the second weight to obtain weighted resource exchange order information;
and carrying out data statistics processing on the weighted resource exchange event information and the weighted resource exchange order information to obtain resource value change data corresponding to the digital resource type M in the target period.
4. The method of claim 1, wherein the set of target digital resource types comprises digital resource type N;
the method further comprises the steps of:
receiving a resource value change request aiming at the digital resource type N, which is sent by a first terminal; the resource value change request includes a change period;
determining X periods corresponding to the change time period, and acquiring resource value change data corresponding to the digital resource type N in the X periods respectively to obtain X resource value change data; x is a positive integer;
rendering the resource value change graphs of the X resource value change data to obtain the resource value change graphs; the X cycles comprise the target cycle; the resource value change graph is used for presenting the resource value change condition of the digital resource type N in the change time period.
5. The method of claim 4, wherein the resource value change request further comprises a login status;
the method further comprises the steps of:
performing legal verification processing on the login state to obtain a legal verification result;
if the legal verification result indicates that the login state is legal, executing the steps of determining X periods corresponding to the change time period, and obtaining the resource value change data corresponding to the digital resource type N in the X periods respectively to obtain X resource value change data;
And if the legal verification result indicates that the login state is an illegal login state, sending login error prompt information to the first terminal.
6. The method of claim 4, wherein the resource value change request further comprises a resource value change graph type; the X resource value change data comprise resource change data corresponding to Y data attributes respectively, wherein Y is a positive integer;
rendering the resource value change map of the X resource value change data to obtain the resource value change map, including:
determining Z data attributes matched with the resource value change graph type; z is a positive integer; the Z data attributes belong to the Y data attributes;
acquiring resource change data corresponding to the Z data attributes from the resource change data corresponding to the Y data attributes respectively, and taking the resource change data as target resource change data;
determining a graph rendering mode matched with the resource value change graph type, and performing image rendering on the target resource change data according to the graph rendering mode to obtain a resource value change graph corresponding to the resource value change graph type.
7. The method of claim 1, wherein adding the resource exchange event information to the set of event information when it is detected that an off-centered resource exchange contract deployed in the blockchain network generates resource exchange event information associated with the set of target digital resource types, comprises:
Synchronizing, by a contract event detector, resource exchange event information from an decentralized resource exchange contract deployed in a blockchain network when the contract event detector detects that the resource exchange contract generates resource exchange event information associated with a target set of digital resource types;
and adding the synchronized resource exchange event information to an event information set.
8. The method as recited in claim 7, further comprising:
receiving a decentralizing configuration request sent by a second terminal; the decentralised configuration request comprises a decentralised compound contract address corresponding to a target digital resource type set and a decentralised resource exchange contract;
generating a contract event detector corresponding to the decentralized resource switching contract according to the decentralized contract address and the target digital resource type set; the contract event detector is configured to synchronize resource exchange event information associated with the target set of digital resource types upon detecting that the decentralized resource exchange contract generates the resource exchange event information.
9. The method of claim 8, wherein the de-centralized configuration request further comprises request-to-initiate object information; the method further comprises the steps of:
Performing configuration permission verification processing according to the request initiated object information to obtain a configuration permission verification result;
if the configuration right verification result is a configuration right verification passing result, executing the step of generating a contract event detector corresponding to the decentralised resource exchange contract according to the decentralised contract address and the target digital resource type set;
and if the configuration permission verification result is a configuration permission verification failing result, sending permission verification failing prompt information to the second terminal.
10. The method of claim 1, wherein when the information acquisition duration is determined to reach a target period, acquiring resource exchange order information associated with the target set of digital resources generated by a centralized resource exchange server within the information acquisition duration comprises:
when the information acquisition time length reaches a target period, reading centralized data interface information and a target digital resource type set from a configuration database;
sending a data query request for the target period to a centralized resource exchange server according to the centralized data interface information, and receiving order information generated in the target period and returned by the centralized resource exchange server;
And screening order information associated with the target digital resource type set from the order information, and using the order information as resource exchange order information associated with the target digital resource set, wherein the resource exchange order information is generated by a centralized resource exchange server in the target period.
11. The method as recited in claim 10, further comprising:
receiving a centralized configuration request sent by a third terminal; the centralized configuration request comprises centralized data interface information and a target digital resource type set;
storing the centralized data interface information and the set of target digital resource types to a configuration database.
12. A blockchain-based data processing device, comprising:
the first acquisition module is used for adding the resource exchange event information to the event information set when detecting that an decentralized resource exchange contract deployed in the blockchain network generates the resource exchange event information associated with the target digital resource type set; the resource exchange event information is used for indicating the blockchain network to exchange resources between a first digital resource stored in an address on a first chain and a second digital resource stored in an address on a second chain; the digital resource types respectively corresponding to the first digital resource and the second digital resource are different; the digital resource types respectively corresponding to the first digital resource and the second digital resource belong to the target digital resource type set;
The second acquisition module is used for acquiring resource exchange order information which is generated by the centralized resource exchange server in the target period and is associated with the target digital resource type set when the information acquisition duration reaches the target period; the resource exchange order information is used for indicating the centralized resource exchange server to convert the third digital resource of the first object account into a fourth digital resource; the third digital resource and the fourth digital resource respectively correspond to different digital resource types; the digital resource types respectively corresponding to the third digital resource and the fourth digital resource belong to the target digital resource type set;
the generation module is used for generating resource value change data corresponding to each digital resource type contained in the target digital resource type set in the target period according to the event information set and the resource exchange order information; the resource value change data corresponding to one digital resource type in the target period is used for reflecting the change condition of the resource value of the digital resource corresponding to one digital resource type in the target period; the resource value is used to characterize resource exchange quotations of the digital resource in the blockchain network.
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.
CN202311129929.XA 2023-09-04 2023-09-04 Block chain-based data processing method, device, equipment and readable storage medium Active CN116862679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311129929.XA CN116862679B (en) 2023-09-04 2023-09-04 Block chain-based data processing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311129929.XA CN116862679B (en) 2023-09-04 2023-09-04 Block chain-based data processing method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN116862679A CN116862679A (en) 2023-10-10
CN116862679B true CN116862679B (en) 2023-11-21

Family

ID=88229008

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311129929.XA Active CN116862679B (en) 2023-09-04 2023-09-04 Block chain-based data processing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116862679B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648071A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 Value evaluation of tourism resources method and apparatus based on block chain
CN112001713A (en) * 2019-05-27 2020-11-27 深圳市红砖坊技术有限公司 Block chain system and request processing method and device
CN114706509A (en) * 2022-05-05 2022-07-05 芜湖听松网络科技有限公司 Virtual resource processing method and device, electronic equipment and storage medium
CN115860884A (en) * 2022-12-31 2023-03-28 蚂蚁区块链科技(上海)有限公司 Method and device for processing digital resources in block chain system
CN116012017A (en) * 2023-01-13 2023-04-25 中国工商银行股份有限公司 Resource information processing method, device, computer equipment and storage medium
CN116308372A (en) * 2022-11-30 2023-06-23 蚂蚁区块链科技(上海)有限公司 Detection method and device for blockchain transaction

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210118054A1 (en) * 2016-12-01 2021-04-22 Trovata, Inc. Resource exchange system
JP2021520011A (en) * 2018-03-30 2021-08-12 エクスポジション パーク ホールディングス エスイーゼットシー Exchange of digital assets
US20210366044A1 (en) * 2020-05-25 2021-11-25 The Toronto-Dominion Bank Systems and methods for managing allocation of resources
US11966779B2 (en) * 2021-07-12 2024-04-23 Bank Of America Corporation System and method for transfer of digital resources using an integrated resource platform

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648071A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 Value evaluation of tourism resources method and apparatus based on block chain
CN112001713A (en) * 2019-05-27 2020-11-27 深圳市红砖坊技术有限公司 Block chain system and request processing method and device
CN114706509A (en) * 2022-05-05 2022-07-05 芜湖听松网络科技有限公司 Virtual resource processing method and device, electronic equipment and storage medium
CN116308372A (en) * 2022-11-30 2023-06-23 蚂蚁区块链科技(上海)有限公司 Detection method and device for blockchain transaction
CN115860884A (en) * 2022-12-31 2023-03-28 蚂蚁区块链科技(上海)有限公司 Method and device for processing digital resources in block chain system
CN116012017A (en) * 2023-01-13 2023-04-25 中国工商银行股份有限公司 Resource information processing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN116862679A (en) 2023-10-10

Similar Documents

Publication Publication Date Title
US11050690B2 (en) Method for providing recording and verification service for data received and transmitted by messenger service, and server using method
CN110851879B (en) Method, device and equipment for infringement and evidence preservation based on evidence preservation block chain
CN111445333B (en) Block generation method, device, computer equipment and storage medium
CN112287034B (en) Data synchronization method, equipment and computer readable storage medium
CN112613877B (en) Intelligent contract triggering method and device applied to block chain network and related equipment
CN110400217B (en) Rule change processing method and device for intelligent contract
CN106161367A (en) A kind of verifying dynamic password method and system, client and server
CN111985007A (en) Contract signing and executing method and device based on block chain
CN112287033B (en) Data synchronization method, equipment and computer readable storage medium
CN109684786A (en) A kind of copyright registration method, apparatus and terminal device based on block chain
WO2022095518A1 (en) Automatic interface test method and apparatus, and computer device and storage medium
CN115114372A (en) Data processing method, device and equipment based on block chain and readable storage medium
CN113205340A (en) Data processing method and related device for bank-enterprise direct connection platform
CN112291321A (en) Service processing method, device and system
CN116862679B (en) Block chain-based data processing method, device, equipment and readable storage medium
CN111709857A (en) House resource sharing method and device and electronic equipment
US20230388120A1 (en) Client-Side Device Bloom Filter Mapping
CN114399389A (en) Block chain-based power generation data management method and smart grid system
CN114677138A (en) Data processing method, data processing equipment and computer readable storage medium
CN112926981A (en) Transaction information processing method, device and medium for block chain and electronic equipment
CN117495473A (en) Block chain-based data processing method, device, equipment and readable storage medium
CN116804949B (en) Block chain-based data processing method, device, equipment and readable storage medium
CN117176737A (en) Block chain-based data processing method, device, equipment and readable storage medium
WO2023134282A1 (en) Blockchain-based data processing method and apparatus, device, storage medium and program product
CN110781523B (en) Method and apparatus for processing information

Legal Events

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