Routing path determination method and device, electronic equipment and storage medium

By combining the sparrow algorithm and network topology diagram, the fitness value of the routing path is calculated, and the problem of low efficiency of existing routing algorithms in complex network environments is solved, and efficient and reliable routing path selection is achieved.

CN119182705APending Publication Date: 2024-12-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411155103.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

When facing complex network environments, existing routing algorithms are difficult to adapt to changes in network state in time. The static routing efficiency is low, the dynamic routing calculation complexity is high and the convergence speed is slow, resulting in low efficiency of optimal routing path selection.

Method used

Combined with the sparrow algorithm, by obtaining the current network topology map, the fitness value of the candidate routing path is calculated, and the optimal routing path is determined through multiple updates, improving the convergence accuracy and speed of routing path selection.

Benefits of technology

Effectively output better routing paths, improve the reliability and efficiency of path selection, improve the efficiency of optimal routing path selection, and adapt to changes in complex network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182705A_ABST
    Figure CN119182705A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a routing path determination method and device, electronic equipment and a storage medium, and relates to the technical field of computer network communication. The method comprises the following steps: acquiring a current network topological graph; determining N candidate routing paths according to the current network topological graph, and calculating fitness values of the N candidate routing paths based on the link congestion degree, the time delay, the bandwidth and the hop count in the routing table information; taking the N candidate routing paths as N sparrows in a sparrow algorithm, taking fitness values of the N candidate routing paths as fitness values of the N sparrows, and updating the positions of the N sparrows for multiple times until a termination condition is met; and when the termination condition is satisfied, the candidate routing path corresponding to the sparrow with the highest fitness value in the N sparrows is determined as the optimal routing path, so that the convergence precision and speed of routing path selection calculation are improved, and the efficiency of optimal routing path selection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer network communication technology, and in particular to a method, device, electronic device and storage medium for determining a routing path. Background Art

[0002] At present, switches are widely used in the Internet as data communication equipment, and three-layer switches have routing functions, completing the routing and forwarding of data packets at the ASIC (Application Specific Integrated Circuit) chip level. In the process of determining the best path, the routing algorithm needs to initialize and maintain the routing table. The routing information contained in the routing table varies depending on the routing algorithm. Generally, the routing table includes the following information: destination network address (destination IP), network node, etc.

[0003] As for the selection of routing paths, routing selection refers to the selection of a channel for transmitting information from a source node to a destination node through an interconnected network, and the information passes through at least one intermediate node. In traditional network routing, static routing cannot adapt to changes in network status in a timely manner to modify the path in real time; and the current dynamic routing has high computational complexity, slow convergence speed, and low efficiency in determining the best routing path. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, electronic device and storage medium for determining a routing path, so as to improve the convergence accuracy and speed of routing path selection calculation and improve the efficiency of selecting the optimal routing path.

[0005] A first aspect of an embodiment of the present invention provides a method for determining a routing path, the method comprising:

[0006] Obtaining a current network topology map, wherein the current network topology map is used to characterize the current network environment state and routing table information of each routing node, wherein the routing table information at least includes: link congestion degree, delay, bandwidth and number of hops;

[0007] Determine N candidate routing paths according to the current network topology diagram, and calculate the fitness values ​​of the N candidate routing paths based on the link congestion degree, delay, bandwidth and number of hops in the routing table information;

[0008] The N candidate routing paths are used as N sparrows in the sparrow algorithm, the fitness values ​​of the N candidate routing paths are used as the fitness values ​​of the N sparrows, and the positions of the N sparrows are updated multiple times until a termination condition is met;

[0009] When the termination condition is met, the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows is determined as the optimal routing path.

[0010] A second aspect of an embodiment of the present invention provides a method for determining a routing path, the method comprising:

[0011] Determine the network environment complexity of the current network topology diagram;

[0012] When the complexity of the network environment is higher than the complexity threshold, based on the routing path determination method shown in any of the above embodiments, determining the optimal routing path in the current network topology map;

[0013] When the complexity of the network environment is lower than the complexity threshold, the optimal routing path in the current network topology map is determined based on any one of the following target algorithms; the target algorithm includes at least: a distance vector routing algorithm, a link state routing algorithm, and a path vector routing algorithm.

[0014] A third aspect of an embodiment of the present invention provides a routing path determination device, the device comprising:

[0015] A topology acquisition module is used to acquire a current network topology map, wherein the current network topology map is used to characterize the current network environment state and the routing table information of each routing node, wherein the routing table information at least includes: link congestion degree, delay, bandwidth and hop count;

[0016] A fitness determination module, used to determine N candidate routing paths according to the current network topology diagram, and calculate the fitness values ​​of the N candidate routing paths based on the link congestion degree, delay, bandwidth and hop count in the routing table information;

[0017] A position updating module, used to use the N candidate routing paths as N sparrows in the sparrow algorithm, use the fitness values ​​of the N candidate routing paths as the fitness values ​​of the N sparrows, and update the positions of the N sparrows multiple times until a termination condition is met;

[0018] The path selection module is used to determine the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows as the optimal routing path when the termination condition is met.

[0019] A fourth aspect of an embodiment of the present invention provides a routing path determination device, the device comprising:

[0020] A complexity determination module, used to determine the network environment complexity of the current network topology diagram;

[0021] A first path determination module, configured to determine, when the complexity of the network environment is higher than a complexity threshold, an optimal routing path in the current network topology map based on the routing path determination method shown in any of the above embodiments;

[0022] The second path determination module is used to determine the optimal routing path in the current network topology diagram based on any one of the following target algorithms when the complexity of the network environment is lower than the complexity threshold; the target algorithm includes at least: a distance vector routing algorithm, a link state routing algorithm, and a path vector routing algorithm.

[0023] A fifth aspect of an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the routing path determination method as described in the first aspect of the embodiment of the present invention are implemented, or the steps of the routing path determination method as described in the second aspect of the embodiment of the present invention are implemented.

[0024] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the routing path determination method as described in the first aspect of the embodiment of the present invention are implemented, or the steps of the routing path determination method as described in the second aspect of the embodiment of the present invention are implemented.

[0025] A fifth aspect of an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the routing path determination method as described in the first aspect of the embodiment of the present invention, or implements the steps of the routing path determination method as described in the second aspect of the embodiment of the present invention.

[0026] A method for determining a routing path provided by an embodiment of the present invention comprises the following steps: firstly, obtaining a current network topology map, which is used to characterize the current network environment state and routing table information of each routing node; secondly, determining N candidate routing paths according to the current network topology map, and calculating the fitness values ​​of the N candidate routing paths based on the link congestion degree, delay, bandwidth and hop count in the routing table information; then, taking the N candidate routing paths as N sparrows in a sparrow algorithm, taking the fitness values ​​of the N candidate routing paths as the fitness values ​​of the N sparrows, and updating the positions of the N sparrows for multiple times until a termination condition is met; finally, when the termination condition is met, determining the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows as the optimal routing path. In this embodiment, the selection of the routing path is combined with the sparrow algorithm, and the candidate routing paths are used as sparrows. The fitness value corresponding to each candidate routing path in the network topology diagram is determined based on the link congestion level, delay, bandwidth and number of hops of each routing node, so that the optimal routing path is selected based on the fitness value by updating the sparrow position. Not only can a better routing path be effectively output, the reliability of path selection is improved, but also the convergence accuracy and speed of routing path selection can be improved, thereby improving the efficiency of optimal routing path selection. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0028] Figure 1 is a flowchart of a method for determining a routing path according to an embodiment of the present invention;

[0029] Figure 2 A method for selecting a reason path based on a sparrow algorithm is provided in one embodiment of the present invention;

[0030] Figure 3 is a flowchart of a method for determining a routing path according to an embodiment of the present invention;

[0031] Figure 4 is a structural block diagram of a routing path determination device provided by an embodiment of the present invention;

[0032] Figure 5 is a structural block diagram of a routing path determination device provided by an embodiment of the present invention;

[0033] Figure 6 It is a schematic diagram of an electronic device shown in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] The following is an explanation of the relevant technical terms in the embodiments of the present invention:

[0036] Sparrow Search Algorithm (SSA): is an optimization algorithm inspired by the group behavior of sparrows in nature. When a group of sparrows are looking for food, they need to search for food resources quickly and efficiently in a wide area. This behavior precisely reflects the core idea of ​​the algorithm: in a wide search space, through the cooperation and competition of the group, the optimal solution can be found efficiently. The main idea of ​​the sparrow algorithm is as follows, in which it is divided into discoverers, joiners and vigilants. The discoverer has a higher fitness value and is used to find food, while the rest of the joiners follow to forage. When the population encounters a greater danger, it will sound an alarm, so that the discoverers and joiners will move to other areas to forage. In the population, the identities of discoverers and joiners can be interchangeable, but the proportion of the two in the population remains unchanged.

[0037] At present, routing selection works at the network layer of the OSI reference model, involving Ethernet layer 3 switches. Network routing technology is an indispensable part of modern communication networks. It determines the transmission path of data packets in the network. In traditional network routing, a single path selection method is usually used. Therefore, when facing a more complex network environment, it is impossible to select the best routing path, and when the environment changes, it is impossible to modify the path in real time.

[0038] In the related art, routing can be divided into static routing and dynamic routing. Static routing is manually configured in the router, and dynamic routing is also called adaptive routing. Routing is made based on real-time measurement or estimation of the congestion level in the current network, topology results, etc. According to the operating characteristics of the routing protocol, it can be divided into: distance vector protocol and link state protocol; among them, distance vector protocols include RIP, EIGRP, BGP, etc., and link state protocols include OSPF, ISIS, etc. The method by which the router selects the best route to place in the routing table is mainly through the use of routing protocols and algorithms to determine the best path. These protocols and algorithms will evaluate each possible path according to different metrics and select the best path to add to the routing table.

[0039] As for static routing selection: its characteristics are simplicity and low overhead, but it cannot adapt to changes in network status in a timely manner. Generally, this algorithm is applicable when the network topology remains unchanged. Since the routes are manually configured in the machine in advance, when the congestion level of the network environment changes, manual modification is required. However, manual configuration will always have omissions, and the current network environment cannot be considered during configuration. It is not applicable to situations with larger network specifications, and some configurations are more complex and manual configuration is prone to errors.

[0040] Dynamic routing selection: Its characteristic is that it can adapt well to changes in network status, but it is more complex to implement and has a relatively high overhead. It is a method of automatically learning and updating routing tables through routing protocols between nodes according to the current network topology results and changes in load status. The main disadvantages are as follows: high computational complexity, slow convergence speed, not very suitable for ultra-large network environments; and requires a large amount of storage and processing resources.

[0041] Therefore, in order to at least partially solve the above problems and one or more of other potential problems, an embodiment of the present invention proposes a method for determining a routing path, in which the selection of a routing path is combined with a sparrow algorithm, and the candidate routing paths in the network topology map are used as sparrows. Based on the link congestion level, delay, bandwidth and number of hops of each routing node constituting the candidate routing path, the fitness value corresponding to each candidate routing path in the network topology map is determined, so that the optimal routing path is selected based on the fitness value by updating the position of the sparrow. In this way, not only can a more optimal routing path be effectively outputted to improve the reliability of path selection, but also the convergence accuracy and speed of routing path selection can be improved, thereby improving the efficiency of optimal routing path selection.

[0042] Please refer to Figure 1 , Figure 1 FIG. 1 is a flowchart of a method for determining a routing path according to an embodiment of the present invention. The method for determining a routing path according to this embodiment may include the following steps:

[0043] Step S11: obtaining a current network topology map, wherein the current network topology map is used to characterize the current network environment status and routing table information of each routing node, wherein the routing table information at least includes: link congestion degree, delay, bandwidth and number of hops.

[0044] In this embodiment, a network topology map can be constructed in a network topology environment based on the routing information in the network where the machine is located. Since the routing information in the network may change at any time, this embodiment can construct and obtain the current network topology map in real time. Among them, the current network topology map of this embodiment is used to characterize the current network environment state and the routing table information of each routing node that constitutes the network topology; the routing table information includes at least: link congestion level, delay, bandwidth and number of hops. And, the network of this embodiment can be a wired network, and the network environment can be a wired network environment.

[0045] Step S12: According to the current network topology, N candidate routing paths are determined, and based on the link congestion degree, delay, bandwidth and number of hops in the routing table information, the fitness values ​​of the N candidate routing paths are calculated.

[0046] In this embodiment, N candidate routing paths corresponding to the current network topology map can be determined based on the current network topology map obtained, and the candidate routing path is any routing path from the source node to the destination node in the network topology map. In addition, this embodiment can calculate the fitness value of each of the N candidate routing paths based on the link congestion level, delay, bandwidth and number of hops in the routing table information. The fitness value of the candidate routing path reflects the adaptability of the candidate routing path in the current network environment. The higher the fitness value, the better the environment of the link of the candidate routing path.

[0047] Step S13: taking the N candidate routing paths as N sparrows in the sparrow algorithm, taking the fitness values ​​of the N candidate routing paths as the fitness values ​​of the N sparrows, and updating the positions of the N sparrows multiple times until a termination condition is met.

[0048] In this embodiment, N candidate routing paths can be used as N sparrows in the sparrow algorithm, and the fitness values ​​of the N candidate routing paths can be used as the fitness values ​​of the N sparrows, and the positions of the N sparrows are updated multiple times until the termination condition is met. Among them, updating the position of the sparrow represents updating the candidate routing path, and the fitness value of the sparrow reflects the degree of adaptation of the sparrow in the current environment. Due to the complex network topology environment, in order to prevent the infinite update iteration from continuing and occupying too many resources, a termination condition is set in advance in this embodiment.

[0049] Step S14: when the termination condition is met, the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows is determined as the optimal routing path.

[0050] In this embodiment, when it is determined that the termination condition is met, the sparrow with the highest fitness value among the N sparrows can be determined, so that the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows is determined as the optimal routing path, thereby completing the selection of the optimal routing path from the source node to the destination node.

[0051] In this embodiment, the selection of the routing path is combined with the sparrow algorithm, and the candidate routing paths are used as sparrows. The fitness value corresponding to each candidate routing path in the network topology diagram is determined based on the link congestion level, delay, bandwidth and number of hops of each routing node, so that the optimal routing path is selected based on the fitness value by updating the sparrow position. Not only can a better routing path be effectively output, the reliability of path selection is improved, but also the convergence accuracy and speed of routing path selection can be improved, thereby improving the efficiency of optimal routing path selection.

[0052] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides a method for determining a routing path. In this method, after "using the N candidate routing paths as N sparrows in the sparrow algorithm" in step S13, step S21 may also be included, and any update in "updating the positions of the N sparrows multiple times" in the above step S13 is performed according to steps S22 to S25:

[0053] Step S21: Initialize a first number of sparrows among the N sparrows as discoverers in the sparrow algorithm, initialize the remaining sparrows as followers in the sparrow algorithm, and initialize a second number of sparrows among the discoverers and / or followers as guards in the sparrow algorithm.

[0054] In this embodiment, the sparrow population can be initialized, and initial parameter values ​​can be set for the discoverers and followers in the sparrow population, respectively. Specifically, the first number of sparrows in the N sparrows can be initialized as discoverers in the sparrow algorithm; the remaining number of sparrows in the N sparrows except the first number can be initialized as followers in the sparrow algorithm. For example, the ratio between the first number and the remaining number can be set, such as the first number accounts for 15% and the remaining number accounts for 85%.

[0055] As for the alerters in the sparrow algorithm, some sparrows among the discoverers and / or followers may be responsible for alerting. Specifically, a second number of sparrows among the discoverers and / or followers may be initialized as alerters in the sparrow algorithm; wherein, the part of alerters may be a set proportion among the discoverers and / or followers, and there is no limitation to this.

[0056] Step S22: obtaining the warning value output by the alerter after processing the current network topology map.

[0057] In this embodiment, the alerter in the sparrow can process the current network topology map and output an early warning value, which represents the probability of selecting the candidate routing path corresponding to the alerter.

[0058] Step S23: According to the relationship between the warning value and the safety value, the position of the discoverer is updated in a first updating manner to obtain an updated position of the discoverer.

[0059] In this embodiment, a safety value is set, and the safety value represents the range of candidate routing paths corresponding to the alerter with a high probability of being selected. In this embodiment, the position of the discoverer can be updated according to the relationship between the warning value and the safety value in a first updating manner to obtain the updated position of the discoverer. Among them, the first updating manner is a position updating manner for the discoverer, and the position of the discoverer can be updated according to the internal energy level in the sparrow population.

[0060] Step S24: According to the relationship between the current fitness value of the follower and the preset threshold, the position of the follower is updated according to the second updating method to obtain the updated position of the follower.

[0061] In this embodiment, the position of the follower can also be updated according to the relationship between the current fitness value of the follower and the preset threshold value according to the second updating method to obtain the updated position of the follower. Among them, the preset threshold value in this embodiment is the maximum fitness value that characterizes the difference between the current fitness values ​​of the follower, and the specific value can be set arbitrarily according to the needs. Among them, the second updating method is a position updating method for the follower.

[0062] Step S25: According to the relationship between the current fitness value of the sentinel and the current global optimal fitness value, the position of the sentinel is updated according to the third updating method to obtain the updated position of the sentinel.

[0063] In this embodiment, the macro can update the position of the sentinel according to the relationship between the current fitness value of the sentinel and the current global optimal fitness value, and obtain the updated position of the sentinel. The third updating method is a position updating method for the sentinel, and the global optimal fitness value is the highest fitness value among the fitness values ​​corresponding to all sparrows.

[0064] In this embodiment, the candidate routing path can be updated by updating the positions of the discoverer, follower and alerter, and the direction of the next hop of the route can be selected according to the positions of the discoverer and alerter: that is, when the danger is realized, the sparrows in the group will quickly move to the current global optimal position (safe area) to update the sparrow position; and when switching to route selection, when the alerter finds that the probability of selecting the candidate routing path is not high, the selection will be directed to the candidate routing path with a higher probability of selection. In each iteration of the sparrow position update, the position of the discoverer is updated according to the internal energy level in the population, and then the convergence calculation is performed in the new area according to the position of the discoverer, so as to achieve the update of the optimal routing path.

[0065] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides a method for determining a routing path. In this method, the "updating the positions of the N sparrows multiple times until the termination condition is met" in the above step S13 may specifically include steps S31 to S35:

[0066] Step S31: Based on the updated position of the discoverer, the updated position of the follower and the updated position of the sentinel, the fitness values ​​of the N sparrows are updated to obtain the updated fitness values ​​of the N sparrows.

[0067] In this embodiment, after the position of the sparrow is updated once, the fitness values ​​of the N sparrows can be updated based on the updated position of the discoverer, the updated position of the follower, and the updated position of the sentinel to obtain the updated fitness values ​​of the N sparrows.

[0068] Among them, one position update in this embodiment is equivalent to one iteration. After each iteration, the sparrow in the best position in the sparrow population can be set as the discoverer, and the rest can be set as followers. Since the position of the discoverer is generally the best position, the followers will search for the position of the discoverer, and then escape to the vicinity of the discoverer to forage. Therefore, when passing through a better routing position on the path, the sparrow is in the best position and escapes to a position near itself. When the position is poor, it escapes to the vicinity of the best routing position, thereby updating the position.

[0069] Step S32: Determine the current optimal candidate routing path according to the updated fitness values ​​of the N sparrows.

[0070] In this embodiment, after obtaining the updated fitness values ​​corresponding to the N sparrows, the sparrow with the highest updated fitness value can be selected, and the candidate routing path corresponding to the sparrow with the highest updated fitness value can be determined as the current optimal candidate routing path.

[0071] Step S33: Determine whether the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update.

[0072] In this embodiment, after determining the current optimal candidate routing path, a judgment can be made based on the current optimal candidate routing path and the optimal candidate routing path corresponding to the last update to determine whether the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update. Specifically, it can be based on whether the fitness value of the current optimal candidate routing path is higher than the fitness value of the optimal candidate routing path corresponding to the last update: when it is determined that the fitness value of the current optimal candidate routing path is higher than the fitness value of the optimal candidate routing path corresponding to the last update, it is determined that the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update; when it is determined that the fitness value of the current optimal candidate routing path is not higher than the fitness value of the optimal candidate routing path corresponding to the last update, it is determined that the current optimal candidate routing path is not better than the optimal candidate routing path corresponding to the last update.

[0073] Step S34: when the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update, it is determined whether the maximum number of iterations is reached or whether there is a sparrow at the target position among the N sparrows.

[0074] In this embodiment, when it is determined that the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update, it is necessary to further determine whether the current iteration number reaches the maximum iteration number or whether there is a sparrow at the target position among the N sparrows. The source node and the destination node of the candidate routing path corresponding to the sparrow at the target position are the same node.

[0075] Step S35: When the maximum number of iterations is reached or a sparrow at the target position exists among the N sparrows, it is determined that the termination condition is satisfied.

[0076] In this embodiment, when it is determined that the current number of iterations reaches the maximum number of iterations, or when it is determined that there is a sparrow at the target position among the N sparrows, it can be determined that the termination condition is satisfied.

[0077] In this embodiment, during the iterative process of updating the position of the sparrow, due to the complex network topology environment, in order to prevent the algorithm from iterating infinitely and occupying too many resources, a maximum number of iterations is set. Even if the optimal routing path is not found, the optimal result of the current iteration that has reached the maximum number of iterations will still be output. In this way, after multiple iterations, the sparrow is guided to select a better path in the exploration, so that after the convergence of the algorithm, a better routing path is found to achieve the purpose of optimizing the routing selection. When the termination condition is met, it means that the optimal path has been found.

[0078] In combination with the above embodiments, in one implementation, the present invention also provides a method for determining a routing path. In this method, in addition to the above steps, step S41 may also be included:

[0079] Step S41: When the current optimal candidate routing path is not better than the optimal candidate routing path corresponding to the last update, return to step: according to the relationship between the warning value and the safety value, update the position of the discoverer according to the first updating method to obtain the updated position of the discoverer.

[0080] In this embodiment, when it is determined that the current optimal candidate routing path is not better than the optimal candidate routing path corresponding to the last update, return to step S23: according to the relationship between the warning value and the safety value, the position of the discoverer is updated according to the first updating method to obtain the updated position of the discoverer.

[0081] In addition, in one embodiment, when it is determined that the current number of iterations has not reached the maximum number of iterations, or when it is determined that there is no sparrow at the target position among the N sparrows, it can be determined that the termination condition is not met at this time. When it is determined that the termination condition is not met, return to step S23: according to the relationship between the warning value and the safety value, the position of the discoverer is updated according to the first updating method to obtain the updated position of the discoverer.

[0082] In one embodiment, if Figure 2 As shown, Figure 2 This is a method for selecting a path based on a sparrow algorithm provided by an embodiment of the present invention. Figure 2In the method, firstly, a routing information topology map (i.e., the aforementioned current network topology map) is constructed, and then the paths in the network topology map are characterized by the sparrows in the sparrow algorithm, and the group parameters of the discoverers and joiners (i.e., followers) in the sparrows are initialized, i.e., the ratio of the discoverers and joiners in the sparrow group is initialized, and then the positions of the sparrows are updated: the positions of the discoverers, the joiners, and the vigilants are updated in sequence; then, based on the updated positions of the sparrows, the selected routing path is updated; then, it is determined whether the selected routing path is better than the previously selected routing path, and if it is determined that the selected routing path is better than the previously selected routing path, it is determined whether the optimal path is reached or whether the maximum number of iterations is reached, and if it is determined that the optimal path is reached or the maximum number of iterations is reached, the optimal routing path is output; if the optimal path is not reached, the maximum number of iterations is not reached, or it is determined that the selected routing path is not better than the previously selected routing path, the sparrow position update is re-executed, i.e., the step of updating the discoverer's position is returned.

[0083] In combination with the above embodiments, in one implementation, an embodiment of the present invention further provides a method for determining a routing path. In this method, the above step S23 may specifically include step S51 and step S52, the above step S24 may specifically include step S53 and step S54, and the above step S25 may specifically include step S56 and step S57:

[0084] Step S51: When the warning value is less than the safety value, the position of the discoverer is updated based on the position corresponding to the last update of the discoverer, the maximum number of iterations, the first random number and the position of the discoverer among the N sparrows to obtain the updated position of the discoverer.

[0085] In this embodiment, the size relationship between the warning value and the safety value can be determined. When it is determined that the warning value is less than the safety value, it indicates that there are no predators around the foraging environment at this time. The discoverer can perform extensive search operations. At this time, the position update based on the discoverer is: based on the position corresponding to the last update of the discoverer, the maximum number of iterations, the first random number and the position of the discoverer among the N sparrows, the position of the discoverer is updated to obtain the updated position of the discoverer.

[0086] In step S52, when the warning value is greater than or equal to the safety value, the position of the discoverer is updated based on the position corresponding to the last update of the discoverer, the second random number and the first matrix to obtain the updated position of the discoverer.

[0087] In this embodiment, when it is determined that the warning value is greater than or equal to the safety value, it indicates that some sparrows in the population have discovered the predator and issued an alarm to other sparrows in the population. At this time, all sparrows need to fly quickly to other safe places to forage. At this time, the position of the discoverer is updated as follows: based on the position corresponding to the last update of the discoverer, the second random number and the first matrix, the position of the discoverer is updated to obtain the updated position of the discoverer.

[0088] In an optional implementation, the location of the finder may be updated using the following formula:

[0089]

[0090] in, is the updated position of the finder, is the position corresponding to the last update of the discoverer, exp(x) is the exponential operator, that is, e to the power of x; i, j represent the position of the sparrow in the topological graph, in a j-dimensional space, represents the position information of the i-th sparrow in the j-th dimension; i is the position of the discoverer among the N sparrows; α represents the first random number, T is the maximum number of iterations set; Q represents the second random number that obeys the normal distribution; L represents the first matrix, which is a 1×d matrix, and all elements in the first matrix are 1; R2 is the warning value, R2∈[0,1]; ST is the safety value, ST∈[0.5,1].

[0091] Step S53: When the current fitness value of the follower is less than the preset threshold, the position of the follower is updated based on the position corresponding to the last update of the follower, the current global worst position, the maximum number of iterations, the first random number and the third random number to obtain the updated position of the follower.

[0092] In this embodiment, the relationship between the current fitness value of the follower and the preset threshold value can be determined. When it is determined that the current fitness value of the follower is less than the preset threshold value, it indicates that the current fitness value is poor and the current position needs to be updated. At this time, the position update based on the follower is as follows: based on the position corresponding to the last update of the follower, the current global worst position, the maximum number of iterations, the first random number and the third random number, the position of the follower is updated to obtain the updated position of the follower.

[0093] Step S54: When the current fitness value of the follower is greater than or equal to the preset threshold, the position of the follower is updated based on the position corresponding to the last update of the follower, the optimal position of the discoverer, the first matrix and the second matrix to obtain the updated position of the follower.

[0094] In this embodiment, when it is determined that the current fitness value of the follower is greater than or equal to the preset threshold, it indicates that the current fitness value is good. At this time, the position update based on the follower is as follows: based on the position corresponding to the last update of the follower, the optimal position of the discoverer, the first matrix and the second matrix, the position of the follower is updated to obtain the updated position of the follower.

[0095] In an optional implementation, the position of the follower may be updated by the following formula:

[0096]

[0097] in, is the updated position of the follower, is the position corresponding to the last update of the follower, exp(x) is the exponential operator, that is, e to the power of x; i, j represent the position of the sparrow in the topological graph, in a j-dimensional space, represents the position information of the i-th sparrow in the j-th dimension; α represents the first random number, and T is the maximum number of iterations set; represents the third random number that follows the normal distribution of [0,1]; represents the optimal position of the finder; represents the current global worst position; Z represents the second matrix. Assume that A is a 1×D second matrix, each value is 1 or -1, and satisfies A=A T (AA T ) -1 ; L represents the first matrix, which is a 1×d matrix, and all elements in the first matrix are 1; n represents the number of sparrows, Indicates that the current fitness value is poor and the current position needs to be updated; others indicate that the current fitness value is good at this time.

[0098] Step S55: When the current fitness value of the sentinel is greater than the current global optimal fitness value, the position of the sentinel is updated based on the current global optimal position, the first control parameter and the position corresponding to the last update of the sentinel to obtain the updated position of the sentinel.

[0099] In this embodiment, the relationship between the current fitness value of the sentinel and the current global optimal fitness value can be determined. When it is determined that the current fitness value of the sentinel is greater than the current global optimal fitness value, it indicates that the sparrow is at the edge of the population and is extremely vulnerable to attacks by predators. At this time, the position of the follower is updated as follows: based on the current global optimal position, the first control parameter and the position corresponding to the last update of the sentinel, the position of the sentinel is updated to obtain the updated position of the sentinel.

[0100] Step S56: When the current fitness value of the sentinel is equal to the current global optimal fitness value, the position of the sentinel is updated based on the current global worst position, the position corresponding to the last update of the sentinel, the fourth random number, the current fitness value of the sentinel, the current global worst fitness value and the first constant to obtain the updated position of the sentinel.

[0101] In this embodiment, when it is determined that the current fitness value of the sentinel is equal to the current global optimal fitness value, it indicates that the sparrows in the middle of the population are aware of the danger and need to get close to other sparrows to minimize their risk of being preyed upon. At this time, the position of the follower is updated as follows: based on the current global worst position, the position corresponding to the last update of the sentinel, the fourth random number, the current fitness value of the sentinel, the current global worst fitness value and the first constant, the position of the sentinel is updated to obtain the updated position of the sentinel.

[0102] In an optional implementation, the position of the sentinel may be updated using the following formula:

[0103]

[0104] in, is the updated position of the Sentinel. is the position corresponding to the last update of the alerter; i, j represent the position of the sparrow in the topological graph, in a j-dimensional space, Represents the position information of the i-th sparrow in the j-th dimension; represents the current global optimal position, β is a step-size control parameter that satisfies the normal distribution of random numbers, with a mean of 0 and a variance of 1; K is the fourth random number in [-1,1], represents the current global worst position; f i is the current fitness value of the sentinel; f w is the current global worst fitness value; f g is the current global optimal fitness value; ε is the first constant, which can be a minimum constant to prevent the denominator from being 0.

[0105] In combination with the above embodiments, in one implementation, during one update process of the sparrow position, the positions of the discoverer, follower and sentinel may be updated alternately in sequence, or the positions of the discoverer, follower and sentinel may be updated simultaneously; and, during one update process of the sparrow position, only the position of any one of the discoverer, follower or sentinel may be updated, and the object of each position update is determined according to the progress of the current routing path selection, so as to reduce the computational complexity as much as possible without affecting the accuracy of the routing path selection, and further reduce the storage and processing resources.

[0106] In combination with the above embodiments, in one implementation, the present invention also provides a method for determining a routing path. In this method, the above step S12 may specifically include steps S61 to S63:

[0107] Step S61: Determine the link congestion level, delay, bandwidth and number of hops of the routing nodes constituting each candidate routing path.

[0108] In this embodiment, the link congestion degree, delay, bandwidth and number of hops respectively corresponding to the routing nodes constituting each candidate routing path may be determined.

[0109] Step S62: Based on the node type of the routing node, determine the weights corresponding to the link congestion degree, delay, bandwidth and number of hops of the routing nodes constituting each candidate routing path.

[0110] In this embodiment, the node types of the routing nodes constituting each candidate routing path are first determined, and the node types may include: destination node, intermediate node and source node; then based on the node types of the routing nodes, the weights corresponding to the link congestion degree, delay, bandwidth and number of hops of the routing nodes constituting each candidate routing path are determined, that is, the weight of the link congestion degree, the weight of the delay, the weight of the bandwidth and the weight of the number of hops are determined.

[0111] Step S63: Determine the fitness value of each candidate routing path based on the link congestion degree, delay, bandwidth and hop number of the routing nodes constituting each candidate routing path and the weights corresponding to the link congestion degree, delay, bandwidth and hop number, until the fitness values ​​of the N candidate routing paths are obtained.

[0112] In this embodiment, the fitness value of each candidate routing path can be determined based on the link congestion, delay, bandwidth and hop count of the routing nodes constituting each candidate routing path and the weights corresponding to the link congestion, delay, bandwidth and hop count, until the fitness values ​​of N candidate routing paths are obtained.

[0113] For example, in an optional embodiment, the fitness function is defined as:

[0114] f = αa + βb + γc + δd;

[0115] Among them, f is the fitness value of the candidate routing path, a is the link congestion degree of the routing node of the candidate routing path, b is the delay of the routing node of the candidate routing path, c is the bandwidth of the routing node of the candidate routing path, d is the hop number of the routing node of the candidate routing path, α, β, γ, δ correspond to the weight of the link congestion degree, the weight of the delay, the weight of the bandwidth and the weight of the hop number respectively.

[0116] In this embodiment, different weights are set for different routing table information of routing nodes based on the node type of the routing node, so as to determine the fitness value of the candidate routing path composed of the routing nodes based on the routing table information and its corresponding weight, so as to fully combine the environmental state and node information in the network topology with the sparrow algorithm to achieve accurate determination of routing selection.

[0117] Based on the same inventive concept, an embodiment of the present invention also provides a method for determining a routing path. Figure 3 As shown, Figure 3 FIG. 1 is a flowchart of a method for determining a routing path according to an embodiment of the present invention. The method for determining a routing path according to this embodiment may include the following steps:

[0118] Step S71: Determine the network environment complexity of the current network topology diagram.

[0119] In this embodiment, a network topology map can be constructed in a network topology environment based on routing information in the network where the machine is located. Since routing information in the network may change at any time, this embodiment can construct and obtain the current network topology map in real time, and then determine the network environment complexity of the current network topology map.

[0120] Step S72: when the complexity of the network environment is higher than the complexity threshold, based on the routing path determination method shown in any of the above embodiments, determine the optimal routing path in the current network topology map.

[0121] In this embodiment, when it is determined that the complexity of the network environment is higher than the complexity threshold, the routing path can be selected based on the sparrow algorithm. Specifically, the optimal routing path in the current network topology diagram can be determined based on the routing path determination method shown in any of the above embodiments.

[0122] Step S73: When the complexity of the network environment is lower than the complexity threshold, determine the optimal routing path in the current network topology map based on any one of the following target algorithms; the target algorithm includes at least: distance vector routing algorithm, link state routing algorithm and path vector routing algorithm.

[0123] In this embodiment, when the complexity of the network environment is not higher than the complexity threshold, the optimal routing path in the current network topology diagram can be determined based on any of the following target algorithms; the target algorithm of this embodiment includes at least: distance vector routing algorithm, link state routing algorithm and path vector routing algorithm.

[0124] In view of the fact that the current routing selection algorithm in the Ethernet environment is relatively fixed, this embodiment adds the sparrow algorithm to the routing path selection, expands the routing path selection method, and is considered a new attempt in routing selection. When the network environment is complex, a large amount of routing information needs to be manually configured, and it is impossible to determine the best path from the source node to the destination node. At this time, the sparrow algorithm can effectively output a better routing path. The sparrow algorithm has the characteristics of high convergence accuracy, fast convergence speed, and robustness. Compared with the original routing path selection method, it has higher reliability and is also considered a new attempt in routing selection, expanding the routing path selection method. When the network environment is not complex, other dynamic routing algorithms can be used, such as the distance vector routing algorithm, the link state routing algorithm, and the path vector routing algorithm.

[0125] That is to say, this embodiment adds the sparrow algorithm to the selection of the routing path, adds the sparrow algorithm to the network transmission, and adds a new option in the routing path selection as a new routing path selection algorithm. At the same time, due to the characteristics of the sparrow algorithm with high convergence accuracy, fast convergence speed, strong optimization ability and high solution efficiency, it can solve the routing path selection problem in a complex network environment.

[0126] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0127] Based on the same inventive concept, an embodiment of the present invention provides a routing path determination device 400. Figure 4 , Figure 4 400 is a structural block diagram of a routing path determination device provided by an embodiment of the present invention. The routing path determination device 400 includes:

[0128] The topology map acquisition module 401 is used to acquire the current network topology map, which is used to characterize the current network environment state and the routing table information of each routing node, and the routing table information at least includes: link congestion degree, delay, bandwidth and hop count;

[0129] A fitness determination module 402 is used to determine N candidate routing paths according to the current network topology diagram, and calculate the fitness values ​​of the N candidate routing paths based on the link congestion degree, delay, bandwidth and hop count in the routing table information;

[0130] The position updating module 403 is used to use the N candidate routing paths as N sparrows in the sparrow algorithm, use the fitness values ​​of the N candidate routing paths as the fitness values ​​of the N sparrows, and update the positions of the N sparrows multiple times until a termination condition is met;

[0131] The path selection module 404 is used to determine the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows as the optimal routing path when the termination condition is met.

[0132] Optionally, the device 400 further includes:

[0133] an initialization module, configured to, after taking the N candidate routing paths as N sparrows in a sparrow algorithm, initialize a first number of sparrows in the N sparrows as discoverers in the sparrow algorithm, initialize the remaining sparrows as followers in the sparrow algorithm, and initialize a second number of sparrows in the discoverers and / or followers as guards in the sparrow algorithm;

[0134] The location updating module 403 includes:

[0135] An early warning value determination module, used to obtain the early warning value output by the alerter by processing the current network topology map;

[0136] A first updating module, configured to update the position of the discoverer in a first updating manner according to the relationship between the warning value and the safety value, to obtain an updated position of the discoverer;

[0137] A second updating module, configured to update the position of the follower in a second updating manner according to a relationship between a current fitness value of the follower and a preset threshold, to obtain an updated position of the follower;

[0138] The third updating module is used to update the position of the sentinel according to the relationship between the current fitness value of the sentinel and the current global optimal fitness value in a third updating manner to obtain the updated position of the sentinel.

[0139] Optionally, the location updating module 403 includes:

[0140] A fitness updating module, used for updating the fitness values ​​of the N sparrows based on the updated position of the discoverer, the updated position of the follower and the updated position of the sentinel, to obtain the updated fitness values ​​of the N sparrows;

[0141] A path updating module, used for determining the current optimal candidate routing path according to the updated fitness values ​​of the N sparrows;

[0142] A first judgment module, used to judge whether the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update;

[0143] A second judgment module is used to judge whether the maximum number of iterations is reached or whether there is a sparrow at a target position among the N sparrows when the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update;

[0144] The condition determination module is used to determine that the termination condition is satisfied when the maximum number of iterations is reached or when a sparrow at a target position exists among the N sparrows.

[0145] Optionally, the device 400 further includes:

[0146] A loop module is used to return to the step of updating the position of the discoverer in a first updating manner according to the relationship between the warning value and the safety value to obtain the updated position of the discoverer when the current optimal candidate routing path is not better than the optimal candidate routing path corresponding to the last update.

[0147] Optionally, the first update module includes:

[0148] A first discoverer updating module is used to update the position of the discoverer based on the position corresponding to the last update of the discoverer, the maximum number of iterations, the first random number and the position of the discoverer among the N sparrows to obtain the updated position of the discoverer when the warning value is less than the safety value;

[0149] A second discoverer update module is used to update the position of the discoverer based on the position corresponding to the last update of the discoverer, the second random number and the first matrix to obtain the updated position of the discoverer when the warning value is greater than or equal to the safety value;

[0150] The second update module includes:

[0151] A first follower update module is used to update the position of the follower based on the position corresponding to the last update of the follower, the current global worst position, the maximum number of iterations, the first random number and the third random number to obtain the updated position of the follower when the current fitness value of the follower is less than the preset threshold;

[0152] A second follower updating module is used to update the position of the follower based on the position corresponding to the last update of the follower, the optimal position of the discoverer, the first matrix and the second matrix to obtain the updated position of the follower when the current fitness value of the follower is greater than or equal to the preset threshold;

[0153] The second update module includes:

[0154] A first alerter updating module is used to update the position of the alerter based on the current global optimal position, the first control parameter and the position corresponding to the last update of the alerter to obtain the updated position of the alerter when the current fitness value of the alerter is greater than the current global optimal fitness value;

[0155] The second sentinel update module is used to update the position of the sentinel based on the current global worst position, the position corresponding to the last update of the sentinel, a fourth random number, the current fitness value of the sentinel, the current global worst fitness value and the first constant to obtain the updated position of the sentinel when the current fitness value of the sentinel is equal to the current global best fitness value.

[0156] Optionally, the fitness determination module 402 includes:

[0157] A first determination module is used to determine the link congestion level, delay, bandwidth and number of hops of the routing nodes constituting each candidate routing path;

[0158] A second determination module is used to determine the weights corresponding to the link congestion degree, delay, bandwidth and number of hops of the routing nodes constituting each candidate routing path based on the node type of the routing node;

[0159] The third determination module is used to determine the fitness value of each candidate routing path based on the link congestion degree, delay, bandwidth and hop number of the routing nodes constituting each candidate routing path and the weights corresponding to the link congestion degree, delay, bandwidth and hop number, until the fitness values ​​of the N candidate routing paths are obtained.

[0160] Based on the same inventive concept, an embodiment of the present invention provides a routing path determination device 500. Figure 5 , Figure 5 1 is a block diagram of a routing path determination device provided by an embodiment of the present invention. The routing path determination device 500 includes:

[0161] The complexity determination module 501 is used to determine the network environment complexity of the current network topology diagram;

[0162] A first path determination module 502, configured to determine an optimal routing path in the current network topology map based on the routing path determination method shown in any of the above embodiments when the complexity of the network environment is higher than a complexity threshold;

[0163] The second path determination module 503 is used to determine the optimal routing path in the current network topology diagram based on any one of the following target algorithms when the complexity of the network environment is lower than the complexity threshold; the target algorithm includes at least: distance vector routing algorithm, link state routing algorithm and path vector routing algorithm.

[0164] Based on the same inventive concept, another embodiment of the present invention provides an electronic device 600, such as Figure 6 shown. Figure 6 6 is a schematic diagram of an electronic device according to an embodiment of the present invention. The electronic device includes a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601, wherein the computer program implements the steps of the method for determining a routing path according to any of the above embodiments of the present invention when executed by the processor.

[0165] Based on the same inventive concept, another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the method for determining a routing path as described in any of the above embodiments of the present invention are implemented.

[0166] Based on the same inventive concept, another embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the method for determining a routing path as described in any of the above embodiments of the present invention.

[0167] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0168] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) to execute the methods described in each embodiment of the present invention.

[0170] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0171] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0172] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0173] In the embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0174] 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.

[0175] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0176] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or optical disk, etc., which can store program code.

[0177] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for determining a routing path, characterized in that: The method comprises: Obtaining a current network topology map, wherein the current network topology map is used to characterize the current network environment state and routing table information of each routing node, wherein the routing table information includes at least: link congestion degree, delay, bandwidth and number of hops; Determine N candidate routing paths according to the current network topology diagram, and calculate the fitness values ​​of the N candidate routing paths based on the link congestion degree, delay, bandwidth and number of hops in the routing table information; The N candidate routing paths are used as N sparrows in the sparrow algorithm, the fitness values ​​of the N candidate routing paths are used as the fitness values ​​of the N sparrows, and the positions of the N sparrows are updated multiple times until a termination condition is met; When the termination condition is met, the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows is determined as the optimal routing path.

2. The method according to claim 1, characterized in that After using the N candidate routing paths as N sparrows in the sparrow algorithm, the method further includes: Initialize a first number of sparrows among the N sparrows as discoverers in the sparrow algorithm, initialize the remaining sparrows as followers in the sparrow algorithm, and initialize a second number of sparrows among the discoverers and / or followers as guards in the sparrow algorithm; The updating of any one of the multiple updates of the positions of the N sparrows is performed according to the following steps: Obtaining a warning value output by the alerter through processing the current network topology map; According to the relationship between the warning value and the safety value, the position of the discoverer is updated in a first updating manner to obtain an updated position of the discoverer; According to the relationship between the current fitness value of the follower and the preset threshold, the position of the follower is updated according to the second updating method to obtain the updated position of the follower; According to the relationship between the current fitness value of the sentinel and the current global optimal fitness value, the position of the sentinel is updated according to the third updating method to obtain the updated position of the sentinel.

3. The method according to claim 2, characterized in that The updating of the positions of the N sparrows for multiple times until a termination condition is met includes: Based on the updated position of the discoverer, the updated position of the follower, and the updated position of the sentinel, the fitness values ​​of the N sparrows are updated to obtain the updated fitness values ​​of the N sparrows; Determine the current optimal candidate routing path according to the updated fitness values ​​of the N sparrows; Determine whether the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update; In the case where the current optimal candidate routing path is better than the optimal candidate routing path corresponding to the last update, determining whether a maximum number of iterations has been reached or whether there is a sparrow at a target location among the N sparrows; When the maximum number of iterations is reached or a sparrow located at a target position exists among the N sparrows, it is determined that the termination condition is satisfied.

4. The method according to claim 3, characterized in that The method further comprises: When the current optimal candidate routing path is not better than the optimal candidate routing path corresponding to the last update, return to step: according to the relationship between the warning value and the safety value, update the position of the discoverer according to the first updating method to obtain the updated position of the discoverer.

5. The method according to any one of claims 2 to 4, characterized in that: The updating of the position of the discoverer in a first updating manner according to the relationship between the warning value and the safety value to obtain the updated position of the discoverer includes: When the warning value is less than the safety value, based on the position corresponding to the last update of the discoverer, the maximum number of iterations, the first random number and the position of the discoverer among the N sparrows, the position of the discoverer is updated to obtain the updated position of the discoverer; When the warning value is greater than or equal to the safety value, based on the position corresponding to the last update of the discoverer, the second random number and the first matrix, the position of the discoverer is updated to obtain the updated position of the discoverer; The updating of the position of the follower in a second updating manner according to the relationship between the current fitness value of the follower and the preset threshold value to obtain the updated position of the follower includes: When the current fitness value of the follower is less than the preset threshold, based on the position corresponding to the last update of the follower, the current global worst position, the maximum number of iterations, the first random number and the third random number, the position of the follower is updated to obtain the updated position of the follower; When the current fitness value of the follower is greater than or equal to the preset threshold, the position of the follower is updated based on the position corresponding to the last update of the follower, the optimal position of the discoverer, the first matrix and the second matrix to obtain the updated position of the follower; The updating of the position of the alerter according to the third updating method based on the relationship between the current fitness value of the alerter and the current global optimal fitness value to obtain the updated position of the alerter includes: When the current fitness value of the sentinel is greater than the current global optimal fitness value, the position of the sentinel is updated based on the current global optimal position, the first control parameter and the position corresponding to the last update of the sentinel to obtain the updated position of the sentinel; When the current fitness value of the sentinel is equal to the current global optimal fitness value, the position of the sentinel is updated based on the current global worst position, the position corresponding to the last update of the sentinel, the fourth random number, the current fitness value of the sentinel, the current global worst fitness value and the first constant to obtain the updated position of the sentinel.

6. The method according to any one of claims 1 to 4, characterized in that: The calculating the fitness values ​​of the N candidate routing paths based on the link congestion degree, delay, bandwidth and number of hops in the routing table information includes: Determine the link congestion, latency, bandwidth, and hop count of the routing nodes that make up each candidate routing path; Based on the node type of the routing node, determining the weights corresponding to the link congestion degree, delay, bandwidth and number of hops of the routing nodes constituting each candidate routing path; Based on the link congestion degree, delay, bandwidth and hop number of the routing nodes constituting each candidate routing path and the weights corresponding to the link congestion degree, delay, bandwidth and hop number, the fitness value of each candidate routing path is determined until the fitness values ​​of the N candidate routing paths are obtained.

7. A method for determining a routing path, characterized in that: The method comprises: Determine the network environment complexity of the current network topology diagram; In the case where the complexity of the network environment is higher than the complexity threshold, determining the optimal routing path in the current network topology map based on the routing path determination method according to any one of claims 1 to 6; When the complexity of the network environment is lower than the complexity threshold, the optimal routing path in the current network topology map is determined based on any one of the following target algorithms; the target algorithm includes at least: a distance vector routing algorithm, a link state routing algorithm, and a path vector routing algorithm.

8. A routing path determination device, characterized in that: The device comprises: A topology acquisition module is used to acquire a current network topology map, wherein the current network topology map is used to characterize the current network environment state and the routing table information of each routing node, wherein the routing table information at least includes: link congestion degree, delay, bandwidth and hop count; A fitness determination module, used to determine N candidate routing paths according to the current network topology diagram, and calculate the fitness values ​​of the N candidate routing paths based on the link congestion degree, delay, bandwidth and hop count in the routing table information; A position updating module, used to use the N candidate routing paths as N sparrows in the sparrow algorithm, use the fitness values ​​of the N candidate routing paths as the fitness values ​​of the N sparrows, and update the positions of the N sparrows multiple times until a termination condition is met; The path selection module is used to determine the candidate routing path corresponding to the sparrow with the highest fitness value among the N sparrows as the optimal routing path when the termination condition is met.

9. A routing path determination device, characterized in that: The device comprises: A complexity determination module, used to determine the network environment complexity of the current network topology diagram; A first path determination module, configured to determine, when the complexity of the network environment is higher than a complexity threshold, an optimal routing path in the current network topology map based on the routing path determination method according to any one of claims 1 to 6; The second path determination module is used to determine the optimal routing path in the current network topology diagram based on any one of the following target algorithms when the complexity of the network environment is lower than the complexity threshold; the target algorithm includes at least: a distance vector routing algorithm, a link state routing algorithm, and a path vector routing algorithm.

10. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps in the method for determining a routing path according to any one of claims 1 to 7 are implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the routing path determination method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data center network flow scheduling method for minimization of network congestion and Qos (Quality of Service) guarantee

    CN115174489A

  • Path optimization method, device and equipment

    CN118396209A