Oracle data processing method and centralized oracle module
By acquiring blockchain events in the oracle system and aggregating data between multiple nodes, the problem of data processing reliability and efficiency in oracle technology is solved, and efficient and reliable third-party data acquisition and processing is achieved.
Patent Information
- Application Number
- CN202111470564.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-12-03
AI Technical Summary
When obtaining third-party data from blockchain, existing oracle technologies are difficult to meet the reliability and efficiency requirements of data processing at the same time. The centralized oracle system has poor reliability, while the decentralized system has a low decline in aggregation efficiency. question.
In the oracle system, by obtaining oracle events of the blockchain, requesting the target data source and sending the data to multiple oracle nodes, the node data is aggregated based on the pre-stored aggregation strategy, and the node status and data adoption are detected. Rules to ensure data reliability and efficiency.
It improves the efficiency and reliability of external data acquisition of blockchain, enhances the timeliness and authenticity of data processing, and further improves the stability and security of the system through aggregation strategies and data adoption rules.
Smart Images

Figure CN114143333B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, in particular to the field of blockchain technology, and specifically to an oracle data processing method and a centralized oracle module. Background Art
[0002] Oracles solve the problem of impedance mismatch in the outside world of blockchain. Oracles expand the scope of information that blockchain can obtain. They can find and verify real-world data and submit information to smart contracts in an encrypted manner. Oracles are like third-party data agents in the blockchain world.
[0003] At present, there are usually two ways to process oracle data to obtain third-party data outside the blockchain through oracle technology. The first is to use a centralized oracle system, that is, all data channels for obtaining information need to go through this centralized oracle system to obtain third-party data from external data sources of the blockchain. The second is to use a decentralized oracle system distributed in different network nodes. When acquiring and aggregating data, it needs to be done from different nodes, which also means that the oracle nodes of the entire network need to reach a unified aggregation result.
[0004] However, the common problem of centralized oracle systems is poor reliability, and the feedback nodes are all obtained through single information. Once the system itself is malicious or receives other malicious attacks, the data transmitted to the blockchain by the oracle system may become unreliable. The design of decentralized oracle is to distribute the oracle to different nodes in the network for calling. Although this method can improve the reliability of the entire oracle system, it is ultimately necessary to aggregate the result sets of third-party data sources obtained by each oracle. As the number of oracle nodes increases, the aggregation efficiency may be correspondingly lower. In other words, the existing oracle data processing methods that obtain third-party data outside the blockchain through oracle technology all have the problem of not being able to simultaneously meet the reliability and efficiency requirements of oracle data processing. Summary of the invention
[0005] In response to the problems in the prior art, the present application provides an oracle data processing method and a centralized oracle module, which can effectively improve the efficiency and reliability of the oracle data processing process, and thereby effectively improve the efficiency, reliability and authenticity of obtaining third-party data from outside the blockchain.
[0006] In order to solve the above technical problems, this application provides the following technical solutions:
[0007] In a first aspect, the present application provides a method for processing oracle data, comprising:
[0008] Within the oracle system, obtaining oracle data corresponding to the oracle event of the blockchain for requesting target external data from a target data source outside the blockchain;
[0009] Sending the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data;
[0010] Based on the aggregation strategy corresponding to the target data source pre-stored locally, the target external data sent by each target oracle node is aggregated, and the corresponding aggregation result is sent to the blockchain.
[0011] Furthermore, before aggregating the target external data sent by each of the target oracle nodes based on the aggregation strategy corresponding to the target data source pre-stored locally, it also includes:
[0012] Detect whether each of the current target oracle nodes has sent the target external data;
[0013] If all the target oracle nodes have currently sent the target external data, or if the target oracle nodes that have not currently sent the target external data are in a timeout state, the aggregation strategy corresponding to the target data source is obtained locally.
[0014] Further, the aggregation strategy includes: data adoption rules and aggregation algorithms;
[0015] Correspondingly, the target external data sent by each of the target oracle nodes is aggregated based on the aggregation strategy corresponding to the target data source pre-stored locally, including:
[0016] Determine whether the target external data sent by each of the target oracle nodes conforms to the data adoption rule, and if so, select multiple data to be aggregated from each of the target external data based on the data adoption rule;
[0017] Aggregation processing is performed on each of the to-be-aggregated data based on the aggregation algorithm.
[0018] Furthermore, the determining whether the target external data sent by each of the target oracle nodes meets the data adoption rule, and if so, selecting a plurality of data to be aggregated from each of the target external data based on the data adoption rule, includes:
[0019] Determine whether the total number of the target external data with the same data in the target external data sent by each of the target oracle nodes is greater than or equal to the total number threshold of the same data specified by the data adoption rule. If so, all the target external data with the same data are selected as the data to be aggregated.
[0020] Furthermore, obtaining, within the oracle system, oracle data corresponding to the oracle event of the blockchain for requesting target external data from a target data source outside the blockchain includes:
[0021] If the oracle event is detected on the blockchain, the oracle event is stored in the oracle system.
[0022] Obtaining a unique identifier of a target data source external to the blockchain from the oracle event;
[0023] Determine whether the target data source has been locally registered based on the unique identifier of the target data source. If so, generate oracle data corresponding to the oracle event for requesting target external data from the target data source outside the blockchain.
[0024] Further, the generating of oracle data corresponding to the oracle event for requesting target external data from a target data source outside the blockchain includes:
[0025] Extracting a target variable for requesting target external data from the target data source from the oracle event;
[0026] Based on a preset standard protocol format, converting the target variable into a corresponding standard protocol, wherein the standard protocol is used to store the corresponding relationship between each field name, field type and field description in the target variable;
[0027] The standard protocol is compressed to obtain the oracle data corresponding to the oracle event.
[0028] Furthermore, it also includes:
[0029] Receiving a data source registration request, wherein the data source registration request includes a unique identifier of a data source external to the blockchain;
[0030] The data source is registered locally in the oracle system according to the unique identifier of the data source, and the aggregation strategy corresponding to the data source is obtained, and the aggregation strategy of the data source is stored locally in the oracle system.
[0031] Further, sending the oracle data to each target oracle node outside the oracle system so that each target oracle node obtains the target external data from the target data source according to the oracle data, includes:
[0032] Find each oracle node that has been registered with the oracle system and is currently available, and determine each oracle node that has been registered with the oracle system and is currently available as the current target oracle node;
[0033] Sending the oracle data to each of the target oracle nodes respectively, so that each of the target oracle nodes respectively obtains the target external data from the target data source according to the oracle data;
[0034] Wherein, obtaining the target external data from the target data source according to the oracle data respectively includes:
[0035] Parsing the oracle data to obtain a unique identifier of the target data source and a unique identifier of the target external data, accessing the target data source according to the unique identifier of the target data source, and extracting a result set including the target external data from the target data source based on the unique identifier of the target external data;
[0036] Encrypting and signing the result set to obtain corresponding signature information;
[0037] The result set and the signature information are sent to the oracle system.
[0038] Furthermore, before sending the oracle data to each target oracle node outside the oracle system, it also includes:
[0039] Receive a oracle node registration request, wherein the oracle node registration request includes a unique identifier of a service device;
[0040] According to the unique identification of the service device, the service device is registered locally in the oracle system to identify the service device as the oracle node, and the registered oracle node is set at any location that can be connected to the local network.
[0041] In a second aspect, the present application provides a centralized oracle module, including:
[0042] A data acquisition module, used to obtain, within the oracle system, oracle data corresponding to the oracle event of the blockchain and used to request target external data from a target data source outside the blockchain;
[0043] A data distribution module, used for sending the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data;
[0044] The data aggregation module is used to aggregate the target external data sent by each of the target oracle nodes based on the aggregation strategy corresponding to the target data source pre-stored locally, and send the corresponding aggregation results to the blockchain.
[0045] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the oracle data processing method when executing the program.
[0046] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the oracle data processing method when executed by a processor.
[0047] It can be seen from the above technical scheme that the present application provides an oracle data processing method and a centralized oracle module, the method comprising: obtaining, within the oracle system, oracle data corresponding to the oracle event of the blockchain, which is used to request target external data from the target data source outside the blockchain; sending the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data; based on the aggregation strategy corresponding to the target data source pre-stored locally, the target external data sent by each target oracle node is aggregated, and the corresponding aggregation result is sent to the blockchain. By extracting the oracle data in the oracle event within the oracle system and aggregating the target external data sent by each oracle node, it is possible to effectively realize the centralized extraction of the oracle from the blockchain. The oracle data and external data aggregation processing can effectively improve the efficiency of the oracle data processing process such as extracting oracle data from the blockchain and performing external data aggregation processing, thereby effectively improving the efficiency of obtaining third-party data from outside the blockchain, and improving the operational stability of the blockchain and the timeliness of data processing; by sending the oracle data to each oracle node outside the oracle system to achieve the acquisition of third-party data, it can effectively achieve decentralized acquisition of third-party data from outside the blockchain for multiple times and then aggregation, which can effectively improve the reliability of the oracle data processing process, thereby effectively improving the reliability and authenticity of third-party data obtained from outside the blockchain; at the same time, by adopting the aggregation strategy corresponding to the target data source pre-stored in the oracle system to aggregate external data, the reliability of the oracle data processing process can be further improved, so as to further improve the reliability and authenticity of third-party data obtained from outside the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 It is a schematic diagram of the deployment architecture of the oracle system and oracle nodes in the embodiment of the present application.
[0050] Figure 2 It is a first flow chart of the oracle data processing method in the embodiment of the present application.
[0051] Figure 3It is a second flow chart of the oracle data processing method in the embodiment of the present application.
[0052] Figure 4 It is a third flow chart of the oracle data processing method in the embodiment of the present application.
[0053] Figure 5 This is the fourth flow chart of the oracle data processing method in the embodiment of the present application.
[0054] Figure 6 This is the fifth flow chart of the oracle data processing method in the embodiment of the present application.
[0055] Figure 7 This is the sixth flow chart of the oracle data processing method in the embodiment of the present application.
[0056] Figure 8 This is the seventh flow chart of the oracle data processing method in the embodiment of the present application.
[0057] Fig. 9 This is the eighth flow chart of the oracle data processing method in the embodiment of the present application.
[0058] Fig.10 This is the ninth flow chart of the oracle data processing method in the embodiment of the present application.
[0059] Fig.11 It is a structural diagram of the centralized oracle module in the embodiment of the present application.
[0060] Fig.12 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0062] It should be noted that the oracle data processing method and device disclosed in the present application can be used in the field of blockchain technology, and can also be used in any field outside the field of blockchain technology. The application field of the oracle data processing method and device disclosed in the present application is not limited.
[0063] Smart contracts are actually just a user-defined program that can be defined according to the user's business details. When the nodes on the blockchain install smart contracts, the relevant logic of the smart contracts can be implemented. Since all operations through smart contracts are completed on the chain, and the data on the chain is visible and trusted to all users of the current chain (the alliance chain is visible to all nodes with corresponding permissions that have joined the alliance chain, and the public chain is visible to everyone), the logic and data executed by the smart contract are also trusted.
[0064] Oracles solve the problem of impedance mismatch in the outside world of blockchain. Oracles expand the scope of information that blockchain can obtain. They can find and verify real-world data and submit information to smart contracts in an encrypted manner. Oracles are like third-party data agents in the blockchain world.
[0065] The current oracle technology solutions include:
[0066] 1) Centralized oracle system solution. A centralized oracle system means that the oracle system belongs to a centralized system, that is, all data channels for obtaining information need to go through this centralized oracle system to obtain data from external data sources.
[0067] 2) Decentralized oracle system solution. The decentralized oracle system is distributed among different network nodes. When acquiring and aggregating data, it needs to be done from different nodes, which also means that the oracle nodes of the entire network need to reach a unified aggregation result.
[0068] However, a common problem of centralized oracle systems is poor reliability, and the feedback nodes are all obtained through single information. Once the system itself acts maliciously or receives other malicious attacks, the data transmitted by the oracle system to the blockchain may become unreliable. This unreliable system design runs counter to the technical essence of the blockchain itself.
[0069] The existing decentralized oracle design is to distribute the oracles across different nodes in the network for calling. Although this method can improve the reliability of the entire oracle system, it ultimately needs to aggregate the result sets of third-party data sources obtained by each oracle. As the number of oracle nodes increases, the aggregation efficiency may be correspondingly lower.
[0070] Based on this, the existing oracle data processing methods for obtaining third-party data outside the blockchain through oracle technology all have the problem of being unable to simultaneously meet the reliability and efficiency requirements of oracle data processing. The embodiment of the present application provides an oracle data processing method, which obtains oracle data corresponding to the oracle event of the blockchain and is used to request target external data from the target data source outside the blockchain within the oracle system; sends the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data; based on the aggregation strategy corresponding to the target data source pre-stored locally, aggregates the target external data sent by each target oracle node, and sends the corresponding aggregation result to the blockchain, by extracting the oracle data in the oracle event within the oracle system, and aggregating the target external data sent by each oracle node Processing can effectively realize the centralized extraction of oracle data from the blockchain and external data aggregation processing, can effectively improve the efficiency of oracle data processing processes such as extracting oracle data from the blockchain and external data aggregation processing, and thus can effectively improve the efficiency of obtaining third-party data from outside the blockchain, improve the operational stability of the blockchain and the timeliness of data processing; by sending the oracle data to each oracle node outside the oracle system to achieve the acquisition of third-party data, it can effectively realize the decentralized acquisition of third-party data from outside the blockchain for multiple times and then aggregation, can effectively improve the reliability of the oracle data processing process, and thus can effectively improve the reliability and authenticity of third-party data obtained from outside the blockchain; at the same time, by adopting the aggregation strategy corresponding to the target data source pre-stored in the oracle system to aggregate external data, the reliability of the oracle data processing process can be further improved, so as to further improve the reliability and authenticity of third-party data obtained from outside the blockchain.
[0071] In one or more embodiments of the present application, an oracle is a system that enables a smart contract to obtain external data. The oracle system has been deployed and run in advance, and the chain module of the oracle system has been associated with a node on the chain, that is, the chain module can initiate a call request to the smart contract deployed on the node through the chain node.
[0072] In one or more embodiments of the present application, a oracle node refers to: the oracle system needs the ability to obtain external data sources, and such ability needs to be implemented by a relatively independent system. The main ability of such systems is to achieve distributed operation, that is, the nodes deployed by such systems can be distributed in various companies or enterprises or other servers accessible to the public network. The deployed oracle nodes can call external data sources and obtain corresponding return data through instructions sent by the oracle system.
[0073] Based on the above content, the present application also provides a centralized oracle module for implementing the oracle data processing method provided in one or more embodiments of the present application. The specific implementation of the centralized oracle module can be a server. In a specific example, see Figure 1 , the centralized oracle module can be set inside a centralized oracle system; the centralized oracle module and each oracle node outside the oracle system are respectively and sequentially communicated and connected; each oracle node includes oracle node A, oracle node B to oracle node N, etc., and N is a positive integer greater than 2. Each of the oracle nodes is respectively communicated and connected with a third-party data source (the data source or target data source mentioned in the embodiment of the present application); the third-party data source includes data source A and data source B, and data source A and data source B respectively include multiple interfaces, such as interface API1, interface API2 and interface API3; and the centralized oracle module can be connected and correspond to at least one blockchain, each blockchain includes multiple blockchain nodes corresponding to enterprises, such as node 1, node 2 to node N, and N is a positive integer greater than 2.
[0074] In addition, users can send blockchain data processing requests with external data acquisition requirements to the blockchain through their client devices, so that the centralized oracle module obtains the target data source corresponding to the external data acquisition requirements from the blockchain data processing request.
[0075] It is understandable that the client device may include any mobile device capable of loading applications, such as a smart phone, a tablet electronic device, a network set-top box, a portable computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0076] The above-mentioned mobile terminal may have a communication module (i.e., a communication unit), which can communicate with a remote target blockchain to realize data transmission with the target blockchain.
[0077] The details are described in detail through the following embodiments and application examples.
[0078] In order to solve the problem that the existing oracle data processing methods for obtaining third-party data outside the blockchain through oracle technology cannot simultaneously meet the requirements of oracle data processing reliability and efficiency, this application provides an embodiment of an oracle data processing method, see Figure 2 The oracle data processing method based on the centralized oracle module specifically includes the following contents:
[0079] Step 100: Within the oracle system, obtain oracle data corresponding to the oracle event of the blockchain, which is used to request target external data from a target data source outside the blockchain.
[0080] It is understandable that the centralized oracle module of the oracle system is deployed on a central server, while multiple decentralized modules are deployed on servers with different network addresses that can be connected.
[0081] In step 100, the centralized oracle module of the oracle system obtains the request of the external data source that the user needs to delegate by listening to the transaction of the oracle event on the chain. This request can be defined as an oracle event in the present invention. The user here can be the actual operating user of the application system on the upper layer of the blockchain, or the program of the application system connected to the blockchain interface, or the smart contract itself.
[0082] Step 200: Send the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data.
[0083] In step 200, the decentralized oracle node can receive documents in yaml and json formats that conform to the standard protocol data structure definition, and then parse and execute the API url, method, parameter type, etc. corresponding to the data source described in the standard document, and then initiate a call to the third-party data source.
[0084] Step 300: Based on the aggregation strategy corresponding to the target data source pre-stored locally, the target external data sent by each of the target oracle nodes is aggregated, and the corresponding aggregation results are sent to the blockchain.
[0085] In step 300, the aggregation strategy is determined when the data source is registered in the centralized oracle module, for example, the "consensus aggregation strategy" is used when registering an API of the data source.
[0086] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application can effectively realize the centralized extraction of oracle data from the blockchain and external data aggregation processing by extracting oracle data in oracle events within the oracle system and aggregating the target external data sent by each of the oracle nodes, which can effectively improve the efficiency of oracle data processing processes such as extracting oracle data from the blockchain and performing external data aggregation processing, thereby effectively improving the efficiency of obtaining third-party data from outside the blockchain, and improving the operational stability of the blockchain and the timeliness of data processing; by sending the oracle data to each oracle node outside the oracle system to achieve the acquisition of third-party data, it can effectively realize the decentralized acquisition of third-party data from outside the blockchain multiple times and then aggregation, which can effectively improve the reliability of the oracle data processing process, thereby effectively improving the reliability and authenticity of the third-party data obtained from outside the blockchain; at the same time, by adopting the aggregation strategy corresponding to the target data source pre-stored in the oracle system to aggregate external data, the reliability of the oracle data processing process can be further improved, so as to further improve the reliability and authenticity of the third-party data obtained from outside the blockchain.
[0087] In order to further improve the reliability and effectiveness of the aggregate processing of the target external data sent by each of the target oracle nodes, an embodiment of the oracle data processing method provided in this application is provided. Figure 3 The oracle data processing method further specifically includes the following contents between step 200 and step 300:
[0088] Step 001: Detect whether each of the current target oracle nodes has sent the target external data.
[0089] Step 002: If all the target oracle nodes have currently sent the target external data, or if the target oracle nodes that have not currently sent the target external data are in a timeout state, then the aggregation strategy corresponding to the target data source is obtained locally.
[0090] For example, the centralized oracle system module receives return data from decentralized oracle nodes in different time periods. When the return data from all oracle nodes is received (this also includes oracle nodes with timeouts, such as oracle nodes A, B, C, and D, where ABD all return normally. At this time, the module receiving the data set in the centralized oracle system waits until C times out before proceeding to the next step), it starts to aggregate all the result sets.
[0091] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application can effectively improve the reliability and effectiveness of the aggregation processing of the target external data sent by each of the target oracle nodes by obtaining the aggregation strategy corresponding to the target data source locally if the target oracle nodes have currently sent the target external data, or if the target oracle nodes that have not currently sent the target external data are in a timeout state, and can effectively improve the efficiency of the aggregation processing on the basis of ensuring the reliability and effectiveness of the aggregation processing, thereby further improving the reliability and efficiency of the oracle data processing.
[0092] In order to further improve the reliability and accuracy of the aggregation processing of target external data, in one embodiment of the oracle data processing method provided in this application, the aggregation strategy includes: data adoption rules and aggregation algorithms; see Figure 4 , step 300 of the oracle data processing method specifically includes the following contents:
[0093] Step 310: Determine whether the target external data sent by each of the target oracle nodes complies with the data adoption rules. If so, execute step 320; if not, continue to wait for a preset time and execute the judgment process of step 310 again.
[0094] Step 320: selecting a plurality of data to be aggregated from each of the target external data based on the data adoption rule;
[0095] Step 330: Aggregate each of the to-be-aggregated data based on the aggregation algorithm.
[0096] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application can further improve the reliability and accuracy of the aggregation processing of the target external data by adopting data adoption rules and aggregation algorithms to aggregate the target external data, and can further improve the reliability and effectiveness of the oracle data processing, thereby effectively improving the data authenticity and reliability of the aggregation results subsequently sent to the blockchain.
[0097] In order to improve the reliability of determining whether the target external data complies with the data adoption rules, an embodiment of the oracle data processing method provided in this application is provided. Figure 5 , step 310 of the oracle data processing method specifically includes the following contents:
[0098] Step 311: Determine whether the total number of target external data with the same data among the target external data sent by each of the target oracle nodes is greater than or equal to the total number threshold of the same data specified by the data adoption rule; if so, execute step 320;
[0099] See also Figure 5 , the step 320 specifically includes the following contents:
[0100] Step 321: Select all target external data with the same data as data to be aggregated.
[0101] For example, the aggregation strategy is determined when the data source is registered in the centralized oracle module described in the present invention. For example, when registering an API of the data source, the consensus aggregation strategy is adopted, which means that only data results of more than 1 / 2 of the same returned data set are considered correct, and other values inconsistent with this result will not be adopted. Therefore, the result set aggregated by many decentralized oracle nodes here can be considered as a credible data set. As long as the number of malicious nodes does not exceed 1 / 2 of the total number of oracle nodes, the data of the external data source obtained on the chain can be a credible and correct value.
[0102] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application can effectively improve the reliability of judging whether the target external data complies with the data adoption rules by adopting the same total data threshold value to judge whether the target external data sent by each target oracle node complies with the data adoption rules, and can further improve the reliability of oracle data processing, thereby further improving the data authenticity and reliability of the aggregation results subsequently sent to the blockchain.
[0103] In order to improve the security and effectiveness of the oracle data corresponding to the oracle event for requesting the target external data from the target data source outside the blockchain, an embodiment of the oracle data processing method provided in this application is provided, see Figure 6 , step 100 of the oracle data processing method specifically includes the following contents:
[0104] Step 110: If the blockchain is monitored to generate an oracle event, the oracle event is stored inside the oracle system.
[0105] Step 120: parse the oracle event to obtain a unique identifier of the target data source outside the blockchain.
[0106] Step 130: Determine whether the target data source has been locally registered based on the unique identifier of the target data source. If so, generate oracle data corresponding to the oracle event for requesting target external data from the target data source outside the blockchain.
[0107] For example, the centralized oracle module of the oracle system stores the oracle events in the on-chain transactions it monitors in the database of the centralized system. Then the relevant processing module of the centralized system processes the oracle events and parses the third-party data source that the user needs to call from the oracle events. The third-party data source that needs to be called here needs to be a data source that the current centralized system can support. If it is a data source that the centralized system does not support, the corresponding error message is returned.
[0108] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application can effectively improve the security and effectiveness of the oracle data corresponding to the oracle event for requesting target external data from the target data source outside the blockchain by detecting whether the data source has been registered locally, and further improve the reliability, security and effectiveness of the oracle data processing process.
[0109] In order to improve the data standardization degree of each target oracle node obtaining the target external data from the target data source according to the oracle data, an embodiment of the oracle data processing method provided in the present application is provided. Figure 7 , step 130 of the oracle data processing method specifically includes the following contents:
[0110] Step 131: Extract a target variable from the oracle event for requesting target external data from the target data source.
[0111] Step 132: Based on a preset standard protocol format, convert the target variable into a corresponding standard protocol, wherein the standard protocol is used to store the corresponding relationship between each field name, field type and field description in the target variable.
[0112] Step 133: compress the standard protocol to obtain the oracle data corresponding to the oracle event.
[0113] For example, the centralized oracle module of the oracle system fills the variables passed by the user in the document format that can be parsed by the decentralized oracle node according to the preset standard protocol format template, and fills the content of {{variable name}} with the relevant fields defined in the oracle event. The content after filling is a complete version of the standard protocol that can be called by the decentralized oracle node. And the decentralized oracle module can accept documents defined by the standard protocol.
[0114] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application, by converting the target variable into a corresponding standard protocol based on a preset standard protocol format, can effectively improve the data normalization degree of each target oracle node in obtaining the target external data from the target data source according to the oracle data, thereby further improving the efficiency and reliability of the oracle data processing process.
[0115] In order to improve the effectiveness and reliability of determining whether the target data source has been registered locally, an embodiment of the oracle data processing method provided in this application is provided. Figure 8 , before step 100 in the oracle data processing method or during or after the execution of each step, the following contents may be specifically included:
[0116] Step 011: Receive a data source registration request, wherein the data source registration request includes a unique identifier of a data source outside the blockchain.
[0117] Step 012: Register the data source locally to the oracle system based on the unique identifier of the data source, obtain the aggregation strategy corresponding to the data source, and store the aggregation strategy of the data source locally to the oracle system.
[0118] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application can effectively improve the effectiveness and reliability of judging whether the target data source has been registered locally by pre-registering the data source and storing its corresponding aggregation strategy, and can provide an accurate and effective data basis for the subsequent aggregation processing of the target external data sent by each of the target oracle nodes, so as to further improve the reliability, effectiveness and authenticity of the oracle data processing process.
[0119] In order to improve the reliability and effectiveness of sending the oracle data to each target oracle node outside the oracle system, an embodiment of the oracle data processing method provided in the present application is provided. Fig. 9 , step 200 of the oracle data processing method specifically includes the following contents:
[0120] Step 210: Find each oracle node that has been registered with the oracle system and is currently in an available state, and determine each oracle node that has been registered with the oracle system and is currently in an available state as the current target oracle node;
[0121] Step 220: Send the oracle data to each of the target oracle nodes respectively, so that each of the target oracle nodes obtains the target external data from the target data source respectively according to the oracle data.
[0122] Wherein, obtaining the target external data from the target data source according to the oracle data respectively includes:
[0123] 1) parsing the oracle data to obtain the unique identifier of the target data source and the unique identifier of the target external data, accessing the target data source according to the unique identifier of the target data source, and extracting a result set including the target external data from the target data source based on the unique identifier of the target external data;
[0124] 2) encrypting and signing the result set to obtain corresponding signature information;
[0125] 3) Sending the result set and the signature information to the oracle system.
[0126] For example, in the call request sent by the centralized oracle module to all decentralized oracle nodes, all decentralized oracle nodes initiate calls to third-party data sources through the rules of the standard protocol and obtain the corresponding return result set of the external data source. These result sets will be encrypted and signed by the decentralized oracle nodes to ensure the traceability of the data result set, and then the signature information and the original data will be returned to the centralized oracle system. Since oracle nodes can be distributed in various organizations, network nodes, etc., their main ability is to obtain data from external data sources and return the result set to the centralized oracle system.
[0127] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application can effectively improve the reliability and effectiveness of sending the oracle data to each target oracle node outside the oracle system by searching for each oracle node that has been registered with the oracle system and is currently in an available state, so as to further improve the reliability, effectiveness and authenticity of the oracle data processing process.
[0128] In order to further improve the efficiency and reliability of sending the oracle data to each target oracle node outside the oracle system, an embodiment of the oracle data processing method provided in the present application is provided. Fig.10 , the oracle data processing method may specifically include the following contents before step 200 or when, before or after any step is executed:
[0129] Step 021: Receive a oracle node registration request, wherein the oracle node registration request includes a unique identifier of the service device.
[0130] Step 022: Based on the unique identifier of the service device, register the service device locally in the oracle system to identify the service device as the oracle node, and set the registered oracle node at any location that can be connected to the local network.
[0131] For example, decentralized oracle nodes need to be registered in the centralized oracle system. These registered oracle nodes can be distributed anywhere that the centralized oracle module network can connect to, and in theory, the oracle nodes can grow indefinitely.
[0132] From the above description, it can be seen that the oracle data processing method provided in the embodiment of the present application, by pre-registering the service device locally in the oracle system to determine the service device as the oracle node, and setting the registered oracle node at any location that can be connected to the local network, can further improve the efficiency and reliability of sending the oracle data to each target oracle node outside the oracle system, so as to further improve the reliability and efficiency of the oracle data processing process.
[0133] From the software level, in order to solve the problem that the existing oracle data processing methods that obtain third-party data outside the blockchain through oracle technology cannot simultaneously meet the requirements of oracle data processing reliability and efficiency, this application provides an embodiment of a centralized oracle module for executing all or part of the contents of the oracle data processing method, see Fig.11 , the centralized oracle module specifically includes the following contents:
[0134] A data acquisition module 10 is used to obtain, within the oracle system, oracle data corresponding to the oracle event of the blockchain and used to request target external data from a target data source outside the blockchain;
[0135] The data distribution module 20 is used to send the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data;
[0136] The data aggregation module 30 is used to aggregate the target external data sent by each of the target oracle nodes based on the aggregation strategy corresponding to the target data source pre-stored locally, and send the corresponding aggregation results to the blockchain.
[0137] The embodiment of the centralized oracle module provided in this application can be specifically used to execute the processing flow of the embodiment of the oracle data processing method in the above-mentioned embodiment. Its functions will not be repeated here, and reference can be made to the detailed description of the above-mentioned method embodiment.
[0138] From the above description, it can be seen that the centralized oracle module provided in the embodiment of the present application can effectively realize the centralized extraction of oracle data from the blockchain and external data aggregation processing by extracting oracle data in oracle events within the oracle system and aggregating the target external data sent by each of the oracle nodes, which can effectively improve the efficiency of oracle data processing processes such as extracting oracle data from the blockchain and performing external data aggregation processing, thereby effectively improving the efficiency of obtaining third-party data from outside the blockchain, and improving the operational stability of the blockchain and the timeliness of data processing; by sending the oracle data to each oracle node outside the oracle system to obtain third-party data, it can effectively realize decentralized acquisition of third-party data from outside the blockchain for multiple times and then aggregation, which can effectively improve the reliability of the oracle data processing process, thereby effectively improving the reliability and authenticity of third-party data obtained from outside the blockchain; at the same time, by adopting the aggregation strategy corresponding to the target data source pre-stored in the oracle system to aggregate external data, the reliability of the oracle data processing process can be further improved, so as to further improve the reliability and authenticity of third-party data obtained from outside the blockchain.
[0139] To further illustrate the present solution, the application example of the present application involves a design scheme for an oracle node system that needs to call external data for an oracle system that is connected to a consortium chain or a public chain. A technical scheme for an oracle system that combines the advantages of centralization and decentralized reliability is designed, which is specifically embodied in an oracle data processing method; it is used to solve the problem that smart contracts can obtain data from external data sources through the oracle system. The problem solved by the application example of the present application is to split the oracle system into two parts, one of which is a centralized module. This centralized oracle module is mainly used to process the demand for external data on the chain, and then obtain data from external data sources through decentralized nodes and aggregate them in the centralized oracle system module and finally return the data to the chain.
[0140] Specifically, the oracle data processing method provided by the application example of this application specifically includes the following contents:
[0141] Step 1: The centralized oracle module of the oracle system is deployed on a central server, while multiple decentralized modules are deployed on servers with different network addresses that can be connected.
[0142] Step 2: The centralized oracle module of the oracle system obtains the request for the external data source that the user needs to delegate by listening to the oracle event transactions on the chain. This request can be defined as an oracle event in the application example of this application. The user here can be the actual operating user of the application system on the upper layer of the blockchain, the program of the application system connected to the blockchain interface, or the smart contract itself.
[0143] Step 3: The centralized oracle module of the oracle system stores the oracle events in the on-chain transactions it monitors in the database of the centralized system. Then the relevant processing module of the centralized system processes the oracle events and parses the third-party data source that the user needs to call from the oracle events. The third-party data source that needs to be called here needs to be a data source that the current centralized system can support. If it is a data source that the centralized system does not support, the corresponding error message is returned.
[0144] Step 4: The centralized oracle module of the oracle system in the application example of this application fills the variables passed by the user in the document format that can be parsed by the decentralized oracle node according to the following template, and fills the content of {{variable name}} with the relevant fields defined in the oracle event. The content after filling is a complete version of the standard protocol that can be called by the decentralized oracle node. The specific content of the protocol can be viewed in the subsequent steps.
[0145] Step 5: The decentralized oracle module in the application example of this application can accept documents defined by the standard protocol. In the application example of this application, the decentralized oracle module is defined as an oracle node. The format definition of the standard document that can be executed and called by the oracle node is shown in Tables 1 to 4.
[0146] Table 1 - Standard protocol fields
[0147]
[0148] Table 2-Request Object data structure in the common data structure definition
[0149]
[0150]
[0151] Table 3 - Response Object data structure in common data structure definition
[0152]
[0153] Table 4 - Body Object data structure in the public data structure definition
[0154]
[0155] The above data structure can be used to define the third-party data source that the user needs to call and the variables passed in for filling. The filling process is performed in a centralized module. If the filling template is in Yaml format, the content is shown in Table 5:
[0156] Table 5 - Examples of filling variables in a filling template
[0157]
[0158]
[0159] The contents of {{location}}, {{language}}, and {{unit}} in Table 5 above all refer to the variable values that can be replaced by the variable values passed in by the client in the oracle event. For example, if the variables passed in by the user in the oracle event are: location = China, language = Chinese, unit = 1, then the contents of {{location}}, {{language}}, and {{unit}} are replaced by the values of China, Chinese, and 1, respectively.
[0160] Among them, the content defined in the standard protocol field in step 5 can be further changed and altered according to the actual situation, and does not necessarily have to be defined according to the data structure of the standard protocol described in this solution. The main purpose of the standard protocol is to enable decentralized oracle nodes to parse the call information of the interface that needs to call the third-party data source. Therefore, as long as the decentralized oracle node can parse this content, in theory, any data structure definition can be made according to the actual situation.
[0161] Step 6: Before step 6, decentralized oracle nodes need to be registered in the centralized oracle system. These registered oracle nodes can be distributed anywhere that the centralized oracle module network can connect to, and in theory, the oracle nodes can grow indefinitely.
[0162] In step 5, the centralized oracle system module packages the processed standard protocol and searches for all registered and available decentralized oracle nodes in the system, and sends the filled standard protocol to all these oracle nodes.
[0163] Decentralized oracle nodes can receive documents in yaml and json formats that conform to the standard protocol data structure definition, and then parse and execute the API url, method, parameter type, etc. corresponding to the data source described in the document, and then initiate a call to the third-party data source.
[0164] For example: the third-party data source calls a weather network, which has an API named "Get current real-time weather information data" (the API under the data source supported by the solution described in the application example of this application needs to be defined and registered in the centralized oracle module of the application example of this application in advance). The oracle node will parse the standard protocol and initiate an http call to it according to the calling rules of the API named "Get current weather information data" under the data source (the calling protocol here is defined in the standard protocol, and the content defined in the standard protocol needs to comply with the calling rules of the external data source API).
[0165] Step 7: In step 5, in the call request sent by the centralized oracle module to all decentralized oracle nodes, all decentralized oracle nodes initiate calls to third-party data sources through the rules of the standard protocol and obtain the corresponding return result set of the external data source. These result sets will be encrypted and signed by the decentralized oracle nodes to ensure the traceability of the data result set, and then the signature information and the original data will be returned to the centralized oracle system. Since the oracle nodes can be distributed in various organizations, network nodes and other locations, their main ability is to obtain data from external data sources and return the result set to the centralized oracle system.
[0166] Step 8: The centralized oracle system module receives the return data from the decentralized oracle nodes in different time periods. When the return data of all oracle nodes is received (this also includes oracle nodes with timeouts, such as oracle nodes A, B, C, and D, where ABD all return normally. At this time, the module receiving the data set of the centralized oracle system waits until C times out before entering the next step), it starts to aggregate all result sets. The aggregation strategy here is determined when the data source is registered in the centralized oracle module described in the application example of this application. For example, when registering an API of the data source, the "consensus aggregation strategy" is adopted. This means that only data results of more than 1 / 2 of the same returned data set are considered correct, and other values inconsistent with this result will not be adopted. Therefore, the result set aggregated by the many decentralized oracle nodes here can be considered a credible data set. As long as the number of malicious nodes does not exceed 1 / 2 of the total number of oracle nodes, the data of the external data source obtained on the chain can be a credible and correct value.
[0167] Step 9: After the centralized oracle system module completes the aggregation process of the data set returned by the decentralized language and nodes based on step 8, the centralized oracle system module will send the data to the chain, thus completing the process of uploading the trusted data obtained from the external data source off-chain.
[0168] The oracle data processing method provided in the application example of this application enables users to obtain data information outside the chain through smart contracts. In the absence of a system such as an oracle, the blockchain itself cannot obtain real-time information data from the outside world, which also causes a split between the blockchain world and the real world. The design scheme of the oracle system described in the application example of this application proposes such a feasible oracle system that combines the advantages of centralized and decentralized architectures. The centralized oracle module in the scheme design described in this scheme not only ensures the credibility of the external data source itself to a certain extent (the data source needs to be registered in the centralized oracle system), but also improves the efficiency of data aggregation processing, and can also register different types of aggregation schemes according to the characteristics of the data source itself.
[0169] The decentralized oracle node described in this oracle data processing method is mainly responsible for receiving the content defined by the standard protocol and initiating calls to the API interface of the third-party data source. Since the oracle node can be located anywhere in the network, the oracle node can be deployed in any network segment and location of the participating organization or personal server on the blockchain. Because the oracle node itself is completely separated from the centralized oracle system, the oracle node is only responsible for calling according to the content described in the protocol, which greatly ensures that the centralized oracle system has no additional interference to it and the autonomy of the oracle node, which meets the basic requirements of decentralization.
[0170] Finally, the decentralized oracle node obtains the data from the external data source and signs it back to the centralized oracle system module, where it is aggregated. The entire process avoids the inefficiency of the system caused by a large number of oracle nodes having to participate in the aggregation, while also excluding the corresponding malicious nodes from the data returned by many oracle nodes.
[0171] From the hardware level, in order to solve the problem that the existing oracle data processing methods for obtaining third-party data outside the blockchain through oracle technology cannot simultaneously meet the requirements of oracle data processing reliability and efficiency, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the oracle data processing method, and the electronic device specifically includes the following contents:
[0172] Fig.12FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig.12 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig.12 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0173] In one embodiment, the oracle data processing function may be integrated into a central processing unit, wherein the central processing unit may be configured to perform the following control:
[0174] Step 100: Within the oracle system, obtain oracle data corresponding to the oracle event of the blockchain, which is used to request target external data from a target data source outside the blockchain.
[0175] Step 200: Send the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data.
[0176] Step 300: Based on the aggregation strategy corresponding to the target data source pre-stored locally, the target external data sent by each of the target oracle nodes is aggregated, and the corresponding aggregation results are sent to the blockchain.
[0177] From the above description, it can be seen that the electronic device provided in the embodiment of the present application can effectively realize the centralized extraction of oracle data from the blockchain and external data aggregation processing by extracting oracle data in the oracle event within the oracle system and aggregating the target external data sent by each of the oracle nodes, which can effectively improve the efficiency of oracle data processing processes such as extracting oracle data from the blockchain and performing external data aggregation processing, thereby effectively improving the efficiency of obtaining third-party data from outside the blockchain, and improving the operation stability of the blockchain and the timeliness of data processing; by sending the oracle data to each oracle node outside the oracle system to obtain third-party data, it can effectively realize decentralized acquisition of third-party data from outside the blockchain for multiple times and then aggregation, which can effectively improve the reliability of the oracle data processing process, thereby effectively improving the reliability and authenticity of third-party data obtained from outside the blockchain; at the same time, by adopting the aggregation strategy corresponding to the target data source pre-stored in the oracle system to aggregate external data, the reliability of the oracle data processing process can be further improved, so as to further improve the reliability and authenticity of third-party data obtained from outside the blockchain.
[0178] In another embodiment, the centralized oracle module can be configured separately from the central processor 9100. For example, the centralized oracle module can be configured as a chip connected to the central processor 9100, and the oracle data processing function is realized through the control of the central processor.
[0179] like Fig.12 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig.12 In addition, the electronic device 9600 may also include Fig.12 For components not shown, reference may be made to the prior art.
[0180] like Fig.12 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device 9600.
[0181] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0182] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0183] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0184] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0185] The communication module 9110 is a transmitter / receiver 9110 that sends and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0186] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0187] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps in the oracle data processing method in the above embodiments. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps of the oracle data processing method in the above embodiments are implemented by the execution subject being a server or a client. For example, when the processor executes the computer program, the following steps are implemented:
[0188] Step 100: Within the oracle system, obtain oracle data corresponding to the oracle event of the blockchain, which is used to request target external data from a target data source outside the blockchain.
[0189] Step 200: Send the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data.
[0190] Step 300: Based on the aggregation strategy corresponding to the target data source pre-stored locally, the target external data sent by each of the target oracle nodes is aggregated, and the corresponding aggregation results are sent to the blockchain.
[0191] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application can effectively realize the centralized extraction of oracle data from the blockchain and external data aggregation processing by extracting oracle data in the oracle event within the oracle system and aggregating the target external data sent by each of the oracle nodes, which can effectively improve the efficiency of oracle data processing processes such as extracting oracle data from the blockchain and performing external data aggregation processing, thereby effectively improving the efficiency of obtaining third-party data from outside the blockchain, and improving the operational stability of the blockchain and the timeliness of data processing; by sending the oracle data to each oracle node outside the oracle system to achieve the acquisition of third-party data, it can effectively realize the decentralized acquisition of third-party data from outside the blockchain multiple times and then aggregation, which can effectively improve the reliability of the oracle data processing process, thereby effectively improving the reliability and authenticity of the third-party data obtained from outside the blockchain; at the same time, by adopting the aggregation strategy corresponding to the target data source pre-stored in the oracle system to aggregate external data, the reliability of the oracle data processing process can be further improved, so as to further improve the reliability and authenticity of the third-party data obtained from outside the blockchain.
[0192] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take 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.
[0193] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0194] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0196] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for processing oracle data, characterized in that: The execution subject is a centralized oracle module of the oracle system, and the method includes: Within the oracle system, obtaining oracle data corresponding to the oracle event of the blockchain for requesting target external data from a target data source outside the blockchain, wherein the oracle system is a centralized oracle system; Sending the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data, and each target oracle node is respectively connected to the target data source for communication; Based on the aggregation strategy corresponding to the target data source pre-stored locally, the target external data sent by each target oracle node is aggregated, and the corresponding aggregation result is sent to the blockchain; Before aggregating the target external data sent by each of the target oracle nodes based on the aggregation strategy corresponding to the target data source pre-stored locally, the method further includes: Detect whether each of the current target oracle nodes has sent the target external data; If all the target oracle nodes have sent the target external data, or if all the target oracle nodes that have not sent the target external data are in a timeout state, then the aggregation strategy corresponding to the target data source is obtained locally; The method of obtaining, within the oracle system, oracle data corresponding to the oracle event of the blockchain and used to request target external data from a target data source outside the blockchain includes: If the oracle event is detected on the blockchain, the oracle event is stored in the oracle system. Obtaining a unique identifier of a target data source external to the blockchain from the oracle event; Determine whether the target data source has been registered locally according to the unique identifier of the target data source, and if so, generate oracle data corresponding to the oracle event for requesting target external data from the target data source outside the blockchain; The oracle data processing method further includes: Receiving a data source registration request, wherein the data source registration request includes a unique identifier of a data source external to the blockchain; Register the data source to the local oracle system according to the unique identifier of the data source, obtain the aggregation strategy corresponding to the data source, and store the aggregation strategy of the data source to the local oracle system; The generating of oracle data corresponding to the oracle event for requesting target external data from a target data source outside the blockchain includes: Extracting a target variable for requesting target external data from the target data source from the oracle event; Based on a preset standard protocol format, converting the target variable into a corresponding standard protocol, wherein the standard protocol is used to store the corresponding relationship between each field name, field type and field description in the target variable; Compressing the standard protocol to obtain oracle data corresponding to the oracle event; The converting the target variable into a corresponding standard protocol based on a preset standard protocol format includes: According to the preset standard protocol format template, the variables passed by the user are filled in according to the document format that can be parsed by the decentralized oracle node, and the content of {{variable name}} is filled with the relevant fields defined in the oracle event. The content after filling is a complete version of the standard protocol that can be called by the decentralized oracle node; The aggregation strategy includes: data adoption rules and aggregation algorithms; Correspondingly, the target external data sent by each of the target oracle nodes is aggregated based on the aggregation strategy corresponding to the target data source pre-stored locally, including: Determine whether the target external data sent by each of the target oracle nodes conforms to the data adoption rule, and if so, select multiple data to be aggregated from each of the target external data based on the data adoption rule; Performing aggregation processing on each of the to-be-aggregated data based on the aggregation algorithm; The determining whether the target external data sent by each of the target oracle nodes meets the data adoption rule, and if so, selecting a plurality of data to be aggregated from each of the target external data based on the data adoption rule, comprises: Determine whether the total number of the target external data with the same data in the target external data sent by each of the target oracle nodes is greater than or equal to the total number threshold of the same data specified by the data adoption rule. If so, all the target external data with the same data are selected as the data to be aggregated.
2. The oracle data processing method according to claim 1, characterized in that: The sending of the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data, comprises: Find each oracle node that has been registered with the oracle system and is currently available, and determine each oracle node that has been registered with the oracle system and is currently available as the current target oracle node; Sending the oracle data to each of the target oracle nodes respectively, so that each of the target oracle nodes respectively obtains the target external data from the target data source according to the oracle data; Wherein, obtaining the target external data from the target data source according to the oracle data respectively includes: Parsing the oracle data to obtain a unique identifier of the target data source and a unique identifier of the target external data, accessing the target data source according to the unique identifier of the target data source, and extracting a result set including the target external data from the target data source based on the unique identifier of the target external data; Encrypting and signing the result set to obtain corresponding signature information; The result set and the signature information are sent to the oracle system.
3. The oracle data processing method according to claim 2, characterized in that: Before sending the oracle data to each target oracle node outside the oracle system, it also includes: Receive a oracle node registration request, wherein the oracle node registration request includes a unique identifier of a service device; According to the unique identification of the service device, the service device is registered locally in the oracle system to identify the service device as the oracle node, and the registered oracle node is set at any location that can be connected to the local network.
4. A centralized oracle module, characterized in that: include: A data acquisition module, used to obtain, within the oracle system, oracle data corresponding to the oracle event of the blockchain and used to request target external data from a target data source outside the blockchain, wherein the oracle system is a centralized oracle system; A data distribution module, used for sending the oracle data to each target oracle node outside the oracle system, so that each target oracle node obtains the target external data from the target data source according to the oracle data, and each target oracle node is respectively connected to the target data source in communication; A data aggregation module, used to aggregate the target external data sent by each of the target oracle nodes based on the aggregation strategy corresponding to the target data source pre-stored locally, and send the corresponding aggregation result to the blockchain; The centralized oracle module is also used to: detect whether each of the current target oracle nodes has sent the target external data; if each of the current target oracle nodes has sent the target external data, or if the target oracle nodes that have not sent the target external data are in a timeout state, then obtain the aggregation strategy corresponding to the target data source locally; The method of obtaining, within the oracle system, oracle data corresponding to the oracle event of the blockchain and used to request target external data from a target data source outside the blockchain includes: If the oracle event is detected on the blockchain, the oracle event is stored in the oracle system. Obtaining a unique identifier of a target data source external to the blockchain from the oracle event; Determine whether the target data source has been registered locally according to the unique identifier of the target data source, and if so, generate oracle data corresponding to the oracle event for requesting target external data from the target data source outside the blockchain; The centralized oracle module is also used for: Receiving a data source registration request, wherein the data source registration request includes a unique identifier of a data source external to the blockchain; Register the data source to the local oracle system according to the unique identifier of the data source, obtain the aggregation strategy corresponding to the data source, and store the aggregation strategy of the data source to the local oracle system; The generating of oracle data corresponding to the oracle event for requesting target external data from a target data source outside the blockchain includes: Extracting a target variable for requesting target external data from the target data source from the oracle event; Based on a preset standard protocol format, converting the target variable into a corresponding standard protocol, wherein the standard protocol is used to store the corresponding relationship between each field name, field type and field description in the target variable; Compressing the standard protocol to obtain oracle data corresponding to the oracle event; The converting the target variable into a corresponding standard protocol based on a preset standard protocol format includes: According to the preset standard protocol format template, the variables passed by the user are filled in according to the document format that can be parsed by the decentralized oracle node, and the content of {{variable name}} is filled with the relevant fields defined in the oracle event. The content after filling is a complete version of the standard protocol that can be called by the decentralized oracle node; The aggregation strategy includes: data adoption rules and aggregation algorithms; Correspondingly, the target external data sent by each of the target oracle nodes is aggregated based on the aggregation strategy corresponding to the target data source pre-stored locally, including: Determine whether the target external data sent by each of the target oracle nodes conforms to the data adoption rule, and if so, select multiple data to be aggregated from each of the target external data based on the data adoption rule; Performing aggregation processing on each of the to-be-aggregated data based on the aggregation algorithm; The determining whether the target external data sent by each of the target oracle nodes meets the data adoption rule, and if so, selecting a plurality of data to be aggregated from each of the target external data based on the data adoption rule, comprises: Determine whether the total number of the target external data with the same data in the target external data sent by each of the target oracle nodes is greater than or equal to the total number threshold of the same data specified by the data adoption rule. If so, all the target external data with the same data are selected as the data to be aggregated.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the oracle data processing method described in any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the oracle data processing method described in any one of claims 1 to 3.
Citation Information
Patent Citations
Aggregate policing applying max-min fairness for each data source based on probabilistic filtering
CN102668471A
A method and apparatus for executing transactions in block chain network
CN109981679A
Intelligent contract formal verification and error correction method based on oracle machine
CN111311255A
Data processing method and device based on block chain, equipment and storage medium
CN111930852A
Data processing method and device based on blockchain oracle machine and electronic equipment
CN111953648A
