Blockchain network system update method, device, equipment and storage medium
By initially setting up a small number of probe nodes in the blockchain network and updating their number according to the probability distribution status, the problem of resource waste in the public chain network is solved, and the node configuration and information transmission speed are optimized.
Patent Information
- Application Number
- CN202410658415.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-27
AI Technical Summary
Public chain networks often face delays and efficiency issues when processing interactive data and block data dissemination, which results in the need to deploy a large number of probe nodes to ensure the timeliness of information dissemination, resulting in a waste of resources.
By initially setting up a small number of probe nodes in the blockchain network, collecting the probability distribution status of block headers and interactive hashes, deducing the number of connections to the public nodes to be updated, and re-updating the probe nodes to meet broadcast monitoring requirements and avoid configuration Too many nodes.
It effectively avoids resource waste, optimizes the probe node configuration of the blockchain network, reduces maintenance costs, and increases the speed of information transmission.
Smart Images

Figure CN118264671B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of blockchain technology, and in particular, relates to an updating method, device, equipment and storage medium for a blockchain network system. Background Art
[0002] At present, the public chain network often faces delay and efficiency problems when processing the transmission of interactive data and block data. In order to solve this problem, the open source nodes of the public chain currently adopt the square root n neighboring node broadcasting scheme, and each node only sends a random Each node broadcasts complete interaction data and block information, and The remaining nodes only broadcast interactive hashes and block headers, so it is necessary to deploy enough probe nodes to ensure that There is at least one probe node in each node, which leads to waste of resources and has many shortcomings. Summary of the invention
[0003] The embodiments of the present application provide a method, device, equipment and storage medium for updating a blockchain network system, which can solve the problem of the need to deploy enough probe nodes in the current blockchain broadcast architecture to ensure that the blockchain network system is updated in a random manner. The problem of resource waste caused by the presence of at least one probe node in each node.
[0004] In a first aspect, a method for updating a blockchain network system, wherein a public node to be updated in the blockchain network system is connected to a plurality of other public nodes and a first number of probe nodes, the updating method comprising:
[0005] Determine the probability distribution of first data and second data in the blockchain network system according to the data of the blockchain network system collected by each probe node; the first data includes block data and interaction data, and the second data includes block header data and interaction hash data;
[0006] Determine the number of other public nodes connected to the public node to be updated according to the probability distribution and the first number;
[0007] Determine the second number according to the number of other public nodes connected to the public node to be updated and the preset demand probability distribution;
[0008] The probe nodes connected to the public node to be updated are updated to a second number, and a communication connection relationship between the updated probe nodes and the public node to be updated is established; wherein the probability distribution model used to determine the number of other public nodes is the same as that used to determine the second number.
[0009] In an optional embodiment, determining the probability distribution of the first data and the second data in the blockchain network system according to the data of the blockchain network system collected by each probe node includes:
[0010] Counting the amount of first data collected by each probe node within a set time period, and counting the amount of second data collected by each probe node within the set time period;
[0011] The probability distribution is obtained according to the counted number of the first data and the count of the second data.
[0012] In an optional embodiment, determining the number of other public nodes to which the public node to be updated is connected according to the probability distribution and the first number includes:
[0013] According to the probability distribution and the first number, in combination with a preset probability distribution calculation model, the number of other public nodes connected to the public node to be updated is calculated; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the first number of the probe nodes.
[0014] In an optional embodiment, the determining the second number according to the number of other public nodes connected to the public node to be updated and in combination with a preset demand probability distribution includes:
[0015] The second number is generated according to the number of other public nodes connected to the public node to be updated and the demand distribution probability of the first data in the demand probability distribution, combined with a preset probability distribution calculation model; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the second number of the probe nodes.
[0016] In an optional embodiment, before determining the number of other public nodes to which the public node to be updated is connected according to the probability distribution and the first number, the updating method further includes:
[0017] The probability distribution calculation model is established.
[0018] In an optional embodiment, the updating method further includes:
[0019] After the probe nodes connected to the public node to be updated are updated to a second number, determining the actual probability distribution of the first data and the second data in the blockchain network system again based on the data of the blockchain network system collected by each probe node;
[0020] If the actual distribution probability of the first data in the current probability distribution is lower than the required distribution probability of the first data in the required probability distribution, the number of the probe nodes is gradually increased until the actual distribution probability is equal to the required distribution probability.
[0021] In an optional embodiment, the communication connection relationship between the updated probe node and the public node to be updated further includes:
[0022] Modifying the network communication protocol between the probe nodes to remove some security checks and handshake rounds in the network communication protocol; and / or,
[0023] The network communication protocol between the probe node and the public node is modified to remove some security checks and data verifications in the network communication protocol.
[0024] In a second aspect, an updating device for a blockchain network system, wherein a public node to be updated in the blockchain network system is connected to a plurality of other public nodes and a first number of probe nodes, the first data includes block data and interaction data, the second data includes block header data and interaction hash data, and the updating device includes:
[0025] A probability distribution determination module, which determines the probability distribution of the first data and the second data in the blockchain network system according to the data of the blockchain network system collected by each probe node;
[0026] A public node quantity determination module, which determines the quantity of other public nodes to which the public node to be updated is connected according to the probability distribution and the first quantity;
[0027] A second quantity determination module determines the second quantity according to the quantity of other public nodes connected to the public node to be updated and in combination with a preset demand probability distribution;
[0028] An updating module updates the probe nodes connected to the public node to be updated to a second number, and establishes a communication connection relationship between the updated probe nodes and the public node to be updated; wherein the probability distribution model used to determine the number of other public nodes is the same as the probability distribution model used to determine the second number.
[0029] In an optional embodiment, the probability distribution determination module includes:
[0030] A statistical unit, which counts the number of block data and interaction data collected by each probe node within a set time period, and counts the number of block header data and interaction hash data collected by each probe node within a set time period;
[0031] The probability distribution unit obtains the probability distribution according to the counted number of block data and interaction data, and the counted number of block header data and interaction hash data.
[0032] In an optional embodiment, the public node quantity determination module is specifically used to calculate the number of other public nodes connected to the public node to be updated according to the probability distribution and the first quantity in combination with a preset probability distribution calculation model; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the first number of the probe nodes.
[0033] In an optional embodiment, the second quantity determination module is specifically used to generate the second quantity according to the number of other public nodes connected to the public node to be updated and the demand distribution probability of the first data in the demand probability distribution, combined with a preset probability distribution calculation model; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the second number of the probe nodes.
[0034] In an optional embodiment, the updating system further includes:
[0035] A model building module builds the probability distribution calculation model.
[0036] In an optional embodiment, the updating system comprises:
[0037] An actual probability distribution determination module, after updating the probe nodes connected to the public node to be updated to a second number, again determines the actual probability distribution of the first data and the second data in the blockchain network system according to the data of the blockchain network system collected by each probe node;
[0038] The iteration module gradually increases the number of the probe nodes until the actual distribution probability is equal to the demand distribution probability if the actual distribution probability of the first data in the current probability distribution is lower than the demand distribution probability of the first data in the demand probability distribution.
[0039] In an optional embodiment, it also includes:
[0040] A first modification module is used to modify the network communication protocol between the probe nodes, and remove some security checks and handshake rounds in the network communication protocol; and / or,
[0041] The second modification module modifies the network communication protocol between the probe node and the public node, and removes part of the security check and data verification in the network communication protocol.
[0042] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above items is implemented.
[0043] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the cleaning method described in any one of the above-mentioned first aspects.
[0044] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0045] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0046] The present application provides an updating method, apparatus, device and storage medium for a blockchain network system. First, an initial number of probe nodes (for example, a small number of probe nodes) are arranged in the blockchain network to connect to the public nodes of the blockchain. After running for a period of time, the probability distribution states of the collected block headers / block texts and interaction hashes / interaction texts are used to reversely infer the number of probe nodes required to connect to the public nodes to be updated and obtain valid information for the first time. Then, the probe nodes in the blockchain network are updated again, so that the configured probe nodes meet the broadcast monitoring requirements of the public nodes to be updated in the blockchain system while avoiding configuring too many nodes, thereby avoiding waste of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 This is a flowchart of a method for updating a blockchain network system provided by this application;
[0049] Figure 2a is a schematic diagram of a blockchain network system including a second number of probe nodes provided by the present application;
[0050] Figure 2b is a schematic diagram of a blockchain network system including less than a second number of probe nodes provided by the present application;
[0051] Figure 2c is a schematic diagram of a blockchain network system including more than a second number of probe nodes provided by the present application;
[0052] Figure 3 This is a schematic diagram of the structure of an update device of a blockchain network system provided by the present application;
[0053] Figure 4 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0055] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0056] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0057] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0058] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0059] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0060] Existing public chain networks often face delay and efficiency issues when processing transactions and block propagation. Although the use of P2P networks can improve the system's decentralization and anti-attack capabilities, the lack of an effective data propagation optimization mechanism leads to unsatisfactory information propagation speed, affecting the response speed of the entire network and the timeliness of data acquisition.
[0061] Specifically, currently, for an open source node in a public chain that needs to broadcast, a square root n neighboring node broadcast scheme is adopted. That is, for a broadcast node, it is connected to n nodes, where the connected nodes include public nodes and controllable probe nodes. Each node only sends a random Each node broadcasts complete interaction data and block information, and The remaining nodes only broadcast interactive hashes and block headers, while the probe nodes need to monitor the blockchain network data in real time. From the perspective of the overall system, in order to obtain complete transaction and block information as soon as possible, it is necessary to have at least one probe node connected to a certain public chain node in the system within the root number n range, so that the original message can be obtained as soon as possible. Therefore, it is necessary to deploy enough probe nodes to ensure that the original message is received at random. There is at least one probe node in each node, which results in the current number of deployed probe nodes being far greater than the actual number required, resulting in a waste of resources and many deficiencies.
[0062] Based on this, the present application first arranges an initial number of probe nodes (for example, a small number of probe nodes) in the blockchain network to connect to the broadcast node (also a public node) of the blockchain to be monitored, and after running for a period of time, through the probability distribution state of the collected block headers / block texts and interaction hashes / interaction texts, the number of probe nodes required to connect to the public nodes to be updated and obtain valid information in the first time is reversed, and then the probe nodes in the blockchain network are re-updated, so that the configured probe nodes meet the broadcast monitoring requirements of the public nodes to be updated in the blockchain system while avoiding configuring too many nodes, thereby avoiding waste of resources.
[0063] The core concept of this application is described in detail below.
[0064] Figure 1 A flowchart of a method for updating a blockchain network system provided by a specific embodiment of the core concept of the present application is shown as follows: Figure 1 As shown, the updating method includes:
[0065] Step 100, determining the probability distribution of first data and second data in the blockchain network system according to the data of the blockchain network system collected by each probe node;
[0066] Step 200, determining the number of other public nodes to which the public node to be updated is connected according to the probability distribution and the first number;
[0067] Step 300, determining a second number according to the number of other public nodes connected to the public node to be updated and in combination with a preset demand probability distribution;
[0068] Step 400: Update the probe nodes connected to the public node to be updated to a second number, and establish a communication connection relationship between the updated probe node and the public node to be updated.
[0069] In an embodiment of the present application, the probability distribution model used to determine the number of other public nodes and the probability distribution model used to determine the second number are the same.
[0070] The updating method of the blockchain network system provided in the embodiment of the present application configures probe nodes to meet the broadcast monitoring requirements of the public nodes to be updated in the blockchain system while avoiding configuring too many nodes, thereby avoiding waste of resources.
[0071] It should be noted that in step 100, the public node is an open source node for data interaction in the blockchain network system. In the embodiment of the present application, in a data broadcast scenario, the present application is for the blockchain node to be monitored, which is connected to n nodes, some of which are public nodes and some are probe nodes controllable by the monitoring system. Among the n nodes, the blockchain node to be monitored only sends data to random nodes. Each node broadcasts complete interaction data and block information, and The remaining nodes only broadcast the interactive hash and block header, which will not be described in detail in this application.
[0072] In the embodiment of the present application, the probe node is deployed at a key position to capture valid data nodes to monitor the information of the entire blockchain network. It should be noted that in the embodiment of the present application, the probe node is not an additional configuration. The probe node can control the public node in the blockchain network system through the monitoring system and use it as a probe node or convert it into a probe node. Therefore, the probe node comes from the public node. That is, for a public chain, the public node to be updated is connected to n nodes, including x probe nodes, and there are nx non-probe nodes. If x increases, nx decreases, and the number of connected public nodes plus probe nodes is n.
[0073] Furthermore, the present application is to update the number of probe nodes connected to the updated public nodes. It can be used when the initial number of probe nodes (i.e., the first number) is small and the number of updated probe nodes (i.e., the second number) is large. This will not cause waste of probe nodes and avoid setting up more probe nodes. The present application can also be used when the initial number of probe nodes is large and the number of updated probe nodes is small. This will optimize the existing blockchain network architecture and reduce subsequent maintenance costs.
[0074] It should be understood that the method steps of the present application are for updating the configuration of one of the public nodes in the blockchain network system. If the blockchain network system needs to be updated as a whole (that is, all public nodes need to be updated) or partially updated (that is, some public nodes are updated), the method steps mentioned in the present application can be executed multiple times. That is, the method of the present application covers the connection update of a certain public node, and further covers the connection update of multiple public nodes, which is not limited here.
[0075] It should be further explained that in the embodiments of the present application, the number of public nodes cannot be known, that is, among the total number of n connected nodes, the number of x probe nodes is known and controllable. At this time, since the n connected nodes are unknown, the number of nx public nodes is also unknown. The present application first reversely derives the number of nx public nodes based on the probability distribution calculation model and the actual probability distribution.
[0076] In addition, it should be further explained that the actual probability distribution of the first data and the second data is not unchangeable. During processing, due to the influence of network and node failures, theoretically, there is a difference between the probability distribution of the first data and the second data of n connected nodes and the actual probability distribution. This application does not elaborate on this. This application uses the actual probability distribution to reversely infer the number of nx public nodes, and the number of nx public nodes obtained is the actual public nodes available in the public chain. The reverse inference of the actual probability distribution eliminates the situation where some public chains cannot connect to nodes.
[0077] Specifically, multiple probe nodes are deployed in the public chain network. These nodes are specially modified to enhance the efficiency of data broadcasting and querying. The probe nodes are deployed in different geographical locations to ensure a wider coverage and the lowest physical delay to nodes in different regions of the public chain. In step 100, the probe node can collect data broadcast by nodes connected in the blockchain network system. The total nodes n of the blockchain network system include a first number of probe nodes and multiple public nodes. For example, when a public node broadcasts data to other public nodes, The nodes broadcast the first data, which refers to the complete block data and complete interaction data. The remaining nodes broadcast the second data, the second data refers to the block header data and the interactive hash data, wherein the block data includes the block header data and the block body data, and the interactive data is processed by hashing to obtain the interactive hash data. That is, the first data of the embodiment of the present application is the complete data information, and the second data is the partial data information of the first data.
[0078] In the embodiment of the present application, the probe node can collect the data of the node broadcast node connected in the blockchain network system, so a certain number of probe nodes need to be deployed to collect complete data information (i.e., the first data) in the first time. First, an initial number of probe nodes, i.e., the first number of probe nodes, are deployed in the blockchain network system. The probability distribution of the first data and the probability distribution of the second data are obtained by collecting the corresponding connected broadcast nodes according to the first number of probe nodes, and the first number is adjusted according to the probability distribution.
[0079] In step 200, based on the actual probability distribution obtained from the current data statistics and the number of probe nodes, the number of other public nodes connected to the public node to be updated can be inferred. Specifically, the probability distribution is affected by the ratio between the number of other public nodes connected to the public node to be updated and the first number. Therefore, the number of other public nodes can be reversely inferred based on the statistical probability distribution.
[0080] In step 300, the required probability distribution is the requirement for the probability distribution, that is, if in multiple broadcasts, each time to a random Each node broadcasts complete interaction data and block information, randomly The probability that there is at least one probe node in the nodes. For example, 97%, which means that in multiple broadcasts, each random The probability that there is at least one probe node in each node is 97%. The probability that a node includes at least one probe node is converted into a probability distribution of the first data and the second data collected within a period of time. The inventor creatively discovered that the above probability distribution can be equivalently replaced, so that the second number can be determined subsequently based on the number of other public nodes connected to the public node to be updated, combined with the preset demand probability distribution.
[0081] Specifically, when the current statistical probability distribution is lower than the required probability distribution (for example, the required probability distribution is that the first data accounts for 97% of the sum of the first data and the second data), the ratio is used to determine whether the first number of probe nodes needs to be increased or decreased. After increasing or decreasing the number, the second number of probe nodes is obtained. The second number of probe nodes can not only meet the requirement of obtaining complete data information in the first time, but also ensure that too many probe nodes are avoided, which is conducive to avoiding waste of resources.
[0082] In step 400, a communication connection relationship is established between the updated probe nodes and the public nodes to be updated based on the probe nodes updated from the first number to the second number, wherein the total connection nodes n of the public nodes to be updated include the second number of probe nodes and the number of public nodes determined in the above embodiment.
[0083] Specifically, the step 100 includes:
[0084] S101: Counting the amount of first data collected by each probe node within a set time period, and counting the amount of second data collected by each probe node within the set time period.
[0085] S102: Obtain the probability distribution according to the counted number of first data and the counted number of second data.
[0086] In an embodiment of the present application, an initial number of probe nodes of a first number is firstly arranged in the blockchain network, and the number of first data and the number of second data collected by each probe node in a preset time period are counted. For example, the number of first data obtained by each probe node is 100, and the number of second data obtained by each probe node is 10. The probability distribution of the first data is , the probability distribution of the second data is .
[0087] In the present application embodiment, the Figure 2a , Figure 2b and Figure 2c State the relationship between the first quantity and the second quantity, Figure 2a Figure 2b and Figure 2cThe total number of nodes in each figure is 36. The square represents the open source node that sends the broadcast, the circle represents other public nodes, the dotted circle represents the node that collects the first data, the solid circle represents the node that collects the second data, and the black dot represents the probe node. It should be noted that the positions of all nodes deployed in the blockchain network system are randomly distributed. Since the open source nodes are also randomly distributed, The nodes that collect the first data are random, and the probe nodes are also randomly distributed. The first number of probe nodes is initially set as long as at least one of them is in Therefore, the first number of probe nodes initially set can collect both the first data and the second data.
[0088] In a possible implementation manner, the first number of probe nodes initially set in the blockchain network system may be smaller than the updated second number, and the step 200 includes:
[0089] A1: Determine whether the distribution probability of the first data in all collected data is lower than the required probability distribution.
[0090] A2: If it is lower than, increase the number of current probe nodes from the first number to the second number.
[0091] According to steps S101-S102, the distribution probability of the first data in all data is obtained and compared with the demand probability distribution. If the demand probability distribution is 83%, Figure 2a As shown, at this time, the number of probe nodes (indicated by black dots) is 6, the number of received first data (indicated by dotted circles) is 5, and the number of received second data (indicated by solid circles) is 1. The probability distribution includes the distribution probability of the first data in all the collected data, that is, the distribution probability of the first data in all the collected data is , which is exactly 83% of the demand probability distribution, the second number of probe nodes in the blockchain network system should be 6.
[0092] If the first number of probe nodes initially set by the blockchain network system is less than the second number of probe nodes that the blockchain network system needs, Figure 2b As shown, at this time, the number of probe nodes (indicated by black dots) is 4, the number of probe nodes that receive the first data (indicated by dotted circles) is 3, and the number of probe nodes that receive the second data (indicated by solid circles) is 1. The distribution probability of the first data in all collected data is , the probability is 75%, which is less than the required probability distribution of 83%, so the number of current probe nodes needs to be increased.
[0093] In another possible implementation, the first number of probe nodes initially set by the blockchain network system may be greater than the second number of probe nodes rigidly required by the blockchain network system, and step 200 includes:
[0094] B1: Determine whether the distribution probability of the first data in all collected data is lower than the required probability distribution;
[0095] B2: If it is higher, reduce the number of current probe nodes from the first number to the second number.
[0096] If the first number of probe nodes initially set by the blockchain network system is greater than the second number of probe nodes that the blockchain network system needs, Figure 2c As shown, at this time, the number of probe nodes (indicated by black dots) is 7, the number of first data received (indicated by dotted circles) is 6, the number of second data received (indicated by solid circles) is 1, and the distribution probability of the first data in all collected data is , the probability is 85%, which is greater than the required probability distribution 83%, so the number of current probe nodes needs to be reduced.
[0097] In the embodiment of the present application, it should be understood that the probe nodes added or reduced should be added after the first data is collected. In one possible implementation, based on the first number, the number of probe nodes can be continuously increased or decreased until the distribution probability of the first data in all collected data reaches the demand distribution probability of the first data in the demand probability distribution. At this time, the number of probe nodes is the second number, and the second number can be more accurately controlled by iteratively updating the number to ensure that the second number of probe nodes in the system can obtain valid node information at the first time and avoid waste of resources due to excessive configuration. In another possible implementation, the second number of probe nodes can be directly calculated, and the first number can be directly adjusted to the second number according to the calculation result. By directly calculating the approximate second number of probe nodes, the second number can be determined more quickly, speeding up the configuration process of the probe nodes.
[0098] In the embodiment of the present application, step 200, i.e., determining the number of other public nodes to which the public node to be updated is connected according to the probability distribution and the first number, includes:
[0099] S201: Calculate the number of other public nodes connected to the public node to be updated according to the probability distribution and the first number in combination with a preset probability distribution calculation model.
[0100] In this embodiment, step 300, i.e., determining the second number according to the number of other public nodes connected to the public node to be updated and in combination with a preset demand probability distribution, includes:
[0101] S301: Generate the second number according to the number of other public nodes connected to the public node to be updated and the demand distribution probability of the first data in the demand probability distribution, combined with a preset probability distribution calculation model; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the first number of the probe nodes.
[0102] In the embodiment of the present application, the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the second number of the probe nodes.
[0103] It should be noted that P is the distribution probability of the first data in the probability distribution of the current input. The inventor of the present application creatively equates the distribution probability of the first data in the data of the blockchain network system to the probability of each random The probability that at least one probe node is included in each of the nodes is determined by an equivalent method, and the unknown n is determined, thereby deducing the number of all other nodes connected to each public node in the current public chain. This application will not go into details.
[0104] Specifically, in S201, the present application uses a probability distribution calculation model to take the probability distribution currently determined by the data collected from the blockchain network system (which is equivalent to the actual probability distribution at this time) as the current input probability distribution, that is, at this time P is the distribution probability of the first data in the actual probability distribution, and P and x are input into the model to determine n.
[0105] In S301, n and the distribution probability of the first data in the demand probability distribution are input into the model, and x is calculated to obtain the number of probe nodes after the update.
[0106] It should be noted that in the embodiment of the present application, in steps S201 and S301, since P is the distribution probability of the first data in the currently input probability distribution, the currently input probability distribution in step S201 is the "equivalent actual distribution probability of the first data in the equivalent actual probability distribution" calculated by collecting data from the blockchain network system, so at this time P is the equivalent actual distribution probability of the first data in the equivalent actual probability distribution, and the x input to the model at this time is the first quantity. In step S301, since the current input is the demand probability distribution, P is the distribution probability of the first data in the demand probability distribution at this time, and the output x is the second quantity.
[0107] It should be further explained that the inventor of the probability distribution model of this application is based on the Bayesian principle and is created through exploration. This application may also adopt other models in other embodiments. The primary core concept of this application is not to adopt any model, but to use the equivalent probability distribution method to make the probability distribution of the collected blockchain data equivalent to each random The probability that the nodes include at least one probe node can be used to deduce the currently unknown n. As for the probability distribution model adopted in this application, it is a further preferred inventive concept. The probability distribution model of this application is adopted. Since the probability distribution of this application is based on the Bayesian principle, it is found through actual use that it is more accurate than other models. This application will not elaborate on it here.
[0108] In the embodiment of the present application, different blockchain networks correspond to different demand probability distributions. Specifically, before determining the number of other public nodes to which the public node to be updated is connected according to the probability distribution and the first number, the updating method further includes:
[0109] The probability distribution calculation model is established.
[0110] Furthermore, considering that the network environment of the blockchain network system of the present application may change at any time, the present application further configures a self-update solution based on this. Specifically, in some embodiments, the update method further includes:
[0111] S001: after the probe nodes connected to the public node to be updated are updated to a second number, determining the actual probability distribution of the first data and the second data in the blockchain network system again according to the data of the blockchain network system collected by each probe node;
[0112] S002: If the actual distribution probability of the first data in the current probability distribution is lower than the required distribution probability of the first data in the required probability distribution, gradually increase the number of the probe nodes until the actual distribution probability is equal to the required distribution probability.
[0113] In step S001 and step S002, after the probe nodes are updated to the second number, the probe nodes can be randomly selected from the theoretical random number of the present application. The probability of including at least one probe node in each node should be exactly equal to the distribution probability of the first data in the required probability distribution. However, node failures, network connection failures, etc. may occur in the blockchain network system. The inventor of the present application has discovered that this phenomenon exists but the number is small. Based on this, the present application adopts a method of gradually increasing or decreasing probe nodes to adapt to the actual situation of the latest blockchain network system. First, the actual probability distribution is obtained by collecting actual data, and then the required probability distribution is continuously approached according to the actual probability distribution. Therefore, the configuration of the probe nodes of the present application can be dynamically adjusted according to the actual situation of the blockchain network system.
[0114] Exemplarily, n is the number of peer connections of each public node of the blockchain to be monitored, representing how many other blockchain nodes a certain blockchain node to be monitored is connected to. It should be noted that for each public chain, n is a fixed value. For example, in mainstream public chains such as Ethereum, n is between 100 and 300, which is configured by the node operation and maintenance party. x is the number of probe nodes connected to the public node of the blockchain to be monitored, which can be adjusted by the monitoring system. When x is increased, for example, x=50, n=100, the result of the demand probability distribution formula p=1-(1 / 2)^10, the result is close to 1, when x=10, p=1-(9 / 10)^10, the demand probability distribution is lower than when x=50.
[0115] In addition, in some embodiments, in order to obtain complete transaction and block information in the first time, the speed of blockchain node information transmission is also improved in the present application. Specifically, the method of the present application also includes:
[0116] Modifying the network communication protocol between the probe nodes to remove some security checks and handshake rounds in the network communication protocol; and / or,
[0117] The network communication protocol between the probe node and the public node is modified to remove some security checks and data verifications in the network communication protocol.
[0118] By modifying the network communication protocol between probe nodes and between probe nodes and public nodes, the speed at which probe nodes collect data received by public nodes is improved, further accelerating the process of determining the second quantity. Based on the embodiments of the present application, by removing some security checks and data verifications in the network communication protocol, it is beneficial for probe nodes to obtain complete transaction and block information as soon as possible.
[0119] Based on the same inventive concept, see Figure 3 , shows a structural schematic diagram of an update device for a blockchain network system provided in an embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.
[0120] The public node to be updated in the blockchain network system is connected to a plurality of other public nodes and a first number of probe nodes, the first data includes block data and interaction data, the second data includes block header data and interaction hash data, and the updating device includes:
[0121] A probability distribution determination module 410 determines the probability distribution of first data and second data in the blockchain network system according to the data of the blockchain network system collected by each probe node;
[0122] A public node quantity determination module 420 determines the quantity of other public nodes to which the public node to be updated is connected according to the probability distribution and the first quantity;
[0123] A second quantity determination module 430 determines a second quantity according to the quantity of other public nodes connected to the public node to be updated and in combination with a preset demand probability distribution;
[0124] The updating module 440 updates the probe nodes connected to the public node to be updated to a second number, and establishes a communication connection relationship between the updated probe node and the public node to be updated.
[0125] Based on the same inventive concept, in an optional embodiment, the probability distribution determination module includes:
[0126] A statistical unit, which counts the number of block data and interaction data collected by each probe node within a set time period, and counts the number of block header data and interaction hash data collected by each probe node within a set time period;
[0127] The probability distribution unit obtains the probability distribution according to the counted number of block data and interaction data, and the counted number of block header data and interaction hash data.
[0128] Based on the same inventive concept, in an optional embodiment, the public node quantity determination module is specifically used to calculate the number of other public nodes connected to the public node to be updated according to the probability distribution and the first quantity, combined with a preset probability distribution calculation model; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the first number of the probe nodes.
[0129] Based on the same inventive concept, in an optional embodiment, the second quantity determination module is specifically used to generate the second quantity according to the number of other public nodes connected to the public node to be updated and the demand distribution probability of the first data in the demand probability distribution, combined with a preset probability distribution calculation model; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the second number of the probe nodes.
[0130] Based on the same inventive concept, in an optional embodiment, the updating system further includes:
[0131] A model building module builds the probability distribution calculation model.
[0132] Based on the same inventive concept, in an optional embodiment, the updating system includes:
[0133] An actual probability distribution determination module, after updating the probe nodes connected to the public node to be updated to a second number, again determines the actual probability distribution of the first data and the second data in the blockchain network system according to the data of the blockchain network system collected by each probe node;
[0134] The iteration module gradually increases the number of the probe nodes until the actual distribution probability is equal to the demand distribution probability if the actual distribution probability of the first data in the current probability distribution is lower than the demand distribution probability of the first data in the demand probability distribution.
[0135] Based on the same inventive concept, in an optional embodiment, it also includes:
[0136] A first modification module is used to modify the network communication protocol between the probe nodes, and remove some security checks and handshake rounds in the network communication protocol; and / or,
[0137] The second modification module modifies the network communication protocol between the probe node and the public node, and removes part of the security check and data verification in the network communication protocol.
[0138] The updating device of the blockchain network system provided in the embodiment of the present application can be applied in the aforementioned method embodiment. For details, please refer to the description of the aforementioned method embodiment, which will not be repeated here.
[0139] Figure 4 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 4 As shown, the terminal device 700 of this embodiment includes: at least one processor 710 ( Figure 4 Only one is shown in the figure), a memory 720, and a computer program 721 stored in the memory 720 and executable on the at least one processor 710, wherein the processor 710 implements the steps in the above method embodiment when executing the computer program 721.
[0140] The terminal device 700 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 710 and a memory 720. Those skilled in the art will appreciate that Figure 4 It is only an example of the terminal device 700 and does not constitute a limitation on the terminal device 700. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0141] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0142] In some embodiments, the memory 720 may be an internal storage unit of the terminal device 700, such as a hard disk or memory of the terminal device 700. In other embodiments, the memory 720 may also be an external storage device of the terminal device 700, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 700. Further, the memory 720 may also include both an internal storage unit of the terminal device 700 and an external storage device. The memory 720 is used to store an operating system, an application program, a boot loader (Boot Loader), data and other programs, such as the program code of the computer program, etc. The memory 720 may also be used to temporarily store data that has been output or is to be output.
[0143] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0144] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0145] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0146] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0147] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0148] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0149] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0150] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be completed through a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0151] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for updating a blockchain network system. It is characterized in that The public node to be updated in the blockchain network system is connected to a plurality of other public nodes and a first number of probe nodes, and the updating method includes: Determine the probability distribution of first data and second data in the blockchain network system according to the data of the blockchain network system collected by each probe node; the first data includes block data and interaction data, and the second data includes block header data and interaction hash data; Determine the number of other public nodes connected to the public node to be updated according to the probability distribution and the first number; Determine the second number according to the number of other public nodes connected to the public node to be updated and the preset demand probability distribution; The probe nodes connected to the public node to be updated are updated to a second number, and a communication connection relationship between the updated probe nodes and the public node to be updated is established; wherein the probability distribution model used to determine the number of other public nodes is the same as that used to determine the second number.
2. A method for updating a blockchain network system as claimed in claim 1, It is characterized in that Determining the probability distribution of the first data and the second data in the blockchain network system according to the data of the blockchain network system collected by each probe node includes: Counting the amount of first data collected by each probe node within a set time period, and counting the amount of second data collected by each probe node within the set time period; The probability distribution is obtained according to the counted number of the first data and the count of the second data.
3. A method for updating a blockchain network system as claimed in claim 1, It is characterized in that The step of determining the number of other public nodes connected to the public node to be updated according to the probability distribution and the first number includes: According to the probability distribution and the first number, in combination with a preset probability distribution calculation model, the number of other public nodes connected to the public node to be updated is calculated; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the first number of the probe nodes.
4. A method for updating a blockchain network system as claimed in claim 1, It is characterized in that The determining the second number according to the number of other public nodes connected to the public node to be updated and in combination with a preset demand probability distribution includes: The second number is generated according to the number of other public nodes connected to the public node to be updated and the demand distribution probability of the first data in the demand probability distribution, combined with a preset probability distribution calculation model; the probability distribution calculation model is: P=1- ; Wherein P is the distribution probability of the first data in the probability distribution of the current input, n is the number of other public nodes connected to the public node to be updated, and x is the second number of the probe nodes.
5. A method for updating a blockchain network system as claimed in claim 3 or 4, It is characterized in that Before determining the number of other public nodes to which the public node to be updated is connected according to the probability distribution and the first number, the updating method further includes: The probability distribution calculation model is established.
6. A method for updating a blockchain network system as claimed in claim 1, It is characterized in that The updating method further comprises: After the probe nodes connected to the public node to be updated are updated to a second number, determining the actual probability distribution of the first data and the second data in the blockchain network system again based on the data of the blockchain network system collected by each probe node; If the actual distribution probability of the first data in the current probability distribution is lower than the required distribution probability of the first data in the required probability distribution, the number of the probe nodes is gradually increased until the actual distribution probability is equal to the required distribution probability.
7. A method for updating a blockchain network system as claimed in claim 1, It is characterized in that Also includes: Modify the network communication protocol between the probe nodes to remove some security checks and handshake rounds in the network communication protocol; and / or, The network communication protocol between the probe node and the public node is modified to remove some security checks and data verifications in the network communication protocol.
8. An updating device for a blockchain network system, It is characterized in that The public node to be updated in the blockchain network system is connected to a plurality of other public nodes and a first number of probe nodes, and the updating device includes: A probability distribution determination module, which determines the probability distribution of first data and second data in the blockchain network system according to the data of the blockchain network system collected by each probe node, wherein the first data includes block data and interaction data, and the second data includes block header data and interaction hash data; A public node quantity determination module, which determines the quantity of other public nodes to which the public node to be updated is connected according to the probability distribution and the first quantity; A second quantity determination module determines the second quantity according to the quantity of other public nodes connected to the public node to be updated and in combination with a preset demand probability distribution; An updating module updates the probe nodes connected to the public node to be updated to a second number, and establishes a communication connection relationship between the updated probe nodes and the public node to be updated; wherein the probability distribution model used to determine the number of other public nodes is the same as the probability distribution model used to determine the second number.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Block chain-based digital currency transaction network topology data analysis optimization method and system
CN113689222A
Method and device for collecting and broadcasting transaction data of block chain node memory pool
CN115766745A
