Dynamic construction method and system of communication network nodes
By dynamically selecting relay nodes in the blockchain network and using the feature vectors and similarity calculations of the main network nodes, the problem of low throughput in blockchain transactions is solved and data processing efficiency and throughput are improved.
Patent Information
- Application Number
- CN202410094727.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-23
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-01-23
AI Technical Summary
The existing transaction relay nodes between blockchains are relatively fixed and cannot achieve high-throughput technical scenarios, resulting in low data processing efficiency.
By electing the main network node among multiple network nodes, calculating the feature vector and similarity based on the node parameter values, calculating the network level value based on the average response time and throughput, and dynamically selecting the most suitable relay node for transaction processing.
It improves the throughput and response speed between blockchains, increases the data processing volume, and enables dynamic adjustment of relay nodes and more effective utilization of resources.
Smart Images

Figure CN117714465B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a method and system for dynamically constructing communication network nodes. Background Art
[0002] In a telecommunications network, a node is a connection point, representing a redistribution point or a communication endpoint (some terminal equipment). The definition of a node depends on the network and protocol layer mentioned. Blockchain is a data structure that organizes and maintains a large amount of data in a decentralized manner based on cryptographic technology. It can be understood as a distributed ledger or database. People pack information such as data or code within a period of time into blocks, stamp them with timestamps, and connect them with the previous block. The page header of each next block contains the index of the previous block (i.e., the hash value), and then new information is written in the page to form a new block, which is connected end to end, and finally forms a blockchain.
[0003] With the development of blockchain, more and more blockchains need to collaborate to execute data processing. Transactions between existing blockchains are implemented through network nodes, but the relay nodes in existing solutions are relatively fixed and cannot achieve high-throughput technical scenarios. Summary of the invention
[0004] The present application provides a method and system for dynamically constructing communication network nodes, which can dynamically adjust relay nodes, improve the throughput between blockchains, and increase the data processing capacity.
[0005] In a first aspect, the present application provides a method for dynamically constructing a communication network node, the method comprising the following steps:
[0006] A master network node is elected from among the multiple network nodes, the master network node receives a first transaction sent by a user, and the master network node classifies and identifies the first transaction to determine a first type corresponding to the first transaction;
[0007] The main network node obtains multiple parameter values of each network node in the first type of other n network nodes, calculates the feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities;
[0008] The main network node obtains the average response time and throughput of each of the n network nodes, calculates the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the main network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction.
[0009] In a second aspect, a system for dynamically constructing communication network nodes is provided, the system comprising: a plurality of network nodes;
[0010] An election unit is used to elect a master network node from multiple network nodes;
[0011] A main network node is used to receive a first transaction sent by a user, and the main network node classifies and identifies the first transaction to determine a first type corresponding to the first transaction; obtains multiple parameter values of each network node in the other n network nodes in the first type, calculates a feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities;
[0012] The main network node is also used to obtain the average response time and throughput of each network node among the n network nodes, calculate the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the main network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction.
[0013] In a third aspect, the present application provides a computer storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute some or all of the steps described in the first aspect of the present application.
[0014] The embodiments of the present application have the following beneficial effects:
[0015] The technical solution provided by the present application elects a master network node among multiple network nodes, the master network node receives the first transaction sent by the user, and the master network node classifies and identifies the first transaction to determine the first type corresponding to the first transaction; the master network node obtains multiple parameter values of each network node in the other n network nodes in the first type, calculates the feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities; the master network node obtains the average response time and throughput of each network node in the n network nodes, calculates the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the master network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction. In this way, when selecting the relay node for the first transaction, the performance parameters of all network nodes will be comprehensively calculated, and the feature vector of the type of the first transaction will be considered, so that the selected relay node is more matched with the first transaction, so that the relay node can be dynamically adjusted to improve the throughput, response speed and transaction matching between blockchains, and improve the data processing volume. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 creative work.
[0017] Figure 1 This is a schematic diagram of the architecture of a blockchain provided in an embodiment of the present application;
[0018] Figure 2 It is a flowchart of a method for dynamically constructing a communication network node provided in an embodiment of the present application;
[0019] Figure 3 This is a schematic diagram of the network structure provided in Example 1 of the present application;
[0020] Figure 4 It is a flowchart of a method for dynamically constructing a communication network node provided in Example 1 of the present application;
[0021] Figure 5 It is a structural block diagram of a dynamic construction system of a communication network node provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, systems, products or devices.
[0024] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0025] The following is an introduction to the relevant terms involved in this application.
[0026] Smart Contracts
[0027] Smart contracts refer to contracts that are defined in digital form and can automatically execute clauses. Digital form means that the contract must be implemented in computer code, because as long as the parties reach an agreement, the rights and obligations established by the smart contract will be automatically executed, and the results cannot be denied. In blockchain applications, when the transaction that deploys a smart contract reaches a consensus in most nodes, it can be considered that the smart contract has been embedded in the blockchain system. Users can manage a piece of state data through the interface method of the smart contract, and the changes in this piece of state data are on the chain, so that users can modify the on-chain data through smart contracts.
[0028] Network node: A relay node between blockchain nodes and callers, responsible for forwarding transactions between different blockchains and querying data assets.
[0029] Data consistency: The consistency of transaction information stored on network nodes.
[0030] The following describes the architecture of the cloud platform and blockchain involved in the embodiments of the present application.
[0031] The present application also provides a schematic diagram of the architecture of a blockchain, wherein each blockchain includes: a plurality of terminal devices 10, such as Figure 1 As shown, multiple terminal devices are connected to each other through wireless networks or wired networks to form a blockchain, and the blockchains are connected through network nodes. The above network nodes can be cross-chain nodes, such as Figure 1 The three terminal devices in the middle shown can be network nodes, and the above network nodes are nodes of blockchain 1 and also nodes of blockchain 2.
[0032] The above-mentioned node may specifically be a terminal device 10, and the above-mentioned terminal device 10 includes at least one processor (processor) and a memory (memory), and may also include a communication interface (Communications Interface), a display screen and a bus. Among them, the processor, the memory, the display screen and the communication interface can communicate with each other through the bus. The communication interface can transmit information, and the above-mentioned communication interface may have a wireless communication function, and the above-mentioned wireless communication function may be a short-range wireless communication or a long-range communication function (such as LTE or NR mode). The processor may call the logic instructions in the memory to execute or support the method in the embodiment of the present application.
[0033] Any of the above multiple terminal devices can be connected to the blockchain and become a node of the blockchain. The form and specific implementation of the above blockchain are not limited in this application.
[0034] In addition, the logical instructions in the above-mentioned storage can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0035] The memory, as a computer-readable storage medium, can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the method in the embodiment of the present disclosure. The processor 11 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 12, that is, implementing or supporting the method in the embodiment of the present application.
[0036] The above-mentioned terminal device may specifically be: a computer device, a mobile terminal device, a server or other terminal device with strong data processing capabilities.
[0037] When data needs to be coordinated between multiple blockchains, there are certain differences in resources and throughput between the network nodes of the multiple blockchains. The existing method lacks effective management of network nodes, which results in the call of data between blockchain 1 and blockchain 2 using a random selection of network nodes. This may lead to uneven resource utilization among multiple network nodes. Some network nodes have low resource occupancy and are relatively idle, but some network nodes have high resource occupancy and are relatively busy. Therefore, a method of dynamically constructing network nodes is needed to realize the selection of network nodes.
[0038] The specific methods are introduced in detail below.
[0039] See also Figure 2 The present application also provides a method for dynamically constructing a communication network node. Figure 2 A schematic diagram of a flow chart of a method for dynamically constructing a communication network node provided in the present application. The method can be used in Figure 1 The blockchain architecture shown is executed as Figure 2 As shown, the above method may include the following steps:
[0040] Step S201: A master network node is elected from among multiple network nodes. The master network node receives a first transaction sent by a user, and the master network node classifies and identifies the first transaction to determine a first type corresponding to the first transaction.
[0041] The above types include but are not limited to: data call, data storage, data transaction, etc.
[0042] Step S202: The master network node obtains multiple parameter values of the first type for each network node in the other n network nodes, calculates a feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities;
[0043] For example, the multiple parameter values of the first type mentioned above can specifically be: characteristic parameters of the block corresponding to the first type, and the above characteristic parameters include but are not limited to: the size of the block, the number of transactions in the block, the number of transaction addresses in the block, the storage quantity of the block, the block hash value, etc.
[0044] For example, the above-mentioned similarity calculation between n feature vectors to obtain n similarities specifically includes:
[0045] Normalization calculation is performed on the element values in each of the n eigenvectors to obtain a normalized value, the normalized values are combined to obtain a normalized vector of each eigenvector, similarity calculation is performed on a normalized vector among the n normalized vectors and the remaining n-1 normalized vectors to obtain n-1 similarities of a normalized vector relative to the n-1 normalized vectors, the average of the n-1 similarities is calculated as the final similarity of a normalized vector, and the n normalized vectors are traversed to obtain n similarities.
[0046] For example, the above normalization is to convert the element value into a decimal between (0, 1). After the normalization operation, the amount of calculation for similarity calculation is smaller. The above normalization can adopt an existing normalization method, which will not be described here.
[0047] The similarity calculation method can adopt existing similarity algorithms, such as cosine similarity calculation method, Pearson correlation coefficient calculation method, Jaccard similarity coefficient calculation method, Euclidean distance similarity, Manhattan distance similarity, etc. The present application does not limit the similarity calculation method.
[0048] The following is an actual example to illustrate the calculation method of the similarity. Here, it is assumed that the number of eigenvalues is 5. In actual applications, the number of eigenvalues can also be other values, such as 6, 7, 8, 9, etc. Here, it is assumed that n = 3, then the corresponding three eigenvectors are:
[0049] [500,51200,2000,0.2,250],
[0050] [1000,102400,2500,0.4,300],
[0051] [750,76800,2250,0.3,275]
[0052] The normalized vector after normalization calculation is as follows:
[0053] [0.3,0.3,0.3,0.0,0.0],
[0054] [1.0,1.0,1.0,1.0,1.0],
[0055] [0.0,0.0,0.0,0.5,0.5],
[0056] The n similarities obtained from the above similarity calculation are: 0.92, 0.95, and 0.90 respectively.
[0057] Step S203: The main network node obtains the average response time and throughput of each of the n network nodes, calculates the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the main network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction.
[0058] For example, the way in which the above-mentioned relay node executes the first transaction can refer to the specific method of implementing transactions in the blockchain, which will not be repeated here. The above-mentioned transactions include but are not limited to: data call, data storage, data transaction, etc. This application does not limit the specific form of the above-mentioned transactions.
[0059] The technical solution provided by the present application elects a master network node among multiple network nodes, the master network node receives the first transaction sent by the user, and the master network node classifies and identifies the first transaction to determine the first type corresponding to the first transaction; the master network node obtains multiple parameter values of each network node in the other n network nodes in the first type, calculates the feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities; the master network node obtains the average response time and throughput of each network node in the n network nodes, calculates the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the master network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction. In this way, when selecting the relay node for the first transaction, the performance parameters of all network nodes will be comprehensively calculated, and the feature vector of the type of the first transaction will be considered, so that the selected relay node is more matched with the first transaction, so that the relay node can be dynamically adjusted to improve the throughput, response speed and transaction matching between blockchains, and improve the data processing volume.
[0060] For example, the n network level values obtained by calculating the network level value based on the average response time, throughput and similarity of each network node may specifically include:
[0061] Network level value = (Tu / t)*s;
[0062] Among them, Tu represents throughput, t represents average response time, and s represents similarity.
[0063] Specifically, if the throughputs of the three network nodes are 100, 130, and 90, respectively, and the response times are 2.5, 2.0, and 2.8, respectively, the calculated network level values are 36.8, 61.75, and 26.1, respectively; the network node corresponding to 61.75 is directly selected as the relay node.
[0064] By way of example, the election of a master network node among the plurality of network nodes may specifically include:
[0065] Any network node among multiple network nodes broadcasts local network parameters to other network nodes. Any network node receives the network parameters broadcast by other network nodes and compares the broadcast network parameters with the local parameters. If the broadcast parameters are higher than the local parameters, one vote is cast for the network node corresponding to the broadcast parameters. If the broadcast parameters are lower than the local parameters, no vote is cast. The network node with the most votes is selected from multiple network nodes to be determined as the main network node.
[0066] For example, the above local network parameters include but are not limited to: throughput, current thread, hardware parameters, storage space, response time, etc. This application does not limit the specific form of expression of the above local network parameters.
[0067] By way of example, the election of a master network node among the plurality of network nodes may specifically include:
[0068] Periodically elect a master network node from multiple network nodes;
[0069] Or the master network node broadcasts n similarities to n network nodes, and each network node compares the locally calculated similarity with the broadcast similarity. If the comparison is consistent, no proposal message is sent. If the comparison is inconsistent, the proposal message is broadcast, and the number of broadcast proposal messages x is counted. If x>threshold, the election is re-initiated to select a master network node from multiple network nodes.
[0070] Embodiment 1
[0071] Embodiment 1 of the present application provides a method for dynamically constructing a communication network node. The method is as follows: Figure 3 The network structure shown is implemented, wherein the intermediate network may include 4 network nodes, and the number of parameter values of this application is 5 as an example. The above method is as follows Figure 4 As shown, the following steps are included:
[0072] Step S401: Any network node among the four network nodes broadcasts the local parameters to the remaining three network nodes. If the broadcasted parameters are higher than the local parameters, one vote is cast for the network node corresponding to the broadcasted parameters. If the broadcasted parameters are lower than the local parameters, no vote is cast, and the network node with the most votes is selected as the main network node.
[0073] Step S402: The main network node receives the user's transaction, performs classification and identification on the transaction to determine that the first type is a data call, and the main network node receives five parameter values of the data call sent by three network nodes to form three feature vectors;
[0074] The above three eigenvectors can be specifically:
[0075] [500,51200,2000,0.2,250],
[0076] [1000,102400,2500,0.4,300],
[0077] [750,76800,2250,0.3,275]
[0078] Step S403: The main network node performs normalization processing on the three feature vectors to obtain three normalized vectors, and calculates similarity values of the three normalized vectors using cosine similarity to obtain three similarity values;
[0079] The three normalized vectors after the above normalization processing can be specifically:
[0080] [0.3,0.3,0.3,0.0,0.0],
[0081] [1.0,1.0,1.0,1.0,1.0],
[0082] [0.0,0.0,0.0,0.5,0.5],
[0083] The three similarities calculated for the above similarity are: 0.92, 0.95, and 0.90
[0084] Step S404: The main network node obtains the average response time and throughput of each of the three network nodes, calculates the network level value according to the average response time, throughput and similarity of each network node to obtain three network level values, and the main network node selects node3 corresponding to the maximum value of the three network level values as the relay node of the first transaction to execute the first transaction, and node3 extracts the data from the blockchain and calls the corresponding data to feed back to the user.
[0085] The average response time and throughput of the above three network nodes are shown in Table 1.
[0086] Table 1
[0087]
[0088] The technical solution provided by the present application elects a master network node among multiple network nodes, the master network node receives the first transaction sent by the user, and the master network node classifies and identifies the first transaction to determine the first type corresponding to the first transaction; the master network node obtains multiple parameter values of each network node in the other n network nodes in the first type, calculates the feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities; the master network node obtains the average response time and throughput of each network node in the n network nodes, calculates the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the master network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction. In this way, when selecting the relay node for the first transaction, the performance parameters of all network nodes will be comprehensively calculated, and the feature vector of the type of the first transaction will be considered, so that the selected relay node is more matched with the first transaction, so that the relay node can be dynamically adjusted to improve the throughput, response speed and transaction matching between blockchains, and improve the data processing volume.
[0089] See also Figure 5 , Figure 5 A structural block diagram of a dynamic construction system for communication network nodes is provided, the system comprising: a plurality of network nodes;
[0090] An election unit 501 is used to elect a master network node from among multiple network nodes;
[0091] A main network node is used to receive a first transaction sent by a user, and the main network node classifies and identifies the first transaction to determine a first type corresponding to the first transaction; obtains multiple parameter values of each network node in the other n network nodes in the first type, calculates a feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities;
[0092] The main network node is also used to obtain the average response time and throughput of each network node among the n network nodes, calculate the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the main network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction.
[0093] For example, the election unit 501 may be integrated into any network node.
[0094] For example,
[0095] The main network node is specifically used to perform normalization calculation on the element value in each feature vector of n feature vectors to obtain a normalized value, combine the normalized values to obtain a normalized vector of each feature vector, perform similarity calculation on a normalized vector among the n normalized vectors and the remaining n-1 normalized vectors to obtain n-1 similarities of a normalized vector relative to n-1 normalized vectors, calculate the average value of the n-1 similarities as the final similarity of a normalized vector, and traverse the n normalized vectors to obtain n similarities.
[0096] For example,
[0097] Network level value = (Tu / t)*s;
[0098] Among them, Tu represents throughput, t represents average response time, and s represents similarity.
[0099] For example,
[0100] The election unit is specifically used for any one of the multiple network nodes to broadcast the local network parameters to other network nodes, and any one of the network nodes receives the network parameters broadcast by other network nodes, compares the broadcast network parameters with the local parameters, and if the broadcast parameters are higher than the local parameters, casts one vote to the network node corresponding to the broadcast parameters, and if the broadcast parameters are lower than the local parameters, does not vote, and selects the network node with the most votes from the multiple network nodes to be determined as the main network node.
[0101] For example,
[0102] The election unit is specifically used to periodically elect a master network node from multiple network nodes;
[0103] Or the master network node broadcasts n similarities to n network nodes, and each network node compares the locally calculated similarity with the broadcast similarity. If the comparison is consistent, no proposal message is sent. If the comparison is inconsistent, the proposal message is broadcast, and the number of broadcast proposal messages x is counted. If x>threshold, the election is re-initiated to select a master network node from multiple network nodes.
[0104] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0105] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0106] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.
[0107] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.
[0108] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0109] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, 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.
[0110] 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.
[0111] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included 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 hardware plus software functional units.
[0112] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a volatile memory or a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM) and direct RAM bus RAM (DR RAM). Various media that can store program code are available.
[0113] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions without departing from the spirit and scope of the present invention, and can make various changes and modifications, including the combination of the above-mentioned different functions and implementation steps, including software and hardware implementation methods, all of which are within the scope of protection of the present invention.
Claims
1. A method for dynamically constructing a communication network node, characterized in that: The method comprises the following steps: A master network node is elected from among the multiple network nodes, the master network node receives a first transaction sent by a user, and the master network node classifies and identifies the first transaction to determine a first type corresponding to the first transaction; The main network node obtains multiple parameter values of each network node in the first type of other n network nodes, calculates the feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities; The master network node obtains the average response time and throughput of each network node among the n network nodes, calculates the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the master network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction; The performing similarity calculation on the n feature vectors to obtain n similarities specifically includes: Normalization calculation is performed on the element values in each of the n eigenvectors to obtain a normalized value, the normalized values are combined to obtain a normalized vector of each eigenvector, similarity calculation is performed on a normalized vector among the n normalized vectors and the remaining n-1 normalized vectors to obtain n-1 similarities of a normalized vector relative to the n-1 normalized vectors, the average of the n-1 similarities is calculated as the final similarity of a normalized vector, and the n normalized vectors are traversed to obtain n similarities.
2. The method for dynamically constructing a communication network node according to claim 1, characterized in that: The n network level values obtained by calculating the network level value according to the average response time, throughput and similarity of each network node specifically include: Network level value = (Tu / t)*s; Among them, Tu represents throughput, t represents average response time, and s represents similarity.
3. The method for dynamically constructing a communication network node according to claim 1, characterized in that: The selection of a master network node among the multiple network nodes specifically includes: Any network node among multiple network nodes broadcasts local network parameters to other network nodes. Any network node receives the network parameters broadcast by other network nodes and compares the broadcast network parameters with the local parameters. If the broadcast parameters are higher than the local parameters, one vote is cast for the network node corresponding to the broadcast parameters. If the broadcast parameters are lower than the local parameters, no vote is cast. The network node with the most votes is selected from multiple network nodes to be determined as the main network node.
4. The method for dynamically constructing a communication network node according to claim 1, characterized in that: The selection of a master network node among the multiple network nodes specifically includes: Periodically elect a master network node from multiple network nodes; Or the master network node broadcasts n similarities to n network nodes, and each network node compares the locally calculated similarity with the broadcast similarity. If the comparison is consistent, no proposal message is sent. If the comparison is inconsistent, the proposal message is broadcast, and the number of broadcast proposal messages x is counted. If x>threshold, the election is re-initiated to select a master network node from multiple network nodes.
5. A dynamic construction system for communication network nodes, characterized in that: The system comprises: a plurality of network nodes; An election unit is used to elect a master network node from multiple network nodes; A main network node is used to receive a first transaction sent by a user, and the main network node classifies and identifies the first transaction to determine a first type corresponding to the first transaction; obtains multiple parameter values of each network node in the other n network nodes in the first type, calculates a feature vector corresponding to each network node according to the parameter value of each network node to obtain n feature vectors, and performs similarity calculation between the n feature vectors to obtain n similarities; The main network node is further used to obtain the average response time and throughput of each network node among the n network nodes, calculate the network level value according to the average response time, throughput and similarity of each network node to obtain n network level values, and the main network node selects the network node corresponding to the maximum value of the n network level values as the relay node of the first transaction to execute the first transaction; The main network node is specifically used to perform normalization calculation on the element value in each feature vector of n feature vectors to obtain a normalized value, combine the normalized values to obtain a normalized vector of each feature vector, perform similarity calculation on a normalized vector among the n normalized vectors and the remaining n-1 normalized vectors to obtain n-1 similarities of a normalized vector relative to n-1 normalized vectors, calculate the average value of the n-1 similarities as the final similarity of a normalized vector, and traverse the n normalized vectors to obtain n similarities.
6. The dynamic construction system of communication network nodes according to claim 5, characterized in that: Network level value = (Tu / t)*s; Among them, Tu represents throughput, t represents average response time, and s represents similarity.
7. The dynamic construction system of communication network nodes according to claim 5, characterized in that: The election unit is specifically used for any one of the multiple network nodes to broadcast the local network parameters to other network nodes, and any one of the network nodes receives the network parameters broadcast by other network nodes, compares the broadcast network parameters with the local parameters, and if the broadcast parameters are higher than the local parameters, casts one vote to the network node corresponding to the broadcast parameters, and if the broadcast parameters are lower than the local parameters, does not vote, and selects the network node with the most votes from the multiple network nodes to be determined as the main network node.
8. The dynamic construction system of communication network nodes according to claim 5, characterized in that: The election unit is specifically used to periodically elect a master network node from multiple network nodes; Or the master network node broadcasts n similarities to n network nodes, and each network node compares the locally calculated similarity with the broadcast similarity. If the comparison is consistent, no proposal message is sent. If the comparison is inconsistent, the proposal message is broadcast, and the number of broadcast proposal messages x is counted. If x>threshold, the election is re-initiated to select a master network node from multiple network nodes.
Citation Information
Patent Citations
Opportunistic network forwarding method based on node position cosine similarity
CN108183865A
Query method and device under non-whole-network consensus block chain and storage medium
CN113901144A
Low-delay message forwarding method and device and storage medium
CN113934933A
Transaction information processing method and device based on alliance chain system, medium and equipment
CN116112506A
Blockchain system and data storage method and apparatus
US20190342078A1
