WO2022267715A1 - 一种预言机节点筛选方法、装置、存储介质及电子装置 - Google Patents

一种预言机节点筛选方法、装置、存储介质及电子装置 Download PDF

Info

Publication number
WO2022267715A1
WO2022267715A1 PCT/CN2022/091533 CN2022091533W WO2022267715A1 WO 2022267715 A1 WO2022267715 A1 WO 2022267715A1 CN 2022091533 W CN2022091533 W CN 2022091533W WO 2022267715 A1 WO2022267715 A1 WO 2022267715A1
Authority
WO
WIPO (PCT)
Prior art keywords
nodes
oracle
node
reputation
activity
Prior art date
Application number
PCT/CN2022/091533
Other languages
English (en)
French (fr)
Inventor
郭海生
屠要峰
王德政
曾鸣
袁寒寒
周治中
高志鹏
杨杨
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2022267715A1 publication Critical patent/WO2022267715A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • Embodiments of the present disclosure relate to the communication field, and in particular, relate to a method, device, storage medium, and electronic device for screening oracle nodes.
  • blockchain + has become a hot spot for applications.
  • the combination of blockchain and other fields can give full play to its decentralized and difficult-to-tamper characteristics.
  • the blockchain network requires multiple nodes to jointly verify and maintain, when executing a transaction sent by a user, only the consistency of the transaction result can be verified to achieve data consistency across the entire network. Therefore, the blockchain cannot execute uncertain transactions, that is, transactions generated by uncertain data off the chain. For example, the blockchain cannot know the weather and data off the chain, which brings great challenges to the blockchain+.
  • the combination of blockchain and other fields inevitably requires the use of a large amount of off-chain data. When the source, quantity, and content of off-chain data are uncertain, the blockchain cannot achieve data consistency.
  • the oracle machine is a data protocol to solve the synergy between the chain and the blockchain.
  • the oracle nodes under the chain can replace the nodes on the blockchain chain to input deterministic results.
  • the oracle node first collects data off-chain according to the data source or data specified on the blockchain, and returns it to the blockchain after the chain prompts. By comparing the results returned by multiple oracle nodes, it is finally aggregated into The unique result is returned to the blockchain to meet the needs of on-chain and off-chain interactions.
  • the oracle machine breaks the closedness of the blockchain through interaction, achieves the effect of synergy between the chain and the chain, and accelerates the application scenarios of blockchain +.
  • the oracle machine In the development process of blockchain technology, the oracle machine has become an indispensable part of the entire blockchain ecology, and the application scenarios of the blockchain are derived from this.
  • decentralized finance requires blockchain oracle machines to obtain price data from off-chain in real time and then feed prices on the blockchain.
  • the prosperity and development of decentralized finance is inseparable from the technical support of blockchain and oracle machines.
  • real-world finance will be migrated to the blockchain to build a more mature digital ecology .
  • the oracle machine also faces the following technical difficulties:
  • the oracle node When the oracle node returns data, it may intentionally return wrong data or upload random data intentionally.
  • the traditional oracle network prevents the above situation by designing a reward and punishment incentive mechanism.
  • the callback results of oracle nodes with better historical reputation and more pledged tokens are more credible. When these oracle nodes return correct results, they will get the fees paid by users, and when they return wrong results, they will be deducted a certain fee to compensate users. This reward and punishment mechanism makes oracle nodes more inclined to return correct results according to the agreement.
  • this method can regulate the behavior of oracle nodes, using a large number of oracle nodes to perform the same task request and return the same result may lead to a waste of network node resources, and at the same time lead to a situation where the rich keep getting rich.
  • Embodiments of the present disclosure provide an oracle node screening method, device, storage medium, and electronic device to at least solve the problem of using a large number of oracle nodes to perform the same task request and return the same result in the related art, which may cause network nodes to The waste of resources also leads to problems in the situation where the rich stay rich.
  • a method for screening oracle nodes including:
  • a target oracle node for the job is determined based on the reputation values of the plurality of nodes.
  • randomly selecting multiple nodes from the oracle nodes through a verifiable random function includes:
  • the method before selecting the plurality of nodes whose random numbers are greater than a preset threshold from the plurality of oracle nodes, the method further includes:
  • security parameters are generated according to the oracle request and block height
  • the security parameter is determined as the randomly selected threshold.
  • determining a target oracle node for work according to the reputation values of the plurality of nodes includes:
  • determining the reputation values of the plurality of nodes used to describe the confidence of the nodes includes:
  • the reputation value of each node is determined according to the total number of participating activities, the importance of the participating activities, the credit status in each activity and the sum of the reputation values.
  • the reputation of each node is determined according to the total number of participating activities, the importance of the participating activities, the credit status in each activity and the sum of the reputation value through the following formula value:
  • P(t) is the reputation value of node t
  • T(t,i) is the normalized value of the sum of the reputation values of other nodes in the i-time activity of node t
  • P(t,i) is the node in task i
  • the sum of reputation values of t I(t) is the total number of times node t participated in activities
  • C(t,i) is the integrity status of node t in the ith activity
  • R(t,i) is the number of times node t participated in
  • the importance of the i activity, ⁇ , ⁇ , ⁇ are constants
  • b is the initial reputation value.
  • an oracle node screening device including:
  • the selection module is configured to randomly select a plurality of nodes from a plurality of oracle nodes through a verifiable random function, wherein the number of the plurality of nodes is smaller than the number of the plurality of oracle nodes;
  • a first determination module configured to determine the reputation values of the plurality of nodes used to describe the confidence of the nodes
  • the second determination module is configured to determine a target oracle node for work according to the reputation values of the plurality of nodes.
  • the selection module includes:
  • the first obtaining submodule is configured to obtain the random numbers determined by the plurality of oracle nodes through a verifiable random function
  • the first selection submodule is configured to select the plurality of nodes whose random numbers are smaller than a random selection threshold from the plurality of oracle nodes.
  • the device also includes:
  • a receiving module configured to receive oracle requests sent by the plurality of oracle nodes
  • the generation module is configured to generate security parameters according to the oracle machine request and block height through the smart contract;
  • the third determining module is configured to determine the security parameter as the randomly selected threshold.
  • the second determination module includes:
  • the sorting submodule is set to sort multiple nodes according to the reputation value
  • the second selection sub-module is configured to select some nodes whose credibility is greater than a preset threshold from the plurality of nodes as the target oracle nodes.
  • the first determination module includes:
  • the second acquisition sub-module is set to obtain the total number of participation activities of each node, the importance of participation activities, the integrity status of each activity and the sum of the reputation values of the remaining nodes in each activity;
  • the determining submodule is configured to determine the reputation value of each node according to the total number of times of participating activities, the importance of the participating activities, the credit status in each activity and the sum of the reputation values.
  • the determination sub-module is further configured to use the following formulas according to the total number of participation activities, the importance of the participation activities, the credit status in each activity and the The sum of reputation values determines each node's reputation value:
  • P(t) is the reputation value of node t
  • T(t,i) is the normalized value of the sum of the reputation values of other nodes in the i-time activity of node t
  • P(t,i) is the node in task i
  • the sum of reputation values of t I(t) is the total number of times node t participated in activities
  • C(t,i) is the integrity status of node t in the ith activity
  • R(t,i) is the number of times node t participated in
  • the importance of the i activity, ⁇ , ⁇ , ⁇ are constants
  • b is the initial reputation value.
  • a computer-readable storage medium where a computer program is stored in the storage medium, wherein the computer program is set to execute any one of the above method embodiments when running in the steps.
  • an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above Steps in the method examples.
  • a plurality of nodes are randomly selected from a plurality of oracle nodes through a verifiable random function, wherein the number of the plurality of nodes is smaller than the number of the plurality of oracle nodes; the number of the plurality of nodes is determined
  • the reputation value used to describe the confidence of the node according to the reputation value of the multiple nodes, the target oracle node for work can be determined, which can solve the problem of using a large number of oracle nodes to perform the same task request and return the result in the related technology It may lead to a waste of network node resources, and at the same time lead to problems in the situation where the rich are always rich.
  • Fig. 1 is a block diagram of the hardware structure of the mobile terminal of the oracle node screening method of the embodiment of the present disclosure
  • FIG. 2 is a flowchart of a method for screening oracle nodes according to an embodiment of the present disclosure
  • Fig. 3 is a flow chart of randomly selecting oracle nodes according to the present embodiment
  • Fig. 4 is a flow chart of selecting a working oracle node based on a reputation evaluation model according to the present embodiment
  • Fig. 5 is a schematic diagram of the number of times that 50 nodes with different reputation values pass the first stage of screening according to this embodiment
  • Fig. 6 is a schematic diagram of the number of times that 50 nodes with different reputation values pass the second stage of requests according to this embodiment
  • Fig. 7 is a schematic diagram of the reputation value change curve of the selected 10 nodes after processing 100 requests according to this embodiment
  • Fig. 8 is a block diagram of an oracle node screening device according to this embodiment.
  • FIG. 1 is a block diagram of the hardware structure of the mobile terminal according to the oracle node screening method of the embodiment of the present disclosure.
  • the mobile terminal may include one or more (only shown in FIG. 1 a) a processor 102 (the processor 102 may include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned mobile terminal may also include a memory for communication Functional transmission device 106 and input and output device 108 .
  • a processor 102 may include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA
  • a memory 104 for storing data
  • the above-mentioned mobile terminal may also include a memory for communication Functional transmission device 106 and input and output device 108 .
  • FIG. 1 is only for illustration, and it does not limit the structure of the above mobile terminal.
  • the mobile terminal may also include more or fewer components than those shown in FIG. 1 , or have a different configuration from that shown in FIG. 1 .
  • the memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the oracle node screening method in the embodiment of the present disclosure, and the processor 102 runs the computer program stored in the memory 104, thereby Executing various functional applications and slicing processing of the service chain address pool is to realize the above-mentioned method.
  • the memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include a memory that is remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 106 is used to receive or transmit data via a network.
  • the specific example of the above network may include a wireless network provided by the communication provider of the mobile terminal.
  • the transmission device 106 includes a Network Interface Controller (NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • a method for screening oracle nodes running on the above-mentioned mobile terminal or network architecture is provided, which is applied to the terminal, and the terminal accesses the current master node of the source area through a dual connection (Dual Connection, referred to as DC) MN cell and current secondary node SN cell
  • Fig. 2 is a flow chart of the oracle node screening method according to an embodiment of the present disclosure, as shown in Fig. 2, the process includes the following steps:
  • Step S202 randomly selecting a plurality of nodes from a plurality of oracle nodes through a verifiable random function, wherein the number of the plurality of nodes is smaller than the number of the plurality of oracle nodes;
  • Step S204 determining the reputation values of the plurality of nodes used to describe the confidence of the nodes
  • Step S206 determining a target oracle node for work according to the reputation values of the multiple nodes.
  • a plurality of nodes are randomly selected from a plurality of oracle nodes through a verifiable random function, wherein the number of the plurality of nodes is smaller than the number of the plurality of oracle nodes;
  • the reputation value of the node used to describe the confidence of the node; the target oracle node for work is determined according to the reputation values of the multiple nodes, which can solve the problem of using a large number of oracle nodes to perform the same task request and
  • the returned results may lead to a waste of network node resources, and at the same time lead to problems in the situation of the rich.
  • the working oracle node improves the reliability of the working oracle node through two-stage selection and saves network resources.
  • step S202 may specifically include:
  • the smart contract before selecting the plurality of nodes whose random numbers are greater than a preset threshold from the plurality of oracle nodes, receiving the oracle request sent by the plurality of oracle nodes; by The smart contract generates a security parameter according to the oracle machine request and the block height; and determines the security parameter as the random selection threshold.
  • step S206 may specifically include:
  • step S204 may specifically include:
  • the reputation value of each node is determined according to the total number of times of the participating activities, the importance of the participating activities, the credit status in each activity and the sum of the reputation values. Further, each node is determined by the following formula: The reputation value of a node:
  • P(t) is the reputation value of node t
  • T(t,i) is the normalized value of the sum of the reputation values of other nodes in the i-time activity of node t
  • P(t,i) is the node in task i
  • the sum of reputation values of t I(t) is the total number of times node t participated in activities
  • C(t,i) is the integrity status of node t in the ith activity
  • R(t,i) is the number of times node t participated in
  • the importance of the i activity, ⁇ , ⁇ , ⁇ are constants
  • b is the initial reputation value.
  • the oracle node selection mechanism in this embodiment consists of two stages, namely the random selection stage and the reputation evaluation stage.
  • the random selection stage a verifiable random function will be used to randomly select an indefinite number of nodes from the oracle nodes.
  • the reputation evaluation stage the node selected in the random selection stage will determine its corresponding reputation value and finally select the working oracle node.
  • FIG. 3 is a flow chart of randomly selecting oracle nodes according to this embodiment, as shown in Figure 3, including:
  • Step S301 the user sends a request to the oracle node
  • Step S302 the oracle node uses the private key and the oracle request to generate a verifiable certificate
  • Step S303 the oracle node generates a random number according to the proof
  • Step S304 the smart contract generates security parameters according to the oracle request and the block height
  • Step S305 screening and verifying the qualifications of oracle nodes according to security parameters.
  • this patent specifies a randomly selected threshold Random threshold according to the oracle machine request serial number and block height, Only the nodes whose random numbers generated by the oracle node are less than the threshold can enter the reputation evaluation stage, so as to avoid the same nodes entering the second stage in each round, increase the randomness of the nodes entering the second stage, and prevent the situation where the rich keep getting rich Appear.
  • the premise of the node private key is proved by other nodes. Even if an oracle node is eligible for Phase 2, other nodes do not know that it is eligible for Phase 2 until it publishes a proof.
  • FIG. 4 is based on the reputation evaluation of this embodiment.
  • the flow chart of the oracle node for model selection work, as shown in Figure 4, includes:
  • Step S401 recording qualified oracle nodes
  • Step S402 calculating the reputation value of the current node of the oracle node
  • Step S403 sorting the nodes according to the reputation value
  • Step S404 filtering out nodes with higher reputation values to process the request.
  • the reason for the need for secondary screening is that verifiable random functions cannot prevent Sybil attacks, that is, an entity controls a large number of invalid nodes, and uses the node's identity to increase the probability of the entity participating in the random selection stage. Therefore, in the reputation evaluation stage, invalid nodes will be discarded through the reputation evaluation model to reduce the probability of Sybil attacks.
  • the reputation evaluation contract will calculate and evaluate the reputation value of each node according to the calculation method described in the reputation model, and at the same time sort the nodes according to the reputation value and filter out A part of nodes with a higher reputation value processes the request to ensure that the entire network has a sufficiently high degree of credibility in each activity after reducing participating nodes.
  • reputation model uses the total number of times each node participates in activities, the sum of the reputation values of peer nodes for each activity, and the importance of each activity as relevant parameters to calculate the reputation value of each node.
  • the calculation function of the reputation value is shown in formula (1), where I(t) represents the total number of activities participated by node t, and T(t,i) represents the comprehensive return of the reputation values of other nodes in the i-time activity of node t.
  • One value, R(t,i) represents the importance of the i-th activity of node t, ⁇ , b are used as parameters to adjust the value range of the reputation value P(t).
  • b When no request occurs, b will be used as the initial value of node reputation, ⁇ and ⁇ are used as parameters to adjust the proportion of task factors and node factors in node reputation evaluation respectively, and C(t,i) means node t at i-th Integrity status in the event: Negative values indicate dishonesty, positive values indicate integrity.
  • Each node will get a corresponding initial reputation value after joining the blockchain network.
  • the reputation value will evaluate the behavior of the node in the activity according to the final selected node and the result of the consensus between the nodes, and will update the reputation value of the nodes participating in the activity.
  • a corresponding threshold mechanism and normalization mechanism are added to the reputation model to ensure that the node reputation value will not rise without an upper limit and the reputation between nodes The value gap is too large or too small. Set different reputation value gradients.
  • the reputation value of the node When the current reputation value of the node is in a higher reputation value gradient, reduce the reputation value increase speed and increase the reputation value decline speed; when the node's current reputation value is in the highest gradient, greatly Slow down the speed of reputation value improvement, while speeding up the speed of reputation value decline; at the same time, when the node reputation value is at a low gradient, reduce the speed of reputation value decline and speed up the speed of reputation value improvement.
  • the corresponding integrity threshold is set. When the node reputation value is lower than the integrity threshold, if dishonest behavior occurs again, it will be The node is removed from the blockchain network, thereby improving the security and attack resistance of the oracle system.
  • the traditional oracle node selection only punishes the oracle node for evil through a token-based incentive mechanism.
  • the head oracle node holds a large number of tokens to dominate the global results.
  • These head oracle nodes may perform tasks in accordance with the protocol specifications for the value of the pass, but when these oracle nodes are attacked by the outside or deliberately do evil, the results of the oracle will not be credible enough.
  • this embodiment ensures that each oracle node in the oracle network is likely to participate in task execution by adding a verifiable random function, and does not trust each other to improve the randomness of the oracle nodes; at the same time, in order to prevent Sybil attacks and the rich keep rich phenomenon, the reputation model is used to avoid the situation that the head oracle node has a large number of reputation values and a certain entity controls a large number of oracle nodes, and improve the credibility of the oracle node, thereby improving data quality.
  • Integrity probability is the probability of correctly responding to user requests.
  • 20 nodes will be screened to enter the next stage.
  • 10 nodes with higher reputation values will be screened out from the 20 nodes screened out in the previous stage, and nodes with the same reputation value will be Select according to the order of the node serial number.
  • Figure 5 is a schematic diagram of the number of times that 50 nodes with different reputation values pass the first stage of screening according to this embodiment. As shown in Figure 5, 100 user requests are sent to the corresponding oracle network, and each request will perform filter. After the node receives each request, it will generate a random number through a verifiable random function, and the oracle will randomly select each request. After 100 requests, count the number of times each node passes the first-stage screening.
  • the probability of each node passing the first stage is relatively average, basically stable at about 40 times, with a deviation of about 10 times. Therefore, in the first stage, the randomness of node selection can be guaranteed, and the node screening results are relatively average, avoiding the situation where the rich keep getting rich.
  • FIG. 6 is a schematic diagram of the number of times that 50 nodes with different reputation values pass the second stage request according to this embodiment.
  • the second stage screening is performed on the nodes that pass the first stage.
  • the second stage of screening is a screening process based on reputation value. After 100 requests, we also count the number of nodes that passed the second stage.
  • nodes with lower reputation values will be screened out. Not only can nodes with high integrity be selected to participate in user requests, thereby ensuring the credibility of user requests, but also the participation of nodes with low reputation values can be guaranteed.
  • Fig. 7 is a schematic diagram of the reputation value change curve of the selected 10 nodes after processing 100 requests according to this embodiment.
  • the reputation value model in the second stage is tested accordingly.
  • the 50 oracle network nodes randomly select 2 nodes with an integrity probability of 0.9, 3 nodes with an integrity probability of 0.8, 3 nodes with an integrity probability of 0.7, and 2 nodes with an integrity probability of 0.6.
  • the reputation model can more accurately evaluate the reputation value of these nodes. For honest and dishonest nodes, the reputation model can accurately divide them. As shown in the figure, the reputation value interval of nodes with a integrity probability of 60% is roughly around 50, while the reputation value of nodes with a integrity probability of 70% is around 70, and the reputation value of nodes with a integrity probability of 80% is around 85 , the reputation value of nodes with a probability of integrity of 90% is about 90. It can be seen that the improved reputation model can accurately distinguish honest nodes from malicious nodes, and reduce the number of nodes with higher integrity. The extremely high gap between nodes prevents the problem of excessive discourse power of nodes caused by the unlimited growth of integrity.
  • the evaluation is carried out in terms of processing speed and accuracy.
  • the integrity of the nodes is set to be the same as the above 50 nodes in the example.
  • the processing speed and accuracy of traditional oracles include: start time: 1603784028153; end time: 1603784052367; time-consuming: 25347; number of correct user requests: 72.
  • the processing speed and accuracy rate of this embodiment start time: 1603783406002; end time: 1603783434378; time-consuming: 28247; correct number of user requests: 89.
  • FIG. 8 is a block diagram of the oracle node screening device according to this embodiment. As shown in FIG. 8 , it includes:
  • the selection module 82 is configured to randomly select a plurality of nodes from a plurality of oracle nodes through a verifiable random function, wherein the number of the plurality of nodes is smaller than the number of the plurality of oracle nodes;
  • the first determination module 84 is configured to determine the reputation values of the plurality of nodes used to describe the confidence of the nodes
  • the second determination module 86 is configured to determine a target oracle node for work according to the reputation values of the plurality of nodes.
  • the selection module 82 includes:
  • the first obtaining submodule is configured to obtain the random numbers determined by the plurality of oracle nodes through a verifiable random function
  • the first selection submodule is configured to select the plurality of nodes whose random numbers are smaller than a random selection threshold from the plurality of oracle nodes.
  • the device also includes:
  • a receiving module configured to receive oracle requests sent by the plurality of oracle nodes
  • the generation module is configured to generate security parameters according to the oracle machine request and block height through the smart contract;
  • the third determining module is configured to determine the security parameter as the randomly selected threshold.
  • the second determination module includes:
  • the sorting submodule is set to sort multiple nodes according to the reputation value
  • the second selection sub-module is configured to select some nodes whose credibility is greater than a preset threshold from the plurality of nodes as the target oracle nodes.
  • the first determination module includes:
  • the second acquisition sub-module is set to obtain the total number of participation activities of each node, the importance of participation activities, the integrity status of each activity and the sum of the reputation values of the remaining nodes in each activity;
  • the determining submodule is configured to determine the reputation value of each node according to the total number of times of participating activities, the importance of the participating activities, the credit status in each activity and the sum of the reputation values.
  • the determination sub-module is further configured to use the following formulas according to the total number of participation activities, the importance of the participation activities, the credit status in each activity and the The sum of reputation values determines each node's reputation value:
  • P(t) is the reputation value of node t
  • T(t,i) is the normalized value of the sum of the reputation values of other nodes in the i-time activity of node t
  • P(t,i) is the node in task i
  • the sum of reputation values of t I(t) is the total number of times node t participated in activities
  • C(t,i) is the integrity status of node t in the ith activity
  • R(t,i) is the number of times node t participated in
  • the importance of the i activity, ⁇ , ⁇ , ⁇ are constants
  • b is the initial reputation value.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is set to execute the steps in any one of the above method embodiments when running.
  • the above-mentioned computer-readable storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
  • ROM read-only memory
  • RAM random access memory
  • mobile hard disk magnetic disk or optical disk and other media that can store computer programs.
  • Embodiments of the present disclosure also provide an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
  • the electronic device may further include a transmission device and an input and output device, wherein the transmission device is connected to the processor, and the input and output device is connected to the processor.
  • each module or each step of the above-mentioned disclosure can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices In fact, they can be implemented in program code executable by a computing device, and thus, they can be stored in a storage device to be executed by a computing device, and in some cases, can be executed in an order different from that shown here. Or described steps, or they are fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present disclosure is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer And Data Communications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种预言机节点筛选方法、装置、存储介质及电子装置,该方法包括:通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,该多个节点的数量小于该多个预言机节点的数量(S202);确定该多个节点的用于描述节点置信度的信誉值(S204);根据该多个节点的信誉值确定用于工作的目标预言机节点(S206)。利用可验证随机函数从预言机节点中随机选出不定量的多个节点,根据多个节点的信誉值选定工作的预言机节点,通过两阶段选择提高工作的预言机节点的可信性,节省网络资源,避免出现富者恒富的情况。

Description

一种预言机节点筛选方法、装置、存储介质及电子装置
相关申请的交叉引用
本公开基于2021年06月22日提交的发明名称为“一种预言机节点筛选方法、装置、存储介质及电子装置”的中国专利申请CN202110694893.4,并且要求该专利申请的优先权,通过引用将其所公开的内容全部并入本公开。
技术领域
本公开实施例涉及通信领域,具体而言,涉及一种预言机节点筛选方法、装置、存储介质及电子装置。
背景技术
随着区块链技术的发展,区块链+成为应用热点。区块链与其他领域的结合可充分发挥其去中心化、难以篡改的特性。但是,由于区块链网络需要多个节点共同验证和维护,在执行用户发来的交易时,只能验证交易结果的一致性,以达到全网的数据一致性。因此,区块链无法执行不确定的交易即无法执行链下不确定数据产生的交易,如区块链无法得知链下的天气、数据等,这给区块链+带来极大挑战。区块链与其他领域的结合不免需要使用大量的链下数据,当链下数据来源、数量、内容不确定时,使得区块链无法取得数据一致性。预言机是为解决区块链链上链下协同的数据协议,其通过构建虚拟的预言机网络,让链下的预言机节点代替区块链链上的节点输入确定性的结果。预言机节点首先根据区块链上指定的数据源或者是数据,根据链上提示在链下收集数据后将其返回到区块链上,通过比较多个预言机节点返回的结果,最终聚合成唯一的结果返回给区块链,以满足链上链下的交互需求。预言机通过交互的方式打破区块链的封闭性,达到链上链下协同的效果,加速区块链+的应用场景落地。
在区块链技术的发展过程中,预言机已经成为整个区块链生态不可或缺的一环,区块链的应用场景由此衍生。例如,去中心化金融是需要区块链预言机实时从链下进行获取价格数据随后在区块链上进行喂价的过程。当前,去中心化金融繁荣发展,其背后离不开区块链和预言机的技术支撑,通过二者的链上链下协同将现实世界金融迁移到区块链上,构建更加繁荣的数字生态。但是,预言机同时面临着以下技术难题:
预言机节点返回数据时,可能故意作恶返回错误的数据或者是故意上传随机数据。传统的预言机网络通过设计奖惩激励机制防止上述情况的出现,历史信誉较好以及质押通证较多的预言机节点的回调结果更加可信。这些预言机节点返回正确结果时将获得用户支付的费用,返回错误结果时将被扣除一定的费用以补偿用户,这种奖惩机制使得预言机节点更加趋于按照协议返回正确的结果。尽管这种方式能够规范预言机节点的行为,但是将大量的预言机节点用于执行相同的任务请求并返回相同的结果可能导致网络节点资源的浪费,同时导致富者恒富的情况出现。
针对相关技术中将大量的预言机节点用于执行相同的任务请求并返回相同的结果可能导致网络节点资源的浪费,同时导致富者恒富的情况出现的问题,尚未提出解决方案。
发明内容
本公开实施例提供了一种预言机节点筛选方法、装置、存储介质及电子装置,以至少解决相关技术中将大量的预言机节点用于执行相同的任务请求并返回相同的结果可能导致网络节点资源的浪费,同时导致富者恒富的情况出现的问题。
根据本公开的一个实施例,提供了一种预言机节点筛选方法,包括:
通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,所述多个节点的数量小于所述多个预言机节点的数量;
确定所述多个节点的用于描述节点置信度的信誉值;
根据所述多个节点的信誉值确定用于工作的目标预言机节点。
在一示例性实施例中,通过可验证随机函数从预言机节点中随机选取多个节点包括:
获取所述多个预言机节点通过可验证随机函数确定的随机数;
从所述多个预言机节点中选取所述随机数小于随机选择阈值的所述多个节点。
在一示例性实施例中,在从所述多个预言机节点中选取所述随机数大于预设阈值的所述多个节点之前,所述方法还包括:
接收所述多个预言机节点发送的预言机请求;
通过智能合约,根据所述预言机请求和区块高度生成安全参数;
将所述安全参数确定为所述随机选择阈值。
在一示例性实施例中,根据所述多个节点的信誉值确定用于工作的目标预言机节点包括:
将多个节点按照信誉度值进行排序;
从所述多个节点中选取信誉度大于预设阈值的部分节点作为所述目标预言机节点。
在一示例性实施例中,确定所述多个节点的用于描述节点置信度的信誉值包括:
分别获取每个节点的参与活动的总次数,参与活动的重要程度、每次活动中的诚信状况以及每次活动中其余节点的信誉值总和;
分别根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值。
在一示例性实施例中,分别通过以下公式根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值:
Figure PCTCN2022091533-appb-000001
Figure PCTCN2022091533-appb-000002
其中,P(t)为节点t的信誉值,T(t,i)为节点t在第i次活动中其余节点的信誉值总和的归一值,P(t,i)为任务i中节点t的信誉值总和,I(t)为节点t参与活动的总次数,C(t,i)为节点t在第i次活动中的诚信状况,R(t,i)为节点t参与的第i次活动的重要程度,α、β、γ为常数,b为初始信誉值。
根据本公开的另一个实施例,还提供了一种预言机节点筛选装置,包括:
选取模块,设置为通过可验证随机函数从多个预言机节点中随机选取多个节点,其中, 所述多个节点的数量小于所述多个预言机节点的数量;
第一确定模块,设置为确定所述多个节点的用于描述节点置信度的信誉值;
第二确定模块,设置为根据所述多个节点的信誉值确定用于工作的目标预言机节点。
在一示例性实施例中,所述选取模块包括:
第一获取子模块,设置为获取所述多个预言机节点通过可验证随机函数确定的随机数;
第一选取子模块,设置为从所述多个预言机节点中选取所述随机数小于随机选择阈值的所述多个节点。
在一示例性实施例中,所述装置还包括:
接收模块,设置为接收所述多个预言机节点发送的预言机请求;
生成模块,设置为通过智能合约,根据所述预言机请求和区块高度生成安全参数;
第三确定模块,设置为将所述安全参数确定为所述随机选择阈值。
在一示例性实施例中,所述第二确定模块包括:
排序子模块,设置为将多个节点按照信誉度值进行排序;
第二选取子模块,设置为从所述多个节点中选取信誉度大于预设阈值的部分节点作为所述目标预言机节点。
在一示例性实施例中,所述第一确定模块包括:
第二获取子模块,设置为分别获取每个节点的参与活动的总次数,参与活动的重要程度、每次活动中的诚信状况以及每次活动中其余节点的信誉值总和;
确定子模块,设置为分别根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值。
在一示例性实施例中,所述确定子模块,还设置为分别通过以下公式根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值:
Figure PCTCN2022091533-appb-000003
Figure PCTCN2022091533-appb-000004
其中,P(t)为节点t的信誉值,T(t,i)为节点t在第i次活动中其余节点的信誉值总和的归一值,P(t,i)为任务i中节点t的信誉值总和,I(t)为节点t参与活动的总次数,C(t,i)为节点t在第i次活动中的诚信状况,R(t,i)为节点t参与的第i次活动的重要程度,α、β、γ为常数,b为初始信誉值。
根据本公开的又一个实施例,还提供了一种计算机可读的存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
根据本公开的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。
本公开实施例,通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,所述多个节点的数量小于所述多个预言机节点的数量;确定所述多个节点的用于描述节点置信度的信誉值;根据所述多个节点的信誉值确定用于工作的目标预言机节点,可以解决相关技术中将大量的预言机节点用于执行相同的任务请求并返回结果可能导致网络节点资源的浪费,同时导致富者恒富的情况出现的问题,利用可验证随机函数从预言机节点中随机选出不定量的多个节点,根据多个节点的信誉值选定工作的预言机节点,通过两阶段选择提高工作的预言机节点的可信性,节省网络资源。
附图说明
图1是本公开实施例的预言机节点筛选方法的移动终端的硬件结构框图;
图2是根据本公开实施例的预言机节点筛选方法的流程图;
图3是根据本实施例的随机选择预言机节点的流程图;
图4是根据本实施例的基于信誉评估模型选择工作的预言机节点的流程图;
图5是根据本实施例的50个信誉值不同的节点通过第一阶段筛选的次数的示意图;
图6是根据本实施例的50个信誉值不同的节点通过第二阶段请求的次数的示意图;
图7是根据本实施例的选定的10个节点在100次请求处理后的信誉值变化曲线的示意图;
图8是根据本实施例的预言机节点筛选装置的框图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开的实施例。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本公开实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本公开实施例的预言机节点筛选方法的移动终端的硬件结构框图,如图1所示,移动终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,其中,上述移动终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本公开实施例中的预言机节点筛选方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及业务链地址池切片处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network  Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。
在本实施例中提供了一种运行于上述移动终端或网络架构的预言机节点筛选方法,应用于终端,所述终端通过双连接(Dual Connection,简称为DC)接入源区域的当前主节点MN小区与当前辅节点SN小区,图2是根据本公开实施例的预言机节点筛选方法的流程图,如图2所示,该流程包括如下步骤:
步骤S202,通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,所述多个节点的数量小于所述多个预言机节点的数量;
步骤S204,确定所述多个节点的用于描述节点置信度的信誉值;
步骤S206,根据所述多个节点的信誉值确定用于工作的目标预言机节点。
通过上述步骤S202至S206,通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,所述多个节点的数量小于所述多个预言机节点的数量;确定所述多个节点的用于描述节点置信度的信誉值;根据所述多个节点的信誉值确定用于工作的目标预言机节点,可以解决相关技术中将大量的预言机节点用于执行相同的任务请求并返回结果可能导致网络节点资源的浪费,同时导致富者恒富的情况出现的问题,利用可验证随机函数从预言机节点中随机选出不定量的多个节点,根据多个节点的信誉值选定工作的预言机节点,通过两阶段选择提高工作的预言机节点的可信性,节省网络资源。
本实施例中,上述步骤S202具体可以包括:
获取所述多个预言机节点通过可验证随机函数确定的随机数;
从所述多个预言机节点中选取所述随机数小于随机选择阈值的所述多个节点。
在一示例性实施例中,在从所述多个预言机节点中选取所述随机数大于预设阈值的所述多个节点之前,接收所述多个预言机节点发送的预言机请求;通过智能合约,根据所述预言机请求和区块高度生成安全参数;将所述安全参数确定为所述随机选择阈值。
本实施例中,上述步骤S206具体可以包括:
将多个节点按照信誉度值进行排序;
从所述多个节点中选取信誉度大于预设阈值的部分节点作为所述目标预言机节点。
本实施例中,上述步骤S204具体可以包括:
分别获取每个节点的参与活动的总次数,参与活动的重要程度、每次活动中的诚信状况以及每次活动中其余节点的信誉值总和;
分别根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值,进一步的,分别通过以下公式确定每个节点的信誉值:
Figure PCTCN2022091533-appb-000005
Figure PCTCN2022091533-appb-000006
其中,P(t)为节点t的信誉值,T(t,i)为节点t在第i次活动中其余节点的信誉值总和的归一值,P(t,i)为任务i中节点t的信誉值总和,I(t)为节点t参与活动 的总次数,C(t,i)为节点t在第i次活动中的诚信状况,R(t,i)为节点t参与的第i次活动的重要程度,α、β、γ为常数,b为初始信誉值。
本实施例的预言机节点选择机制由两个阶段组成,分别是随机选择阶段和信誉评价阶段。随机选择阶段将利用可验证随机函数从预言机节点中随机选出不定量的节点,信誉评估阶段根据随机选择阶段选择节点确定其相应的信誉值最终选定工作的预言机节点,通过两阶段选择提高工作的预言机节点的可信性,节省网络资源。以下将对预言机节点选择机制展开详细描述。
在随机选择阶段,利用可验证随机函数(Verifiable Random Function,VRF)使得预言机节点在不公开私钥的前提下,进行数据有效性证明,并结合智能合约和区块链实现预言机节点的不可预测性、公平性和可验证性,图3是根据本实施例的随机选择预言机节点的流程图,如图3所示,包括:
步骤S301,用户向预言机节点发送请求;
步骤S302,预言机节点利用私钥和预言机请求生成可验证证明;
步骤S303,预言机节点根据证明生成随机数;
步骤S304,智能合约根据预言机请求和区块高度生成安全参数;
步骤S305,根据安全参数筛选和验证预言机节点的资格。
预言机网络中的节点首先在本地生成公私钥对Keypair(sk i,pk i)用作预言机网络的身份以进行数据获取和回调操作,随后该节点利用私钥以及监听到的预言机请求消息生成消息证明Proof=S(sk i,H(m)),并根据消息证明生成该消息对应的随机数Random=H(Proof)用于判断是否达到第二阶段的准入门槛。由于区块链发出的每个预言机请求序号Request不同以及区块链在进行预言机请求共识的区块高度不同,因此本专利根据预言机请求序号以及区块高度指定随机选择的阈值Random threshold,只有预言机节点生成随机数小于该阈值的节点才可进入信誉评价阶段,以避免每轮均是相同的节点进入第二阶段,为进入第二阶段的节点增加随机性,防止富者恒富的情况出现。本专利采用每轮都变化的预言机请求序号以及区块高度Height在智能合约中共同频繁更新安全参数Para,其中Para=H((Request+1)||(Height+1)),预言机节点需要保证H(S(sk i,H(Para)))<Random threshold,即只有生成随机数小于阈值随机数的预言机节点才能进入第二阶段,并且这个结果根据消息证明可以在不公开预言机节点私钥的前提下被其他节点所证明。即使预言机节点有资格进入第二阶段,在其公布证明之前,其他节点不知道该节点具有进入第二阶段的资格。此时,该节点需要将其证明进行广播,由其他节点进行验证,只有Verify(pk i,Proof,m)=true时,该节点的资格才被认可,否则该预言机节点的结果将不被认可,其无法根据执行结果获取信誉值奖励。因此,第一阶段是从大量的预言机节点中随机选取不定量的节点进入信誉评价阶段,防止过多的节点执行重复的操作,浪费网络资源。
在信誉评价阶段,利用智能合约和信誉评价模型,将从随机阶段中选出的节点进行筛选,使得信誉度高的部分节点最终成为预言机工作节点,图4是根据本实施例的基于信誉评估模型选择工作的预言机节点的流程图,如图4所示,包括:
步骤S401,记录具有资格的预言机节点;
步骤S402,计算预言机节点当前节点的信誉值;
步骤S403,将节点按照信誉值高低排序;
步骤S404,筛选出信誉值较高的节点处理请求。
需要二次筛选的原因是,可验证随机函数无法防止女巫攻击,即某个实体控制大量的无效节点,利用节点的身份提高实体参与随机选择阶段的概率。因此,信誉评价阶段将通过信誉评价模型摒弃无效的节点,降低女巫攻击发生的概率。
在区块链网络上部署相应的信誉评价合约。根据每个节点在其参与的每次活动中所表现的行为,信誉评价合约会按照信誉模型描述的计算方法对每个节点的信誉值进行计算评估,同时将节点按照信誉值进行排序,筛选出信誉值较高的一部分节点处理请求,以保证在减少参与节点之后,整个网络在每次活动中都有足够高的可信度。
针对区块链网络中可能存在的不诚信行为和安全威胁,综合PeerTrust等信誉模型进行相应的改进和调整,增加区块链预言机场景下适用的节点信誉评价参数,删减区块链预言机网络场景下不适用的节点信誉评估参数,调整节点信誉值计算公式,并将改进调整后的信誉模型作为整个区块链网络的信誉模型,以对每个节点的信誉值进行评估。信誉模型将每个节点的活动参与总次数,每次活动的同行节点的信誉值总和以及每次活动的重要性等作为相关参数计算各个节点的信誉值。信誉值的计算函数如式(1)所示,其中I(t)表示节点t的活动参与总次数,T(t,i)表示节点t在第i次活动中其余节点的信誉值综合的归一值,R(t,i)表示节点t的第i次活动的重要程度,α,b作为参数,用于调整信誉值P(t)的取值范围。在无任何请求发生时,b将作为节点信誉初始值,β、γ作为参数分别用于调整任务因素和节点因素在节点信誉评估中的占比,C(t,i)表示节点t在第i次活动中的诚信状况:负值表示不诚信、正值表示诚信。
Figure PCTCN2022091533-appb-000007
其中,T(t,i)所表示节点t在第i次活动中其余节点的信誉值综合的归一值的计算,则如公式(2)所示,其中P(t,i)表示任务i中节点t的信誉值总和。
Figure PCTCN2022091533-appb-000008
每个节点在加入区块链网络后都会获得相应的初始信誉值。信誉值在每一次活动后,根据最终选择的节点和节点之间共识的结果,对节点在活动中的行为进行评价,并会将参与活动的节点的信誉值进行更新。为了防止女巫攻击以及单节点信誉值过高而可能导致的中心化问题,在信誉模型中添加了相应的阈值机制和归一化机制,保证节点信誉值不会出现无上限上升以及节点之间信誉值差距过大或者过小的问题。设置不同的信誉值梯度,当节点当前的信誉值处在较高的信誉值梯度中时,减少信誉值提升速度,提高信誉值下降速度;当节点当前信誉值处在最高的梯度时,大幅度的放缓信誉值提升速度,同时加快信誉值下降速度;同时,当节点信誉值处于较低梯度时,减少信誉值下降速度,加快信誉值提升速度。为了防止多个信誉值节点(包括恶意节点)参与节点筛选而产生的网络资源消耗,设置了相应的诚信度阈值,当节点信誉值在低于诚信度阈值之后,若再次出现不诚信行为,便将该节点从区块链网络中移除,从而使预言机***的安全性和抗攻击行得到提高。
传统的预言机节点选择只通过基于通证的激励机制以惩罚预言机节点作恶。但是,随着时间的推移,逐渐出现头部预言机节点持有大量通证主导全局结果的情况出现。这些头部预言机节点可能为了通证的价值而按照协议规范执行任务,但是当这些预言机节点被外部攻击或者是故意作恶的情况出现,则预言机的结果将不够可信。因此,本实施例通过添加基于可验证随机函数以保证预言机网络的每个预言机节点均有可能参与任务执行,且对彼此并不信任,以提高预言机节点的随机性;同时,为了防止女巫攻击和富者恒富现象,采用信誉模型避免头部预言机节点掌握大量信誉值以及某一实体控制大量预言机节点的情况出现,提高预言机节点的可信度,从而提高数据质量。
下面以50个信誉值不同的模拟节点为例,对本实施例进行详细说明。
在实例模拟的50个节点中,包含有10个诚信概率为0.9的节点、15个诚信概率为0.8的节点、15个诚信概率为0.7的节点和10个诚信概率为0.6的节点。诚信概率为正确反馈用户请求的概率。第一阶段将筛选20个节点进入下一个阶段,第二阶段将从上一个阶段筛选出的20个节点中再根据信誉值大小筛选出10个信誉值较高的节点,信誉值相同的节点则按照节点序号排序进行挑选。
图5是根据本实施例的50个信誉值不同的节点通过第一阶段筛选的次数的示意图,如图5所示,向相应的预言机网络发送100条用户请求,每次请求都会对节点进行筛选。节点收到每次请求之后,会通过可验证随机函数生成随机数,预言机会对每次请求进行随机挑选。在100次请求之后,对每个节点通过第一阶段筛选的次数进行统计。
可以看出,无论信誉值的高低,每个节点在通过第一阶段的概率都较为平均,基本稳定在40次左右,上下大约有10次左右的偏差。所以,在第一阶段中能够保证节点选择的随机性,节点筛选结果较为平均,避免富者恒富的情况的出现。
图6是根据本实施例的50个信誉值不同的节点通过第二阶段请求的次数的示意图,如图6所示,对于第一阶段通过的节点进行第二阶段的筛选。第二阶段的筛选是基于信誉值的筛选过程。100次请求之后,我们同样对通过第二阶段的节点个数进行统计。
当通过第一阶段的节点在进行第二阶段筛选时会筛选掉信誉值较低的节点。不仅能够挑选出诚信度较高的节点参与用户请求,从而保证用户请求的可信性,还能够保证信誉值较低的节点的参与度。
图7是根据本实施例的选定的10个节点在100次请求处理后的信誉值变化曲线的示意图,如图7所示,对第二阶段的信誉值模型进行相应的测试。在50个预言机网络节点中,随机选择2个诚信概率为0.9的节点、3个诚信概率为0.8的节点、3个诚信概率为0.7的节点和2个诚信概率为0.6的节点。我们向预言机网络中持续发送用户请求,并在选定节点分别处理过100次请求之后,统计这10个节点的信誉值变化数据。
在诚信概率不相同的10个节点中,信誉模型能够较为准确地对这些节点进行信誉值评估。对于诚信和不诚信的节点,信誉模型能够进行准确的划分。如图所示,诚信概率在60%的节点的信誉值区间大致在50左右,而诚信概率在70%的节点的信誉值则为70左右,诚信概率在80%的节点的信誉值为85左右,诚信概率在90%的节点的信誉值则为90左右.由此可见,改进后的信誉模型能够在准确的区分诚信节点和恶意节点的基础上,缩小了诚信度较高的节点和诚信度极高的节点的差距,防止诚信度无上限增长带来的节点话语权过重的问题。
最后,将本实施例与传统的分布式预言机进行对比。本实例中,通过处理速度和正确率 两个方面进行评估。节点的诚信度设置与实例中上述的50个节点相同。同样向两个预言机模型分别发送100条用户请求。传统预言机的处理速度和正确率包括:start time:1603784028153;end time:1603784052367;耗时:25347;用户请求正确次数:72。本实施例的处理速度和正确率start time:1603783406002;end time:1603783434378;耗时:28247;用户请求正确次数:89。
通过对比可以看出,本实施例的执行效率与传统预言机差别不大,但是在相同阶段诚信度下,面对相同的用户请求,本实施例的可信性相较于传统预言机有着较大的提高。在预言机网络整体诚信度不高,甚至存在较多恶意节点或女巫攻击威胁的情况下,仍然能够有较高的正确率。
根据本公开的另一个实施例,还提供了一种预言机节点筛选装置,图8是根据本实施例的预言机节点筛选装置的框图,如图8所示,包括:
选取模块82,设置为通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,所述多个节点的数量小于所述多个预言机节点的数量;
第一确定模块84,设置为确定所述多个节点的用于描述节点置信度的信誉值;
第二确定模块86,设置为根据所述多个节点的信誉值确定用于工作的目标预言机节点。
在一示例性实施例中,所述选取模块82包括:
第一获取子模块,设置为获取所述多个预言机节点通过可验证随机函数确定的随机数;
第一选取子模块,设置为从所述多个预言机节点中选取所述随机数小于随机选择阈值的所述多个节点。
在一示例性实施例中,所述装置还包括:
接收模块,设置为接收所述多个预言机节点发送的预言机请求;
生成模块,设置为通过智能合约,根据所述预言机请求和区块高度生成安全参数;
第三确定模块,设置为将所述安全参数确定为所述随机选择阈值。
在一示例性实施例中,所述第二确定模块包括:
排序子模块,设置为将多个节点按照信誉度值进行排序;
第二选取子模块,设置为从所述多个节点中选取信誉度大于预设阈值的部分节点作为所述目标预言机节点。
在一示例性实施例中,所述第一确定模块包括:
第二获取子模块,设置为分别获取每个节点的参与活动的总次数,参与活动的重要程度、每次活动中的诚信状况以及每次活动中其余节点的信誉值总和;
确定子模块,设置为分别根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值。
在一示例性实施例中,所述确定子模块,还设置为分别通过以下公式根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值:
Figure PCTCN2022091533-appb-000009
Figure PCTCN2022091533-appb-000010
其中,P(t)为节点t的信誉值,T(t,i)为节点t在第i次活动中其余节点的信誉值总和的归一值,P(t,i)为任务i中节点t的信誉值总和,I(t)为节点t参与活动的总次数,C(t,i)为节点t在第i次活动中的诚信状况,R(t,i)为节点t参与的第i次活动的重要程度,α、β、γ为常数,b为初始信誉值。
本公开的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (10)

  1. 一种预言机节点筛选方法,包括:
    通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,所述多个节点的数量小于所述多个预言机节点的数量;
    确定所述多个节点的用于描述节点置信度的信誉值;
    根据所述多个节点的信誉值确定用于工作的目标预言机节点。
  2. 根据权利要求1所述的方法,其中,通过可验证随机函数从预言机节点中随机选取多个节点包括:
    获取所述多个预言机节点通过可验证随机函数生成的随机数;
    从所述多个预言机节点中选取所述随机数小于随机选择阈值的所述多个节点。
  3. 根据权利要求2所述的方法,其中,在从所述多个预言机节点中选取所述随机数大于预设阈值的所述多个节点之前,所述方法还包括:
    接收所述多个预言机节点发送的预言机请求;
    通过智能合约,根据所述预言机请求和区块高度生成安全参数;
    将所述安全参数确定为所述随机选择阈值。
  4. 根据权利要求1所述的方法,其中,根据所述多个节点的信誉值确定用于工作的目标预言机节点包括:
    将多个节点按照信誉度值进行排序;
    从所述多个节点中选取信誉度大于预设阈值的部分节点作为所述目标预言机节点。
  5. 根据权利要求1所述的方法,其中,确定所述多个节点的用于描述节点置信度的信誉值包括:
    分别获取每个节点的参与活动的总次数,参与活动的重要程度、每次活动中的诚信状况以及每次活动中其余节点的信誉值总和;
    分别根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的所述信誉值。
  6. 根据权利要求5所述的方法,其中,
    分别通过以下公式根据所述参与活动的总次数,所述参与活动的重要程度、所述每次活动中的诚信状况以及所述信誉值总和确定每个节点的信誉值:
    Figure PCTCN2022091533-appb-100001
    Figure PCTCN2022091533-appb-100002
    其中,P(t)为节点t的信誉值,T(t,i)为节点t在第i次活动中其余节点的信誉值总和的归一值,P(t,i)为任务i中节点t的信誉值总和,I(t)为节点t参与活动的总次数,C(t,i)为节点t在第i次活动中的诚信状况,R(t,i)为节点t参与的第i次活动的重要程度,α、β、γ为常数,b为初始信誉值。
  7. 一种预言机节点筛选装置,包括:
    选取模块,设置为通过可验证随机函数从多个预言机节点中随机选取多个节点,其中,所述多个节点的数量小于所述多个预言机节点的数量;
    第一确定模块,设置为确定所述多个节点的用于描述节点置信度的信誉值;
    第二确定模块,设置为根据所述多个节点的信誉值确定用于工作的目标预言机节点。
  8. 根据权利要求7所述的装置,其中,所述选取模块包括:
    第一获取子模块,设置为获取所述多个预言机节点通过可验证随机函数确定的随机数;
    第一选取子模块,设置为从所述多个预言机节点中选取所述随机数小于随机选择阈值的所述多个节点。
  9. 一种计算机可读的存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至6任一项中所述的方法。
  10. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至6任一项中所述的方法。
PCT/CN2022/091533 2021-06-22 2022-05-07 一种预言机节点筛选方法、装置、存储介质及电子装置 WO2022267715A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110694893.4A CN115510152A (zh) 2021-06-22 2021-06-22 一种预言机节点筛选方法、装置、存储介质及电子装置
CN202110694893.4 2021-06-22

Publications (1)

Publication Number Publication Date
WO2022267715A1 true WO2022267715A1 (zh) 2022-12-29

Family

ID=84499659

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091533 WO2022267715A1 (zh) 2021-06-22 2022-05-07 一种预言机节点筛选方法、装置、存储介质及电子装置

Country Status (2)

Country Link
CN (1) CN115510152A (zh)
WO (1) WO2022267715A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116866045A (zh) * 2023-07-18 2023-10-10 四川华西集采电子商务有限公司 一种基于访问控制规则的区块链可信预言机决策支撑***
CN117314473A (zh) * 2023-10-23 2023-12-29 苏州思萃区块链技术研究所有限公司 一种基于可验碳凭证的碳排放数据要素流通管理***

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049319B (zh) * 2023-03-07 2023-07-25 天聚地合(苏州)科技股份有限公司 一种基于预言机信誉值的链外数据获取方法和装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1282289A2 (en) * 2001-07-31 2003-02-05 Sun Microsystems, Inc. Mechanism for trusted relationships in decentralised networks
CN111882104A (zh) * 2020-06-15 2020-11-03 合肥维天运通信息科技股份有限公司 一种基于区块链和Oracle预言机的物流运价预测方法和***
CN112003941A (zh) * 2020-08-25 2020-11-27 杭州时戳信息科技有限公司 分发链下数据请求的方法、***、节点设备与存储介质
CN112003942A (zh) * 2020-08-25 2020-11-27 杭州时戳信息科技有限公司 链下数据请求响应方法、***、节点设备与存储介质
CN112016105A (zh) * 2020-08-17 2020-12-01 东北大学秦皇岛分校 基于分布式预言机和同态加密的链上链下数据共享方案
CN112532587A (zh) * 2020-11-04 2021-03-19 齐鲁工业大学 基于PeerTrust的DPos的共识节点评估方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1282289A2 (en) * 2001-07-31 2003-02-05 Sun Microsystems, Inc. Mechanism for trusted relationships in decentralised networks
CN111882104A (zh) * 2020-06-15 2020-11-03 合肥维天运通信息科技股份有限公司 一种基于区块链和Oracle预言机的物流运价预测方法和***
CN112016105A (zh) * 2020-08-17 2020-12-01 东北大学秦皇岛分校 基于分布式预言机和同态加密的链上链下数据共享方案
CN112003941A (zh) * 2020-08-25 2020-11-27 杭州时戳信息科技有限公司 分发链下数据请求的方法、***、节点设备与存储介质
CN112003942A (zh) * 2020-08-25 2020-11-27 杭州时戳信息科技有限公司 链下数据请求响应方法、***、节点设备与存储介质
CN112532587A (zh) * 2020-11-04 2021-03-19 齐鲁工业大学 基于PeerTrust的DPos的共识节点评估方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116866045A (zh) * 2023-07-18 2023-10-10 四川华西集采电子商务有限公司 一种基于访问控制规则的区块链可信预言机决策支撑***
CN116866045B (zh) * 2023-07-18 2024-01-23 四川华西集采电子商务有限公司 一种基于访问控制规则的区块链可信预言机决策支撑***
CN117314473A (zh) * 2023-10-23 2023-12-29 苏州思萃区块链技术研究所有限公司 一种基于可验碳凭证的碳排放数据要素流通管理***

Also Published As

Publication number Publication date
CN115510152A (zh) 2022-12-23

Similar Documents

Publication Publication Date Title
WO2022267715A1 (zh) 一种预言机节点筛选方法、装置、存储介质及电子装置
Yuan et al. CSEdge: Enabling collaborative edge storage for multi-access edge computing based on blockchain
CN107566124B (zh) 基于哈希运算的共识建立方法、区块链***及存储介质
CN110443614B (zh) 节点设备删除方法、装置、计算机设备及存储介质
CN110611701B (zh) 一种基于区块链的参数配置和交易处理方法
CN110738497B (zh) 一种数据处理方法、装置、节点设备及存储介质
CN108765159B (zh) 一种基于区块链的上链与状态处理方法、装置及互联***
JP2021523476A (ja) 準安定ビザンチン合意
CN111130790B (zh) 基于区块链节点网络的共识出块方法
Yuan et al. Efficient Byzantine consensus mechanism based on reputation in IoT blockchain
CN113448694B (zh) 一种提高事务处理能力的区块链共识方法
US11062280B1 (en) Network consensus-based data processing
WO2021238514A1 (zh) 基于区块链的数据处理方法、装置、设备及可读存储介质
KR20210096619A (ko) 분산 컴퓨팅 및 스토리지에 대한 지능형 비중앙집중식 자율 마켓플레이스
CN112118138B (zh) 区块链共识机制实现***和方法
Yuan et al. CoopEdge+: Enabling decentralized, secure and cooperative multi-access edge computing based on blockchain
CN112822267A (zh) 基于区块链的数据处理方法和装置
CN110460471B (zh) 一种超级节点竞选方法、装置及存储介质
Cui et al. A secure and decentralized DLaaS platform for edge resource scheduling against adversarial attacks
CN108833592A (zh) 云主机调度器优化方法、装置、设备及存储介质
Liu et al. A storage sustainability mechanism with heterogeneous miners in blockchain
CN110990790A (zh) 一种数据处理方法及设备
CN113486118A (zh) 共识节点选取方法及装置
Huang et al. Incentive assignment in hybrid consensus blockchain systems in pervasive edge environments
CN115879889A (zh) 基于区块链的业务处理方法、装置和计算机设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22827213

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22827213

Country of ref document: EP

Kind code of ref document: A1