A data aggregation method for reputation management architecture of blockchain oracle

By introducing dynamic reputation value adjustment and data aggregation algorithms into the reputation management architecture of blockchain oracle, the problems of insufficient reputation management and outliers in the existing technology are solved, and the credibility and accuracy of data are improved.

CN114462730BActive Publication Date: 2025-02-11NORTHEASTERN UNIV AT QINHUANGDAO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011236146.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-09
Publication Date
2025-02-11
Estimated Expiration
2040-11-09

AI Technical Summary

Technical Problem

The reputation management mechanism of the existing blockchain oracle cannot effectively and dynamically adjust the reputation value, and the outliers cannot be removed during data aggregation, resulting in insufficient data credibility and accuracy.

Method used

By introducing a dynamic reputation value adjustment mechanism into the reputation management architecture, the reputation value is adjusted according to the evaluation of the service quality of nodes, and a weighted average and outlier removal algorithm is used when data aggregation to improve the credibility and accuracy of the data.

Benefits of technology

It improves the credibility and accuracy of blockchain oracles to obtain external data, and ensures high quality and reliability of data through dynamic reputation adjustment and outlier removal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114462730B_ABST
    Figure CN114462730B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of blockchain, and specifically is a data aggregation method of a reputation management architecture of a blockchain oracle; the steps of the data aggregation method are: identity registration, data request, and data response in three stages; in the method, the reputation value of a node and a data source is dynamically evaluated according to service quality standards such as the response time of the node and the data source, the request completion status, and the number of complaints, and when the reputation value is lower than a certain threshold, the service is suspended for a corresponding length of time, and rewards and punishments are graded according to the reputation value to encourage it to provide high-quality services and remain honest; when aggregating data, the reputation value is used as a weight to improve the credibility of the aggregation result, and when aggregating data, an outlier is removed by an algorithm to avoid the influence of biased and excessive data on the result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a data aggregation method for a reputation management architecture of a blockchain oracle. Background Art

[0002] Blockchain technology uses distributed technology and cryptography technology to achieve trusted data storage in an incompletely trusted environment. It has the characteristics of decentralized architecture, full data traceability, non-tamperability, and non-repudiation. It is regarded as a key technology for the transformation of information Internet to value Internet.

[0003] The blockchain system needs to expand computing and storage capabilities through the off-chain system. The existing off-chain system needs to be connected to the blockchain system to solve problems such as information islands and anti-tampering. However, the blockchain is a closed system and cannot directly request off-chain system data. Because the storage of data in the blockchain must pass the consensus of multiple nodes, the smart contract is independently executed by each blockchain node. If a request to call off-chain data is issued from the contract, the difference in the call data will be caused by network delays, data source fluctuations, node performance and other reasons, resulting in different results when each blockchain node executes the contract, resulting in the inability to reach a consensus, which will endanger the trust foundation of the blockchain. Town Crier proposed to use off-chain nodes to monitor the request event logs generated by the contracts deployed on the chain, obtain data according to the log requirements, adapt the format and push it to the smart contract. This method of actively requesting data on demand establishes a data relay for the blockchain and the off-chain world, improves the timeliness of data, and avoids the impact on the consensus mechanism. This method was later called the blockchain oracle in the industry.

[0004] For oracle technology, Oraclize and MakerDAO proposed centralized oracles. However, centralized architectures will inevitably have problems such as single point failures, performance bottlenecks, and centralized trust. Chainlink and Augur proposed decentralized oracles, which obtain the same data from multiple data sources through multiple oracle nodes, aggregate the data and return a single result to reduce the impact of biased data from a single data source or oracle node, thereby improving data credibility. At the same time, a reputation and margin mechanism is introduced to incentivize oracle nodes and data sources to maintain integrity. However, the existing reputation mechanism is similar to a scoring system, which can only have a subjective impact on users' selection of data sources and nodes, and cannot play a greater role. In addition, the data obtained by multiple nodes are usually only averaged when aggregated, without removing outliers. Summary of the invention

[0005] To solve the above problems, the present invention provides a data aggregation method for a reputation management architecture of a blockchain oracle. The present invention realizes dynamic adjustment of a preset reputation value according to the evaluation of node service quality, incorporates reputation into data processing processes such as aggregation, and removes outliers during data aggregation, ultimately improving the credibility and accuracy of blockchain oracle acquisition of external data.

[0006] A reputation management architecture for blockchain oracles, including: data users, data demand contracts, oracles contracts, oracles nodes, and data providers;

[0007] Data consumer: indirectly calls the oracle by calling a data request contract or constructing a user-defined contract.

[0008] Data demand contract: A user-defined contract constructed for a data consumer or a deployed data request contract called by a data consumer, which obtains data by calling an oracle contract.

[0009] Oracle contracts include: reputation management contracts, data aggregation contracts, and other oracle contracts; the reputation management contract is part of the oracle contract, and is mainly responsible for allocating default reputation values, dynamically adjusting reputation values, and suspending services; the data aggregation contract: only exists when aggregation is on the chain, and aggregates the data sent by the oracle node into a single result; the other oracle contracts are other oracle contracts except the above-mentioned oracle contracts.

[0010] Oracle nodes: multiple nodes deployed off-chain. They obtain task parameters by listening to the on-chain request logs and obtain data from data providers. During off-chain aggregation, there are three types of oracle nodes: request adaptation, request execution, and response adaptation, according to the division of labor of listening, execution, and aggregation. During on-chain aggregation, there is only one request execution node responsible for listening and execution. The request adaptation node uses a preemptive message queue.

[0011] Data provider: An entity that can provide a data interface to respond to data requests.

[0012] The specific steps of a data aggregation method for a reputation management architecture of a blockchain oracle are: it is mainly divided into three stages: identity registration, data request, and data response.

[0013] The S1 identity registration phase is mainly divided into three steps: data user registration, data provider registration, and oracle node registration.

[0014] S1.1 Data User Registration

[0015] Data user registration refers to the data users generating their own public and private key pairs and blockchain addresses.

[0016] S1.2 Data Provider Registration

[0017] Data provider registration means that the data provider generates their own public and private key pairs, blockchain addresses, and submits the public key, blockchain address, identity information, and deposit to the reputation management contract, which sets the initial value for it.

[0018] S1.3 Oracle Node Registration

[0019] Oracle node registration means that the oracle node generates its own public and private key pair, blockchain address, and submits the public key, blockchain address, identity information, and deposit to the reputation management contract, which sets the initial value for it.

[0020] The S2 data request phase is divided into four steps: contract call, event generation, event monitoring, and request execution.

[0021] S2.1 Contract Call

[0022] Contract call means that the data user constructs a user-defined contract or directly calls a deployed data request contract to call the oracle contract and issue a request containing data requirements.

[0023] S2.2 Event Generation

[0024] Event generation means that the oracle contract stores the task requirement generation event number and event log on the blockchain, and reports the event generation timestamp and other event information to the reputation management contract.

[0025] S2.3 Event Monitoring

[0026] Event monitoring means that if the aggregation is off-chain, the adapter oracle node is requested to monitor the contract log. When the event log assigned to itself is monitored, the task is read and the preemption count is set before putting it into the preemptive message queue. The request execution node with idle resources preempts the task from the preemptive message queue. After all the tasks waiting for the same event are preempted, the oracle node reports the execution node information, timestamp and report signature of the preempted task to the response adapter node. If the aggregation is on-chain, the execution oracle is requested to monitor the contract log, and the task is read when the event log assigned to itself is monitored.

[0027] S2.4 Request execution

[0028] Request execution means that if the aggregation is off-chain, the oracle sends the validity of the request sent by the oracle node and the corresponding signature to the adapter node, and obtains the data request from the data provider specified by the task. If the aggregation is on-chain, the data request is obtained directly from the data provider specified by the task.

[0029] S3 data response is divided into three steps: data aggregation, request response, and reputation evaluation.

[0030] S3.1 Data Aggregation

[0031] Data aggregation refers to the aggregation operation performed by the aggregation executor after receiving data from the request execution node and the data provider's signature on the data, and recording the timestamp of the response received from each request execution node. If the aggregation is off-chain, the aggregation executor is the response adapter node, and if the aggregation is on-chain, the aggregation executor is the data aggregation contract.

[0032] S3.2 Request Response

[0033] Request response means that the oracle contract returns the aggregation result to the user-defined contract or data request contract that originally issued the request. If it is an off-chain aggregation, the timestamp of the response adapter node is also recorded.

[0034] S3.3 Reputation Assessment

[0035] Reputation evaluation refers to the reputation management contract calculating the response time of each oracle node and data provider based on the difference between several timestamps received, and obtaining the average response time with historical records. At the same time, the feedback and signature verification results provided by the data user are used as the data validity evaluation, together with the validity of the request and the addresses of data providers and oracle nodes with large deviations recorded during the data aggregation process. The reputation values ​​corresponding to addresses with long response times, poor effectiveness, and large data deviations are reduced, and the reputation values ​​of nodes with short response times, good effectiveness, and small data deviations are increased. When the reputation value is lower than the warning threshold, the service will be suspended for a certain period of time and a certain amount of deposit will be confiscated. When the reputation value is lower than the minimum threshold, the service will be suspended until compliance is reviewed and all deposits will be confiscated.

[0036] Further, the data execution algorithm for data aggregation includes: a numerical data execution algorithm and a non-numerical data execution algorithm;

[0037] The steps of the algorithm for numerical data execution are:

[0038] (1) Calculate the product of the oracle reputation value corresponding to each data and the average reputation value of the data provider;

[0039] (2) Calculate the weight of each data point multiplied by the product in (1) to the sum of all products, and sum them up to obtain the weighted average of the data points;

[0040] (3) Calculate the mean square error of all data pairs with respect to the weighted average;

[0041] (4) Traverse the data and remove the data with a deviation greater than k times, where k has a default value and can be specified by the task, and record the address list of the data provider and oracle node corresponding to the removed data;

[0042] (5) Finally, the remaining data are multiplied by the weight of the product in (1) relative to the sum of all products, and the weighted average of the remaining data is obtained as the aggregation result.

[0043] The algorithm steps for non-numeric data are:

[0044] (1) Calculate the product of the oracle reputation value corresponding to each data and the average reputation value of the data provider;

[0045] (2) Each data is added to the mapping list in turn, with the key being the data hash and the value being the address list of the data provider and oracle node that sent the data, and the corresponding oracle reputation value multiplied by the average reputation of the data provider. If the data hash added later already has a mapping, the value is accumulated, and the newly added oracle node address and data provider address are added to the address list;

[0046] (3) Finally, the data corresponding to the mapping with the highest sum of the product of the oracle reputation value and the average reputation of the data provider is taken as the aggregation result, and the list of oracle nodes and data provider addresses corresponding to the aggregation result is recorded, and the data provider and oracle node addresses corresponding to other data are summarized.

[0047] The beneficial effects of the present invention are:

[0048] The present invention dynamically evaluates the reputation of nodes and data sources based on service quality standards such as response time, request completion, and number of complaints. When the reputation value is below a certain threshold, the service is suspended for a corresponding period of time, and rewards and punishments are graded according to the reputation value to encourage them to provide high-quality services and remain honest. When aggregating data, the reputation value is used as a weight to improve the credibility of the aggregation results, and an algorithm is used to remove outliers during data aggregation to avoid the impact of biased and excessive data on the results. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A typical flow chart of a reputation management architecture of a blockchain oracle according to an embodiment of the present invention

[0050] Figure 2 This is a schematic diagram of the overall structure of a data aggregation method for a reputation management architecture of a blockchain oracle in an embodiment of the present invention during off-chain aggregation

[0051] Figure 3 This is a schematic diagram of the overall structure of a data aggregation method for a reputation management architecture of a blockchain oracle according to an embodiment of the present invention when aggregating on a typical chain

[0052] Figure 4 A data aggregation algorithm flow chart of a data aggregation method for a reputation management architecture of a blockchain oracle of the present invention DETAILED DESCRIPTION

[0053] Embodiment 1:

[0054] like Figure 1 As shown, it is a typical flow diagram of a reputation management architecture of a blockchain oracle according to an embodiment of the present invention. For a typical distributed blockchain oracle system, the data provider, the data user, and the oracle node first register their identities in the system. Then the data user issues a request to call the oracle contract on the chain by constructing a custom user contract or calling the data request contract deployed by the system, and the oracle contract generates a corresponding event log according to the request. The oracle node listens to the event log of the oracle contract on the chain in real time off the chain. After listening to the data call request, it issues a data request to the specified data provider according to the task in the event log. After receiving the request from the oracle node, the data provider responds to the node that issued the request with data. After receiving the data, the oracle node simply processes it according to the requirements and converts the result into a contract format. For the oracle scheme aggregated off the chain, the oracle node responsible for aggregating data aggregates the data into a result off the chain after receiving all responses or timeouts from the oracle node responsible for requesting data to the same event, sends it to the oracle contract on the chain, and returns it to the contract that was originally called. For the on-chain aggregated oracle solution, multiple data oracle nodes will send the acquired data to the data aggregation contract specified by the request. The data aggregation contract will aggregate the data on the chain and return it to the contract that issued the data call request.

[0055] A reputation management architecture of a blockchain oracle in this embodiment 1 includes: a data user, a data demand contract, an oracle contract, an oracle node, and a data provider;

[0056] The data user: indirectly calls the oracle by calling the data request contract or constructing a user-defined contract.

[0057] The data demand contract is a user-defined contract constructed for the data user or a deployed data request contract called by the data user, which obtains data by calling the oracle contract.

[0058] The oracle contract includes: a reputation management contract, a data aggregation contract, and other oracle contracts; the reputation management contract is a part of the oracle contract, which is mainly responsible for allocating default reputation values, dynamically adjusting reputation values, and suspending services; the data aggregation contract: only exists when the chain is aggregated, and aggregates the data sent by the oracle node into a single result; the other oracle contracts are other oracle contracts except the above-mentioned oracle contracts.

[0059] The oracle nodes are multiple nodes deployed off-chain. They obtain task parameters by listening to the request logs on the chain and obtain data from the data provider. When aggregating off-chain, the division of labor of listening, executing, and aggregating corresponds to three types of oracle nodes: request adaptation, request execution, and response adaptation. When aggregating on-chain, there is only one request execution node responsible for listening and execution. The request adaptation node uses a preemptive message queue.

[0060] The data provider is an entity that can provide a data interface to respond to data requests.

[0061] The specific steps of the data aggregation method of the reputation management architecture of a blockchain oracle in Example 1 are as follows:

[0062] S1 Identity Registration

[0063] S1.1 Data User Registration

[0064] Data user registration refers to the data user U i Generate their respective public and private key pairs (Upk i , Usk i ), blockchain address Uaddr i .

[0065] S1.2 Data Provider Registration

[0066] Data provider registration refers to data provider P j Generate their respective public and private key pairs (Ppk j , Psk j ), blockchain address Paddr j , and Ppk j 、Paddr j 、Identity information Pinfo j 、Margin Pdepo j Submit it to the reputation management contract RepuSC, which sets the initial reputation value Prepu j .

[0067] S1.3 Oracle Node Registration

[0068] Oracle node registration refers to Oracle node O k Generate their respective public and private key pairs (Opk k , Osk k ), blockchain address Oaddr k , and Opk k 、Oaddr k , identity information Oinfo k 、Margin Odepo kSubmit it to the reputation management contract RepuSC, which sets the initial reputation value Orepu k .

[0069] S2 Data Request

[0070] S2.1 Contract Call

[0071] Contract call refers to the data user U i Construct a user-defined contract or directly call the deployed data request contract to call the oracle contract and issue a request containing data requirements.

[0072] S2.2 Event Generation

[0073] Event generation refers to the oracle contract generating the event number EvId from the task requirement i and Event Log EvLog i Stored on the blockchain, and reporting the event to RepuSC to generate a timestamp TS gen (EvId i ) and other event information.

[0074] S2.3 Event Monitoring

[0075] Event monitoring means that if the chain is aggregated, the adaptive oracle node ReqOracle is requested to monitor the contract log. When the EvLog assigned to it is monitored i When reading the task and setting the preemption count, it is put into the preemptive message queue PreemMQ. The request execution node ExeOracle with idle resources preempts the task from PreemMQ. After all the tasks waiting for the same event are preempted, ReqOracle will preempt the ExeOracle information of the task. task , timestamp TS listen (EvId i ) and report signature Report to the response adapter node ResOracle. If the chain is aggregated, request the execution oracle ExeOracle to monitor the contract log. When it monitors the EvLog assigned to itself i Read the task at the same time.

[0076] S2.4 Request execution

[0077] Request execution means that ExeOracle obtains one or more data from one or more data providers specified by the task, and performs simple processing according to the task requirements to obtain data D d , but retain the data provider list List(Paddr j ), and D d , for D d Signature List(Paddr j ) is sent to the aggregation executor. If the aggregation is off-chain, ExeOracle also needs to send the validity of the request sent by ReqOracle. req (EvId i ||ReqOaddr k ) and the corresponding signature are sent to ResOracle.

[0078] S3 Data Response

[0079] The data response phase is divided into three steps: data aggregation, request response, and reputation evaluation.

[0080] S3.1 Data Aggregation

[0081] The data aggregation refers to the aggregation operation performed by the aggregation executor after receiving the data from ExeOracle, and recording the timestamp TS of each ExeOracle response received exe (EvId i ). If the aggregation is off-chain, the aggregation executor is the response adapter node ResOracle, and if the aggregation is on-chain, the aggregation executor is the data aggregation contract.

[0082] S3.2 Request Response

[0083] Request response means that the oracle contract returns the aggregation result to the user-defined contract or data request contract that originally issued the request. If it is an off-chain aggregation, the timestamp TS of receiving ResOracle must also be recorded. res (EvId i ).

[0084] S3.3 Reputation Assessment

[0085] Reputation evaluation refers to the reputation management contract RepuSC calculating the response time of each oracle node and data provider based on the difference between several timestamps received, and obtaining the average response time with historical records. At the same time, the feedback and signature verification results provided by the data user are used as the data validity evaluation, together with the validity of the request and the addresses of data providers and oracle nodes with large deviations recorded during the data aggregation process. The reputation values ​​corresponding to addresses with long response times, poor effectiveness, and large data deviations are reduced, and the reputation values ​​of nodes with short response times, good effectiveness, and small data deviations are increased. When the reputation value is lower than the warning threshold, the service will be suspended for a certain period of time and a certain amount of deposit will be confiscated. When the reputation value is lower than the minimum threshold, the service will be suspended until compliance is reviewed and all deposits will be confiscated.

[0086] like Figure 4As shown, a data execution algorithm of a data aggregation method of a reputation management architecture of a blockchain oracle includes: a numerical data execution algorithm and a non-numerical data execution algorithm;

[0087] For numeric data, the following algorithm is performed:

[0088] (1) First, calculate the product of the oracle reputation value corresponding to each data and the mean reputation of the data provider

[0089] (2) Then calculate each data multiplied by Weight Get the weighted average of the data

[0090]

[0091] (3) Calculate the mean square error of all data with respect to the weighted average

[0092]

[0093] (4) Then traverse the data and find the deviation greater than k times dx p , where k has a default value and can be specified by the task, and records the address list of the data provider and oracle node corresponding to the removed data (List(Paddr j )||Oaddr k );

[0094] (5) Finally, calculate the remaining m data and multiply them by the corresponding Weight Get the weighted average of the data As the aggregation result.

[0095] For non-numeric data, the following algorithm is performed:

[0096] (1) First, calculate the product of the oracle reputation value corresponding to each data and the mean reputation of the data provider

[0097] (2) Then add each data to the mapping list in turn, with the key being the data hash value is the address list of the data provider and oracle node that sent this data (List(Paddr j )||Oaddr k ), and its corresponding If the data hash added later already has a mapping, Accumulate and add the newly added oracle node addresses and data provider addresses to the address list;

[0098] (3) Finally The data corresponding to the highest accumulated mapping is taken as the aggregation result, and the List (List (Paddr j )||Oaddr k ), and aggregate the data providers and oracle node addresses corresponding to other data.

[0099] Example 2

[0100] like Figure 2 As shown, it is a schematic diagram of the overall structure of a reputation management and data aggregation method for a distributed blockchain oracle in the case of off-chain aggregation according to an embodiment of the present invention. Figure 2 In the oracle, the oracle node is divided into three types of oracle nodes: request adaptation, request execution, and response adaptation according to the monitoring log, data acquisition, and data aggregation. Among them, the request adaptation node reports the node parameters of the execution task to the response adaptation node, and the reputation management contract dynamically adjusts the reputation value of the oracle node and the data source according to the service quality.

[0101] This embodiment 2 assumes the use of an off-chain aggregation solution, where the data user requests numerical data from five data providers through a user-defined contract, and three request execution oracle nodes provide services.

[0102] S1 Identity Registration Phase

[0103] S1.1 Data User Registration:

[0104] Data user U1 generates a public-private key pair (Upk1, Usk1) and blockchain address Uaddr1.

[0105] S1.2 Data provider registration:

[0106] Data provider P j Generate their respective public and private key pairs (Ppk j , Psk j ), blockchain address Paddr j , and Ppk j 、Paddr j 、Identity information Pinfo j 、Margin Pdepo j Submit it to the reputation management contract RepuSC, which sets the initial reputation value Prepu j Assume that U1 calls the data of five data providers P1, P2, P3, P4, and P5.

[0107] S1.3 Oracle Node Registration:

[0108] Oracle Node O k Generate their respective public and private key pairs (Opkk , Osk k ), blockchain address Oaddr k , and Opk k 、Oaddr k , identity information Oinfo k 、Margin Odepo k Submit it to the reputation management contract RepuSC, which sets the initial reputation value Orepu k . Assume that this call involves 1 request adaptation oracle node O 1001 , 3 request execution oracle nodes O 2001 , O 2002 , O 2003 , 1 response adapter oracle node O 3001 .

[0109] S2 Data Request

[0110] S2.1 Contract call:

[0111] Data user U1 constructs a user-defined contract to call the oracle contract and issues a request containing data requirements.

[0112] S2.2 Event generation:

[0113] The oracle contract generates an event number EvId from the task requirements i and Event Log EvLog i Stored on the blockchain, and reporting the event to the reputation management contract RepuSC to generate a timestamp TS gen (EvId i ) and other event information. Assume that the event number assigned to this request is EvId1, and the event log EvLog1 is generated.

[0114] S22.3 event monitoring:

[0115] Request the adapted oracle node ReqOracle to monitor the contract log. When it monitors the event log EvLog assigned to itself i When reading the task and setting the preemption times, it is put into the preemptive message queue PreemMQ. The request execution node ExeOracle with idle resources preempts the task from the preemptive message queue PreemMQ. The adaptation oracle node ReqOracle waits for the same event. After all tasks are preempted, the request execution node ExeOracle that preempts the task will be sent to the information Info task , timestamp TS listen (EvId i ) and report signature Report to the response adapter node ResOracle. 3 request execution oracle node O 2001 , O 2002 , O 2003 Seize the task of this event.

[0116] S2.4 Request execution:

[0117] ExeOracle obtains multiple data from the five data providers specified by the task, and performs simple processing according to the task requirements to obtain the data Dd, but retains the data provider list List (Paddr j ), and D d , for D d Signature List(Paddr j ) is sent to the aggregate executor. ExeOracle sends the validity of the request sent by ReqOracle to req (EvId i ||ReqOaddr k ) and the corresponding signature are sent to ResOracle.

[0118] S3 data response phase

[0119] S3.1 Data Aggregation:

[0120] The aggregation executor is the response adapter node ResOracle, which performs aggregation operations after receiving data from ExeOracle and records the timestamp TS of each ExeOracle response received exe (EvId i ). Execute the following algorithm:

[0121] (1) First, calculate the product of the oracle reputation value corresponding to each data and the mean reputation of the data provider

[0122] (2) Then calculate each data multiplied by Weight Get the weighted average of the data

[0123]

[0124] (3) Calculate the mean square error of all data with respect to the weighted average

[0125]

[0126] (4) Then traverse the data and find the deviation greater than k times dx p, where k is specified as 3 by the task, and the address list of the data provider and oracle node corresponding to the removed data is recorded List(List(Paddr j )||Oaddr k );

[0127] (5) Finally, calculate the remaining m data and multiply them by the corresponding Weight Get the weighted average of the data As the aggregation result, assume that the data deviation of P1 in this request is greater than three times the mean square error and is removed, and the others are retained.

[0128] S3.2 Request Response:

[0129] The oracle contract returns the aggregated result to the user-defined contract or data request contract that originally issued the request, and records the timestamp TS of receiving ResOracle. res (EvId i ).

[0130] S3.3 Reputation Assessment:

[0131] The reputation management contract RepuSC calculates the response time of each oracle node and data provider based on the difference of several timestamps received, and obtains the average response time with historical records. At the same time, the feedback and signature verification results provided by the data user are used as the data validity evaluation, together with the validity of the request and the addresses of data providers and oracle nodes with large deviations recorded during the data aggregation process as the evaluation basis. Since the data deviation of P1 in this request is greater than three times the mean square error, and the rest is normal, the reputation value of P1 is reduced by 5, and the reputation values ​​of other addresses are increased by 1. At the same time, the reputation value is increased or decreased according to the service quality evaluation results such as response time. Assuming that O 1001 , O 3001 Due to the long response time, the reputation value was reduced by 5. Finally, the P1 reputation value was lower than the warning value, and the service was suspended for 1 hour.

[0132] Embodiment 3:

[0133] like Figure 3 As shown, it is a schematic diagram of the overall structure of a reputation management and data aggregation method for a distributed blockchain oracle according to an embodiment of the present invention when aggregating on a typical chain. Figure 3 In the process, all oracle nodes listen to the on-chain logs. When they hear a task assigned to them, they request data from the data provider and return it to the data aggregation contract on the chain.

[0134] This embodiment 3 assumes the use of an on-chain aggregation solution, where the data user requests non-numeric data from five data providers through a data request contract, and three request execution oracle nodes provide services.

[0135] S1 Identity Registration

[0136] S1.1 Data User Registration:

[0137] Data user U1 generates a public-private key pair (Upk1, Usk1) and blockchain address Uaddr1.

[0138] S1.2 Data provider registration:

[0139] Data provider P j Generate their respective public and private key pairs (Ppk j , Psk j ), blockchain address Paddr j , and Ppk j 、Paddr j 、Identity information Pinfo j 、Margin Pdepo j Submit it to the reputation management contract RepuSC, which sets the initial reputation value Prepu j Assume that U1 calls the data of five data providers P1, P2, P3, P4, and P5.

[0140] S1.3 Oracle Node Registration:

[0141] Oracle Node O k Generate their respective public and private key pairs (Opk k , Osk k ), blockchain address Oaddr k , and Opk k 、Oaddr k , identity information Oinfo k 、Margin Odepo k Submit it to the reputation management contract RepuSC, which sets the initial reputation value Orepu k . Assume that this call involves 3 request execution oracle nodes O 2001 , O 2002 , O 2003 .

[0142] S2 Data Request

[0143] S2.1 Contract call:

[0144] Data user U1 constructs a user-defined contract to call the oracle contract and issues a request containing data requirements.

[0145] S2.2 Event generation:

[0146] The oracle contract generates an event number EvId from the task requirementsi and Event Log EvLog i Stored on the blockchain, and reporting the event to RepuSC to generate a timestamp TS gen (EvId i ) and other event information. Assume that the event number assigned to this request is EvId1, and the event log EvLog1 is generated.

[0147] S2.3 Event monitoring:

[0148] S6. Request the execution oracle ExeOracle to monitor the contract log, and read the task when it monitors the EvLogi assigned to itself.

[0149] S2.4 Request execution:

[0150] ExeOracle obtains one or more data from one or more data providers specified by the task, and performs simple processing according to the task requirements to obtain data D d , but retain the data provider list List(Paddr j ), and D d , for D d Signature List(Paddr j ) is sent to the data aggregation contract.

[0151] S3 data response phase

[0152] S3.1 Data Aggregation:

[0153] The data aggregation contract performs aggregation operations after receiving data from ExeOracle and records the timestamp TS of each ExeOracle response received exe (EvId i ). Execute the following algorithm:

[0154] (1) First, calculate the product of the oracle reputation value corresponding to each data and the mean reputation of the data provider

[0155] (2) Then add each data to the mapping list in turn, with the key being the data hash value is the address list of the data provider and oracle node that sent this data (List(Paddr j )||Oaddr k ), and its corresponding If the data hash added later already has a mapping, Accumulate and add the newly added oracle node addresses and data provider addresses to the address list;

[0156] (3) Finally The data corresponding to the highest accumulated mapping is taken as the aggregation result, and the List (List (Paddr j )||Oaddr k ), and aggregate the data providers and oracle node addresses corresponding to other data. Assuming that the data of P1, P2, and P3 in this request are the same and the sum of the product of the reputation values ​​is the highest, they are selected as the aggregation result, and the execution node is O 2001 , O 2002 .

[0157] S3.2 Request Response:

[0158] The oracle contract returns the aggregated results to the user-defined contract or data request contract that originally made the request.

[0159] S3.3 Reputation Assessment:

[0160] S10. The reputation management contract RepuSC calculates the response time of each oracle node and data provider based on the difference of several timestamps received, and obtains the average response time by comparing with the historical records. At the same time, the feedback and signature verification results provided by the data user are used as the data validity evaluation, together with the validity of the request and the addresses of the data providers and oracle nodes with large deviations recorded during the data aggregation process as the evaluation basis. According to the aggregation situation, P1, P2, P3, O 2001 , O 2002 The reputation value of P4, P5, O 2003 The reputation value is reduced by 5. Assuming that the final 2003 If the credit value is below the minimum threshold, the service will be suspended until compliance review is required before the service can be resumed.

[0161] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A data aggregation method for a reputation management architecture of a blockchain oracle, characterized by: The specific steps of this method are: S1 Identity Registration S1.1 Data User Registration The data user registration refers to the data user generating their own public and private key pairs and blockchain addresses; S1.2 Data Provider Registration The data provider registration refers to the data provider generating their own public and private key pairs and blockchain addresses, and submitting the public key, blockchain address, identity information, and deposit to the reputation management contract, which sets the initial value for them; S1.3 Oracle Node Registration The oracle node registration refers to the oracle node generating its own public and private key pair, blockchain address, and submitting the public key, blockchain address, identity information, and deposit to the reputation management contract, which sets the initial value for it; S2 Data Request S2.1 Contract Call The contract call refers to the data user constructing a user-defined contract or directly calling a deployed data request contract to call the oracle contract and issue a request containing data requirements; S2.2 Event Generation The event generation refers to the oracle contract storing the task requirement generation event number and event log on the blockchain, and reporting the event generation timestamp and other event information to the reputation management contract; S2.3 Event Monitoring The event monitoring means that if the aggregation is off-chain, the adapter oracle node is requested to monitor the contract log. When the event log assigned to itself is monitored, the task is read and the preemption number is set before putting it into the preemptive message queue. The request execution node with idle resources preempts the task from the preemptive message queue; after all the tasks waiting for the same event by the oracle node are preempted, the execution node information, timestamp and report signature of the preempted task are reported to the response adapter node; if the aggregation is on-chain, the execution oracle is requested to monitor the contract log, and the task is read when the event log assigned to itself is monitored; S2.4 Request execution The request execution means that if the aggregation is off-chain, the oracle sends the validity of the request sent by the oracle node and the corresponding signature to the adapter node, and obtains the data request from the data provider specified by the task; if the aggregation is on-chain, the data request is directly obtained from the data provider specified by the task; S3 Data Response S3.1 Data Aggregation The data aggregation refers to the aggregation operation performed by the aggregation executor after receiving the data from the request execution node and the data provider's signature on the data, and recording the timestamp of the response received from each request execution node; if the aggregation is off-chain, the aggregation executor is the response adapter node, and if the aggregation is on-chain, the aggregation executor is the data aggregation contract; S3.2 Request Response The request response refers to the oracle contract returning the aggregation result to the user-defined contract or data request contract that originally issued the request. If it is an off-chain aggregation, the timestamp of the response adapter node received must also be recorded; S3.3 Reputation Assessment The reputation assessment refers to the reputation management contract calculating the response time of each oracle node and data provider based on the difference between several timestamps received, and obtaining the average response time by comparing with historical records; at the same time, the feedback and signature verification results provided by the data user are used as the data validity evaluation, together with the validity of the request and the addresses of data providers and oracle nodes with large deviations recorded during the data aggregation process, to reduce the reputation values ​​corresponding to addresses with long response time, poor validity, and large data deviation, and improve the reputation values ​​of nodes with short response time, good validity, and small data deviation; when the reputation value is lower than the warning threshold, the service is suspended for a certain period of time and a certain deposit is confiscated; when the reputation value is lower than the minimum threshold, the service is suspended until compliance is reviewed and all deposits are confiscated.

2. The data aggregation method of the reputation management architecture of a blockchain oracle according to claim 1 is characterized in that: The data execution algorithm of the data aggregation includes: numerical data execution algorithm and non-numerical data execution algorithm; The numerical data execution algorithm steps are: (1) Calculate the product of the oracle reputation value corresponding to each data and the average reputation value of the data provider; (2) Calculate the weight of each data point multiplied by the product in (1) to the sum of all products, and sum them up to obtain the weighted average of the data points; (3) Calculate the mean square error of all data pairs with respect to the weighted average; (4) Traverse the data and remove the data with a deviation greater than k times, where k has a default value and can be specified by the task, and record the address list of the data provider and oracle node corresponding to the removed data; (5) Finally, the remaining data are multiplied by the weight of the product in (1) to the sum of all products, and the weighted average of the remaining data is obtained as the aggregation result; The steps of executing the algorithm for non-numeric data are as follows: (1) Calculate the product of the oracle reputation value corresponding to each data and the average reputation value of the data provider; (2) Each data is added to the mapping list in sequence, with the key being the data hash and the value being the address list of the data provider and oracle node that sent the data, and the corresponding oracle reputation value multiplied by the average reputation of the data provider; if the data hash added later already has a mapping, the value is accumulated, and the newly added oracle node address and data provider address are added to the address list; (3) Finally, the data corresponding to the mapping with the highest sum of the product of the oracle reputation value and the average reputation of the data provider is taken as the aggregation result, and the list of oracle nodes and data provider addresses corresponding to the aggregation result is recorded, and the data provider and oracle node addresses corresponding to other data are summarized.

Citation Information

Patent Citations

  • Supply chain logistics monitoring and early warning method based on blockchain oracle machine technology

    CN110930095A

  • Data processing method based on intelligent contract, related nodes and storage medium

    CN110992020A