A method, storage medium and electronic device for distinguishing neighbor nodes of virtual currency public chain network transaction nodes based on IP
By deploying probe nodes in the virtual currency public chain network, monitoring transaction information and calculating node probability, the problem of difficult and low accuracy of transaction information traceability in the virtual currency public chain network is solved, and neighbor node prediction of transaction nodes is realized and the accurate construction of transaction information dissemination path.
Patent Information
- Application Number
- CN202210744816.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-08-25
- Filing Date
- 2022-06-27
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-06-27
AI Technical Summary
In the virtual currency public chain network, traditional transaction traceability technology is difficult to track the transmission path of transaction information, resulting in the accuracy and difficulty of traceability of transaction information, and the inability to effectively predict the transmission path of transaction information.
By deploying probe nodes in the virtual currency public chain network, monitoring and recording all transaction information, and according to the hash value and arrival time of the transaction information, counting the number of occurrences of the target node and the node to be tested, and calculating the probability of their potential neighbor nodes based on the hash value and the order of the transaction information, the , and confirm neighbor nodes through filtering and fitting functions to construct transaction topology to predict the propagation path of transaction information.
It realizes the prediction of neighbor nodes of each transaction node in the virtual currency public chain network, builds a transaction topology, and improves the accuracy and predictability of transaction information traceability.
Smart Images

Figure CN115102963B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of server node monitoring, and in particular to an IP identification method, storage medium and electronic device based on a neighbor node of a virtual currency public chain network transaction node. Background Art
[0002] Recently, with the rapid development of blockchain technology, the scale of virtual currency transactions has gradually increased, attracting widespread attention at home and abroad. Taking a certain virtual currency as an example, it has the decentralized and anonymized characteristics of blockchain, making it difficult to identify the identity of virtual currency traders, providing a hiding space for illegal activities. Based on the decentralized characteristics of blockchain virtual currency transactions, compared with traditional financial systems, virtual currency transactions have stronger anti-traceability capabilities.
[0003] The blockchain-based virtual currency trading system generally has the following characteristics: (1) The anonymity of the trader's IP address. When trading virtual currency, the trader's IP is the account used by the user when participating in the virtual currency transaction. The address is created by the user himself and has nothing to do with the user's identity information. The creation and use process does not require the participation of a third party. (2) The decentralization of transaction nodes. The virtual currency system supports users to initiate transactions through different transaction nodes. Therefore, the user's transaction information will be scattered in different transaction nodes, and it is difficult to find the user's identity characteristics by analyzing the transaction records. (3) The decentralized network structure. The virtual currency system uses the P2P (peer-to-peer network) protocol to form a network, and there is no central node.
[0004] Based on the above characteristics of the virtual currency system, it is difficult to track the propagation path of transaction information in the virtual currency public chain network by monitoring a single server, and traditional transaction tracing technology is not applicable in the virtual currency system. This makes the propagation path of transaction information in the virtual currency public chain network unpredictable, affecting the accuracy of transaction information tracing. Summary of the invention
[0005] To this end, it is necessary to provide a technical solution based on the IP identification of neighbor nodes of virtual currency public chain network transaction nodes to solve the problems of difficulty in tracing transaction information and low accuracy in existing virtual currency traceability technologies.
[0006] To achieve the above-mentioned object, in a first aspect, the present invention discloses a method for identifying the IP addresses of neighbor nodes of a virtual currency public chain network transaction node, the method comprising the following steps:
[0007] S1: Setting at least one probe node in the virtual currency public chain network; the probe node is configured to be able to establish connections with all nodes in the virtual currency public chain network;
[0008] S2: monitoring all transaction information of each transaction node in the virtual currency public chain network during the transaction process through the probe node; the transaction information includes a hash value of the transaction, and each transaction information corresponds to a unique transaction hash value;
[0009] S3: The probe node classifies all the collected transaction information according to different transaction hash values, and sorts the IP addresses of the transaction senders corresponding to the transaction information with the same transaction hash value according to the order of the transaction information arrival time of each received transaction information, to obtain a first sorting set group; the transaction information arrival time refers to the timestamp information of each transaction information received by the probe node, and the IP address information of the transaction sender is the IP address information of the sender who sends the transaction information to the probe node;
[0010] S4: Count the number of sorted sets in which the target node and the node to be tested appear simultaneously in the first sorted set group, calculate the ratio of the number of sorted sets in which the target node and the node to be tested appear simultaneously to the number of sets in the first sorted set group that include the target node, and output the calculation result as the probability that the node to be tested is a potential neighbor node of the target node.
[0011] Furthermore, the number of the nodes to be tested is multiple, and “calculating the ratio of the number of sorted sets in which the target node and the node to be tested appear simultaneously to the number of sets in the first sorted set group that include the target node, and outputting the calculated result as the probability that the node to be tested is a potential neighbor node of the target node” includes:
[0012] Calculate the ratio of the number of sorted sets in which the target node and each node to be tested appear simultaneously to the number of sets in the first sorted set group that include the target node, obtain the probability of each node to be tested being a potential neighbor node of the target node, and output it;
[0013] When the number of the nodes to be tested is greater than a preset number, the nodes to be tested whose probability of being potential neighbor nodes of the target node is greater than a preset probability threshold are screened out and used as potential neighbor nodes of the target node.
[0014] Furthermore, the method comprises:
[0015] The probe node requests the target node to which it is connected, and obtains the node information table known by the target node as the visible node information table corresponding to the target node;
[0016] Determine whether the identification information of the node to be tested that is listed as a potential neighbor node of the target node appears in the visible node information table corresponding to the target node. If so, retain the node to be tested as a potential neighbor node of the target node; otherwise, remove the node to be tested from the potential neighbor nodes of the target node.
[0017] Furthermore, the method comprises:
[0018] Select several nodes to be tested with the highest probability values of potential neighbor nodes of the target node as neighbor nodes of the target node, take the neighbor nodes of the target node as new target nodes, calculate the probability of potential neighbor nodes of the new target node according to steps S3-S4 and output them; repeat the above steps until the neighbor nodes of all transaction nodes in the virtual currency public chain network are confirmed.
[0019] Furthermore, the method comprises:
[0020] The step of selecting several nodes to be tested with the highest probability values of potential neighbor nodes of the target node as neighbor nodes of the target node includes:
[0021] Set a probability threshold;
[0022] It is determined whether the probability value corresponding to the selected node to be tested is greater than the probability threshold. If so, the node to be tested is retained as a neighbor node of the target node. Otherwise, the node to be tested is not used as a neighbor node of the target node.
[0023] Furthermore, the method comprises:
[0024] Acquire all transaction information in multiple unit times, calculate the probability of the node to be tested being a potential neighbor node of the target node in each unit time, obtain a set of probability value sequences, fit the probability value sequences, and obtain a probability value fitting function corresponding to the node to be tested;
[0025] Obtain all transaction information in the next unit time, calculate the probability that the node to be tested is a potential neighbor node of the target node in the current unit time, and determine whether the probability that the node to be tested is a potential neighbor node of the target node in the current unit time matches the result predicted by the fitting function. If so, retain the node to be tested as a potential neighbor node of the target node; otherwise, remove the node to be tested from the potential neighbor nodes of the target node.
[0026] Furthermore, the information transmitted between the probe node and all nodes in the virtual currency public chain network includes first-type message information and second-type message information; the first-type message information is message information including the transaction information that can affect the judgment result of the neighboring node, and the second-type message information is other message information except the first-type message information;
[0027] The method comprises:
[0028] The probe node is configured not to forward the first type of message information and to process the second type of message information normally, so that the probe node always remains active in the virtual currency public chain network.
[0029] Furthermore, there are multiple seed nodes, and each seed node stores node information corresponding to some transaction nodes in the virtual currency public chain network;
[0030] The probe node is configured to be able to establish connections with all nodes in the virtual currency public chain network including:
[0031] After the probe node establishes a connection with each seed node in the virtual currency public chain network, it initiates a node information acquisition request to all the seed nodes;
[0032] The probe node obtains the node information stored by each seed node; the node information includes the IP address information of the corresponding node in the virtual currency public chain network;
[0033] The probe node organizes the node information sent by all seed nodes, and initiates a connection request to the IP address of each node to establish a connection;
[0034] The probe node organizes the node information sent by all seed nodes, including: when the node information received from various child nodes contains multiple identical IP addresses, only initiates a connection request to one of the IP addresses.
[0035] In a second aspect, the present invention provides a storage medium, which is placed in a probe node and stores a computer program, which, when executed, implements the method described in the first aspect of the present invention.
[0036] In a third aspect, the present invention provides an electronic device, comprising:
[0037] A storage medium, which is the storage medium described in the second aspect of the present invention;
[0038] A processor is electrically connected to the storage medium and is used to execute the computer program stored in the storage medium to implement the method as described in the first aspect of the present invention.
[0039] Different from the prior art, the present invention provides an IP discrimination method, storage medium and electronic device based on the neighbor node of the transaction node of the virtual currency public chain network, the method includes the following steps: by deploying probe nodes in the virtual currency public chain network, and using probe nodes to record the transaction information transmitted by each node in the transaction network, and sorting the IP addresses of the transaction senders corresponding to the transaction information with the same transaction hash value according to the order of the arrival time of the transaction information of each transaction received by the probe node, and obtaining a first sorting set group; then counting the number of sorting sets in which the target node and the node to be tested appear at the same time in the first sorting set group, calculating the proportion of the number of sorting sets in which the target node and the node to be tested appear at the same time and the number of sets containing the target node in the first sorting set group, and using the calculation result as the probability that the node to be tested is a potential neighbor node of the target node and outputting it. Through the scheme of the present application, the neighbor nodes of each transaction node in the virtual currency public chain network can be predicted, and then the transaction topology of the virtual currency public chain network can be constructed, and the propagation path of each transaction information in the transaction topology can be better predicted later, so as to realize the traceability of transaction information. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flowchart of a method for identifying the IP addresses of neighbor nodes of a virtual currency public chain network transaction node according to a first embodiment of the present invention;
[0041] Figure 2 This is a flow chart of a method for identifying the IP addresses of neighbor nodes of a virtual currency public chain network transaction node according to a second embodiment of the present invention;
[0042] Figure 3 This is a flowchart of a method for identifying the IP addresses of neighbor nodes of a virtual currency public chain network transaction node according to a third embodiment of the present invention;
[0043] Figure 4 This is a flowchart of a method for identifying the IP addresses of neighbor nodes of a virtual currency public chain network transaction node according to a fourth embodiment of the present invention;
[0044] Figure 5 This is a flowchart of a method for identifying the IP addresses of neighbor nodes of a virtual currency public chain network transaction node according to a fifth embodiment of the present invention;
[0045] Figure 6 A method for connecting a probe node to a transaction node in the entire network according to an embodiment of the present invention;
[0046] Figure 7 A schematic diagram of an electronic device according to an embodiment of the present invention;
[0047] Figure 8 A schematic diagram of first-order neighbor nodes corresponding to each target node involved in an embodiment of the present invention;
[0048] Fig. 9 The figure is a full-chain first-order link node connection topology diagram involved in one embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0050] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0051] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0052] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0053] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0054] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0055] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0056] In order to facilitate understanding of the solution described in this application, some terms involved in this application are defined and explained below, as follows:
[0057] (1) Virtual currency public chain network:
[0058] The virtual currency public chain network refers to a virtual currency transaction network built on blockchain technology. Usually, the virtual currency public chain network includes multiple transaction nodes, and each transaction node can be implemented by one server or multiple server clusters.
[0059] Each transaction node in the virtual currency public chain network communicates with each other through a specific communication protocol. For example, each transaction node can connect to the virtual currency transaction network by initiating the "connect ip-xxxx-port" command. At the same time, in order to ensure that the reception and forwarding of transaction information is not interfered by other information, the users of each transaction node can also block the transaction information of other types of virtual currencies by setting port permissions, that is, to ensure that once each transaction node is connected to a virtual currency public chain network, it will only receive transaction information in the virtual currency public chain network of that type.
[0060] (2) Probe Node
[0061] The probe node in this application refers to a transaction node that is set up with a traceability program and deployed in a virtual currency public chain network. When the traceability program is executed, it is used to analyze and process various types of data collected and recorded by the probe node to determine the probability that a node is a neighbor node of another node. The probe node in this application is configured to establish a connection with all other transaction nodes in the virtual currency public chain network, so that the transaction information forwarded by all transaction nodes in the virtual currency public chain network can be obtained. The probe node joins a virtual currency public chain network by sending a specific protocol command.
[0062] (3) Transaction information
[0063] Generally speaking, in a virtual currency public chain network, transaction information includes transaction hash value, transaction amount and other notes. Transaction hash value is a set of random strings, which is randomly generated by the transaction initiating node when initiating the transaction, and forwarded to the next transaction node along with the transaction content of this transaction (such as transaction amount, other notes). In the process of forwarding transaction information, although the same transaction information will be continuously forwarded by each transaction node, the transaction hash value of the same transaction information remains unchanged. The same transaction here refers to a transaction initiated by a certain transaction node at a certain point in time.
[0064] (4) Transaction information arrival time
[0065] In the present application, the transaction information arrival time refers to the time information when each transaction information is received by the probe node. Preferably, the transaction information arrival time can be expressed by the difference time, which refers to the difference between the timestamp when a transaction is received by the probe node and the timestamp when the transaction is initiated in the virtual currency public chain network, that is, the network delay. When a transaction node initiates a transaction, based on the transaction mechanism of virtual currency, all transaction nodes in the virtual currency public chain network will know the initiation time of the transaction, but they cannot know which transaction node initiated the transaction. This application establishes a connection with all transaction nodes by setting up a probe node, and then calculates the probability that a node is a neighbor node of another node by separately monitoring all transaction information collected.
[0066] (5) IP address information of the transaction sender
[0067] In this application, the IP address information of the transaction sender is the IP address information of the sender who forwards the transaction information to the probe node. Simply put, since all transaction nodes in the virtual currency public chain network are connected to the probe node, that is, the probe node is the neighbor node of all transaction nodes, the probe node can continuously receive transaction information forwarded by each transaction node. In addition to classifying these transaction information according to the transaction hash value, the probe node will also record the arrival time and sender's IP address corresponding to each transaction information (that is, which node transaction IP sends the transaction information to the probe node).
[0068] (6) Nodes to be tested and target nodes
[0069] The node to be tested is relative to the target node. One of the purposes of this application is to determine the probability that a node is a neighbor node of another node. For example, if it is necessary to determine the probability value of whether node A is a neighbor node of node B, then node A is the node to be tested and node B is the target node.
[0070] (7) Seed Node
[0071] In the virtual currency public chain network, there are some nodes that have been running stably for a long time, which are regarded as seed nodes. Seed nodes are even hard-coded into the program. By connecting to seed nodes, other nodes in the network can be quickly discovered. The IP address of the seed node in the virtual currency transaction blockchain is known. The probe node can obtain node information (including the IP addresses of each transaction node in some or all transactions) and other node IP information known to these nodes from multiple seed nodes. The probe node sends a connection request to the collected node information and establishes connections one by one, eventually enabling the probe node to establish connections with all transaction nodes in the current virtual currency public chain network.
[0072] In this application, all virtual currencies or virtual currency transactions involved refer to legal and compliant virtual currencies or virtual currency transactions.
[0073] In the first aspect, Figure 1 As shown, the present invention provides an IP identification method for neighbor nodes of a virtual currency public chain network transaction node, and the method comprises the following steps:
[0074] S1: Setting at least one probe node in the virtual currency public chain network; the probe node is configured to be able to establish connections with all nodes in the virtual currency public chain network;
[0075] S2: monitoring all transaction information of each transaction node in the virtual currency public chain network during the transaction process through the probe node; the transaction information includes a hash value of the transaction, and each transaction information corresponds to a unique transaction hash value;
[0076] S3: The probe node classifies all the collected transaction information according to different transaction hash values, and sorts the IP addresses of the transaction senders corresponding to the transaction information with the same transaction hash value according to the order of the transaction information arrival time of each received transaction information, to obtain a first sorting set group; the transaction information arrival time refers to the timestamp information of each transaction information received by the probe node, and the IP address information of the transaction sender is the IP address information of the sender who sends the transaction information to the probe node;
[0077] S4: Count the number of sorted sets in which the target node and the node to be tested appear simultaneously in the first sorted set group, calculate the ratio of the number of sorted sets in which the target node and the node to be tested appear simultaneously to the number of sets in the first sorted set group that include the target node, and output the calculation result as the probability that the node to be tested is a potential neighbor node of the target node.
[0078] In this embodiment, the probe node first classifies the collected transaction information according to the transaction hash value. Each transaction has its corresponding transaction hash value, and different transactions involve different transaction hash values. By classifying the collected transaction information according to the transaction hash value by the probe node, it is possible to know the arrival time of the transaction information of the same hash value forwarded to the probe node through different propagation links, and then select the IP addresses of the transaction senders corresponding to the arrival time of several transaction information with the highest ranking according to the order of arrival time to obtain the first sorting set group.
[0079] For the same virtual currency transaction with the same transaction hash value, the probe node will receive multiple versions of transaction information from transaction nodes through different paths in the virtual currency public chain network. Although the transaction hash value of each version of the transaction information is the same, due to the different times when different transaction nodes forward the transaction information (usually two transaction nodes that are neighboring nodes will appear in the first arrival time sequence of the same transaction information), the probe node can sort the corresponding transaction senders according to the arrival time sequence of the received transaction information with the same hash value. After obtaining the first sorted set group, the number of sorted sets in which the target node and the node to be tested appear at the same time in the first sorted set group is counted, and the ratio of the number of sorted sets in which the target node and the node to be tested appear at the same time to the number of sets containing the target node in the first sorted set group is calculated. The calculation result is used as the probability that the node to be tested is a potential neighbor node of the target node and is output.
[0080] For example, if the probe node collects 10,000 transaction information in a certain period of time in the virtual currency public chain network, and selects the IP addresses of the first 8 transaction senders with the earliest arrival time for a certain transaction information, then the first sorted set group of 10,000 rows and 8 columns can be obtained. Assuming that the transaction node appears 2,000 times in the 10,000 sets, and transaction node A and transaction node B appear together 1,500 times, then the probability that transaction node B is the neighbor node of transaction node A can be calculated as 1500 / 2000=0.75. Based on the above method, the probability value of a transaction node in the virtual currency public chain network is another transaction node, and then the transaction topology of the virtual currency public chain network is completed, which is convenient for the traceability of subsequent transaction information.
[0081] like Figure 2 As shown, the number of the nodes to be tested is multiple, and “calculating the ratio of the number of sorted sets in which the target node and the node to be tested appear simultaneously to the number of sets in the first sorted set group that include the target node, and outputting the calculation result as the probability that the node to be tested is a potential neighbor node of the target node” includes:
[0082] First, proceed to step S201 to calculate the ratio of the number of sorted sets in which the target node and each node to be tested appear at the same time to the number of sets in the first sorted set group that include the target node, and obtain and output the probability that each node to be tested is a potential neighbor node of the target node;
[0083] Then, the process proceeds to step S202 . When the number of the nodes to be tested is greater than a preset number, the nodes to be tested whose probability of being potential neighbor nodes of the target node is greater than a preset probability threshold are screened out and used as potential neighbor nodes of the target node.
[0084] Preferably, the preset number is less than 10. For example, the preset number is 8, assuming that the preset probability threshold is 0.6, and taking transaction node A as the target node, when each transaction node in the virtual currency public chain network is judged as a node to be tested, the probability value of the node to be tested being a neighbor node of transaction node A, assuming that the number of nodes to be tested that meet the probability value greater than 0.6 calculated in the end is 12, then the first 8 nodes with larger probability values are selected as potential neighbor nodes of transaction node A. Of course, if the number of nodes to be tested that meet the probability value greater than 0.6 calculated is less than 8, the first 8 nodes with larger probability values can be directly selected as potential neighbor nodes of transaction node A.
[0085] In some embodiments, the step of selecting several nodes to be tested having the highest probability values of potential neighbor nodes of the target node as neighbor nodes of the target node includes:
[0086] Set a probability threshold;
[0087] It is determined whether the probability value corresponding to the selected node to be tested is greater than the probability threshold. If so, the node to be tested is retained as a neighbor node of the target node. Otherwise, the node to be tested is not used as a neighbor node of the target node.
[0088] For example, if the probability threshold is 0.8, after selecting several nodes with the highest probability values, further analysis will be performed to determine whether the probability values corresponding to the selected nodes are greater than 0.8. If so, the node can be retained as a neighbor node of the target node, otherwise the node will not be used as a neighbor node of the target node. By setting the probability threshold, the neighbor nodes corresponding to the target node can be more accurately selected from the potential neighbor nodes, making the initial network topology more accurate.
[0089] like Figure 3 As shown, the method includes:
[0090] First, in step S301, the probe node requests the target node to which it is connected, and obtains the node information table known by the target node as the visible node information table corresponding to the target node;
[0091] Then enter step S302 to determine whether the identification information of the node to be tested, which is listed as a potential neighbor node of the target node, appears in the visible node information table corresponding to the target node. If so, retain the node to be tested as a potential neighbor node of the target node; otherwise, remove the node to be tested from the potential neighbor nodes of the target node.
[0092] In the virtual currency public chain network, each transaction node has its own corresponding node information table, which stores the IP addresses of nodes that have information interactions with it in historical data. These node IP addresses are arranged in order from recent to far according to the interaction time. If two transaction nodes are neighboring nodes, the IP address of the other transaction node is stored in the node information table of one of the transaction nodes, that is, in the previous historical transaction data, the two transaction nodes should have forwarded transaction information to each other.
[0093] Therefore, the present application obtains the node information table known by the target node and uses it as the visible node information table corresponding to the target node, and then determines whether the identification information of the node to be tested that is listed as a potential neighbor node of the target node appears in the visible node information table corresponding to the target node. If so, the node to be tested is retained as a potential neighbor node of the target node, otherwise the node to be tested is removed from the potential neighbor nodes of the target node. This method can further improve the accuracy of judging whether the node to be tested is a neighbor node of the target node.
[0094] like Figure 4As shown, in some embodiments, the method includes:
[0095] First, enter step S401 to select several nodes to be tested with the highest probability values of potential neighbor nodes of the target node as neighbor nodes of the target node;
[0096] Then, the process proceeds to step S402, taking the neighbor node of the target node as the new target node, and calculating the probability of the potential neighbor node of the new target node according to steps S3-S4 and outputting it;
[0097] Then proceed to step S403 to repeat the above steps until the neighbor nodes of all transaction nodes in the virtual currency public chain network are confirmed.
[0098] For example, if the target node is transaction node A, the method in steps S3-S4 is used to select the top 8 transaction nodes with probability values as potential neighbor nodes of target node A. These 8 transaction nodes are transaction node B-transaction node I. Then, any one of transaction node B-transaction node I can be used as a new target node to calculate all neighbor nodes of the new target node. This process is repeated until all transaction nodes in the virtual currency public chain network are calculated as target nodes once, and the neighbor nodes corresponding to all transaction nodes in the virtual currency public chain network can be obtained.
[0099] In some embodiments, the method includes: constructing an initial transaction topology of the virtual currency public chain network based on the neighbor nodes of all transaction nodes in the virtual currency public chain network, and converting the probability value of each transaction node and its corresponding neighbor node into the routing cost of the adjacent transaction node.
[0100] go through Figure 4After the method shown is processed, the neighbor nodes corresponding to all transaction nodes in the virtual currency public chain network can be obtained. On this basis, the adjacent transaction nodes are connected to obtain the transaction topology of the initial virtual currency public chain network. Because the probability values of neighbor nodes between different adjacent nodes are different, in order to make the transaction topology of the initial virtual currency public chain network more realistic, the probability values of each transaction node and its corresponding neighbor node can be converted into the routing cost of the adjacent transaction node. Routing cost is network delay. Generally, the higher the probability that two transaction nodes are neighbor nodes, the shorter the communication time required for the exchange of information between the two, that is, the smaller the routing cost. Therefore, the inverse of each calculated probability value can be taken to convert it into the routing cost of the adjacent transaction node. After calculating the routing cost between each adjacent transaction node, it can be inferred that the time for the transaction information initiated by any transaction node as the initial transaction node in the virtual currency public chain network to reach the probe node through any propagation path can be obtained. According to the specific values of each transaction time received by the probe node, the initial node and propagation path of each transaction information in the virtual currency public chain network can be predicted, thereby completing the traceability of the transaction information.
[0101] like Figure 5 As shown, in some embodiments, the method includes:
[0102] First, enter step S501 to obtain all transaction information in multiple unit times, respectively calculate the probability of the node to be tested being a potential neighbor node of the target node in each unit time, obtain a set of probability value sequences, fit the probability value sequences, and obtain a probability value fitting function corresponding to the node to be tested;
[0103] Then proceed to step S502 to obtain all transaction information in the next unit time, and calculate the probability that the node to be tested is a potential neighbor node of the target node in the current unit time;
[0104] Then, step S503 is entered to determine whether the probability that the node to be tested is a potential neighbor node of the target node in the current unit time matches the result predicted by the fitting function. If so, step S504 is entered to retain the node to be tested as a potential neighbor node of the target node. Otherwise, step S505 is entered to remove the node to be tested from the potential neighbor nodes of the target node.
[0105] For example, all transaction information is obtained within a preset time period (including multiple unit time periods), and the obtained transaction information is sliced according to unit time (such as 1 day), and then the probability of the potential neighbor nodes of the target node is calculated according to the transaction information in each unit time. Multiple unit times can be used to calculate the probability of multiple certain nodes to be tested as potential neighbor nodes of the target node. Fit these probabilities as discrete points to obtain a fitting function, and then the probability of the node to be tested as a potential neighbor node of the target node based on the transaction information of the next unit time can be predicted according to the fitting function. By calculating the fitting function to predict the probability value in the next cycle, and comparing the predicted value with the actual value, further screening of the potential neighbor nodes of the target node can be achieved, thereby improving the transaction topology of the initial virtual currency public chain network to be more realistic and improving the accuracy of transaction traceability.
[0106] Preferably, judging whether the probability that the node to be tested is a potential neighbor node of the target node in the current unit time matches the result predicted by the fitting function includes: judging whether the number of times that the probability that the node to be tested is a potential neighbor node of the target node in the current unit time deviates from the predicted value of the fitting function exceeds a preset number, if so, the two are deemed to be mismatched, otherwise, the two are deemed to be matched.
[0107] In some embodiments, the information transmitted between the probe node and all nodes in the virtual currency public chain network includes a first type of message information and a second type of message information; the first type of message information is message information including the transaction information that can affect the judgment result of the neighboring node, and the second type of message information is other message information except the first type of message information;
[0108] The method comprises:
[0109] The probe node is configured not to forward the first type of message information and to process the second type of message information normally, so that the probe node always remains active in the virtual currency public chain network.
[0110] Taking a virtual currency trading network as an example, the interaction protocols between adjacent trading nodes in two networks include protocols such as node discovery, connection, message forwarding, initial block download, SPV client, and heartbeat message. Among them, getaddr, addr message broadcast, getblocks, getdata and other information are first-type message information, and the probe node does not forward this information. Heartbeat message information, connection information (such as version synchronization information), node discovery and other interactive information are second-type message information, and the probe node processes this type of message normally, so that the probe node always remains active in the virtual currency public chain network, improving the concealment of the probe node in the entire trading network.
[0111] like Figure 6 As shown, the number of the seed nodes is multiple, and each seed node stores node information corresponding to some transaction nodes in the virtual currency public chain network; the probe node is configured to be able to establish connections with all nodes in the virtual currency public chain network, including:
[0112] First, enter step S601, after the probe node establishes a connection with each seed node in the virtual currency public chain network, it initiates a node information acquisition request to all the seed nodes;
[0113] Then, the probe node enters step S602 to obtain the node information stored by each seed node; the node information includes the IP address information of the corresponding node in the virtual currency public chain network;
[0114] Then, in step S603, the probe node organizes the node information sent by all seed nodes, and initiates a connection request to the IP address of each node to establish a connection;
[0115] Then, the probe node enters step S604 to sort out the node information sent by all seed nodes, including: when the node information received from various child nodes contains multiple identical IP addresses, a connection request is only initiated to one of the IP addresses.
[0116] By sorting out the node information sent by all seed nodes and only initiating a connection request to one of the IP addresses, bandwidth can be effectively saved.
[0117] In a second aspect, the present invention further provides a storage medium, which is placed in a probe node and stores a computer program, which, when executed, implements the method described in the first aspect of the present invention.
[0118] like Figure 7As shown, in the third aspect, the present invention also provides an electronic device 10, including a processor 101 and a storage medium 102, wherein the storage medium 102 is the storage medium as in the second aspect; the processor 101 is electrically connected to the storage medium 102, and is used to execute a computer program stored in the storage medium 102 to implement the method steps as in the first aspect.
[0119] In this embodiment, the electronic device is a computer device, including but not limited to: personal computers, servers, general-purpose computers, special-purpose computers, network devices, embedded devices, programmable devices, smart mobile terminals, smart home devices, wearable smart devices, vehicle-mounted smart devices, etc. Storage media include but are not limited to: RAM, ROM, disks, tapes, optical disks, flash memory, USB flash drives, mobile hard disks, memory cards, memory sticks, network server storage, network cloud storage, etc. Processors include but are not limited to CPU (central processing unit), GPU (graphics processing unit), MCU (microprocessor), etc.
[0120] The following is a detailed description of the method of this application with reference to examples:
[0121] Connect the probe node d to the blockchain network (such as a virtual currency public chain network) and establish connections with all nodes in the network. The probe node can save the full node information as a list Node={node_1,node_2,node_3,Λ,node_m}; where m is the total number of full nodes connected to the probe node d.
[0122] Then the probe node d requests node information from all nodes node_i in the node list Node, and node_i returns the node information {node_i} it knows to the probe node d. The probe node d establishes a node relationship table NeighborNodes = {{node_1}, {node_2}, {node_3}, Λ, {node_m}}, recording the node information known by all nodes. Usually, there is an interaction of historical information between two adjacent transaction nodes. Therefore, if a transaction node is a neighbor node of another transaction node, the node information table of the transaction node generally stores the IP address of the other transaction node.
[0123] Probe node d listens to the transaction data on the chain. For the same transaction data (transaction information with the same hash value), probe node d sorts the transaction data sent to it by each node in the order of receipt time:
[0124] List(txid_1)={node1,node2,node3,Λ,nodek},
[0125] The probe node d continuously listens to transaction messages on the chain. For each new transaction data, it will generate a record of the order in which the transaction messages sent to it by each node are received, List(txid_i)={Λ}.
[0126] like Figure 8 As shown, we can then build a discriminant model to determine whether any two transaction nodes in the network are first-order neighbor nodes, as follows:
[0127] 1) Construct the subset list(txid): Since the messages of the originating node (the initiator of the transaction information) and its first-order neighbor nodes of a transaction information are most likely to reach the probe node first, the first few nodes in List(txid_i) are most likely to be first-order neighbor nodes. Let l = 8, that is, take the first 8 nodes in the top order as potential first-order neighbor node objects, and construct the subset List(txid_i) The number of nodes in list(txid) does not exceed l.
[0128] 2) Take a target node node_i and calculate the probability that node node_j is a first-order neighbor node of node_i, where node_j belongs to the subset list(txid) and node_j is included in the node information table {node_i} of node_i. The calculation steps are as follows:
[0129] (1) Set the time granularity (i.e., unit time) to 1 day, slice list(txid) by date, and calculate the number of nodes Count(node_i) that contain node_i in list(txid) observed within the same day;
[0130] (2) Calculate the number of nodes Count(node_i,node_j) that contain both node_i and node_j in list(txid);
[0131] (3) Then the probability that node_j is node_i can be expressed as:
[0132] P date (node_j|node_i)=Count(node_i,node_j) / Count(node_i)
[0133] Among them, P date In the text, date is the subscript for the date.
[0134] Observe and record the transaction information obtained by the probe node within a period of time, and perform the above calculation on a daily basis to obtain a set of probability value sequences about the two transaction nodes node_i and node_j being first-order neighbor nodes. The probability value sequence is fitted using the curve fitting function P = at 2 +bt+c, where t is the time variable, a set of fitting parameters a, b, c can be calculated.
[0135] According to the fitting function, the probability that node_j is the first-order neighbor node of node_i in the next time period is predicted, and the first k (k≤l) nodes with the largest probability are taken as the first-order neighbor nodes of node_i.
[0136] According to the order List(txid_i) in which the probe node d receives the transaction message in the latest time period, calculate the probability P that node_j is node_i in the latest period new_date (node_j|node_i), if P new_date If the number of consecutive deviations from the fitting value exceeds the specified number, then in the new time period, node_j is no longer the first-order neighbor node of node_i, and the first-order neighbor node table of node_i is updated.
[0137] like Fig. 9 As shown in the figure, it is a schematic diagram of the constructed full-chain first-order link node connection topology diagram (i.e., the transaction topology of the initial virtual currency public chain network). After obtaining the first-order neighbor node table of each transaction node, the full-chain transaction node matrix can be established:
[0138]
[0139] Then we can build the first-order neighbor node matrix corresponding to the full-chain transaction node:
[0140]
[0141] Taking the first 8 nodes with the highest connection probability as the neighbor nodes of the target node, the first-order node connection topology of the whole chain can be constructed, such as Fig. 9 As shown. It should be noted that since the node connection status in the full-chain transaction node list Node is not permanent, some nodes disappear in the middle, and new nodes will join, so the neighbor nodes corresponding to each target node are in a changing state, that is, the full-chain first-order node connection topology diagram is dynamically changing. In order to ensure that the full-chain first-order node connection topology diagram is as consistent as possible with the actual situation, a dynamic full-chain first-order node connection topology diagram can be constructed according to the above method with 24 hours as the time unit.
[0142] The present invention provides an IP identification method, storage medium and electronic device for neighbor nodes of transaction nodes based on a virtual currency public chain network, comprising the following steps: deploying probe nodes to record transaction information transmitted by each node in a transaction network, and sorting the IP addresses of transaction senders corresponding to different transaction information with the same transaction hash value according to the order of arrival time of the transaction information of each transaction received by the probe node to obtain a first sorting set group; then counting the number of sorting sets in which a target node and a node to be tested appear at the same time in the first sorting set group, calculating the ratio of the number of sorting sets in which the target node and the node to be tested appear at the same time to the number of sets containing the target node in the first sorting set group, and using the calculation result as the probability that the node to be tested is a potential neighbor node of the target node and outputting it, thereby realizing the identification of the neighbor nodes of each transaction node, and facilitating the tracing of subsequent transaction information.
[0143] Those skilled in the art should understand that the above embodiments can be provided as methods, devices, or computer program products. These embodiments can take the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. All or part of the steps in the methods involved in the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a storage medium readable by a computer device for executing all or part of the steps of the methods of the above embodiments.
[0144] The above embodiments are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a computer device to generate a machine, so that the instructions executed by the processor of the computer device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer device readable memory capable of directing a computer device to operate in a specific manner, so that the instructions stored in the computer device readable memory produce a manufactured product including an instruction device, the instruction device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer device so that a series of operating steps are executed on the computer device to produce a computer-implemented process, whereby the instructions executed on the computer device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0147] Although the above embodiments have been described, once those skilled in the art know the basic creative concepts, they can make additional changes and modifications to these embodiments. Therefore, the above are only embodiments of the present invention and do not limit the patent protection scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the specification and drawings of the present invention, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for identifying the IP addresses of neighbor nodes of a virtual currency public chain network transaction node, characterized in that: The method comprises the following steps: S1: Setting at least one probe node in the virtual currency public chain network; the probe node is configured to be able to establish connections with all nodes in the virtual currency public chain network; S2: monitoring all transaction information of each transaction node in the virtual currency public chain network during the transaction process through the probe node; the transaction information includes a hash value of the transaction, and each transaction information corresponds to a unique transaction hash value; S3: The probe node classifies all the collected transaction information according to different transaction hash values, and sorts the IP addresses of the transaction senders corresponding to the transaction information with the same transaction hash value according to the order of the transaction information arrival time of each received transaction information, to obtain a first sorting set group; the transaction information arrival time refers to the timestamp information of each transaction information received by the probe node, and the IP address information of the transaction sender is the IP address information of the sender who sends the transaction information to the probe node; S4: Counting the number of sorted sets in which the target node and the node to be tested appear simultaneously in the first sorted set group, calculating the ratio of the number of sorted sets in which the target node and the node to be tested appear simultaneously to the number of sets containing the target node in the first sorted set group, and outputting the calculation result as the probability that the node to be tested is a potential neighbor node of the target node; The method comprises: Select several nodes to be tested with the highest probability values of potential neighbor nodes of the target node as neighbor nodes of the target node, take the neighbor nodes of the target node as new target nodes, calculate the probability of potential neighbor nodes of the new target node according to steps S3-S4 and output; repeat the above steps until the neighbor nodes of all transaction nodes in the virtual currency public chain network are confirmed; The method comprises: Acquire all transaction information in multiple unit times, calculate the probability of the node to be tested being a potential neighbor node of the target node in each unit time, obtain a set of probability value sequences, fit the probability value sequences, and obtain a probability value fitting function corresponding to the node to be tested; Obtain all transaction information in the next unit time, calculate the probability that the node to be tested is a potential neighbor node of the target node in the current unit time, and determine whether the probability that the node to be tested is a potential neighbor node of the target node in the current unit time matches the result predicted by the fitting function. If so, retain the node to be tested as a potential neighbor node of the target node; otherwise, remove the node to be tested from the potential neighbor nodes of the target node.
2. The IP identification method of the neighbor node based on the virtual currency public chain network transaction node according to claim 1 is characterized in that: The number of the nodes to be tested is multiple, and "calculating the ratio of the number of sorted sets in which the target node and the node to be tested appear simultaneously to the number of sets in the first sorted set group that include the target node, and outputting the calculation result as the probability that the node to be tested is a potential neighbor node of the target node" includes: Calculate the ratio of the number of sorted sets in which the target node and each node to be tested appear simultaneously to the number of sets in the first sorted set group that include the target node, obtain the probability of each node to be tested being a potential neighbor node of the target node, and output it; When the number of the nodes to be tested is greater than a preset number, the nodes to be tested whose probability of being potential neighbor nodes of the target node is greater than a preset probability threshold are screened out and used as potential neighbor nodes of the target node.
3. The IP identification method of the neighbor node based on the virtual currency public chain network transaction node according to claim 2 is characterized in that: The method comprises: The probe node requests the target node to which it is connected, and obtains the node information table known by the target node as the visible node information table corresponding to the target node; Determine whether the identification information of the node to be tested that is listed as a potential neighbor node of the target node appears in the visible node information table corresponding to the target node. If so, retain the node to be tested as a potential neighbor node of the target node; otherwise, remove the node to be tested from the potential neighbor nodes of the target node.
4. The IP identification method of the neighbor node based on the virtual currency public chain network transaction node according to claim 1 is characterized in that: The step of selecting several nodes to be tested with the highest probability values of potential neighbor nodes of the target node as neighbor nodes of the target node includes: Set a probability threshold; It is determined whether the probability value corresponding to the selected node to be tested is greater than the probability threshold. If so, the node to be tested is retained as a neighbor node of the target node. Otherwise, the node to be tested is not used as a neighbor node of the target node.
5. The IP identification method of the neighbor node based on the virtual currency public chain network transaction node according to claim 1 is characterized in that: The information transmitted between the probe node and all nodes in the virtual currency public chain network includes first-type message information and second-type message information; the first-type message information is message information including the transaction information that can affect the judgment result of the neighboring node, and the second-type message information is other message information except the first-type message information; The method comprises: The probe node is configured not to forward the first type of message information and to process the second type of message information normally, so that the probe node always remains active in the virtual currency public chain network.
6. The IP identification method of the neighbor node based on the virtual currency public chain network transaction node according to claim 1 is characterized in that: There are multiple seed nodes, each of which stores node information corresponding to some transaction nodes in the virtual currency public chain network; The probe node is configured to be able to establish connections with all nodes in the virtual currency public chain network including: After the probe node establishes a connection with each seed node in the virtual currency public chain network, it initiates a node information acquisition request to all the seed nodes; The probe node obtains the node information stored by each seed node; the node information includes the IP address information of the corresponding node in the virtual currency public chain network; The probe node organizes the node information sent by all seed nodes, and initiates a connection request to the IP address of each node. After receiving the connection request, each node broadcasts the connection request so that other nodes can establish a connection with the probe node after receiving the connection request. The probe node organizes the node information sent by all seed nodes, including: when the node information received from various child nodes contains multiple identical IP addresses, only initiates a connection request to one of the IP addresses.
7. A storage medium, characterized in that: The storage medium is placed in the probe node, and a computer program is stored in the storage medium. When the computer program is executed, the method according to any one of claims 1 to 6 is implemented.
8. An electronic device, characterized in that: include: The storage medium is the storage medium as claimed in claim 7; A processor, electrically connected to the storage medium, and configured to execute a computer program stored in the storage medium to implement the method according to any one of claims 1 to 6.