Node selection method and apparatus, electronic device, and storage medium
By combining a local search algorithm with the artificial bee colony algorithm, and utilizing the location information of candidate network nodes and global parameters, the problem of low node search accuracy is solved, and more efficient network speed measurement is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD
- Filing Date
- 2022-08-24
- Publication Date
- 2026-05-15
AI Technical Summary
Existing node search methods have low accuracy and cannot find the optimal node for measuring network speed in all regions. Furthermore, heuristic search algorithms suffer from local optima, resulting in low search accuracy.
We employ an artificial bee colony algorithm (ABC) combined with a local search algorithm. During the observation bee phase, we utilize the location information of candidate network nodes and global parameters to further search for nodes. By adjusting the parameters, we can improve the diversity and accuracy of the iteration process.
It improves the accuracy of node search, ensures that the optimal node can be found more effectively during the iteration process, avoids local optimum traps, and improves the accuracy and efficiency of network speed measurement.
Smart Images

Figure CN116980329B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent scheduling, and in particular to a node selection method, apparatus, electronic device, and storage medium. Background Technology
[0002] In the internet age, the network is inextricably linked to users' lives. To enable relevant personnel to determine whether a network has been successfully installed, or for users to understand the health of their home network, network speed needs to be measured through network nodes; the performance of these network nodes is directly related to the effectiveness of the speed measurement. Therefore, it is crucial to select the appropriate nodes for network speed measurement to maximize its accuracy.
[0003] However, in related technologies, the node search method suffers from low accuracy in node search. Summary of the Invention
[0004] To address the related technical issues, embodiments of this application provide a node selection method, apparatus, electronic device, and storage medium.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a node selection method, including:
[0007] Determine the location of at least one candidate network node in the first space;
[0008] Based on the location of the at least one candidate network node, at least one network node for measuring network speed is determined from the at least one candidate network node using the Artificial Bee Colony (ABC) algorithm; wherein, in the process of selecting the network node for measuring network speed, during the observation bee phase, at least one second candidate network node is selected using the location information of the first candidate network node and a first parameter, and the selected at least one second candidate network node is used to determine the network node for measuring network speed, the first candidate network node is included in the candidate network nodes selected during the leader bee phase, and the first parameter characterizes the global information corresponding to the at least one candidate network node.
[0009] In the above scheme, the step of selecting at least one second candidate network node using the location information and first parameter of the first candidate network node includes:
[0010] Using the location information of the first candidate network node, the first parameter, and the second parameter, at least one second candidate network node is determined, where the second parameter represents a random number.
[0011] In the above scheme, during the observation bee phase, the first parameter is adjusted during the iteration process so that the iteration results have a convergence direction.
[0012] In the above scheme, adjusting the first parameter includes:
[0013] In each iteration, the first parameter is updated using the first parameter and factor used in the previous iteration; the factor is less than 1.
[0014] The method in the above scheme further includes:
[0015] Determine the fitness of each of the at least one selected second candidate network nodes, wherein the first formula is used to determine the fitness of the candidate network nodes;
[0016] Using the fitness of each of the at least one selected second candidate network nodes, a first strategy is employed to determine the network nodes used to measure network speed.
[0017] In the above scheme, the first strategy for determining the network node used to measure network speed includes:
[0018] The second candidate network node with the highest fitness among the at least one second candidate network nodes is used as the network node for measuring network speed.
[0019] The method in the above scheme further includes:
[0020] During the leading bee phase, in the iteration process, the location information of the third candidate network node is used to determine the fourth candidate network node, which includes the neighbor nodes of the third candidate network node;
[0021] The candidate network nodes for the next iteration are determined by comparing the fitness of the third candidate network node and the fitness of the fourth candidate network node.
[0022] This application embodiment also provides a node selection device, including:
[0023] A determining unit is used to determine the position of at least one candidate network node in the first space;
[0024] The processing unit is configured to determine at least one network node for measuring network speed from the at least one candidate network node based on the location of the at least one candidate network node and based on ABC; wherein, in the process of selecting the network node for measuring network speed, during the observation bee phase, at least one second candidate network node is selected using the location information of the first candidate network node and a first parameter, the selected at least one second candidate network node is used to determine the network node for measuring network speed, the first candidate network node is included in the candidate network nodes selected during the leading bee phase, and the first parameter characterizes the global information corresponding to the at least one candidate network node.
[0025] This application also provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor.
[0026] When the processor runs the computer program, it executes any of the steps of the node selection method described above.
[0027] This application embodiment also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the node selection methods described above.
[0028] The node selection method, apparatus, electronic device, and storage medium provided in this application embodiment determine the position of at least one candidate network node in a first space; based on the position of the at least one candidate network node, at least one network node for measuring network speed is determined from the at least one candidate network node based on ABC (Analog-Bionic-Bee) algorithm; wherein, in the process of selecting the network node for measuring network speed, during the observation bee phase, at least one second candidate network node is selected using the position information of the first candidate network node and a first parameter, and the selected at least one second candidate network node is used to determine the network node for measuring network speed, the first candidate network node is included in the candidate network nodes selected during the leading bee phase, and the first parameter characterizes the global information corresponding to the at least one candidate network node. The scheme provided in this application embodiment, in the process of using ABC to search for nodes for measuring network speed, during the observation bee phase, further searches for nodes are performed based on the node information and global parameters shared during the leading bee phase, to ensure the diversity of the searched nodes during the iteration process, thereby increasing the probability of finding the optimal node, i.e., improving the node search accuracy. Attached Figure Description
[0029] Figure 1 A flowchart illustrating a node selection method in a related technology;
[0030] Figure 2 A schematic diagram of the method for selecting nodes in the embodiments of this application;
[0031] Figure 3 This is a schematic diagram illustrating the method flow of node scheduling based on ABC, which is an application example of this application.
[0032] Figure 4 This is a schematic diagram of the node selection device structure in an embodiment of this application;
[0033] Figure 5 This is a schematic diagram of the electronic device structure according to an embodiment of this application. Detailed Implementation
[0034] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.
[0035] In related technologies, the basic process for measuring network speed includes: operators deploying a large number of nodes for measuring network speed in different areas; selecting the node closest to the user's geographical location from the user's area and using the selected node as the node for measuring network speed; obtaining the address information corresponding to the node for measuring network speed, which is used for file transfer; using the obtained address information, transferring files (e.g., uploading or downloading) through the node for measuring network speed; wherein, during the file transfer process, the required traffic and transfer time can be determined, thereby determining the file transfer speed (e.g., upload speed or download speed).
[0036] In practical applications, the performance of the selected node for measuring network speed directly affects the accuracy of the measurement. Currently, relevant node search methods include searching for high-performance nodes based on geographical location and other information. However, these methods are geographically limited, only allowing searching within the user's local area. They cannot find the optimal node for measuring network speed across all regions, resulting in low search accuracy.
[0037] Secondly, related technologies also employ heuristic search algorithms to select nodes. However, due to the limitations of human experience in heuristic search selection, it is easy to get trapped in local optima during the search process, thus failing to find the optimal node and also resulting in low node search accuracy.
[0038] In addition, related technologies also employ intelligent scheduling algorithms for searching, such as particle swarm optimization, ant colony optimization, immune algorithms, simulated annealing, legacy algorithms, or ABC, to select the optimal node for measuring network speed. Among these, ABC is a global algorithm based on swarm intelligence, its logic derived from the nectar-collecting behavior of bee colonies in nature. Specifically, a bee colony typically contains three types of bees: leader bees, scout bees, and observer bees. Different types of bees perform different tasks; bees share information obtained during task execution by sending it to the colony to find the globally optimal solution in the colony's spatial distribution, i.e., the nectar source with the highest bee density. The leader bees search for new nectar sources based on relevant experience and share nectar source information; the observer bees select nectar sources based on the shared information; and the scout bees search for new nectar sources randomly.
[0039] In practical applications, the ABC search method for finding the optimal node for measuring network speed is applied to electronic devices, such as... Figure 1 As shown, it includes the following steps:
[0040] Step 101: Initialize the bee colony, then proceed to step 102;
[0041] Here, the initialized bee colony contains two groups of equal numbers: one group of leader bees and the other group of observer bees; there will be a role switch between the leader bees and the observer bees.
[0042] Assuming the search space of the initialized bee colony is D-dimensional, and the number of leader bees, observer bees, and nectar sources is G, then the process of selecting the optimal node for measuring network speed based on ABC can be understood as the bees in the colony searching in the D-dimensional space to find the location of the nectar source with the most nectar in the space as the optimal solution; where the location of each nectar source represents a candidate solution; and the fitness of the nectar source is related to the fitness of the candidate solution.
[0043] In addition, during the initialization phase, the electronic device also needs to set relevant parameters, including the number of iteration terminations and the iteration threshold (Limit). The iteration threshold is used to determine whether the search process is trapped in a local optimum, and the number of iteration terminations is used to terminate the iteration process and output the optimal solution in the space.
[0044] Step 102: Generate the initial location of the nectar source;
[0045] In practical applications, the initial location of the nectar source can be generated randomly; specifically, the electronic device uses the following formula to generate the initial location of nectar source i:
[0046]
[0047] Where 1≤i≤G, 1≤d≤D, and These correspond to the positions of the upper and lower boundaries of the D-dimensional space, respectively, x id The initial position of the i-th nectar source in d dimensions is represented by rand(0,1), and a random number is generated in the interval [0,1].
[0048] In other words, the electronic device can generate at least one initial candidate solution X using formula (1). i ={x i1 ,x i2 ,...x id Next, proceed to step 103.
[0049] Step 103: The electronic device determines whether the loop condition is met;
[0050] The loop condition may include the number of iterations being less than the number of iteration terminations, and the number of iteration terminations may be set to 100.
[0051] In practical applications, if the current iteration number is less than the iteration termination number, it means that the loop condition is met, and step 104 is executed; otherwise, it means that the loop condition is not met, and step 108 is executed.
[0052] Step 104: In the lead bee stage, search for new nectar sources;
[0053] In practical applications, during the lead bee phase, in the first iteration, the electronic device will be based on the initial positions (X) of G nectar sources. i ={x i1 ,x i2 ,...x id}), Search for new honey sources (W i ={w i1 ,w i2 ,...w id}); where the following formula is used to search for new nectar sources:
[0054] w id =x id +φ(x id +x kd (2)
[0055] Where 1≤k≤G, k≠i; w id φ represents the candidate position of the i-th nectar source in the d-dimensional space; φ represents a random number uniformly distributed in the interval [-1, 1].
[0056] Here, for ease of description, the initial location of the nectar source is called the first potential solution, and the location of the new nectar source found by formula (2) is called the second potential solution. Then, in the lead bee stage, the electronic device can compare the first and second potential solutions and use a greedy selection strategy to select the nectar source with better quality as the result of this iteration. Specifically, after the electronic device determines the fitness of the first and second potential solutions respectively, it determines the nectar source with better quality by comparing the fitness of the first and second potential solutions; wherein, the fitness is calculated using the following formula:
[0057]
[0058] Among them, f i The score characterizes the honey source, which can be determined based on the performance parameters of the node represented by the honey source. These performance parameters may include node idle status, bandwidth usage, location information, etc.
[0059] If the fitness of the second potential solution is greater than or equal to the fitness of the first potential solution, the electronic device retains the second potential solution and discards the first potential solution, using the second potential solution as the location of the honey source in the next iteration. If the fitness of the second potential solution is less than or equal to the fitness of the first potential solution, the electronic device retains the first potential solution and discards the second potential solution, using the first potential solution as the location of the honey source in the next iteration. Next, step 105 is executed.
[0060] Similarly, during the m-th iteration, the electronic device will search for the location of a new honey source, i.e., the second potential solution, based on the location of the honey source obtained in the previous iteration, i.e. the first potential solution, where m is an integer greater than or equal to 2. By comparing the fitness of the first potential solution and the second potential solution, based on a greedy selection strategy, it can select a honey source with better quality and use the location of the honey source with better quality as the location of the honey source in the next iteration.
[0061] Step 105: Switch from the leader bee stage to the observation bee stage;
[0062] In practical applications, once the electronic device determines the location of the nectar source for the next iteration during the lead bee phase, it enters the observation bee phase. During this phase, it selects nectar sources based on probability to further the search; the probability is determined using the following formula:
[0063]
[0064] Next, after selecting a honey source according to formula (4), the electronic device searches for a new honey source (hereinafter referred to as the fourth potential solution) in the neighborhood of the selected honey source (hereinafter referred to as the third potential solution) using formula (2), and selects a honey source of higher quality through a greedy selection strategy. Specifically, through formula (3), the electronic device can determine the fitness of the third potential solution and the fourth potential solution respectively; if the fitness of the fourth potential solution is greater than or equal to the fitness of the third potential solution, the electronic device will retain the fourth potential solution and discard the third potential solution, and use the fourth potential solution as the position of the honey source in the next iteration, and then execute step 106; if the fitness of the fourth potential solution is less than the fitness of the second potential solution, the electronic device will retain the third potential solution and discard the fourth potential solution, and use the third potential solution as the position of the honey source in the next iteration, and then execute step 106.
[0065] Step 106: During the iteration process, determine whether to generate a scout bee;
[0066] If it is determined that a scout bee will be generated, proceed to step 107; otherwise, proceed to step 103 to determine whether the loop condition is met.
[0067] Here, during the iteration process, if the quality of the nectar source does not improve after a cumulative threshold number of iterations, that is, the fitness of the nectar source does not improve, it indicates that the current state is trapped in a local optimum. At this time, the electronic device will enter the scout bee stage and discard the current nectar source. Then, step 107 will be executed.
[0068] Step 107: During the scout bee phase, generate new nectar sources;
[0069] In practical applications, during the scout bee phase, electronic devices can randomly generate new nectar source locations within space to replace those of discarded nectar sources. The following formula is used to generate the new nectar source locations:
[0070]
[0071] Then, the electronic device can enter the leading bee stage and, based on the newly generated nectar source, perform step 103.
[0072] Step 108: Output the optimal solution;
[0073] In practical applications, if the loop condition is not met, the electronic device can select the honey source with the best quality from the honey sources obtained from the observation bee stage and output the selected honey source as the optimal solution.
[0074] Specifically, for the G nectar sources obtained from the observation bee stage, the fitness of each nectar source can be determined by formula (3); based on the fitness of each nectar source among the G nectar sources, the nectar source with the highest fitness is selected as the nectar source with the best quality and output, and then step 109 is executed.
[0075] Step 109: End the current process.
[0076] As can be seen from the description of steps 101 to 109 above, during the leader bee stage, the electronic device searches for new nectar sources in the vicinity of the nectar source using formula (2); during the observer bee stage, based on the nectar source information shared during the leader bee stage, the electronic device also searches for new nectar sources in the vicinity of the shared nectar sources using formula (2). In other words, the leader bee stage uses the same method as the observer bee stage to search for new nectar sources, which reduces the diversity of nectar sources searched by both the leader bee and the observer bee, thus affecting the algorithm's local search capability. That is, the global search capability and the local search capability are unbalanced, resulting in a decrease in search accuracy and the inability to obtain the optimal solution.
[0077] Local search algorithms are used to solve optimization problems. They search the neighborhood of the current solution until a locally optimal solution is found. Considering the low local optimization ability of ABC, combining local search algorithms with ABC can enhance the local search ability of ABC, thereby improving the search accuracy of nodes.
[0078] Based on this, in various embodiments of this application, during the process of using ABC search to measure network speed nodes, a local search algorithm is used in the observation bee phase. That is, the node search is further performed by combining the node information shared by the leading bee and global parameters, so as to improve the diversity of nodes in the iteration process, thereby increasing the probability of obtaining the optimal node and improving the node search accuracy.
[0079] This application provides a node selection method applied to electronic devices, such as... Figure 2 As shown, the method includes the following steps:
[0080] Step 201: Determine the location of at least one candidate network node in the first space;
[0081] Step 202: Based on the location of the at least one candidate network node, determine at least one network node for measuring network speed from the at least one candidate network node based on ABC; wherein, in the process of selecting the network node for measuring network speed, during the observation bee phase, at least one second candidate network node is selected using the location information of the first candidate network node and the first parameter, the selected at least one second candidate network node is used to determine the network node for measuring network speed, the first candidate network node is included in the candidate network nodes selected during the leading bee phase, and the first parameter characterizes the global information corresponding to the at least one candidate network node.
[0082] In practical applications, the electronic device may include a device capable of performing steps 201 to 202, such as a server, laptop computer, tablet computer, or desktop computer. This application embodiment does not limit this.
[0083] In addition, the first space can be called the search space, search space, etc. This application embodiment does not limit it, as long as its function is realized.
[0084] Here, in step 201, the electronic device may determine the position of at least one candidate network node in the first space in a random manner. This application embodiment does not limit the method for determining the position of the candidate network node.
[0085] For example, assuming the dimension of the first space is D, the electronic device can use formula (1) to generate the positions of G candidate network nodes in the first space, where G is an integer greater than or equal to 1, such as 50.
[0086] In practical applications, during the process of selecting a network node for measuring network speed, the electronic device can use the selection method corresponding to the leading bee to select the first candidate network node in the leading bee stage.
[0087] Based on this, in one embodiment, the method may further include:
[0088] During the leading bee phase, in the iteration process, the location information of the third candidate network node is used to determine the fourth candidate network node, which includes the neighbor nodes of the third candidate network node;
[0089] The candidate network nodes for the next iteration are determined by comparing the fitness of the third candidate network node and the fitness of the fourth candidate network node.
[0090] In practical applications, the fitness of a candidate network node is related to its performance parameters, which may include the duration of time the candidate network node is occupied, bandwidth resources, etc.; that is, the fitness of a candidate network node can reflect its performance.
[0091] Here, during the iteration process, based on the location of the at least one candidate network node, the electronic device can select at least one third candidate network node and determine the location information of the at least one third candidate network node; for each third candidate network node, the electronic device can use the location information of the third candidate network node to search in the neighboring area of the third candidate network node to determine the fourth candidate network node; wherein, the fourth candidate network node can be determined by formula (2).
[0092] Here, since the effectiveness of measuring network speed is related to the performance of network nodes, and the fitness of the candidate network nodes can reflect the performance of the candidate network nodes, during the iteration process, the electronic device selects the candidate network nodes with high fitness by comparing fitness and adopts a greedy selection strategy, and uses the selected candidate network nodes as the candidate network nodes for the next iteration, so as to facilitate the subsequent selection of network nodes for measuring network speed; wherein, the electronic device can use formula (3) to determine the fitness of the third candidate network node and the fourth candidate network node respectively.
[0093] It should be noted that during the pilot bee phase, the electronic device can adopt the selection method corresponding to the pilot bee described above, selecting one first candidate network node, or selecting multiple first candidate network nodes, such as 20. This application embodiment does not limit the number of first candidate network nodes.
[0094] In addition, during the iteration process of the leading bee phase, if the number of iterations reaches the first threshold and the fitness of the candidate network node selected by the electronic device does not improve continuously, it indicates that the device is currently trapped in a local optimum. At this time, the electronic device can discard the currently selected candidate network node and enter the scout bee phase. The value of the first threshold can be set as needed, such as 10.
[0095] In practical applications, during the reconnaissance bee phase, the electronic device can randomly determine new candidate network nodes in the first space to replace discarded candidate network nodes; wherein, formula (5) can be used to determine the new candidate network nodes. This application embodiment does not limit the method for determining new candidate network nodes. After determining new candidate network nodes, the electronic device will enter the leader bee phase and continue iterating. This avoids getting trapped in local optima during iteration and failing to obtain the optimal node, thus increasing the probability of obtaining the optimal node.
[0096] Next, in step 202, before determining the at least one second candidate network node during the observation bee phase, the electronic device may select the first candidate network node based on the fitness of the candidate network node selected during the leading bee phase; wherein, the first candidate network node may be selected using formula (4).
[0097] As can be seen from formula (4), candidate network nodes with high fitness have a high probability of being selected as the first candidate network node; correspondingly, candidate network nodes with low fitness have a low probability of being selected as the first candidate network node, that is, a high probability of being discarded. In other words, during the observation bee phase, the electronic device will select or discard the candidate network nodes selected during the leading bee phase according to probability.
[0098] After selecting the first candidate network node, the electronic device can use the selected first candidate network node and the first parameter to further select candidate network nodes, so as to ensure the diversity of candidate network nodes during the iteration process, thereby ensuring the accuracy of the nodes.
[0099] Specifically, the step of selecting at least one second candidate network node using the location information of the first candidate network node and the first parameter includes:
[0100] Using the location information of the first candidate network node, the first parameter, and the second parameter, at least one second candidate network node is determined, where the second parameter represents a random number.
[0101] Wherein, the first parameter represents the global information corresponding to the at least one candidate network node, and can also be understood as a global vector associated with the first space; wherein, when the dimension of the first space is D, the electronic device can initialize the first parameter using the following formula:
[0102]
[0103] Where 1≤d≤D, and The boundary position corresponding to the d-dimensional space is represented.
[0104] Next, during the iteration process, the electronic device uses the location information of the first candidate network node, the first parameter, and the second parameter to determine the location of at least one second candidate network node, thereby determining the at least one second candidate network node; wherein, the location of the second candidate network node is selected using the following formula:
[0105] N jd =N d +R d ×rand(-0.5,0.5) (7)
[0106] Where 1≤d≤D, 1≤j≤G; N d This refers to the position of the first candidate network node in d dimensions; rand(-0.5, 0.5) represents a random number distributed in the interval (-0.5, 0.5), which is the second parameter; R d The global vector, i.e., the first parameter; N id The position of the j-th second candidate network node in the d-dimensional dimension is represented.
[0107] In order to enable the iteration results to converge quickly and ensure the efficiency of network node selection, the electronic device can adjust the first parameter during the iteration process to improve the convergence speed.
[0108] Specifically, in one embodiment, during the observation bee phase, the first parameter is adjusted during the iteration process so that the iteration result has a convergence direction.
[0109] In practical applications, the electronic device can adjust the first parameter in a linear decreasing manner to gradually narrow the selection range of candidate network nodes, thereby improving the convergence speed.
[0110] Specifically, in one embodiment, adjusting the first parameter includes:
[0111] In each iteration, the first parameter is updated using the first parameter and factor used in the previous iteration; the factor is less than 1.
[0112] The electronic device can update the first parameter using the following formula:
[0113] R d =R d ×(1-β) (8)
[0114] Here, β represents the decreasing parameter, i.e., the factor, for example, set to 0.1.
[0115] In other words, in each iteration, the electronic device updates the first parameter using the first parameter and the factor used in the previous iteration, so that the value of the first parameter decreases linearly. This ensures the efficiency of node selection.
[0116] It should be noted that if the electronic device selects multiple first candidate network nodes during the leading bee stage, then for each first candidate network node, the electronic device can use the location information of the first candidate network node, the first parameter and the second parameter, i.e., use formula (7) to determine at least one corresponding second candidate network node.
[0117] In practical applications, during the iterative process of the bee observation phase, when the iteration termination condition is met, the electronic device can evaluate at least one second candidate network node currently selected, and select a network node for measuring network speed based on the evaluation result. The iteration termination condition may include the number of iterations reaching a second threshold, the value of which can be set as needed, such as 100, and the second threshold is greater than a first threshold. This application embodiment does not limit the content of the iteration termination condition.
[0118] Specifically, in one embodiment, the method may further include:
[0119] Determine the fitness of each of the at least one selected second candidate network nodes, wherein the first formula is used to determine the fitness of the candidate network nodes;
[0120] Using the fitness of each of the at least one selected second candidate network nodes, a first strategy is employed to determine the network nodes used to measure network speed.
[0121] The first strategy can be called a greedy selection strategy, but this application embodiment does not limit it.
[0122] In other words, the electronic device can evaluate the at least one second candidate network node using a fitness method. Specifically, the electronic device can determine the fitness of each of the at least one second candidate network node using formula (3); by comparing the fitness of the second candidate network nodes, the network node used to measure the network speed is determined.
[0123] Specifically, in one embodiment, the second candidate network node with the highest fitness among the at least one second candidate network node is used as the network node for measuring network speed.
[0124] In practical applications, since the fitness of a candidate network node can reflect its performance, in order to select the network node for measuring network speed and maximize the effectiveness of network speed measurement, the electronic device can use the second candidate network node with the highest fitness as the network node for measuring network speed.
[0125] Furthermore, if it is necessary to determine M network nodes for measuring network speed, where M is an integer greater than or equal to 2, the electronic device can arrange them in descending order of fitness value and select the M network nodes with high fitness for measuring network speed.
[0126] The node selection method provided in this application embodiment determines the position of at least one candidate network node in a first space; based on the position of the at least one candidate network node, at least one network node for measuring network speed is determined from the at least one candidate network node based on ABC; wherein, in the process of selecting the network node for measuring network speed, during the observation bee phase, at least one second candidate network node is selected using the position information of the first candidate network node and a first parameter, and the selected at least one second candidate network node is used to determine the network node for measuring network speed, the first candidate network node is included in the candidate network nodes selected in the leader bee phase, and the first parameter characterizes the global information corresponding to the at least one candidate network node. The scheme provided in this application embodiment, in the process of searching nodes using ABC, allows the observation bee to further search for nodes based on the node information and global parameters shared by the leader bee, thereby ensuring the diversity of the searched nodes during the iteration process, thus increasing the probability of finding the optimal node, i.e., improving the node accuracy.
[0127] The present application will be further described in detail below with reference to application examples.
[0128] To address the issue of low search accuracy due to weak local search capabilities when swarm intelligence optimization algorithms (such as ABC) terminate iterations, this application example proposes an improved ABC. Specifically, by modifying the search mechanism of the observer bees, the global node shared by the leading bee (i.e., the first candidate network node mentioned above) is used as the initial solution. A local search strategy is employed to search for and evaluate multiple random neighbor nodes (i.e., the second candidate network nodes mentioned above) to obtain a locally optimal node. Then, by comparing the fitness of multiple locally optimal nodes, the optimal node (i.e., the network node used to measure network speed mentioned above) is selected.
[0129] In practical applications, electronic devices employ an improved ABC selection process for choosing nodes to measure network speed, such as... Figure 3 As shown, it includes the following steps:
[0130] Step 301: Initialize the bee colony;
[0131] Here, the electronic device initializes and generates a bee colony based on a preset number of bees. The number of leader bees and observer bees in the initialized colony is G. At the same time, the electronic device also sets parameters such as a threshold (i.e., the first threshold mentioned above), a maximum number of iterations (i.e., the second threshold mentioned above), and the number of nodes. Among them, the number of nodes is the same as the number of leader bees and observer bees, and is set to G. Then, step 302 is executed.
[0132] Step 302: Initialize the nodes and determine their fitness; then, proceed to step 303.
[0133] In practical applications, the electronic device uses formula (1) to randomly generate the initial positions of G nodes. In addition, for each node, the electronic device can also determine the fitness of the node using formula (3).
[0134] Step 303: During the leading bee phase, the electronic device uses the corresponding search mechanism to search for neighboring nodes based on the current node;
[0135] Specifically, using formula (2), the electronic device can search for neighboring nodes in the vicinity of the current node. Next, step 304 is executed.
[0136] Step 304: The electronic device compares the fitness (which can be understood as the quality of the honey source) of the current node (i.e., the third candidate network node mentioned above) and its neighboring nodes (i.e., the fourth candidate network node mentioned above).
[0137] Here, the electronic device determines the fitness of the current node and the neighboring nodes using formula (3); based on the fitness of the current node and the neighboring nodes, a greedy selection strategy is adopted to update the nodes; if the fitness of the neighboring node is greater than the fitness of the current node, then step 305 is executed; otherwise, step 306 is executed.
[0138] Step 305: The electronic device replaces the current node with a neighboring node;
[0139] In other words, during the iteration process, the electronic device will select the node with higher fitness (which can be understood as a higher quality honey source) as the candidate node for the next iteration; then, step 306 is executed.
[0140] Step 306: Switch from the leader bee stage to the observation bee stage, and proceed to step 307;
[0141] In each iteration, after the electronic device selects a node with higher fitness, it switches to the observer bee phase and uses a local search strategy to further search in the observer bee phase, thereby selecting the optimal node.
[0142] Step 307: The electronic device determines whether the condition of the threshold node not being updated is met;
[0143] If it is determined that the threshold node has not been updated, proceed to step 308; otherwise, proceed to step 309.
[0144] Here, if the node selected in the leader bee phase does not update for a consecutive threshold number of times (e.g., 5 times), that is, the fitness threshold number of the node does not increase for a consecutive number of times, it means that it is currently trapped in a local optimum. At this time, step 308 is executed.
[0145] Step 308: The electronic device enters the reconnaissance bee phase and initializes and generates new nodes;
[0146] To avoid getting trapped in local optima, the electronic device discards the node selected in the leader bee phase and enters the scout bee phase; in the scout bee phase, new nodes are generated using formula (5). After generating new nodes, the electronic device continues the search based on the new nodes. In this way, the problem of getting trapped in local optima can be avoided, increasing the probability of obtaining the optimal node.
[0147] Step 309: During the observation bee phase, select the corresponding node based on the node information selected during the leader bee phase, and then conduct further searches based on the selected node;
[0148] Here, by utilizing the fitness of the node information selected during the leading bee phase, the electronic device can select the corresponding node through formula (4) and further search based on the selected node, i.e., execute step 310.
[0149] As can be seen from formula (4), for nodes with high fitness, the electronic device has a higher probability of selecting them; for nodes with low fitness, the electronic device has a higher probability of discarding them; that is to say, the electronic device can select or discard nodes through formula (4).
[0150] Step 310: During the observation bee phase, the electronic device searches for neighboring nodes according to the local search strategy;
[0151] Here, the electronic device can search for multiple neighboring nodes in the neighborhood of the shared node according to the local search strategy, i.e., formula (7); in order to speed up the convergence and improve the search efficiency, the electronic device will use formula (8) to adjust the global vector (i.e. the first parameter mentioned above) in each iteration so that the global vector decreases linearly.
[0152] Step 311: The electronic device calculates the fitness of the current node and its neighboring nodes, and compares the fitness of the current node and its neighboring nodes;
[0153] For example, the electronic device calculates the fitness of the current node and each of its multiple neighboring nodes using formula (3), and then selects the node with the highest fitness as the node for the next iteration using a greedy selection strategy. Next, step 312 is executed.
[0154] Step 312: Determine whether the iteration termination condition is met;
[0155] The iteration termination condition may include reaching the maximum number of iterations.
[0156] Here, if the electronic device determines that the iteration termination condition is met, the node with the highest fitness is selected from the nodes selected in the observation bee phase, and the selected node is taken as the optimal node. Then, step 313 is executed; otherwise, step 303 is executed.
[0157] Step 313: End the process.
[0158] In practical applications, electronic devices will select the optimal node as the node for measuring network speed in order to achieve network speed measurement.
[0159] The improved ABC proposed in this application example alters the nectar-collecting mechanism of the observation bees. Instead of using the same search mechanism as the leader bees, the observation bees employ a local search strategy. Combined with the leader bees' search mechanism, this increases the diversity of nodes (or the population) during iteration, improving the local optimization performance of ABC. This not only increases the search accuracy but also the search efficiency. Furthermore, during iteration, the scout bees, under preset conditions, randomly search for new nectar sources, avoiding the problem of getting trapped in local optima due to the local search strategy, thus ensuring search accuracy. Therefore, when using the improved ABC to select the optimal node for measuring network speed, intelligent network speed measurement exhibits high stability and accuracy.
[0160] To implement the solutions of the embodiments of this application, the embodiments of this application also provide a network slicing resource allocation device, which is installed on an electronic device, such as... Figure 4 As shown, the device includes:
[0161] Determining unit 401 is used to determine the position of at least one candidate network node in the first space;
[0162] Processing unit 402 is configured to determine at least one network node for measuring network speed from the at least one candidate network node based on the position of the at least one candidate network node and based on ABC; wherein, in the process of selecting the network node for measuring network speed, during the observation bee phase, at least one second candidate network node is selected using the position information of the first candidate network node and a first parameter, the selected at least one second candidate network node is used to determine the network node for measuring network speed, the first candidate network node is included in the candidate network nodes selected during the leading bee phase, and the first parameter characterizes the global information corresponding to the at least one candidate network node.
[0163] In one embodiment, the processing unit 402 is used to determine the at least one second candidate network node using the location information of the first candidate network node, the first parameter, and the second parameter, wherein the second parameter represents a random number.
[0164] In one embodiment, during the bee observation phase, the first parameter is adjusted during the iteration process so that the iteration result has a convergence direction.
[0165] In one embodiment, in each iteration, the first parameter is updated using the first parameter and factor used in the previous iteration; the factor is less than 1.
[0166] In one embodiment, the processing unit 402 is further configured to:
[0167] Determine the fitness of each of the at least one selected second candidate network nodes, wherein the first formula is used to determine the fitness of the candidate network nodes;
[0168] Using the fitness of each of the at least one selected second candidate network nodes, a first strategy is employed to determine the network nodes used to measure network speed.
[0169] In one embodiment, the processing unit 402 is configured to:
[0170] The second candidate network node with the highest fitness among the at least one second candidate network nodes is used as the network node for measuring network speed.
[0171] In one embodiment, the processing unit 402 is further configured to:
[0172] During the leading bee phase, in the iteration process, the location information of the third candidate network node is used to determine the fourth candidate network node, which includes the neighbor nodes of the third candidate network node;
[0173] The candidate network nodes for the next iteration are determined by comparing the fitness of the third candidate network node and the fitness of the fourth candidate network node.
[0174] In practical applications, the determining unit 401 and the processing unit 402 can be implemented by the processor in the node selection device.
[0175] It should be noted that the node selection device provided in the above embodiments is only illustrated by the division of the above-described program units. In practical applications, the above processing can be assigned to different program units as needed, that is, the internal structure of the device can be divided into different program units to complete all or part of the processing described above. In addition, the node selection device and the node selection method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0176] Based on the hardware implementation of the above program modules, and in order to implement the node selection method of the embodiments of this application, the embodiments of this application also provide an electronic device, such as... Figure 5 As shown, the electronic device 500 includes:
[0177] The communication interface 501 enables interaction with other devices;
[0178] The processor 502 is connected to the communication interface 501 to enable interaction with other devices and, when running a computer program, executes the method provided by one or more of the above-mentioned node selection device technical solutions;
[0179] The computer program is stored in memory 503.
[0180] Specifically, the processor 502 is used for:
[0181] Determine the location of at least one candidate network node in the first space;
[0182] Based on the location of the at least one candidate network node, at least one network node for measuring network speed is determined from the at least one candidate network node based on ABC; wherein, in the process of selecting the network node for measuring network speed, during the observation bee phase, at least one second candidate network node is selected using the location information of the first candidate network node and a first parameter, and the selected at least one second candidate network node is used to determine the network node for measuring network speed, the first candidate network node is included in the candidate network nodes selected during the leading bee phase, and the first parameter characterizes the global information corresponding to the at least one candidate network node.
[0183] In one embodiment, the processor 502 is configured to determine the at least one second candidate network node using the location information of the first candidate network node, the first parameter, and the second parameter, wherein the second parameter represents a random number.
[0184] In one embodiment, during the bee observation phase, the first parameter is adjusted during the iteration process so that the iteration result has a convergence direction.
[0185] In one embodiment, the processor 502 is configured to:
[0186] In each iteration, the first parameter is updated using the first parameter and factor used in the previous iteration; the factor is less than 1.
[0187] In one embodiment, the processor 502 is further configured to:
[0188] Determine the fitness of each of the at least one selected second candidate network nodes, wherein the first formula is used to determine the fitness of the candidate network nodes;
[0189] Using the fitness of each of the at least one selected second candidate network nodes, a first strategy is employed to determine the network nodes used to measure network speed.
[0190] In one embodiment, the processor 502 is configured to select the second candidate network node with the highest fitness among the at least one second candidate network nodes as the network node for measuring network speed.
[0191] In one embodiment, the processor 502 is further configured to:
[0192] During the leading bee phase, in the iteration process, the location information of the third candidate network node is used to determine the fourth candidate network node, which includes the neighbor nodes of the third candidate network node;
[0193] The candidate network nodes for the next iteration are determined by comparing the fitness of the third candidate network node and the fitness of the fourth candidate network node.
[0194] It should be noted that the specific processing procedure of the processor 502 can be understood by referring to the above method.
[0195] Of course, in practical applications, the various components in electronic device 500 are coupled together through bus system 504. It can be understood that bus system 504 is used to realize the connection and communication between these components. In addition to a data bus, bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 5 The general designated all buses as Bus System 504.
[0196] The memory 503 in this embodiment is used to store various types of data to support the operation of the electronic device 500. Examples of such data include any computer program used to operate on the electronic device 500.
[0197] The methods disclosed in the embodiments of this application can be applied to the processor 502, or implemented by the processor 502. The processor 502 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 502 or by instructions in the form of software. The processor 502 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 502 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in the memory 503. The processor 502 reads the information in the memory 503 and combines its hardware to complete the steps of the aforementioned method.
[0198] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0199] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 503 storing a computer program, which can be executed by the processor 502 of the electronic device 500 to complete the aforementioned node selection step. The computer-readable storage medium may 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), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory may be a disk storage device or a magnetic tape storage device.
[0200] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0201] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0202] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A node selection method, characterized in that, include: Determine the location of at least one candidate network node in the first space; Based on the location of the at least one candidate network node, at least one network node for measuring network speed is determined from the at least one candidate network node using the Artificial Bee Colony Algorithm (ABC). During the selection of the network node for measuring network speed, in the observation bee phase, at least one second candidate network node is selected using the location information and a first parameter of the first candidate network node. The selected at least one second candidate network node is used to determine the network node for measuring network speed. The first candidate network node is included in the candidate network nodes selected in the leader bee phase. The first parameter characterizes the global information corresponding to the at least one candidate network node. The step of selecting at least one second candidate network node using the location information and the first parameter includes: Using the location information of the first candidate network node, the first parameter, and the second parameter, at least one second candidate network node is determined, where the second parameter represents a random number; wherein, when the dimension of the first space is D, the first parameter is initialized using the following formula: in, , and The boundary position corresponding to the d-dimensional space is represented.
2. The method according to claim 1, characterized in that, During the bee observation phase, the first parameter is adjusted during the iteration process to give the iteration results a convergence direction.
3. The method according to claim 2, characterized in that, The adjustment of the first parameter includes: In each iteration, the first parameter is updated using the first parameter and factor used in the previous iteration; the factor is less than 1.
4. The method according to claim 1, characterized in that, The method further includes: Determine the fitness of each of the at least one second candidate network nodes; Using the fitness of each of the at least one second candidate network node, a first strategy is employed to determine the network node used to measure network speed.
5. The method according to claim 4, characterized in that, The first strategy for determining the network nodes used to measure network speed includes: The second candidate network node with the highest fitness among the at least one second candidate network nodes is used as the network node for measuring network speed.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: During the leading bee phase, in the iteration process, the location information of the third candidate network node is used to determine the fourth candidate network node, which includes the neighbor nodes of the third candidate network node; The candidate network nodes for the next iteration are determined by comparing the fitness of the third candidate network node and the fitness of the fourth candidate network node.
7. A node selection device, characterized in that, include: A determining unit is used to determine the position of at least one candidate network node in the first space; A processing unit is configured to determine at least one network node for measuring network speed from the at least one candidate network node based on the location of the at least one candidate network node and using ABC (Aspect-Based Selection). Specifically, during the selection of the network node for measuring network speed, in the observation bee phase, at least one second candidate network node is selected using the location information of the first candidate network node and a first parameter. The selected at least one second candidate network node is used to determine the network speed measurement node. The first candidate network node is included in the candidate network nodes selected in the leader bee phase. The first parameter characterizes the global information corresponding to the at least one candidate network node. The processing unit is configured to determine at least one second candidate network node using the location information of the first candidate network node, the first parameter, and the second parameter, wherein the second parameter represents a random number; wherein, when the dimension of the first space is D, the first parameter is initialized using the following formula: in, , and The boundary position corresponding to the d-dimensional space is represented.
8. An electronic device, characterized in that, include: The processor and the memory used to store computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 6.
9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.