Disclosure of Invention
The technical problem mainly solved by the embodiment of the invention is to provide a point-to-point network processing method, a point-to-point network processing device, a client, a mixed point-to-point network and a storage medium, which can solve the trust problem of a centralized network and the safety problem of a decentralized network in the prior art.
In a first aspect, an embodiment of the present application provides a hybrid peer-to-peer network processing method, which is used for a client, and includes:
uploading the interactive data of the client and the service nodes to at least two verification nodes so that the at least two verification nodes verify whether the service nodes are credible or not, and sending verification results to a block chain;
and inquiring the verification result in the block chain, and if the verification result is that the service node is credible, authorizing the service node so that the service node can access the authorization data of the client on the block chain.
In some embodiments, the method further comprises:
encrypting data and uploading the encrypted data to the block chain;
data is acquired from the blockchain.
In some embodiments, the method further comprises:
and point reward is carried out on the nodes which are the service node and the verification node.
In some embodiments, the at least two verification nodes verifying whether the service node is authentic, comprising:
and the at least two verification nodes verify whether the service node is credible according to PBFT algorithm voting.
In a second aspect, an embodiment of the present application further provides a hybrid peer-to-peer network processing apparatus, which is used for a client, and includes:
the first uploading module is used for uploading the interactive data of the client and the service nodes to at least two verification nodes so that the at least two verification nodes verify whether the service nodes are credible or not and send verification results to the block chain;
and the query module is used for querying the verification result in the block chain, and if the verification result is that the service node is credible, the service node is authorized to the service node so that the service node can access the authorization data of the client on the block chain.
In a third aspect, an embodiment of the present application further provides a client, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described above.
In a fourth aspect, an embodiment of the present application further provides a hybrid peer-to-peer network, including: the system comprises the client, a service node, a verification node and a block chain, wherein the service node, the verification node and the block chain are respectively in communication connection with the client;
the client is used for carrying out data interaction with the service node;
the service node is used for providing centralized service;
the verification node is used for verifying whether the service node is credible;
the block chain is respectively in communication connection with the client, the service node and the verification node, and provides data for the client and the service node and receives a verification result sent by the verification node.
In a fifth aspect, the present application also provides a non-transitory computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, cause the processor to perform the above-mentioned method.
According to the hybrid point-to-point network processing method provided by the embodiment of the application, the interactive data of the client and the service nodes are sent to at least two verification nodes for reliability verification, the verification result is sent to the block chain, and if the service nodes are credible, the client can authorize the service nodes to access the block chain to obtain data on the block chain by using a digital signature, so that the trust problem of a centralized network and the safety problem of a decentralized network can be solved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The hybrid peer-to-peer network provided by the present application, as shown in fig. 1, includes a client 10, and a service node 20, an authentication node 30, and a blockchain 40, which are respectively connected to the client 10 in a communication manner. The client 10 is connected in communication with the service node 20, and is used for performing data interaction with the service node 20 and uploading the interacted data to the verification node 30. The service node 20 is connected to the client 10 in communication, and provides a centralized service for the client 10. Verification node 30 is communicatively coupled to serving node 20, and verification node 30 is configured to verify whether serving node 20 is trusted. The blockchain 40 is in communication connection with the client 10 and the service node 20, respectively, the client 10 can directly send data to the blockchain 40 in an encrypted manner and obtain data from the blockchain 40, the blockchain 40 is in communication connection with the service node 20, and when the client 10 authorizes the service node 20, the service node 20 can access the blockchain 40 to obtain data. The number of the service nodes 20, the verification nodes 30 and the blockchain 40 is plural, any service node 20 is connected with any verification node 30 in a communication way, the blockchain 40 is connected with the service node 20 in a communication way, fig. 1 only shows an example of the service node a, the verification node B1, the verification node B2, the verification node B3, the verification node B4, the blockchain C1, the blockchain C2 and the blockchain C3, and in an actual network environment, more service nodes, verification nodes and blockchains are further included.
The interactive data of the client and the service nodes are sent to at least two verification nodes for reliability verification, the verification result is sent to the block chain, and if the service nodes are credible, the client can authorize the service nodes to access the block chain to obtain the data by using a digital signature on the block chain, so that the trust problem of a centralized network and the safety problem of a decentralized network can be solved. If the verification node confirms that the service node is not trusted, the service node or the client records the non-trusted information to the block chain, and other clients can select the non-trusted information according to the situation.
As shown in fig. 2, an embodiment of the present application provides a hybrid peer-to-peer network processing method, which is used for a client and includes:
step 202, uploading the interaction data of the client and the service node to at least two verification nodes, so that the at least two verification nodes verify whether the service node is trusted or not, and sending the verification result to the block chain.
Before data interaction is carried out between a client and a service node, the client and the service node are respectively provided with a corresponding application program, when the client and the service node carry out data interaction, the interaction data are uploaded to at least two verification nodes, the verification nodes immediately carry out reliability verification on the service node after receiving the data, and then the verification results are sent to a block chain for the client to inquire. In particular, at least two verification nodes may vote to decide whether a service node is trusted using the PBFT algorithm. For example, when a plurality of verification nodes vote that a service node is not trusted, the verification nodes notify a client that the service node is not trusted, and the client may query whether the service node is trusted by itself.
And step 204, inquiring a verification result in the block chain, and if the verification result is that the service node is credible, authorizing the service node so that the service node can access the authorization data of the client on the block chain.
After the verification node sends the verification result to the block chain, the client can inquire the verification result in the block chain, and if the verification result is that the service node is authentic, the client can authorize the service node to access the block chain to obtain data on the block chain by using a digital signature.
The interactive data of the client and the service nodes are sent to at least two verification nodes for reliability verification, the verification result is sent to the block chain, and if the service nodes are credible, the client can authorize the service nodes to access the block chain to obtain the data by using a digital signature on the block chain, so that the trust problem of a centralized network and the safety problem of a decentralized network can be solved.
In one embodiment, the hybrid peer-to-peer network processing method further includes: encrypting the data and uploading the encrypted data to a block chain; data is acquired from a chain of blocks.
Because the client is in communication connection with the blockchain, the data is directly uploaded to the blockchain in a public key encryption mode, the client can directly obtain the data in the blockchain without obtaining the data from a centralized service node, and therefore safety can be guaranteed. It should be noted that the data encryption method is not limited, and only the data is guaranteed not to be tampered, and the limitation in this embodiment is not required.
In one embodiment, the hybrid peer-to-peer network processing method further includes: points are rewarded for nodes that are serving nodes and verification nodes.
The bonus points is only one of many bonus methods, but is not limited to bonus points. In this embodiment, in order to give the reward node as the service node and the verification node, the token or the credit operated by a certain bank enterprise may be given to the service node and the verification node as the reward. In other embodiments, the data of the client may also be granted to the service node, and the manner of the reward is not limited, and is not limited in this embodiment.
Accordingly, an embodiment of the present application further provides a hybrid peer-to-peer network processing apparatus, for a client, as shown in fig. 3, where the hybrid peer-to-peer network processing apparatus 300 includes:
the first uploading module 302 is configured to upload the interaction data between the client and the service node to at least two verification nodes, so that the at least two verification nodes verify whether the service node is trusted, and send a verification result to the block chain.
And the query module 304 is configured to query the verification result in the blockchain, and if the verification result is that the service node is trusted, authorize the service node, so that the service node can access the authorization data of the client in the blockchain.
According to the hybrid point-to-point network processing device provided by the embodiment of the application, the interactive data of the client and the service nodes are sent to at least two verification nodes for reliability verification, the verification result is sent to the block chain, and if the service nodes are credible, the client can authorize the service nodes to access the block chain to obtain data on the block chain by using a digital signature, so that the trust problem of a centralized network and the safety problem of a decentralized network can be solved.
Optionally, in another embodiment of the apparatus, referring to fig. 4, the apparatus 300 further includes:
a second uploading module 306, configured to upload the encrypted data to the blockchain, so that the client obtains the data.
Optionally, in another embodiment of the apparatus, referring to fig. 4, the apparatus 300 further includes:
a reward module 308 for rewarding points for nodes that are the service node and the verification node.
Optionally, in another embodiment of the apparatus, referring to fig. 4, the apparatus 300 further includes:
and the verification module 310 is used for voting by at least two verification nodes to verify whether the service node is credible according to the PBFT algorithm.
It should be noted that the hybrid peer-to-peer network processing apparatus can execute the hybrid peer-to-peer network processing method provided in the embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method. For technical details that are not described in detail in the embodiment of the hybrid peer-to-peer network processing device, reference may be made to the hybrid peer-to-peer network processing method provided in the embodiment of the present application.
Fig. 5 is a schematic hardware structure diagram of the client 10 according to an embodiment of the present application, and as shown in fig. 5, the client 10 includes:
one or more processors 11 and a memory 12, with one processor 11 being an example in fig. 5.
The processor 11 and the memory 12 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The memory 12, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules (e.g., the first upload module 302 and the query module 304 shown in fig. 3) corresponding to the hybrid peer-to-peer network processing method in the embodiment of the present application. The processor 11 executes various functional applications and data processing of the client by executing the nonvolatile software program, instructions and modules stored in the memory 12, that is, the hybrid point-to-point network processing method of the foregoing method embodiment is implemented.
The memory 12 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the hybrid point-to-point network processing device, and the like. Further, the memory 12 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 12 may optionally include memory located remotely from processor 11, which may be connected to a hybrid point-to-point network processing device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 12, and when executed by the one or more processors 11, perform the hybrid peer-to-peer network processing method in any of the above method embodiments, for example, perform the above-described method steps 202 to 204 in fig. 2; the functions of the modules 302 to 304 in fig. 3 and the modules 302 to 310 in fig. 4 are realized.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in the embodiments of the present application.
Embodiments of the present application provide a non-transitory computer-readable storage medium storing computer-executable instructions, which are executed by one or more processors, such as one processor 11 in fig. 5, to enable the one or more processors to perform the hybrid peer-to-peer network processing method in any of the above method embodiments, such as performing the above-described method steps 202 to 204 in fig. 2; the functions of the modules 302 to 304 in fig. 3 and the modules 302 to 310 in fig. 4 are realized.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a general hardware platform, and certainly can also be implemented by hardware. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; within the context of the present application, where technical features in the above embodiments or in different embodiments can also be combined, the steps can be implemented in any order and there are many other variations of the different aspects of the present application as described above, which are not provided in detail for the sake of brevity; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.