Network dynamic construction method and system based on gossip protocol
By using the scoring function scoring other nodes in the non -centered network, dynamically adjust the network connection, solve the problem of self -adjustment of network structure caused by changes in the network environment, and achieve efficient resource utilization and system operation efficiency.
Patent Information
- Application Number
- CN202211300621.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-24
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-10-24
AI Technical Summary
After the existing centerless peer network is deployed on the public network, changes in the network environment cause the original network structure to be unable to adjust itself, resulting in the number of message delivery and redundancy, which affects the system operation efficiency and resource consumption.
By collecting the parameters of the message transfer time, quantity and accuracy in the network node, set the parameter weight and threshold, and use the scoring function to score other nodes. Adjust the network structure.
The network structure is automatically adjusted according to the network environment and message characteristics, improved the operation efficiency of the system, reduced the consumption of resources, improved the comprehensive efficiency of the system, and reduced bandwidth waste.
Smart Images

Figure CN115766619B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information technology, in particular to a network dynamic construction method and system based on a gossip protocol. Background Art
[0002] The decentralized peer-to-peer network is a widely used distributed system, and the gossip protocol is a commonly used distributed consistency protocol, which is used to ensure the consistency of node information in the network. As you can see from the word gossip, its Chinese meaning is gossip, rumors, etc. The working principle of the gossip protocol is similar to this. It spreads information to the entire network by one person passing it to ten people, and ten people passing it to a hundred people, and makes all the node data in the system consistent within a certain period of time. Compared with the distributed system that relies on the central node, this decentralized, fully peer-to-peer distributed system has the advantages of simple deployment, easy expansion, high fault tolerance, robustness, and eventual consistency. At the same time, there is also a disadvantage that the number of message transmissions and transmission redundancy cannot be achieved at the same time. After the system is initialized, it is generally networked according to a rule, but after being deployed on the public network, the network environment may be affected by objective factors or user usage. The original networking structure will magnify the above shortcomings and needs to be able to adjust itself according to the actual situation.
[0003] Therefore, how to dynamically adjust the network structure, improve system operation efficiency, and reduce resource consumption is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The technical task of the present invention is to provide a network dynamic construction method and system based on the gossip protocol to solve the problem of how to dynamically adjust the network structure, improve system operation efficiency and reduce resource consumption.
[0005] The technical task of the present invention is achieved in the following way: a network dynamic construction method based on the gossip protocol, in which each node in the network collects parameters of the transmission time, quantity and accuracy of messages with other nodes by category, sets parameter weights and related thresholds for different categories, obtains scores of other nodes through a scoring function, and the nodes periodically disconnect from low-scoring nodes and establish connections with high-scoring nodes based on the scores.
[0006] Preferably, the method is as follows:
[0007] S1. Receive messages, calculate parameters, and classify messages;
[0008] S2, simultaneous timing loop execution: each node maintains a timer, and the next step is to execute step S3;
[0009] S3, each node scores other nodes in the network according to the scoring function, and then executes step S4;
[0010] S4. The node determines whether its own connection number is greater than or equal to the set connection number upper limit:
[0011] ① If yes, disconnect the node with the lowest score among the connected nodes, and then execute step S5;
[0012] ②, if not, proceed to step S5;
[0013] S5. The node determines whether its own connection number is less than the set connection number upper limit:
[0014] ①. If yes, proceed to step S6;
[0015] ②, if not, jump to step S2;
[0016] S6. Select the node with the highest score among the unconnected nodes as the target node for connection, and then jump to step S2.
[0017] Preferably, in step S1, the message calculation parameters are received and the messages are classified as follows:
[0018] S101, classify the transmitted messages and set them as t i ; Among them, the parameters of each node in the network include P1, P2, P3, P4, P5, P6 and P7; P1 represents the message transmission time between this node and other nodes, which is the upper limit when it exceeds the upper limit; P2 represents the number of message transmissions between this node and other nodes, which is the upper limit when it exceeds the upper limit; P3 represents the number of failed message transmissions between this node and other nodes, which is a negative number; P4 represents the square of the number of invalid messages transmitted between this node and other nodes, which is a negative number; P5 represents the message transmission rate, and sets a threshold for the expected number of transmissions. If the number of transmitted messages is higher than the threshold, it is 0, and if it is lower, it is the square of the missing part, which is a negative number; P6 represents the number of nodes in the same subnet minus the set threshold. If there is a surplus, it is squared, otherwise it is 0, which is a negative number; P7 represents the threshold set by the application, which can be positive or negative, indicating the importance of this application;
[0019] S102, after receiving the message, the node recalculates the seven parameters P1, P2, P3, P4, P5, P6 and P7, and updates the seven parameters P1, P2, P3, P4, P5, P6 and P7;
[0020] S103. The user sets the weights of the categories and parameters in the scoring function and the global threshold according to the importance of the message categories and applications. The seven parameters P1, P2, P3, P4, P5, P6 and P7 are periodically decayed according to the set decay factor to ensure that the larger impact score will not produce stickiness within the cycle. The decay factor is a floating point number in the range of (0.0, 1.0) and will be multiplied by the current parameter value at each decay interval update; among them, the values of the four parameters P2, P3, P4 and P5 are set to 0 after they are decayed below the set threshold.
[0021] Preferably, the scoring function in step S3 is as follows:
[0022] Score(p)=Σt i *(w1(t i )*P1(t i )+w2(t i )*P2(t i )+w3(t i )*P3(t i )+w4(t i )*P4(t i )+w5(t i )*P5(t i ))+w6*P6+w7*P7;
[0023] Among them, w1, w2, w3, w4, w5, w6 and w7 are the weights of P1, P2, P3, P4, P5, P6 and P7 respectively. The default values are all 1 and can be set by the user as needed.
[0024] More preferably, the upper limit of the number of connections in step S4 refers to the cube root of the number of nodes rounded off.
[0025] A network dynamic construction system based on a gossip protocol, the system comprising a classification module, a timing module, a scoring module, a first judgment module, an interruption module, a second judgment module, a connection module and a circulation module;
[0026] The classification module is used to receive message calculation parameters and classify the messages;
[0027] The timing module is used for timing loop execution: each node maintains a timer;
[0028] The scoring module is used by each node to score other nodes in the network according to the scoring function;
[0029] The judgment module 1 is used for the node to judge whether the number of its own connections is greater than or equal to the set upper limit of the number of connections;
[0030] The interruption module is used to interrupt the connection with the node with the smallest score among the connected nodes;
[0031] The second judgment module is used for the node to judge whether the number of its own connections is less than the set upper limit of the number of connections;
[0032] The connection module is used to select the node with the highest score among the unconnected nodes as the target node for connection;
[0033] The loop module is used to repeatedly execute the timing module, the scoring module, the judgment module 1, the interruption module, the judgment module 2 and the connection module after the timer expires, so as to realize dynamic optimization of network connection.
[0034] Preferably, the classification module comprises:
[0035] Classification submodule 1 is used to classify the transmitted messages, set to t i ; Among them, the parameters of each node in the network include P1, P2, P3, P4, P5, P6 and P7; P1 represents the message transmission time between this node and other nodes, which is the upper limit when it exceeds the upper limit; P2 represents the number of message transmissions between this node and other nodes, which is the upper limit when it exceeds the upper limit; P3 represents the number of failed message transmissions between this node and other nodes, which is a negative number; P4 represents the square of the number of invalid messages transmitted between this node and other nodes, which is a negative number; P5 represents the message transmission rate, and sets a threshold for the expected number of transmissions. If the number of transmitted messages is higher than the threshold, it is 0, and if it is lower, it is the square of the missing part, which is a negative number; P6 represents the number of nodes in the same subnet minus the set threshold. If there is a surplus, it is squared, otherwise it is 0, which is a negative number; P7 represents the threshold set by the application, which can be positive or negative, indicating the importance of this application;
[0036] The update submodule is used for the node to recalculate the seven parameters P1, P2, P3, P4, P5, P6 and P7 after receiving the message, and update the seven parameters P1, P2, P3, P4, P5, P6 and P7;
[0037] The parameter setting submodule is used to set the weights of categories and parameters in the scoring function and the global threshold according to the importance of message categories and applications. The seven parameters P1, P2, P3, P4, P5, P6 and P7 are regularly decayed according to the set decay factor to ensure that large impact scores will not become sticky within the cycle. The decay factor is a floating point number in the range of (0.0, 1.0) and will be multiplied by the current parameter value at each decay interval update; among them, the values of the four parameters P2, P3, P4 and P5 are set to 0 after decaying below the set threshold.
[0038] As a preferred embodiment, the scoring function is as follows:
[0039] Score(p)=Σt i *(w1(ti )*P1(t i )+w2(t i )*P2(t i )+w3(t i )*P3(t i )+w4(t i )*P4(t i )+w5(t i )*P5(t i ))+w6*P6+w7*P7;
[0040] Among them, w1, w2, w3, w4, w5, w6 and w7 are the weights of P1, P2, P3, P4, P5, P6 and P7 respectively. The default value is 1 and the user can set it according to the needs;
[0041] The upper limit of the number of connections refers to the cube root of the number of nodes rounded off.
[0042] An electronic device comprising: a memory and at least one processor;
[0043] Wherein, the memory stores a computer program;
[0044] The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the network dynamic construction method based on the gossip protocol as described above.
[0045] A computer-readable storage medium stores a computer program, which can be executed by a processor to implement the network dynamic construction method based on the gossip protocol as described above.
[0046] The network dynamic construction method and system based on the gossip protocol of the present invention have the following advantages:
[0047] (1) The present invention uses a method in which each node in the gossip network scores other nodes to determine the comprehensive status of different message transmission lines, adjust the connection path between the node and other nodes, and automatically adjust the network structure according to comprehensive factors such as the real-time status of the network environment, the importance of message classification, and the frequency of message sending and receiving, thereby improving the overall efficiency of the system and reducing bandwidth waste;
[0048] (ii) While maintaining the original characteristics of gossip, the present invention enables the system to dynamically adjust the network structure as the network environment, message importance and message sending and receiving frequency change, thereby improving system operation efficiency and reducing resource consumption;
[0049] (III) The present invention is mainly used to automatically adjust the network after the gossip network is established according to comprehensive factors such as network environment, message type weight, and sending and receiving frequency to improve system efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The present invention is further described below in conjunction with the accompanying drawings.
[0051] Attached Figure 1 This is a flowchart of a network dynamic construction method based on the gossip protocol. DETAILED DESCRIPTION
[0052] The network dynamic construction method and system based on the gossip protocol of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments of the specification.
[0053] Embodiment 1:
[0054] The present invention discloses a network dynamic construction method based on a gossip protocol. The method collects parameters of the transmission time, quantity and accuracy of messages with other nodes by category at each node in the network, sets weights of parameters for different categories and related thresholds, obtains scores of other nodes through a scoring function, and the nodes regularly disconnect from low-scoring nodes and establish connections with high-scoring nodes according to the scores.
[0055] As attached Figure 1 As shown, the method is as follows:
[0056] S1. Receive messages, calculate parameters, and classify messages;
[0057] S2, simultaneous timing loop execution: each node maintains a timer, and the next step is to execute step S3;
[0058] S3, each node scores other nodes in the network according to the scoring function, and then executes step S4;
[0059] S4. The node determines whether its own connection number is greater than or equal to the set connection number upper limit:
[0060] ① If yes, disconnect the node with the lowest score among the connected nodes, and then execute step S5;
[0061] ②, if not, proceed to step S5;
[0062] S5. The node determines whether its own connection number is less than the set connection number upper limit:
[0063] ①. If yes, proceed to step S6;
[0064] ②, if not, jump to step S2;
[0065] S6. Select the node with the highest score among the unconnected nodes as the target node for connection. The next step jumps to step S2. That is, after the timer expires, steps S2 to S6 are repeated.
[0066] In step S1 of this embodiment, the message calculation parameters are received and the messages are classified as follows:
[0067] S101, classify the transmitted messages and set them as t i ; Among them, the parameters of each node in the network include P1, P2, P3, P4, P5, P6 and P7; P1 represents the message transmission time between this node and other nodes, which is the upper limit when it exceeds the upper limit; P2 represents the number of message transmissions between this node and other nodes, which is the upper limit when it exceeds the upper limit; P3 represents the number of failed message transmissions between this node and other nodes, which is a negative number; P4 represents the square of the number of invalid messages transmitted between this node and other nodes, which is a negative number; P5 represents the message transmission rate, and sets a threshold for the expected number of transmissions. If the number of transmitted messages is higher than the threshold, it is 0, and if it is lower, it is the square of the missing part, which is a negative number; P6 represents the number of nodes in the same subnet minus the set threshold. If there is a surplus, it is squared, otherwise it is 0, which is a negative number; P7 represents the threshold set by the application, which can be positive or negative, indicating the importance of this application;
[0068] S102, after receiving the message, the node recalculates the seven parameters P1, P2, P3, P4, P5, P6 and P7, and updates the seven parameters P1, P2, P3, P4, P5, P6 and P7;
[0069] S103. The user sets the weights of the categories and parameters in the scoring function and the global threshold according to the importance of the message categories and applications. The seven parameters P1, P2, P3, P4, P5, P6 and P7 are periodically decayed according to the set decay factor to ensure that the larger impact score will not produce stickiness within the cycle. The decay factor is a floating point number in the range of (0.0, 1.0) and will be multiplied by the current parameter value at each decay interval update; among them, the values of the four parameters P2, P3, P4 and P5 are set to 0 after they are decayed below the set threshold.
[0070] The scoring function in step S3 of this embodiment is specifically as follows:
[0071] Score(p)=Σt i *(w1(t i )*P1(t i )+w2(t i )*P2(t i )+w3(t i )*P3(t i )+w4(t i )*P4(ti )+w5(t i )*P5(t i ))+w6*P6+w7*P7;
[0072] Among them, w1, w2, w3, w4, w5, w6 and w7 are the weights of P1, P2, P3, P4, P5, P6 and P7 respectively. The default values are all 1 and can be set by the user as needed.
[0073] The upper limit value of the number of connections in step S4 of this embodiment refers to the cube root of the number of nodes rounded off.
[0074] In the specific implementation, in the network, node A is connected to node B, and node B is connected to node C. When node A needs a message of category 1, and node C sends a large number of messages of category 1 in a short period of time, at this time, the score of node C in node A is higher than that of node B, and node A will disconnect from node B and establish a connection with node C. After a period of time, the parameters decay and return to normal, then the score of node B exceeds that of node C again, node A disconnects from node C and reconnects to node B.
[0075] Embodiment 2:
[0076] This embodiment provides a network dynamic construction system based on the gossip protocol, which includes a classification module, a timing module, a scoring module, a judgment module 1, an interruption module, a judgment module 2, a connection module and a circulation module;
[0077] The classification module is used to receive message calculation parameters and classify the messages;
[0078] The timing module is used for timing loop execution: each node maintains a timer;
[0079] The scoring module is used by each node to score other nodes in the network according to the scoring function;
[0080] The judgment module 1 is used for the node to judge whether the number of its own connections is greater than or equal to the set upper limit of the number of connections;
[0081] The interruption module is used to interrupt the connection with the node with the smallest score among the connected nodes;
[0082] The second judgment module is used for the node to judge whether the number of its own connections is less than the set upper limit of the number of connections;
[0083] The connection module is used to select the node with the highest score among the unconnected nodes as the target node for connection;
[0084] The loop module is used to repeatedly execute the timing module, the scoring module, the judgment module 1, the interruption module, the judgment module 2 and the connection module after the timer expires, so as to realize dynamic optimization of network connection.
[0085] The classification module in this embodiment includes:
[0086] Classification submodule 1 is used to classify the transmitted messages, set to t i ; Among them, the parameters of each node in the network include P1, P2, P3, P4, P5, P6 and P7; P1 represents the message transmission time between this node and other nodes, which is the upper limit when it exceeds the upper limit; P2 represents the number of message transmissions between this node and other nodes, which is the upper limit when it exceeds the upper limit; P3 represents the number of failed message transmissions between this node and other nodes, which is a negative number; P4 represents the square of the number of invalid messages transmitted between this node and other nodes, which is a negative number; P5 represents the message transmission rate, and sets a threshold for the expected number of transmissions. If the number of transmitted messages is higher than the threshold, it is 0, and if it is lower, it is the square of the missing part, which is a negative number; P6 represents the number of nodes in the same subnet minus the set threshold. If there is a surplus, it is squared, otherwise it is 0, which is a negative number; P7 represents the threshold set by the application, which can be positive or negative, indicating the importance of this application;
[0087] The update submodule is used for the node to recalculate the seven parameters P1, P2, P3, P4, P5, P6 and P7 after receiving the message, and update the seven parameters P1, P2, P3, P4, P5, P6 and P7;
[0088] The parameter setting submodule is used to set the weights of categories and parameters in the scoring function and the global threshold according to the importance of message categories and applications. The seven parameters P1, P2, P3, P4, P5, P6 and P7 are regularly decayed according to the set decay factor to ensure that large impact scores will not become sticky within the cycle. The decay factor is a floating point number in the range of (0.0, 1.0) and will be multiplied by the current parameter value at each decay interval update; among them, the values of the four parameters P2, P3, P4 and P5 are set to 0 after decaying below the set threshold.
[0089] The scoring function in this embodiment is as follows:
[0090] Score(p)=Σt i *(w1(t i )*P1(t i )+w2(t i )*P2(t i )+w3(t i )*P3(t i )+w4(t i )*P4(t i )+w5(t i )*P5(t i ))+w6*P6+w7*P7;
[0091] Among them, w1, w2, w3, w4, w5, w6 and w7 are the weights of P1, P2, P3, P4, P5, P6 and P7 respectively. The default values are all 1 and can be set by the user as needed.
[0092] In this embodiment, the upper limit of the number of connections refers to the cube root of the number of nodes rounded off.
[0093] Embodiment 3:
[0094] The present invention also provides an electronic device, including: a memory and a processor;
[0095] Wherein, the memory stores computer-executable instructions;
[0096] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the network dynamic construction method based on the gossip protocol in any embodiment of the present invention.
[0097] The processor 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. The processor may be a microprocessor or any conventional processor, etc.
[0098] The memory can be used to store computer programs and / or modules. The processor realizes various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can also include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, at least one disk storage period, a flash memory device, or other volatile solid-state storage devices.
[0099] Embodiment 4:
[0100] This embodiment also provides a computer-readable storage medium, which stores a plurality of instructions, which are loaded by a processor, so that the processor executes the network dynamic construction method based on the gossip protocol in any embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0101] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0102] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0103] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0104] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A network dynamic construction method based on gossip protocol, characterized in that: This method is to collect parameters of the transmission time, quantity and accuracy of messages with other nodes by category at each node in the network, set the weights and related thresholds of parameters for different categories, obtain the scores of other nodes through the scoring function, and the nodes regularly disconnect from low-scoring nodes and establish connections with high-scoring nodes according to the scores; the details are as follows: S1. Receive message calculation parameters and classify the message; the details are as follows: S101, classify the transmitted messages and set them as tᵢ; the parameters of each node in the network include P1, P2, P3, P4, P5, P6 and P7; P1 represents the message transmission time between this node and other nodes, which is the upper limit when it exceeds the upper limit; P2 represents the number of message transmissions between this node and other nodes, which is the upper limit when it exceeds the upper limit; P3 represents the number of failed message transmissions between this node and other nodes, which is a negative number; P4 represents the square of the number of invalid messages transmitted between this node and other nodes, which is a negative number; P5 represents the message transmission rate, and sets a threshold for the expected number of transmissions. If the number of transmitted messages is higher than the threshold, it is 0, and if it is lower, it is the square of the missing part, which is a negative number; P6 represents the number of nodes in the same subnet minus the set threshold. If there is a surplus, it is squared, otherwise it is 0, which is a negative number; P7 represents the threshold set by the application, which can be positive or negative, indicating the importance of this application; S102, after receiving the message, the node recalculates the seven parameters P1, P2, P3, P4, P5, P6 and P7, and updates the seven parameters P1, P2, P3, P4, P5, P6 and P7; S103, the user sets the weights of the categories and parameters in the scoring function and the global threshold according to the importance of the message categories and applications. The seven parameters P1, P2, P3, P4, P5, P6 and P7 are periodically decayed according to the set decay factor. The decay factor is a floating point number in the range of (0.0, 1.0) and will be multiplied by the current parameter value at each decay interval update. Among them, the values of the four parameters P2, P3, P4 and P5 are set to 0 after being decayed and falling below the set threshold. S2, simultaneous timing loop execution: each node maintains a timer, and the next step is to execute step S3; S3, each node scores other nodes in the network according to the scoring function, and then executes step S4; S4. The node determines whether its own connection number is greater than or equal to the set connection number upper limit: ① If yes, disconnect the node with the lowest score among the connected nodes, and then execute step S5; ②, if not, proceed to step S5; S5. The node determines whether its own connection number is less than the set connection number upper limit: ①. If yes, proceed to step S6; ②, if not, jump to step S2; S6. Select the node with the highest score among the unconnected nodes as the target node for connection, and then jump to step S2.
2. The method for dynamic network construction based on gossip protocol according to claim 1, characterized in that: The scoring function in step S3 is as follows: Score(p) = Σtᵢ*(w1(tᵢ)*P1(tᵢ) + w2(tᵢ)*P2(tᵢ) + w3(tᵢ)*P3(tᵢ) + w4(tᵢ)*P4(tᵢ) + w5(tᵢ)*P5(tᵢ)) + w6*P6+ w7*P7; Among them, w1, w2, w3, w4, w5, w6 and w7 are the weights of P1, P2, P3, P4, P5, P6 and P7 respectively, all of which are 1 by default and can be set by the user as needed.
3. The method for dynamic network construction based on gossip protocol according to claim 1, characterized in that: The upper limit value of the number of connections in step S4 refers to the cube root of the number of nodes rounded off.
4. A network dynamic construction system based on gossip protocol, characterized in that: The system includes a classification module, a timing module, a scoring module, a judgment module 1, an interruption module, a judgment module 2, a connection module and a circulation module; The classification module is used to receive message calculation parameters and classify the messages; The timing module is used for timing loop execution: each node maintains a timer; The scoring module is used by each node to score other nodes in the network according to the scoring function; The judgment module 1 is used for the node to judge whether the number of its own connections is greater than or equal to the set upper limit of the number of connections; The interruption module is used to interrupt the connection with the node with the smallest score among the connected nodes; The second judgment module is used for the node to judge whether the number of its own connections is less than the set upper limit of the number of connections; The connection module is used to select the node with the highest score among the unconnected nodes as the target node for connection; The loop module is used to repeatedly execute the timing module, the scoring module, the judgment module 1, the interruption module, the judgment module 2 and the connection module after the timer expires, so as to realize dynamic optimization of network connection; Among them, the classification module includes: The classification submodule 1 is used to classify the transmitted messages, which is set as tᵢ; the parameters of each node in the network include P1, P2, P3, P4, P5, P6 and P7; P1 represents the message transmission time between this node and other nodes, which is the upper limit when it exceeds the upper limit; P2 represents the number of message transmissions between this node and other nodes, which is the upper limit when it exceeds the upper limit; P3 represents the number of failed message transmissions between this node and other nodes, which is a negative number; P4 represents the square of the number of invalid messages transmitted between this node and other nodes, which is a negative number; P5 represents the message transmission rate, and sets a threshold for the expected number of transmissions. If the number of transmitted messages is higher than the threshold, it is 0, and if it is lower, it is the square of the missing part, which is a negative number; P6 represents the number of nodes in the same subnet minus the set threshold. If there is a surplus, it is squared, otherwise it is 0, which is a negative number; P7 represents the threshold set by the application, which can be positive or negative, indicating the importance of this application; The update submodule is used for the node to recalculate the seven parameters P1, P2, P3, P4, P5, P6 and P7 after receiving the message, and update the seven parameters P1, P2, P3, P4, P5, P6 and P7; The parameter setting submodule is used to set the weights of categories and parameters in the scoring function and the global threshold according to the importance of message categories and applications. The seven parameters P1, P2, P3, P4, P5, P6 and P7 are regularly decayed according to the set decay factor. The decay factor is a floating point number in the range of (0.0, 1.0) and will be multiplied by the current parameter value at each decay interval update. Among them, the values of the four parameters P2, P3, P4 and P5 are set to 0 after they decay below the set threshold.
5. The network dynamic construction system based on the gossip protocol according to claim 4 is characterized in that: The scoring function is as follows: Score(p) = Σtᵢ*(w1(tᵢ)*P1(tᵢ) + w2(tᵢ)*P2(tᵢ) + w3(tᵢ)*P3(tᵢ) + w4(tᵢ)*P4(tᵢ) + w5(tᵢ)*P5(tᵢ)) + w6*P6 + w7*P7; Among them, w1, w2, w3, w4, w5, w6 and w7 are the weights of P1, P2, P3, P4, P5, P6 and P7 respectively. The default values are all 1 and can be set by the user according to the needs; The upper limit of the number of connections refers to the cube root of the number of nodes rounded off.
6. An electronic device, characterized in that: include: memory and at least one processor; Wherein, the memory stores a computer program; The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the network dynamic construction method based on the gossip protocol as described in any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the network dynamic construction method based on the gossip protocol as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Big data operation state monitoring and health degree evaluation method and device
CN112579685A
Distributed database network connection management method based on Gossip
CN114363357A