Data processing method and device based on data pool, blockchain and storage medium
By adjusting the pricing function model using smart contracts and oracle listening systems in the blockchain, flexible data processing between data pools is achieved, solving the problem of data type limitations in the blockchain and improving the flexibility and applicability of transactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2026-03-27
AI Technical Summary
In blockchain, transactions of different data types can only be converted according to the pre-set equivalence model in smart contracts, resulting in low flexibility and scalability, and thus limiting its widespread application.
By obtaining the amount of data to be deducted from the first data pool, and adjusting it using the pricing function model in the preset smart contract and the oracle listening system, the amount of data to be added to the second data pool is calculated, thus realizing flexible data processing between data pools.
It improves the flexibility and scalability of data processing, making it applicable to transaction processes involving different data types.
Smart Images

Figure CN114168681B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the blockchain technology, in particular, to a data processing method and device based on a data pool, a blockchain and a storage medium. BACKGROUND
[0002] The blockchain technology is a kind of ledger technology maintained by multiple parties, which is composed of consensus mechanism, cryptographic algorithm, network routing, contract script and other technologies, and has the technical characteristics of distributed trust, difficulty of tampering and multi-party maintenance. These technical characteristics make the blockchain be considered as one of the most disruptive technologies since the popularization of the Internet, and it has attracted worldwide attention.
[0003] The consensus mechanism on the blockchain mainly solves the problem of who constructs the block and how to maintain the uniformity of the blockchain. Public chains guarantee consensus in a mutually untrusted network environment through cryptography and economic incentives, and realize a fully decentralized credit mechanism.
[0004] At present, when two different data types of the blockchain are transacted, they can usually only be converted according to the preset equivalent model in the smart contract, and can only be used in the transaction of the fixed two data types, which has low flexibility and expandability, and cannot be widely applied. SUMMARY
[0005] The present application provides a data processing method and device based on a data pool, a blockchain and a storage medium to solve the above technical problems.
[0006] According to a first aspect of the present application, a data processing method based on a data pool is provided, the method comprising:
[0007] Obtaining a first data amount to be deducted in a first data pool;
[0008] Calculating a second data amount to be added in a second data pool according to a pricing function model in a preset smart contract and the first data amount, wherein the smart contract is connected with an oracle monitoring system, and is used to adjust the pricing function model according to the data obtained by the oracle monitoring system;
[0009] Processing the data amount of the first data pool and the second data pool according to the first data amount and the second data amount.
[0010] Optionally, in the present embodiment, the calculation of the second data amount to be added in the second data pool according to the pricing function model in the preset smart contract and the first data amount comprises:
[0011] The second data amount is calculated according to the following formula:
[0012]
[0013] wherein, is the second data amount, is the first data amount, is a constant value of the pricing function model, is a total number of the second data pool, is a total number of the first data pool.
[0014] Optionally, in the embodiment, the calculating the second data amount to be added in the second data pool according to the preset pricing function model in the smart contract and the first data amount comprises:
[0015] The second data amount is calculated according to the following formula:
[0016]
[0017] wherein, is the second data amount, is the first data amount, is a constant value of the pricing function model, is a total number of the second data pool, is a total number of the first data pool, is a conversion coefficient.
[0018] Optionally, in the embodiment, the method further comprises:
[0019] obtaining a number of nodes involved in the first data pool and a number of nodes involved in the second data pool ;
[0020] obtaining a total number of nodes in a blockchain , wherein the nodes involved in the first data pool and the nodes involved in the second data pool are all nodes in the blockchain;
[0021] obtaining a conversion coefficient according to the following formula: wherein, is a maximum value function.
[0022] Optionally, in the embodiment, the method further comprises:
[0023] obtaining nodes involved in the first data pool and forming a set ;
[0024] obtaining nodes involved in the second data pool and forming a set ;
[0025] obtaining the total number of nodes in the blockchain The nodes involved in the first data pool and the nodes involved in the second data pool are nodes in the blockchain.
[0026] The conversion coefficient is obtained according to the following formula: Wherein, is the number of elements in the intersection of set and set ; or,
[0027] The conversion coefficient is obtained according to the following formula: Wherein, is the number of elements in the union of set and set .
[0028] Optionally, in the embodiment, the method further comprises:
[0029] obtaining the total amount of data in the first data pool and the total amount of data in the second data pool .
[0030] obtaining the number of data in the first data pool reduced during the previous data processing .
[0031] The conversion coefficient is obtained according to the following formula: Wherein, N is a preset upper limit value of data.
[0032] Optionally, in the embodiment, the method further comprises:
[0033] Adjusting the constant value of the pricing function model according to the data obtained by the oracle monitoring system.
[0034] According to a second aspect of the embodiments of the present application, a data processing device based on a data pool is provided, and the device comprises:
[0035] A data acquisition module is configured to obtain a first amount of data to be deducted in a first data pool.
[0036] A data calculation module is configured to calculate a second amount of data to be added in a second data pool according to a pricing function model in a preset smart contract and the first amount of data, wherein the smart contract is connected with an oracle monitoring system, and the oracle monitoring system is configured to adjust the pricing function model according to data obtained by the oracle monitoring system.
[0037] A data processing module is configured to process the amount of data in the first data pool and the second data pool according to the first amount of data and the second amount of data.
[0038] According to a third aspect of the embodiments of the present application, a blockchain is provided, the blockchain comprising a main chain and at least one sub-chain;
[0039] The main chain comprises a plurality of supernodes, and the sub-chain comprises a backbone node and a plurality of service nodes, each sub-chain being anchored to any supernode of the main chain through the backbone node;
[0040] The backbone node or any service node of the sub-chain is configured to execute the method of the first aspect.
[0041] According to a fourth aspect of the embodiments of the present application, a storage medium is provided, the storage medium storing a computer program, the computer program being executed by a processor to execute the method of the first aspect.
[0042] The embodiments of the present application provide a data processing method and device based on a data pool, a blockchain and a storage medium. First, a first data amount to be deducted in a first data pool is obtained. Then, a second data amount to be added in a second data pool is calculated according to a pricing function model in a preset smart contract and the first data amount, wherein the smart contract is connected with an oracle listening system, and is configured to adjust the pricing function model according to data obtained by the oracle listening system. Finally, the data amounts of the first data pool and the second data pool are processed according to the first data amount and the second data amount. In the data processing, the pricing function model used to calculate the deduction amount and the increase amount of the data pool can be adjusted according to the data obtained by the oracle listening system, and has high flexibility and expansibility, and can be widely applied to data processing processes of different data types. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of the present application and illustrate the illustrative embodiments of the present application and their description serve to explain the present application, but do not limit the present application. In the drawings:
[0044] Figure 1 The structural schematic diagram of the blockchain provided by the embodiments of the present application is shown;
[0045] Figure 2 The functional architecture diagram of the main chain provided by the embodiments of the present application is shown;
[0046] Figure 3 The functional architecture diagram of the sub-chain provided by the embodiments of the present application is shown;
[0047] Figure 4 The flowchart of the data processing method based on the data pool provided by the embodiments of the present application is shown;
[0048] Figure 5 A schematic diagram of a prediction machine monitoring system provided for an embodiment of the present application;
[0049] Figure 6 A functional module diagram of a data processing device based on a data pool provided for an embodiment of the present application. DETAILED DESCRIPTION
[0050] In the process of implementing the present application, the inventors found that at present, when two different data types of the blockchain are transacted between nodes, the nodes need to simultaneously meet the corresponding transaction requirements, and usually can only be converted according to a preset equivalent model in the smart contract, and can only be limited to transactions of the fixed two data types, which has a high transaction difficulty and low flexibility and expandability, resulting in that the blockchain cannot be widely applied.
[0051] In view of the above problems, the present application provides a data processing method and device based on a data pool, a blockchain and a storage medium. First, a first data amount to be deducted in a first data pool is obtained. Then, a second data amount to be increased in a second data pool is calculated according to a pricing function model in a preset smart contract and the first data amount, wherein the smart contract is connected with a prediction machine monitoring system, and is used to adjust the pricing function model according to data obtained by the prediction machine monitoring system. Finally, the data amounts of the first data pool and the second data pool are processed according to the first data amount and the second data amount. When processing data, the pricing function model used to calculate the deduction amount and the increase amount of the data pool can be adjusted according to the data obtained by the prediction machine monitoring system, has high flexibility and expandability, and can be widely applied to data processing processes of different data types.
[0052] The scheme in the embodiments of the present application can be implemented in various computer languages, such as object-oriented program design languages Java and interpreted script languages JavaScript.
[0053] In order to make the technical solutions and advantages in the embodiments of the present application clearer and more apparent, the following will further describe the exemplary embodiments of the present application in detail with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0054] First, please refer to Figure 1 , Figure 1 A structural schematic diagram of a blockchain provided for an embodiment of the present application. In Figure 1In the embodiment, the blockchain is a master-slave chain structure, i.e., a "1+N" master-slave chain architecture, the master chain includes a plurality of super nodes and a supervision node, the slave chain includes a backbone node, a plurality of service nodes and at least one block, each slave chain is anchored with any super node of the master chain through the backbone node, and the super nodes anchored by the backbone nodes of different slave chains are different. The slave chain performs a cross-chain interaction process with the master chain through the backbone node, and the backbone node is used to synchronize data of the slave chain to which the backbone node belongs to the supervision node, and the block is used to store data.
[0055] The backbone nodes included in different slave chains are different, or at least two slave chains share one backbone node. The structures of any two slave chains can be the same or different.
[0056] In the embodiment, please refer to Figure 2 , Figure 2 a functional architecture diagram of the master chain provided by the embodiment of the application.
[0057] The master chain provides common services for the entire chain group structure and cultivates a thriving ecological development; provides a cross-chain transaction platform and specification for each blockchain and promotes data sharing and integration; provides hosting services for various industries to ensure data tamper-proofing and recoverability; provides trusted authentication to ensure cross-domain credibility of nodes and their data, and nodes with authentication permissions provide authentication services for nodes or identifiers; provides supervision services and security monitoring services for each blockchain to ensure compliance and operational safety of each node in the entire chain group structure; the master chain opens application services to the outside world, and service nodes can freely enter or exit the master chain to enjoy the open services of the master chain, and promote enterprise capability improvement.
[0058] The master chain has basic functions and service functions, and the basic functions of the master chain are to ensure efficient operation of the chain group, wherein the basic functions include but are not limited to: pluggable architecture, high-performance consensus mechanism, high-reliability smart contract, privacy protection, encryption mechanism, autonomy, isomorphism and heterogeneous link, incentive mechanism.
[0059] The service function is to ensure the healthy development of the entire chain group ecology, wherein the service function includes but is not limited to: digital identity BID, trusted authentication service, multi-identity root area management, identifier registration and resolution, hosting service, public service, interface service, cross-chain.
[0060] The main chain includes a plurality of supernodes and one supervision node. The supernode is used for performing main chain consensus, and has functions of data hosting, cross-chain gateway, qualification review, chain group management and the like; a trusted computing environment is provided, a pre-prediction service is run based on trusted computing hardware; and external data is obtained, and after verification, trusted data service can be provided to the outside. All nodes in the chain group can apply to become supernode candidates, and have the right to be elected as supernodes. The supernode is responsible for node group construction, manages data synchronization permissions of service nodes with free access, and improves the overall service capability of the main chain.
[0061] In addition to the above basic functions and service functions, the supernode also has but is not limited to the following functions: public data management, user / node identity authentication, external public service, node group construction and management, chain access authentication, chain group management, contract management, trusted computing environment, big data analysis, operation monitoring, main chain consensus, cross-chain gateway, trusted data service, and pre-prediction service based on trusted hardware.
[0062] The supervision node of the main chain is used for supervising the data and behavior of the entire chain group users and nodes, and disposing the violation behaviors such as stopping service, limiting permission, controlling traffic, and marking untrusted users; at the same time, the supervision node has management permission for the supernode and backbone node, and performs qualification review and trusted authentication to ensure the trustworthiness of the key nodes.
[0063] In addition to the above basic functions and service functions, the supervision node also has but is not limited to the following functions: data content supervision, node behavior supervision, supernode qualification review, backbone node qualification review, application violation disposal, node violation disposal, supernode authentication, and backbone node authentication.
[0064] Through the supervision node and the supernode of the main chain, a shared interaction platform can be realized, service monitoring and supervision can be realized, equal cooperation and co-governance can be realized, and ecological construction and operation can be realized.
[0065] Please refer to Figure 3 , Figure 3 The function architecture diagram of the slave chain provided for the embodiments of the present application.
[0066] The slave chain also has basic functions and service functions. The basic functions of the slave chain are to ensure the efficient operation of the slave chain under the backbone node, and the service functions of the slave chain provide protection for the normal development of the slave chain business and the benign development of the industry ecology. The basic functions of the slave chain include but are not limited to: pluggable architecture, high-performance consensus mechanism, high-reliability smart contract, privacy protection, encryption mechanism, autonomy, main chain interconnection, and incentive mechanism; the service functions of the slave chain include but are not limited to: digital identity BID, trusted authentication service, multi-identity fusion management, identity registration and resolution, personalized customization service, external service, interface service, and cross-chain.
[0067] The access mode of the slave chain includes two modes: one is to create a homogeneous slave chain based on the main chain, and the other is to develop an interface for accessing the main chain according to the interface specification of the main chain by the existing heterogeneous blockchain. The access of the slave chain needs to submit an application to the main chain and be connected to the main chain through the backbone node. The slave chain can use the public services or resources of the entire chain group, or can deploy personalized applications or smart contracts according to the needs.
[0068] The slave chain includes one backbone node and multiple service nodes. The backbone node has the functions of anchoring the main chain, slave chain consensus, slave chain supervision, smart contract deployment, etc. Among them, the slave chain can perform cross-chain interaction process with the main chain through the backbone node. Different slave chains can share one backbone node, or each slave chain includes a separate backbone node.
[0069] In addition to the above basic functions and service functions, the backbone node also has the following functions, but is not limited to: anchoring the main chain, slave chain management, slave chain node permission management, slave chain consensus, providing services to the outside, smart contract customization, pluggable component configuration, participating in chain group voting.
[0070] The service node performs specific business activities, and the permission is uniformly allocated and managed by the backbone node. In addition, the slave chain can also include a consensus node, which is used for consensus.
[0071] In addition to the above basic functions and service functions, the consensus node also has the following functions, but is not limited to: smart contract customization, synchronization of slave chain data, providing services to the outside, slave chain consensus, performing specific business activities, participating in chain group voting.
[0072] In addition to the above basic functions and service functions, the service node also has the following functions, but is not limited to: participating in voting chain group, synchronizing slave chain data, smart contract customization, providing public services to the outside, using chain group public services, and performing specific business activities.
[0073] Through the backbone node, consensus node and service node of the slave chain, business autonomy, independent consensus, service customization, public resource sharing and other functions can be realized.
[0074] Optionally, the data processing method based on the data pool provided in the embodiment is executed by the backbone node or the service node on the slave chain in the above blockchain.
[0075] Please refer to Figure 4 , Figure 4 The flowchart of the data processing method based on the data pool provided in the embodiment. In this embodiment, the data processing method based on the data pool includes:
[0076] Step S11, obtaining a first data amount to be deducted in a first data pool.
[0077] In step S12, the second data quantity to be added in the second data pool is calculated according to the preset pricing function model in the smart contract and the first data quantity.
[0078] The smart contract is connected with the oracle monitoring system, and the smart contract is used to adjust the pricing function model according to external data obtained by the oracle monitoring system.
[0079] In step S13, the data quantity of the first data pool and the second data pool is processed according to the first data quantity and the second data quantity.
[0080] In the above steps, when the data is processed, the pricing function model used to calculate the deduction quantity and the increase quantity of the data pool can be adjusted according to the data obtained by the oracle monitoring system, which has high flexibility and expansibility, and can be widely applied to the data processing process of different data types.
[0081] Optionally, in the embodiment, each data pool stores the same type of data, for example, the data pool A stores asset A, and the data pool B stores asset B.
[0082] If the user wants to exchange asset A corresponding to the y data quantity for asset B, the first data pool is the data pool corresponding to asset A (i.e., the data pool A), the first data quantity to be deducted in the first data pool is y, the second data pool is the data pool corresponding to asset B (i.e., the data pool B), and the second data quantity corresponding to the first data quantity y needs to be added in the second data pool.
[0083] In calculating the second data quantity, the second data quantity to be added in the second data pool can be calculated based on the preset pricing function model in the smart contract and the first data quantity. Based on the pricing function model, after the data quantity of one of the data pools is known, the data quantity of the second data pool can be obtained. The smart contract is connected with the oracle monitoring system, and is used to adjust the pricing function model according to the data obtained by the oracle monitoring system.
[0084] Then, the data can be processed according to the first data quantity and the calculated second data quantity.
[0085] In the embodiment, the oracle-based data trusted transmission constructs an oracle monitoring system, which can obtain the real-time changes of real-world existing data such as currency exchange rates in real time. The oracle monitoring system, as a third-party tool for interaction between the smart contract and the external world, connects one end to the real world to actively obtain external data and the other end to the smart contract to provide parameters for the pricing function model set by the smart contract, so as to timely adjust the pricing function model according to the exchange rate between different assets, which has high expansibility. At the same time, the oracle monitoring system can be deployed based on multi-node monitoring and trusted execution environment to ensure the security and credibility of the parameters.
[0086] Optionally, in the embodiment, the pricing function model can be different according to the content stored in the data pool.
[0087] In an embodiment, according to the pre-set smart contract, the pricing function model can be: wherein M is a constant value of the pricing function model, is the total number of the second data pool, is the total number of the first data pool.
[0088] Then, the second data amount can be calculated according to the following formula: wherein, is the second data amount, is the first data amount.
[0089] In another embodiment, according to the pre-set smart contract, the pricing function model can be: wherein M is a constant value of the pricing function model, is the total number of the second data pool, is the total number of the first data pool, is a conversion coefficient.
[0090] Then, the second data amount can be calculated according to the following formula: wherein, is the second data amount, is the first data amount.
[0091] Optionally, in the embodiment, the method further comprises determining the conversion coefficient. There are various methods for determining the conversion coefficient, and three methods for determining the conversion coefficient are provided below. In addition to the above, there can be other methods, which are not limited in the embodiment.
[0092] In an embodiment of the embodiment, the step of determining the conversion coefficient can comprise:
[0093] obtaining the number of nodes involved in the first data pool The number of nodes involved in the second data pool ; obtaining the total number of nodes in the blockchain The nodes involved in the first data pool and the nodes involved in the second data pool are nodes in the blockchain; and the conversion coefficient is obtained according to the following formula: , wherein is a maximum value function.
[0094] Taking the first data pool as an example, the nodes involved in the first data pool are nodes storing data related to asset A.
[0095] For example, user 1 buys asset A of I1, and the data of user 1 exists in node 5; user 2 buys asset A of I2, and the data of user 2 exists in node 7; user 3 sells asset A of I3, and the data of user 3 exists in node 21. Therefore, the nodes involved in the first data pool are node 5, node 7 and node 21, and the number of nodes involved in the first data pool is 3, that is, is 3. The number of nodes involved in the second data pool is the same, which will not be repeated here.
[0096] In the embodiment may be the total number of nodes in the blockchain, or may be the sum of all nodes in the subchain where the nodes involved in the first data pool are located and all nodes in the subchain where the nodes involved in the second data pool are located. When the nodes involved in the first data pool and the nodes involved in the second data pool are located in the same subchain, may also be all nodes in the subchain. The determination scheme of is not limited in the embodiment.
[0097] Regardless of which determination scheme is adopted, it is necessary to ensure that the nodes involved in the first data pool and the nodes involved in the second data pool are nodes in the blockchain. That is, the nodes in the blockchain include the nodes involved in the first data pool and the nodes involved in the second data pool, that is, includes and .
[0098] Then, the conversion coefficient is calculated according to the formula , wherein is a maximum value function.
[0099] In another embodiment of the embodiment, the step of determining the conversion coefficient can include:
[0100] obtaining the nodes involved in the first data pool and forming a set obtain nodes involved in the second data pool and form a set obtain total number of nodes in the blockchain the nodes involved in the first data pool and the nodes involved in the second data pool are nodes in the blockchain.
[0101] obtain the conversion coefficient according to the following formula: wherein, is the number of elements in the intersection of set and set or obtain the conversion coefficient according to the following formula: wherein, is the number of elements in the union of set and set .
[0102] Taking the first data pool as an example, the first data pool is a data pool corresponding to asset A (i.e., data pool A), the nodes involved in the first data pool are nodes storing data related to asset A.
[0103] For example, user 1 buys asset A of I1, and the data of user 1 exists in node 5; user 2 buys asset A of I2, and the data of user 2 exists in node 7; user 3 sells asset A of I3, and the data of user 3 exists in node 21. Therefore, the nodes involved in the first data pool are node 5, node 7 and node 21, {node 5, node 7, node 21}. The number of nodes involved in the second data pool is determined in the same way, which is not described here.
[0104] In the embodiment may be the total number of nodes in the blockchain, may be may also be the sum of all nodes in the subchain where the nodes involved in the first data pool are located and all nodes in the subchain where the nodes involved in the second data pool are located. When the nodes involved in the first data pool and the nodes involved in the second data pool are located in the same subchain, may also be all nodes in the subchain. The embodiment does not limit the determination scheme of .
[0105] No matter which determination scheme is adopted, the nodes involved in the first data pool and the nodes involved in the second data pool are nodes in the blockchain. That is, the nodes in the blockchain include the nodes involved in the first data pool and the nodes involved in the second data pool, that is, includes and .
[0106] Then, the conversion coefficient is obtained according to the formula or Calculate the conversion factors, where, For set and set The number of elements in the intersection of , For set and set The number of elements in the union set.
[0107] Alternatively, in another embodiment of this invention, the step of determining the conversion coefficients may include:
[0108] Obtain the total amount of data in the first data pool and the total amount of data in the second data pool ; Obtain the amount of data that decreased in the first data pool during the previous data processing. The conversion factor is obtained using the following formula: ,in, N This is the preset upper limit value for data.
[0109] The first data pool stores data of the same type. For example, data pool A stores the asset quantity of asset A. This asset quantity is... The method for determining the total amount of data in the second data pool is the same, and will not be repeated here.
[0110] Then obtain the amount of data reduction in the first data pool during the previous data processing. That is, the amount of data deducted from the first data pool in the previous data processing. .
[0111] Then according to the formula Calculate the conversion factors, where, N This is a preset upper limit for data, which can be an experience value set by the user.
[0112] It should be noted that the constant value M in the pricing function model is determined by the oracle listening system. For example... Figure 5 As shown, Figure 5 This is a schematic diagram of the oracle listening system provided in this application embodiment. This embodiment can adjust constant values according to external data obtained by the oracle listening system, thereby adjusting the pricing function model according to the exchange rate between different assets, and has extremely high scalability and flexibility.
[0113] The following is based on what users want to use This embodiment will be explained using the example of exchanging stock A for stock B, which means selling... Only stock A, get the money to buy stock B. At this time, stock A is an asset, and stock B is another asset. The transaction information of stock A is recorded in sub-chain A, that is, each node in the sub-chain records a transaction of stock A, which can be sell or buy. The transaction information of stock B is recorded in sub-chain B, that is, each node in sub-chain B records a transaction of stock B. The number of stocks A Y is stored in the first data pool A1, and the number of stocks B X is stored in the second data pool B1. Sub-chain C is used to manage data pools, and each node manages a data pool, such as node C in sub-chain C A1 Manages data pool A1, node C in sub-chain C B1 Manages data pool B1. Then the backbone node C of sub-chain C can perform the following steps:
[0114] Get the first data amount to be deducted in the first data pool A1 ; Calculate the second data amount to be added in the second data pool B1 according to the pricing function model , wherein M is a constant value in the pricing function model, .
[0115] Then the backbone node C controls node C A1 Subtract in the first data pool A1 B1 Meanwhile, control node C B1 Add in the second data pool B1 . Control node C A1 Subtract in the first data pool A1 , and a node in sub-chain A is added, which records the transaction of subtracting here, and consensus is performed. Control node C B1 Add in the second data pool B1 , and a node in sub-chain B is added, which records the transaction of adding here, and consensus is performed.
[0116] In the real market, the prices of stock A and stock B change in real time, and there are quotes (such as buy and sell quotes) every certain period of time (for example, every day). The scheme of the embodiment can also use a premonition monitoring system to monitor quotes in real time and automatically adjust the constant value M in the pricing function model to conform to the real market price.
[0117] By borrowing external data obtained by the premonition monitoring system and effectively combining the external data with the pricing function model, the countermodel can be flexibly adjusted according to the exchange between different assets, and has high expansibility.
[0118] Optionally, in the embodiment, when data transmission is performed, the smart contract can identify and verify the hash value of the transaction, call the address query API interface if the address is queried, obtain the hash values of all transactions corresponding to the address when the database is queried, determine the node positions of the two parties of the transaction, and transmit the data to the smart contract after successful verification, complete the transaction, and verify whether the amount deducted in the first data pool is equal to the amount of data added in the second data pool. If they are equal, it is determined that the transaction is completed. Therefore, the safety of the transaction can be ensured by the smart contract to prevent the transaction node from being attacked.
[0119] Please refer to Figure 6 , Figure 6 The function module diagram of the data processing apparatus 110 based on the data pool provided in the embodiment of the present application is shown in the figure. In the embodiment, the apparatus comprises:
[0120] The data acquisition module 1101 is configured to acquire a first data amount to be deducted in a first data pool.
[0121] The data calculation module 1102 is configured to calculate a second data amount to be added in a second data pool according to a pricing function model in a preset smart contract and the first data amount, wherein the smart contract is connected with an oracle monitoring system, and is configured to adjust the pricing function model according to the data obtained by the oracle monitoring system.
[0122] The data processing module 1103 is configured to process the data amounts of the first data pool and the second data pool according to the first data amount and the second data amount.
[0123] Optionally, the embodiment of the present application further provides a storage medium, and the storage medium stores a computer program. When the computer program is run, the data processing method based on the data pool is executed.
[0124] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0125] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0126] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0127] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0128] While the preferred embodiments of the application have been described, additional variations and modifications can be employed by those skilled in the art. Therefore, the appended claims intend to cover all such modifications and variations as fall within the true spirit and scope of the application.
[0129] It is apparent that a person having ordinary skill in the art can make alterations and modifications to this application without deviating from the spirit and scope of the application. It is therefore intended that such alterations and modifications be considered as within the scope of the application.
Claims
1. A data processing method based on a data pool, characterized in that, The method includes: Obtain the first amount of data to be deducted from the first data pool; The second amount of data to be added to the second data pool is calculated based on the pricing function model in the preset smart contract and the first amount of data. The smart contract is connected to an oracle monitoring system and is used to adjust the pricing function model based on the data obtained by the oracle monitoring system. The pricing model is M = X * Y or M = X * Y * k, where M is a constant value of the pricing function model, X is the total number of data in the second data pool, Y is the total number of data in the first data pool, and k is a conversion coefficient. The data volumes of the first data pool and the second data pool are processed based on the first data volume and the second data volume.
2. The method according to claim 1, characterized in that, The step of calculating the second data volume to be added to the second data pool based on the pricing function model in the preset smart contract and the first data volume includes: The second data volume is calculated using the following formula: Where x is the second data volume and y is the first data volume.
3. The method according to claim 1, characterized in that, The step of calculating the second data volume to be added to the second data pool based on the pricing function model in the preset smart contract and the first data volume includes: The second data volume is calculated using the following formula: Where x is the second data volume and y is the first data volume.
4. The method according to claim 3, characterized in that, The method further includes: Obtain the number of nodes n1 involved in the first data pool and the number of nodes n2 involved in the second data pool; Obtain the total number of nodes n0 in the blockchain, wherein nodes n1 involved in the first data pool and nodes n2 involved in the second data pool are both nodes in the blockchain; The conversion coefficients are obtained using the following formula: k = max{n1,n2} / n0, where max{} is the maximum value function.
5. The method according to claim 3, characterized in that, The method further includes: Obtain the nodes involved in the first data pool and form a set A1; Obtain the nodes involved in the second data pool and form a set A2; Obtain the total number of nodes n0 in the blockchain, where the nodes involved in the first data pool and the nodes involved in the second data pool are both nodes in the blockchain; The conversion coefficients are obtained using the following formula: k = S1 / n0, where S1 is the number of elements in the intersection of set A1 and set A2; or, The conversion coefficients are obtained using the following formula: k = S2 / n0, where S2 is the number of elements in the union of sets A1 and A2.
6. The method according to claim 4, characterized in that, The method further includes: Get the total amount of data n in the first data pool 11 and the total amount of data n in the second data pool 21 ; Get the number of data points n that decreased in the first data pool during the previous data processing. 12 ; The conversion factor can be obtained using the following formula: Where N is the preset upper limit of data.
7. The method according to any one of claims 2-6, characterized in that, The method further includes: The constant values of the pricing function model are adjusted based on the data obtained from the oracle monitoring system.
8. A data processing device based on a data pool, characterized in that, The device includes: The data acquisition module is used to acquire the first amount of data to be deducted from the first data pool; The data calculation module is used to calculate the amount of second data to be added to the second data pool based on the pricing function model in the preset smart contract and the first data volume. The smart contract is connected to the oracle monitoring system and is used to adjust the pricing function model based on the data obtained by the oracle monitoring system. The pricing model is M = X * Y or M = X * Y * k, where M is a constant value of the pricing function model, X is the total number of items in the second data pool, Y is the total number of items in the first data pool, and k is a conversion coefficient. The data processing module is used to process the data volume of the first data pool and the second data pool according to the first data volume and the second data volume.
9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, performs the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Systems and methods of blockchain platform for automated asset based provisioning of resources
US20200074493A1
Information system for buying and selling electrical energy
WO2020231288A1