Path determination method and device, computer equipment, readable storage medium and program product
Through the dual-queue structure and multi-process processing method, the problem that traditional path algorithms cannot meet high requirements is solved, and the multi-factor optimal path is quickly calculated, which improves the service quality and network service capabilities.
Patent Information
- Application Number
- CN202411104091.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-06
AI Technical Summary
Traditional single-factor or multi-factor path algorithms cannot meet the high requirements of cloud VR and video services for high latency, bandwidth and reliability of network paths, and the multi-factor computing method takes time to calculate, making it difficult to meet actual needs.
Using a dual-queue structure and multi-process processing, the search and update path search and update are used to achieve rapid calculation of multi-factor optimal path through search queues and update queues.
It realizes the rapid calculation of multi-factor optimal paths, improves the service quality and network service capabilities, and can meet the business needs of larger topology and more factor scenarios.
Smart Images

Figure CN119094419A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a path determination method, apparatus, computer equipment, readable storage medium, and program product. Background Art
[0002] With the continuous development of network technology, many new services have emerged, which have higher requirements for network service quality. For example, cloud VR (Virtual Reality) related services and video related services have high requirements for multiple factors such as latency, bandwidth, and reliability of the network paths that carry them. However, the path algorithms based on single factors or multiple factors commonly used in traditional solutions cannot meet business requirements. Summary of the invention
[0003] Based on this, it is necessary to provide a path determination method, apparatus, computer equipment, readable storage medium and program product that can meet business requirements in response to the above technical problems.
[0004] In a first aspect, the present application provides a path determination method, comprising:
[0005] Taking out a pre-selected path from the search queue and assigning the pre-selected path to the search process; obtaining a candidate path by performing a search operation on the pre-selected path based on the reference path set by the search process, and placing the candidate path into the update queue;
[0006] Taking candidate paths from the update queue and assigning the candidate paths to the update process; performing an update operation on the reference path set based on the candidate paths through the update process, and placing the candidate paths whose end nodes are not the target end points into the search queue as pre-selected paths;
[0007] When the search queue and update queue are empty, the path traversal is determined to be complete and the target path of the target destination is output.
[0008] In one embodiment, the search process and the update process run asynchronously in parallel.
[0009] In one embodiment, taking out a pre-selected path from a search queue and assigning the pre-selected path to a search process includes:
[0010] The search scheduling process takes the pre-selected path from the search queue and assigns the pre-selected path to the idle search process in the search process pool;
[0011] The candidate paths are taken from the update queue and assigned to the update process, including:
[0012] The update scheduling process takes the candidate paths from the update queue and assigns the candidate paths to the idle update processes in the update process pool.
[0013] In one of the embodiments, multiple search processes in the search process pool run in parallel, and multiple update processes in the update process pool run in parallel.
[0014] In one embodiment, the method further comprises:
[0015] Using the search process to read the reference path set from the shared variable;
[0016] The reference path set after the update operation is written into the shared variable by the update process.
[0017] In one embodiment, the reference path set includes a first Pareto optimal path set corresponding to the end nodes of the path, and a second Pareto optimal path set corresponding to the target destination.
[0018] In one embodiment, updating the reference path set based on the candidate path through an update process includes:
[0019] An update process is adopted to update the first Pareto optimal path set based on the candidate path, and the first Pareto optimal path set after the update operation is written into the shared variable.
[0020] In one embodiment, an updating process is used to update the first Pareto optimal path set based on the candidate paths, including:
[0021] Determine the end node of the candidate path, and read the first Pareto optimal path set corresponding to the end node of the candidate path from the shared variable;
[0022] Compare the candidate path with the path traversal in the first Pareto optimal path set corresponding to the terminal node of the candidate path to obtain a comparison result;
[0023] The candidate path is added to the first Pareto optimal path set of the terminal node corresponding to the candidate path, and the path dominated by the candidate path in the first Pareto optimal path set of the terminal node corresponding to the candidate path is deleted according to the comparison result to obtain the first Pareto optimal path set after the update operation; wherein, the paths in the first Pareto optimal path set after the update operation do not dominate each other.
[0024] In one embodiment, the search process searches the pre-selected path based on the reference path set to obtain the candidate path, and puts the candidate path into the update queue, including:
[0025] Determine the end node of the pre-selected path, and read the first Pareto optimal path set corresponding to the end node of the pre-selected path from the shared variable;
[0026] The pre-selected path is compared with the path in the first Pareto optimal path set and the path in the second Pareto optimal path set of the end node of the pre-selected path to obtain a first comparison result;
[0027] If the first comparison result is that there is no path dominating the pre-selected path, the pre-selected path is extended based on the network topology information to obtain an extended path;
[0028] Determine the end node of the extended path, and read the first Pareto optimal path set corresponding to the end node of the extended path from the shared variable;
[0029] The extended path is traversed and compared with the path in the first Pareto optimal path set and the path in the second Pareto optimal path set of the end node corresponding to the extended path, respectively, to obtain a second comparison result;
[0030] If the second comparison result is that there is no path dominating the extended path, the extended path is put into the update queue as a candidate path.
[0031] In one embodiment, the extended path includes a node connected to an end node of the preselected path.
[0032] In a second aspect, the present application further provides a path determination device, comprising:
[0033] A search module is used to take out a pre-selected path from a search queue and assign the pre-selected path to a search process; the search process searches the pre-selected path based on a reference path set to obtain a candidate path, and puts the candidate path into an update queue;
[0034] An update module is used to take out candidate paths from the update queue and assign the candidate paths to the update process; the update process updates the reference path set based on the candidate paths, and puts the candidate paths whose end nodes are not the target end points into the search queue as pre-selected paths;
[0035] The path output module is used to determine that the path traversal is completed until the search queue and the update queue are empty, and output the target path of the target end point.
[0036] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements each step of the above-mentioned path determination method when executing the computer program.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, each step in the above-mentioned path determination method is implemented.
[0038] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps in the above-mentioned path determination method when executed by a processor.
[0039] The above-mentioned path determination method, device, computer equipment, readable storage medium and program product, through the search process, search the pre-selected path taken out from the search queue based on the reference path set to obtain the candidate path, and put the candidate path into the update queue, and through the update process, update the reference path set taken out from the update queue based on the candidate path, and put the candidate path whose end node is not the target end point into the search queue as the pre-selected path, until the search queue and the update queue are empty, then it is determined that the path traversal is completed, and the target path of the target end point is output. The present application uses two queues, the search queue and the update queue, to store the intermediate paths in the path traversal process, to achieve the decoupling of path search and update, and further, using the search process and the update process, multiple processes process the path search and update in the two queues, and achieve asynchronous parallel calculation of the optimal path, thereby meeting business requirements and improving business service quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A diagram of an application environment of a path determination method in an embodiment;
[0042] Figure 2 A schematic diagram of a flow chart of a path determination method in one embodiment;
[0043] Figure 3 A schematic diagram of a multi-factor path calculation process in an embodiment;
[0044] Figure 4 A schematic diagram of a flow chart of an update operation in an embodiment;
[0045] Figure 5 A schematic diagram of a search operation flow in one embodiment;
[0046] Figure 6 is a schematic diagram of a network topology in an embodiment;
[0047] Figure 7 is a structural block diagram of a path determination device in one embodiment;
[0048] Figure 8FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0051] It is understood that in this application, terms such as "first", "second", etc. are only used to distinguish similar objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. It is understood that "at least one" means one or more, and "a plurality" means two or more.
[0052] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0053] In traditional IP networks, the path is usually calculated based on a single-factor shortest path algorithm. The factor value used for calculation is often based on a metric value set empirically, or only considers a specific factor. In this way, the calculated path is the optimal one with respect to a certain factor (metric value), not the optimal one with multiple factors. When the service has multiple SLA (Service Level Agreement) requirements, this shortest path may not meet the requirements. For example, a cloud VR service requires a bandwidth greater than 1Gbps, a latency less than 20ms, and a reliability of 99.999%. However, based on the single-factor shortest path calculation, the shortest path latency may be calculated to be 10ms, while the bandwidth is only 100Mbs and the reliability is 90%, which does not meet the requirements of the service, resulting in poor service quality.
[0054] The current multi-factor path calculation algorithm can solve the optimal path for multiple factors, that is, the Pareto optimal path. However, multi-factor path calculation is an NP-complete problem, and these algorithms often take a lot of time to solve, which is difficult to meet actual requirements. At the same time, most traditional path calculation methods focus on additive factors, while the bandwidth index commonly used in the network field is a bottleneck factor, and traditional algorithms are not applicable. For example, the method of solving the multi-factor Pareto optimal path, ParetoBFS (Pareto breadth first search), needs to compare the current searched path with the current Pareto optimal path set found (to determine whether it is dominated) many times during the path search process, which is very time-consuming. In addition, ParetoBFS is a serial algorithm that can only be executed step by step in sequence. Although it can handle multi-factor path calculation problems more efficiently in some cases (topology cannot be too large and the number of factors is small), it cannot fully utilize the multi-core computing resources of the computer to achieve multi-process acceleration. When the scale of the path calculation problem is further expanded, relying on the single-core performance of the computer will eventually lead to a computing bottleneck.
[0055] Among them, the ParetoBFS scheme uses a single queue to store the paths in the path traversal process and maintain the Pareto optimal path set of each node. Starting from the starting point, by continuously pushing the path into the queue and popping the path from the queue, the path is expanded based on the topological relationship, and at the same time, it is determined whether the extended path is pruned by the Pareto optimal path set of the target end point or the end node of the path. Otherwise, the extended path is pushed into the queue again and the Pareto optimal path set of the end node of the path is updated. Paths are continuously popped out from the queue until the queue is empty and the path traversal ends. At this moment, the Pareto optimal path set of the target end point is the multi-factor optimal path set from the starting point to the target end point. However, each link of this method is interdependent, and it is impossible to use multiple processes to accelerate the calculation.
[0056] As mentioned above, traditional multi-factor path calculation methods are usually slow when facing large-scale topologies or a large number of factors. The solution is essentially a serial algorithm. There is a dependency between the steps in the multi-factor optimal path calculation process, and it can only be executed step by step in sequence. It is difficult to use multiple processes to accelerate the path calculation, and parallel computing cannot be achieved.
[0057] Based on the above traditional technology, the embodiment of the present application proposes to use shared variables to store the Pareto optimal path set of each node and use two queues to store the intermediate paths in the path traversal process, so as to achieve the decoupling of path expansion (search) and updating shared variables (update). At the same time, multiple processes are used to process the paths in the two queues and update the shared variables to achieve asynchronous parallel calculation of multi-factor optimal paths, and multi-core computing resources can be used to realize multi-process amortization of computing workload and accelerate path calculation.
[0058] It should be noted that the beneficial effects or technical problems solved by the embodiments of the present application are not limited to this one, but may also include other implicit or related problems. For details, please refer to the description of the following embodiments.
[0059] The path determination method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown in the figure, Figure 1 The asynchronous multi-process multi-factor path calculation architecture of an embodiment, the search and update separated asynchronous architecture includes two parts, each of which is composed of a scheduling process and a process pool, and is interconnected through an update queue and a search queue. It should be noted that the present application is applicable to directed graphs and undirected graphs.
[0060] Exemplarily, the path calculation architecture adopts a dual queue structure, which decouples path expansion (search) from updating shared variables (update) during the path traversal process. One queue stores the paths generated during the search process, called the search queue, and the other queue stores the paths during the update process, called the update queue. Furthermore, two process pools (search process pool and update process pool) are used to search and update the corresponding path queues and related shared variables respectively. Optionally, the present application improves the ParetoBFS method, based on the idea of breadth-first search and the Pareto optimal constraint pruning method, and can also use shared variables to store the Pareto optimal path set from the starting point to each node.
[0061] In addition, the embodiments of the present application can build an asynchronous architecture and make full use of the computer's multi-core computing resources to enable multiple processes to obtain paths from two queues and perform calculations, expansions, pruning, queuing, and updates at the same time, thereby achieving the effect of accelerating multi-factor path calculation, and can be applied to larger topologies and more factor scenarios for path calculation.
[0062] The path determination method in the present application can be used as a method for asynchronous multi-process parallel acceleration of multi-factor path calculation, and can quickly calculate the multi-factor optimal path for the services in the network. Exemplarily, the embodiments of the present application can be applied to the multi-factor optimal routing scenario in network operation, and the starting point and target end point of the service demand and the network topology information can be obtained from the path calculation unit or SDN (Software-defined Networking) controller, and then the path determination method proposed in the present application is used to calculate the optimal path and then feed it back to the path calculation unit or SDN controller, that is, to quickly provide the optimal path calculation capability. The embodiments of the present application can also be applied to the multi-factor optimal path calculation in the computing power network. The computing power is used as a new factor. The method is used in the computing power routing to quickly calculate the multi-factor optimal path including computing power and network factors.
[0063] Optionally, the embodiments of the present application can comprehensively consider multiple factors, calculate the optimal path set, match the SLA requirements of the business, and improve the protection of key businesses. In addition, the embodiments of the present application can calculate the optimal path set for the business, and on this basis, consider the overall resource utilization, continue to select the most suitable path from the path set, and further improve resource utilization. It can be understood that the embodiments of the present application can be applied to larger topologies or more factors of the calculation scenario through asynchronous parallel multi-process, and can handle larger-scale problems; and can speed up the multi-factor calculation, which can better provide the optimal path for various businesses.
[0064] Before introducing the specific embodiments of the present application, the professional terms involved in the present application are explained first:
[0065] Additive factor: A factor attribute of a network link (such as delay). The additive factor value of a path is obtained by adding the additive factor values of all the links that constitute the path.
[0066] Bottleneck (concavity) factor: A factor attribute of a network link (such as bandwidth). The bottleneck factor value of a path is determined by the minimum value of the factor value among all the links that constitute the path.
[0067] Multiplicative factor: A factor attribute of a network link (such as reliability). The multiplicative factor value of a path is obtained by multiplying the multiplicative factor values of all the links that constitute the path.
[0068] Domination: When a network link has multiple factors, if all factor values of a path are not worse than all factor values of another path, and at least one factor value is better, then the path is said to dominate the other path.
[0069] Pareto optimal path set: Given a starting node and a target node, calculate all non-dominant paths between the two points. These paths constitute the Pareto optimal path set about the two points, that is, the multi-factor optimal path set. For simplicity, the Pareto optimal path set from the starting point to the target node is called the Pareto optimal path set of the target node.
[0070] Path extension: Based on the topological connection relationship, other nodes connected to the last node of the path are added to the path as the last node to form a new path. Note that there may be multiple nodes connected to the last node of the path, which will expand to form multiple paths.
[0071] Path pruning: In the case of multi-factor path calculation, compare two paths. If one path is dominated by the other path, stop the further expansion search of this path.
[0072] Pareto optimality constraint: When the factor value is positive, the path continues to expand only leads to worse and worse values of each factor of the path. Therefore, if a path is dominated by a certain path set, no matter how the path continues to expand, it will still be dominated by the path set.
[0073] ParetoBFS (Pareto Breadth First Search): A multi-factor path calculation method based on label correction, using a variant of breadth-first search to perform pruning and path calculation based on Pareto optimality constraints. This method maintains a list for each node, recording the Pareto optimal path set from the starting point to the current node. In the process of traversing and searching (enumerating) paths, if the currently found path is dominated by a known path, the path is pruned. This method can find a complete set of Pareto optimal paths and can handle additive factors and bottleneck factors.
[0074] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0075] In an exemplary embodiment, Figure 2 As shown, a path determination method is provided, which is applied to Figure 1 The calculation path architecture in FIG. 2 is taken as an example to illustrate, including the following steps 202 to 206. Among them:
[0076] Step 202, taking out a pre-selected path from the search queue and assigning the pre-selected path to the search process; the search process searches the pre-selected path based on the reference path set to obtain a candidate path, and puts the candidate path into the update queue.
[0077] The search queue can be understood as a work queue, such as a work queue created corresponding to a process pool. Exemplarily, the search queue in the embodiment of the present application can be used to store paths generated during the search process.
[0078] Specifically, the preselected path may refer to a path generated during the search process. In some examples, the preselected path may include an initial path during initialization, and the initial path may be a path that only includes a starting point.
[0079] During the search process, when the search queue is not empty, a pre-selected path can be taken out of the search queue and assigned to a search process. It can be understood that the search process can be a process that is currently in an idle state. Optionally, each search process can support parallel operation. Further, the search process searches the pre-selected path based on the reference path set to obtain a candidate path, and puts the candidate path into an update queue.
[0080] Exemplarily, the reference path set may include an optimal path set for each node, such as a Pareto optimal path set; optionally, the reference path set may be a Pareto optimal path set from a starting point to the node for each node. In an embodiment of the present application, the search process may perform a search operation on a preselected path through the reference path set, such as calculating a multi-factor optimal path to obtain a candidate path. Optionally, the search operation performed by the search process may include, but is not limited to, calculating the factor value of the path, determining the dominance relationship between paths, and path extension.
[0081] This application uses a search process to implement the search operation for a pre-selected path. The search process can be regarded as an independent task and has the basis for asynchronous parallel computing, so that multi-core computing resources can be used to realize multi-process sharing of some calculations in the path calculation process.
[0082] Step 204, taking out candidate paths from the update queue and assigning the candidate paths to the update process; performing an update operation on the reference path set based on the candidate paths through the update process, and placing the candidate paths whose end nodes are not the target destinations as pre-selected paths into the search queue.
[0083] The update queue can be understood as a work queue, such as a work queue created corresponding to a process pool. Exemplarily, the update queue in the embodiment of the present application can be used to store the path in the update process.
[0084] Specifically, the candidate path may refer to a path in the updating process. In some examples, the end node of the candidate path may be the target end point. In other examples, the end node of the candidate path may not be the target end point.
[0085] During the update process, when the update queue is not empty, a candidate path can be taken from the update queue and assigned to the update process. It can be understood that the update process can be a process that is currently in an idle state. Optionally, each update process can support parallel operation. Further, the update process updates the reference path set based on the candidate path, and puts the candidate path whose end node is not the target end point into the search queue as a pre-selected path.
[0086] Exemplarily, the update operation performed by the update process can be used to update the reference path set, so that after decoupling, the two types of tasks, search and update, provide data to each other and are connected to each other through the update queue and the search queue. Optionally, the update operation includes but is not limited to calculating the factor value of the path and determining the dominance relationship between the paths.
[0087] This application uses an update process to implement the update operation for the reference path set, and puts the candidate paths whose end nodes are not the target endpoints into the search queue as pre-selected paths. The update process can be regarded as an independent task, and has the basis for asynchronous parallel computing, so that multi-core computing resources can be used to realize multi-process sharing of some calculation amounts in the path calculation process, so as to build an asynchronous multi-process architecture based on a solution that decouples search and update.
[0088] Step 206: until the search queue and the update queue are empty, it is determined that the path traversal is completed and the target path of the target destination is output.
[0089] Specifically, the present application can continuously call multiple processes in parallel to take out paths from the search queue and update queue for processing, and continuously repeat the above search operation steps and update operation steps. The paths continuously enter the search queue and update queue and are dequeued from these queues. When the search queue and update queue are empty, it means that there is no path waiting to be expanded at this time, and the path traversal is completed, and the target path of the target destination can be output eventually. Among them, the target path can be the Pareto optimal path from the starting point to the target destination, and the target path can also be the Pareto optimal path set from the starting point to the target destination.
[0090] In the above-mentioned path determination method, in the multi-factor path calculation scenario, a dual queue structure is used to decouple path search and update. In the multi-factor path calculation scenario, path search and update involve a large number of operations to determine whether the paths dominate each other, which is a very time-consuming task. The present application decouples path search and update, uses two queues to implement path traversal, and has the basis for asynchronous parallel computing, thereby achieving the effect of accelerating multi-factor path calculation. It can be applied to larger-scale networks or more multi-factor scenarios, and quickly calculates the multi-factor optimal path for the services in the network, thereby improving service quality and network service capabilities.
[0091] In an exemplary embodiment, the search process and the update process run asynchronously in parallel.
[0092] Specifically, the present application adopts a dual queue structure to store the path of the path calculation process, and uses the search process and the update process to asynchronously and in parallel realize efficient path traversal.
[0093] Among them, the search process can take out the pre-selected path from the search queue and perform search operations based on the reference path set (such as determining whether it is dominated and performing path expansion), and then the search process can put the pre-selected path (i.e., candidate path) that has undergone the search operation into the update queue. At the same time, the update process can take out the candidate path from the update queue to update the reference path set. Multiple processes work asynchronously and in parallel, and the paths in the traversal process continue to enter and exit the queue until the search queue and update queue are empty, the program stops, and the optimal path set of the target destination is output, realizing the function of asynchronous multi-process to speed up the calculation of the path.
[0094] In an exemplary embodiment, taking out a pre-selected path from a search queue and assigning the pre-selected path to a search process may include:
[0095] The search scheduling process takes the pre-selected path from the search queue and assigns the pre-selected path to the idle search process in the search process pool;
[0096] Taking candidate paths from the update queue and assigning the candidate paths to the update process may include:
[0097] The update scheduling process takes the candidate paths from the update queue and assigns the candidate paths to the idle update processes in the update process pool.
[0098] Specifically, during the search process, the search scheduling process can take out a pre-selected path from the search queue and assign the pre-selected path to any idle search process in the search process pool. Exemplarily, when the search scheduling process takes out the pre-selected path from the search queue, it can be determined whether there is an idle search process in the search process pool (i.e., the current state of the process is obtained). When it is determined that there is an idle search process in the search process pool, the idle search process can be used to perform a search operation on the pre-selected path.
[0099] During the update process, the update scheduling process can take out a candidate path from the update queue and assign the candidate path to any idle update process in the update process pool. Exemplarily, when the update scheduling process takes out the candidate path from the update queue, it can determine whether there is an idle update process in the update process pool (i.e., obtain the current state of the process). When it is determined that there is an idle update process in the update process pool, the idle update process can be used to perform an update operation on the candidate path.
[0100] The above is an asynchronous multi-process architecture built based on the search and update decoupling solution. After decoupling, the search and update processes can be regarded as two independent tasks, and these two types of tasks provide data to each other and are connected to each other through the update queue and the search queue. Among them, the search task and the update task can be completed horizontally using the process pool. These processes are parallel and asynchronous, and they work together to accelerate the calculation of the path.
[0101] In one embodiment, multiple search processes in the search process pool run in parallel, and multiple update processes in the update process pool run in parallel.
[0102] Specifically, during the search process, the search scheduling process can continuously take out the pre-selected path from the search queue, and multiple search processes can perform the above search operation in parallel. During the update process, the update scheduling process can continuously take out the candidate path from the update queue, and multiple update processes can perform the above update operation in parallel.
[0103] The search scheduling process and the update scheduling process continuously call multiple processes from their respective process pools (search process pool, update process pool) in parallel to take out paths from the search queue and update queue for processing, and continuously repeat the above search operations and update operations. Paths continuously enter the search queue and update queue and are dequeued from these queues. When the search queue and update queue are empty, the operation ends, the path traversal is completed, and the target path to the target destination (such as the Pareto optimal path) can be output.
[0104] As described above, the present application utilizes multiple processes to process the paths in the two queues, thereby realizing asynchronous parallel calculation of multi-factor optimal paths and parallel accelerated calculation of multi-factor optimal paths.
[0105] In one embodiment, the method may further include:
[0106] Using the search process to read the reference path set from the shared variable;
[0107] The reference path set after the update operation is written into the shared variable by the update process.
[0108] Specifically, a shared variable may refer to a variable that multiple processes need to access; illustratively, a shared variable may also be a variable that multiple processes need to access or modify. The present application embodiment proposes using a shared variable to store a reference path set (e.g., a Pareto optimal path set of each node), wherein using an update process to write the reference path set after the update operation into the shared variable can be understood as updating the shared variable.
[0109] The present application stores the Pareto optimal path set of each node based on shared variables. In the search process, only shared variables are read. In the update process, shared variables can be updated. The use of shared variables to store the Pareto optimal path set of each node makes it possible to calculate the multi-factor optimal path of asynchronous multi-processes, thereby achieving accelerated processing. Furthermore, the embodiment of the present application is based on a dual queue structure, which decouples path expansion (search) from updating shared variables (update) during path traversal; at the same time, multi-processes are used to process the paths in the two queues and update shared variables to achieve asynchronous parallel calculation of multi-factor optimal paths, and multi-core computing resources can be used to share the calculation amount among multiple processes, thereby accelerating path calculation. Among them, a dual queue structure is used to store the path of the path calculation process and shared variables are used to store the Pareto optimal path set of each node, and the search process and the update process are used to asynchronously and parallelly achieve efficient path traversal.
[0110] In one embodiment, the reference path set may include a first Pareto optimal path set corresponding to the end nodes of the path, and a second Pareto optimal path set corresponding to the target end point.
[0111] Specifically, the shared variable can be used to store a reference path set, and the reference path set can include the Pareto optimal path set of each node; illustratively, the reference path set can include a first Pareto optimal path set corresponding to the end node of the path, and a second Pareto optimal path set corresponding to the target end point, that is, the Pareto optimal path set of each node in the shared variable includes the Pareto optimal path set of the target end point, and the Pareto optimal path set of each other node except the target end point. It can be understood that the first Pareto optimal path set can be called the Pareto optimal path set of each corresponding node, and the second Pareto optimal path set can be called the Pareto optimal path set of the target end point.
[0112] It should be noted that the first Pareto optimal path set and the second Pareto optimal path set are only used to distinguish similar objects. When the end node of the corresponding path is the target end point, the first Pareto optimal path set and the second Pareto optimal path set are the same, that is, the first Pareto optimal path set and the second Pareto optimal path set are the same path set.
[0113] In practical applications, based on the embodiments of the present application, shared variables can be used to store the Pareto optimal path set of each node, and two queues can be used to store the intermediate paths in the path traversal process to achieve the decoupling of path expansion (search) and updating shared variables (update). Multi-processes are used to process the paths in the two queues to achieve asynchronous parallel calculation of multi-factor optimal paths.
[0114] The pre-selected paths are path 1 to path P (P is a positive integer), the candidate paths are path P+1 to path Q (Q is a positive integer), the search processes in the search process pool are process 1 to process N (N is a positive integer), the update processes in the update process pool are process 1 to process M (M is a positive integer), and the reference path set in the shared variable includes the Pareto optimal path set of the target end point and the Pareto optimal path set of other nodes. For example, the other nodes are nodes 1 to J (J is a positive integer), such as Figure 3 As shown, processes 1, 2, ..., N can process the paths in the queue in parallel, processes 1, 2, ..., N can read shared variables and process paths in parallel, and processes 1, 2, ...M can process paths in parallel and update shared variables. Multiple processes work asynchronously and in parallel, and the paths in the traversal process are continuously queued and dequeued until the search queue and update queue are empty, the program stops, and the optimal path set of the target destination is output. Among them, shared variables are used to store the optimal path set of each node, and two process pools are used to search and update the corresponding path queues and related shared variables respectively, realizing the function of asynchronous multi-process to speed up path calculation.
[0115] The present application can make full use of the efficient multi-factor path calculation of the multi-core performance of the processor, make many improvements on the basis of the multi-factor path calculation, use shared variables to store the Pareto optimal path set of each node, and divide the path traversal expansion search based on a single queue into two queues, one queue is responsible for path expansion, and the other queue is responsible for updating related shared variables, and build an asynchronous architecture to make full use of the computer's multi-core computing resources to realize multiple processes working simultaneously, thereby achieving the effect of accelerating the multi-factor path calculation.
[0116] In some embodiments, the updating operation of the reference path set based on the candidate path through the updating process in step 204 may include:
[0117] An update process is adopted to update the first Pareto optimal path set based on the candidate path, and the first Pareto optimal path set after the update operation is written into the shared variable.
[0118] Specifically, updating the reference path set may refer to updating the first Pareto optimal path set based on the candidate path, that is, updating the Pareto optimal path set of the end node of the path, which can also be understood as updating the Pareto optimal path set of each node. Further, the update process may write the first Pareto optimal path set after the update operation into a shared variable to update the shared variable.
[0119] In an exemplary embodiment, Figure 4As shown, the updating process is used to update the first Pareto optimal path set based on the candidate path, which may include steps 302 to 306. Among them:
[0120] Step 302, determining the end node of the candidate path, and reading the first Pareto optimal path set corresponding to the end node of the candidate path from the shared variable;
[0121] Specifically, the update process can determine the end node of the candidate path, and then obtain the first Pareto optimal path set corresponding to the end node of the candidate path, for example, read the Pareto optimal path set of the end node of the candidate path from the shared variable.
[0122] Step 304 , compare the candidate path with the path traversal in the first Pareto optimal path set corresponding to the terminal node of the candidate path to obtain a comparison result.
[0123] Specifically, the candidate path can be compared with the path traversal in the first Pareto optimal path set corresponding to the terminal node of the candidate path to obtain a comparison result. The update process can compare the candidate path with the Pareto optimal path set of the terminal node of the candidate path in the shared variable, and determine whether some paths in the path set are dominated by the candidate path during the traversal process.
[0124] Step 306, adding the candidate path to the first Pareto optimal path set of the end node corresponding to the candidate path, and deleting the path dominated by the candidate path in the first Pareto optimal path set of the end node corresponding to the candidate path according to the comparison result, to obtain the first Pareto optimal path set after the update operation; wherein, the paths in the first Pareto optimal path set after the update operation do not dominate each other.
[0125] Specifically, the update process may add the candidate path to the Pareto optimal path set of the terminal node of the candidate path and traverse the path set. During the traversal process, if some paths in the path set are dominated by the path, these paths may be deleted.
[0126] Among them, the paths in the first Pareto optimal path set after the update operation do not dominate each other, which can mean that the paths dominated by the candidate path are eliminated during the traversal process to ensure that the paths in the Pareto optimal path set of the node are still not dominated by each other. Further, it can be determined whether the end node of the candidate path is the target end point. If not, the path is put into the search queue, otherwise the process is stopped and released.
[0127] In the above, multiple processes in the update process pool can take out paths (i.e., candidate paths) from the update queue, compare them with the Pareto optimal path set of the end node of the path in the shared variable, and update the Pareto optimal path set of the end node of the path (add the path to the Pareto optimal path set of the end node of the path, and some paths in this path set may be dominated by the path and need to be deleted). If the end node of the path is not the target end point, the path can be put into the search queue.
[0128] In an exemplary embodiment, Figure 5 As shown, in step 202, the search process searches the pre-selected path based on the reference path set to obtain the candidate path, and puts the candidate path into the update queue, which may include steps 402 to 412. Among them:
[0129] Step 402, determine the end node of the pre-selected path, and read the first Pareto optimal path set corresponding to the end node of the pre-selected path from the shared variable.
[0130] Specifically, the search process can calculate all factor values of the preselected path and determine the end node of the preselected path, and then obtain the first Pareto optimal path set corresponding to the end node of the preselected path, for example, read the Pareto optimal path set of the end node of the preselected path from the shared variable.
[0131] The calculation of the factor value depends on the factors provided in the network topology or the factors preset to participate in the calculation. Taking the three factors of bandwidth, delay and cost in the network topology as an example, calculating the factor value may refer to calculating these three factors. It can be understood that the embodiments of the present application are suitable for any type of factors, including but not limited to additive factors, bottleneck (concave) factors and multiplicative factors.
[0132] Step 404 , traverse and compare the pre-selected path with the paths in the first Pareto optimal path set and the paths in the second Pareto optimal path set corresponding to the end nodes of the pre-selected path, respectively, to obtain a first comparison result.
[0133] Specifically, the search process can also read the second Pareto optimal path set (i.e., the Pareto optimal path set of the target endpoint) from the shared variable, traverse the Pareto optimal path set of the end node of the pre-selected path and the Pareto optimal path set of the target endpoint, and determine whether the pre-selected path is dominated by any path in these path sets. If so, the search process can prune the pre-selected path based on the Pareto optimal constraint, for example, discard the pre-selected path and release the search process.
[0134] Step 406: If the first comparison result is that there is no path dominating the pre-selected path, the pre-selected path is extended based on the network topology information to obtain an extended path.
[0135] Specifically, the search process determines whether the pre-selected path is dominated by any path in the path set, and if not, the pre-selected path can be extended based on the network topology information to obtain an extended path. The network topology information can be used to characterize the topological connection relationship.
[0136] Regarding network topology information, taking the example of calculating the multi-factor optimal path with a Pareto optimal path, which refers to a starting point and an end point in the network topology, network topology information can refer to the connection relationship between network nodes and the status of the links between network nodes. For example, if there is a connection from node A to node B, the corresponding link AB can have indicators such as bandwidth 1000Gbps, latency 5ms, reliability 99.999%, and cost 0.1 (normalized cost). It can be understood that a path is composed of multiple links, and the factors of each link that constitutes the path are needed to calculate the path factor.
[0137] In some embodiments, the extended path may include nodes connected to the end nodes of the pre-selected path.
[0138] Specifically, the present application can expand the current pre-selected path based on the topological connection relationship, add the nodes connected to the end nodes of the pre-selected path to the current pre-selected path, and determine the expanded path (new path).
[0139] Optionally, the extended path may be obtained based on a breadth-first search. For example, if multiple nodes are connected to the end node of the current pre-selected path, multiple new paths (extended paths) may be formed based on a breadth-first search.
[0140] Step 408, determine the end node of the extended path, and read the first Pareto optimal path set corresponding to the end node of the extended path from the shared variable.
[0141] Specifically, when an extended path is obtained, the search process can calculate all factor values of the extended path, determine the end node of the extended path, and read the Pareto optimal path set corresponding to the end node of the extended path and the Pareto optimal path set of the target end point from the shared variable.
[0142] Step 410, traversing and comparing the extended path with the paths in the first Pareto optimal path set and the paths in the second Pareto optimal path set of the end nodes corresponding to the extended path, to obtain a second comparison result.
[0143] Specifically, the search process traverses the Pareto optimal path set of the end node of the extended path and the Pareto optimal path set of the target end point to determine whether the extended path is dominated by any path in these path sets. If so, the extended path is discarded and the search process is released (i.e., pruning is performed again based on the Pareto optimal constraint).
[0144] Step 412: If the second comparison result is that there is no path dominating the extended path, the extended path is put into the update queue as a candidate path.
[0145] Specifically, the search process may traverse the Pareto optimal path set of the end node of the extended path and the Pareto optimal path set of the target end point to determine whether the extended path is dominated by any path in these path sets, and if not, put the extended path into the update queue.
[0146] As mentioned above, starting from the starting point, the pre-selected path can be expanded and entered into the search queue. Multiple search processes in the search process pool take the pre-selected path from the search queue and compare it with the optimal path set of the target end point and the end node (the last node) of the pre-selected path in the shared variable (to determine whether it is dominated). If it is not dominated, the search process will expand the pre-selected path and put it into the update queue, otherwise it will prune the path (discard the path and no longer expand it).
[0147] In the search process of the embodiment of the present application, the search scheduling process takes out a path (i.e., the pre-selected path, also referred to as the current path) from the search queue and assigns it to any idle search process. After the search process obtains the path from the search scheduling process, it calculates all factor values of the path, reads the end node of the path and the Pareto optimal path set of the target end point from the shared variable, traverses these path sets, and determines whether the path is dominated by any path in these path sets. If so, the new path is discarded and the process is released (i.e., based on Pareto optimal constraint pruning). Otherwise, the current path is expanded based on the topological connection relationship, and the nodes connected to the end node of the current path are added to the current path to determine the new path (i.e., the extended path). Among them, if there are multiple nodes connected to the end node of the current path, multiple new paths are formed (breadth-first search). Calculate all factor values of these new paths, and read the end nodes of the new paths and the Pareto optimal path set of the target endpoint from the shared variables again, traverse these path sets, and determine whether the new path is dominated by any path in these path sets. If so, discard the new path and release the process (that is, prune based on the Pareto optimal constraint again), otherwise put the new path into the update queue.
[0148] In order to further illustrate the solution of the present application, a specific example is given below. Taking the initial path as a path containing only the starting point and the Pareto optimal path set of all nodes as an empty set as an example, Figure 6 In the undirected graph shown, Figure 6 The factor values in the box represent bandwidth (Mbps), delay (ms), and cost (normalized) respectively. Bandwidth is a bottleneck factor, and delay and cost are additive factors. You can specify the starting point A and the end point E (i.e. the target end point) to find the Pareto optimal path set from A to E. Set up two search processes and two update processes.
[0149] First, initialize the search queue, add the initial path [A] to the search queue, add the initial path [A] to the Pareto optimal path set corresponding to A, and record the path factor value [+∞, 0, 0] (the factor value of the [A] path, the bottleneck factor is initialized to +∞, and the additive factor is initialized to 0). At this time, since the search queue is not empty, the search scheduling process schedules any idle process, set it as search process 1, and starts working. Search process 1 obtains the path [A] that is dequeued from the search queue and performs the following search operations:
[0150] Step 1: Since the Pareto optimal path set of the end point E is empty at this moment, [A] is not dominated by the Pareto optimal path set of the end point E. At the same time, path [A] is in the temporary Pareto optimal path set with A as the terminal node. Both conditions are met, and step 2 is continued.
[0151] Step 2, traverse A's neighbor nodes B and C (that is, if A has two connected nodes, two new paths [A, B] and [A, C] can be added), and then execute step 3. When the traversal is completed, the search process 1 ends;
[0152] Step 3, (this step takes traversal B as an example, and traversal C is the same) B is not in the current path, and a link (A, B) is added to the end of the previous path to expand the current path (the following step is called the extended path). The extended path is [A, B]. And according to the factor value [+∞, 0, 0] corresponding to the current path [A] and the attributes of the link (A, B) in the topology (i.e., each factor), the factor value of the extended path is calculated to be [1000, 5, 0.5]. Then proceed to step 4.
[0153] Step 4, read the Pareto optimal path set of the end point and node B in the shared variable, and compare it with the extended path. Since the Pareto optimal path set of the end point is still empty, whether the path [A, B] is not dominated by the Pareto optimal path set of the end point E. And the Pareto optimal path set with B as the end node is empty, [A, B] is also not dominated by it. If both are satisfied, add the extended path [A, B] to the update queue.
[0154] Similarly, the path [A, C] will also be added to the update queue. Search process 1 completes this operation and waits for the searched scheduling process to be assigned a new path, and then processes the new path.
[0155] Since the update queue is not empty at this time, the update scheduling process schedules any idle update process. Suppose update process 1 obtains the path [A, B] from the update queue and performs the following update operations:
[0156] Step ①, compare [A, B] with the Pareto optimal path set of node B in the shared variable, add [A, B] to this path set, and determine whether the path dominates some paths in the path set. During the traversal process, remove the paths dominated by [A, B] to ensure that the paths in the Pareto optimal path set of the node are still not dominated by each other, thereby updating the Pareto optimal path set of node B (writing to the shared variable). Since the Pareto optimal path set of B is empty at this moment, the updated Pareto optimal path set is [A, B].
[0157] Step ②, B is not the end point, the path [A, B] is added to the search queue, the update process 1 is finished with this operation, and waits for the updated scheduling process to assign a new path before continuing processing.
[0158] Similarly, update process 2 adds the path [A, C] to the search queue. Update process 2 completes the operation and waits for the updated scheduling process to assign a new path before continuing processing.
[0159] At this point, a cycle is completed. At this point, there are two paths in the search queue [A, B] and [A, C]. The search scheduling process can continue to schedule search process 1 to process [A, B], and search process 2 to process [A, C]. Similar to the search operation steps 1 to 4 above, the shared variables are read during the processing, and the paths are processed, and the paths are pruned or the expanded new paths are placed in the update queue. Similarly, similar to the update operation steps ① and ② above, the update scheduling process continues to schedule update processes 1 and 2 to continue to take out paths from the update queue, update shared variables, and decide whether to put the paths into the search queue.
[0160] The search process and update process continue to process the path, and the above search operation steps and update steps are repeated continuously. The path continues to enter the search queue and update queue and exit the queue. When the search queue and update queue are empty, there is no path waiting to be expanded, and the path traversal ends. The final output is the Pareto optimal path set {['A', 'C', 'E']: 500,6,0.6;['A', 'B', 'E']: 1000,10,0.6} with the end point E node in the shared variable.
[0161] It should be noted that, since it is an initial path, and the initial path [A] has only one node A, that is, at this time, the path [A] has only one point A, so the end node of the path [A] is A, and for the path [A, B], the end node of the path [A, B] is B. Among them, the end node of the initial path [A] is A, and the target end point is E. In this application, the path with xx as the end node can refer to the path from the starting point to the node xx.
[0162] In addition, in the embodiment of the present application, each node maintains a Pareto optimal path set about the node (it is in a temporary state before the program stops running, because it may change constantly, and the shared variable may be modified during the update process). The Pareto optimal path set of the node is initially an empty set, and the optimal path can be added to the Pareto optimal path set during the update process.
[0163] In the above, in the multi-factor path calculation scenario, a dual queue structure is used to decouple the path expansion search and the update of shared variables (Pareto optimal path set). In the multi-factor path calculation scenario, the embodiment of the present application decouples the path expansion search and the update of shared variables, and uses two queues to implement path traversal, which has the basis of asynchronous parallel computing, so that multi-core computing resources can be used to realize multi-process sharing of some computing loads in the path calculation process.
[0164] Based on the decoupling of search and update, an asynchronous multi-process architecture is built. After decoupling, the search and update processes can be regarded as two independent tasks, and these two types of tasks provide data to each other and are connected to each other through the update queue and the search queue. Among them, the search task and the update task can be horizontally expanded using the process pool. These processes are parallel and asynchronous, and they collaborate to complete the acceleration.
[0165] In addition, the Pareto optimal path set of each node is stored based on shared variables. In the path search process, only the shared variables are read. In the path update process, the shared variables can be updated. Using shared variables to store the Pareto optimal path set of each node makes it possible to calculate the multi-factor optimal path of asynchronous multi-process and achieve accelerated processing.
[0166] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0167] Based on the same inventive concept, the embodiment of the present application also provides a path determination device for implementing the path determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more path determination device embodiments provided below can refer to the limitations of the path determination method above, and will not be repeated here.
[0168] In an exemplary embodiment, Figure 7 As shown, a path determination device is provided, comprising:
[0169] Search module 901, used to take out a pre-selected path from the search queue and assign the pre-selected path to the search process; obtain a candidate path by performing a search operation on the pre-selected path based on the reference path set through the search process, and put the candidate path into the update queue;
[0170] The updating module 902 is used to take out the candidate paths from the updating queue and assign the candidate paths to the updating process; update the reference path set based on the candidate paths through the updating process, and put the candidate paths whose end nodes are not the target end points into the search queue as pre-selected paths;
[0171] The path output module 903 is used to determine that the path traversal is completed when the search queue and the update queue are empty, and output the target path of the target destination.
[0172] In one embodiment, the search process and the update process run asynchronously in parallel.
[0173] In one embodiment, the search module 901 includes:
[0174] A search scheduling module, used to take out a pre-selected path from a search queue through a search scheduling process, and assign the pre-selected path to an idle search process in a search process pool;
[0175] The update module 902 includes:
[0176] The update scheduling module is used to take out candidate paths from the update queue through the update scheduling process and allocate the candidate paths to idle update processes in the update process pool.
[0177] In one of the embodiments, multiple search processes in the search process pool run in parallel, and multiple update processes in the update process pool run in parallel.
[0178] In one embodiment, the device further comprises:
[0179] A reading module, used for reading a reference path set from a shared variable using a search process;
[0180] The writing module is used for writing the reference path set after the update operation into the shared variable by utilizing the update process.
[0181] In one embodiment, the reference path set includes a first Pareto optimal path set corresponding to the end nodes of the path, and a second Pareto optimal path set corresponding to the target destination.
[0182] In one embodiment, the update module 902 includes:
[0183] The update operation module is used to perform an update operation on the first Pareto optimal path set based on the candidate path by adopting an update process, and write the first Pareto optimal path set after the update operation into a shared variable.
[0184] In one embodiment, an update operation module is used to determine the end node of a candidate path, read out a first Pareto optimal path set corresponding to the end node of the candidate path from a shared variable; compare the candidate path with the path traversal in the first Pareto optimal path set corresponding to the end node of the candidate path to obtain a comparison result; add the candidate path to the first Pareto optimal path set corresponding to the end node of the candidate path, and delete the path dominated by the candidate path in the first Pareto optimal path set corresponding to the end node of the candidate path according to the comparison result, to obtain the first Pareto optimal path set after the update operation; wherein, the paths in the first Pareto optimal path set after the update operation do not dominate each other.
[0185] In one embodiment, the search module 901 includes:
[0186] A first terminal determination module, used to determine the terminal node of the pre-selected path, and read the first Pareto optimal path set corresponding to the terminal node of the pre-selected path from the shared variable;
[0187] A first comparison module is used to compare the pre-selected path with the paths in the first Pareto optimal path set and the paths in the second Pareto optimal path set corresponding to the end nodes of the pre-selected path, respectively, to obtain a first comparison result;
[0188] A path extension module, configured to extend the pre-selected path based on the network topology information to obtain an extended path if the first comparison result shows that there is no path dominating the pre-selected path;
[0189] A second terminal determination module determines the terminal node of the extended path and reads the first Pareto optimal path set corresponding to the terminal node of the extended path from the shared variable;
[0190] A second comparison module is used to compare the extended path with the paths in the first Pareto optimal path set and the paths in the second Pareto optimal path set of the end nodes of the corresponding extended path, respectively, to obtain a second comparison result;
[0191] The extension determination module is configured to put the extended path into an update queue as a candidate path if the second comparison result shows that there is no path dominating the extended path.
[0192] In one embodiment, the extended path includes a node connected to an end node of the preselected path.
[0193] Each module in the above-mentioned path determination device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0194] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a path set. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a path determination method is implemented.
[0195] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0196] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0197] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0198] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0199] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0200] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0201] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A path determination method, characterized in that: The method comprises: Taking out a pre-selected path from the search queue and assigning the pre-selected path to the search process; obtaining a candidate path by the search process performing a search operation on the pre-selected path based on a reference path set, and placing the candidate path into an update queue; Taking the candidate path from the update queue and assigning the candidate path to an update process; performing an update operation on the reference path set based on the candidate path through the update process, and placing the candidate path whose end node is not a target destination as the pre-selected path into the search queue; When the search queue and the update queue are empty, it is determined that the path traversal is completed, and the target path of the target destination is output.
2. The method according to claim 1, characterized in that The search process and the update process run asynchronously and in parallel.
3. The method according to claim 1, characterized in that The taking out a pre-selected path from the search queue and assigning the pre-selected path to the search process comprises: Taking out the pre-selected path from the search queue through a search scheduling process, and assigning the pre-selected path to the idle search process in the search process pool; The taking out the candidate path from the update queue and assigning the candidate path to the update process comprises: The candidate paths are taken out from the update queue through an update scheduling process, and the candidate paths are allocated to the idle update processes in an update process pool.
4. The method according to claim 3, characterized in that The multiple search processes in the search process pool run in parallel, and the multiple update processes in the update process pool run in parallel.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Using the search process to read the reference path set from a shared variable; The reference path set after the update operation is written into the shared variable by utilizing the update process.
6. The method according to claim 5, characterized in that The reference path set includes a first Pareto optimal path set corresponding to the end nodes of the path, and a second Pareto optimal path set corresponding to the target end point.
7. The method according to claim 6, characterized in that The updating operation of updating the reference path set based on the candidate path through the updating process includes: The update process is used to perform an update operation on the first Pareto optimal path set based on the candidate path, and the first Pareto optimal path set after the update operation is written into the shared variable.
8. The method according to claim 7, characterized in that The updating operation of updating the first Pareto optimal path set based on the candidate path by using the update process includes: Determine the end node of the candidate path, and read the first Pareto optimal path set corresponding to the end node of the candidate path from the shared variable; Compare the candidate path with the path traversal in the first Pareto optimal path set corresponding to the end node of the candidate path to obtain a comparison result; The candidate path is added to the first Pareto optimal path set corresponding to the end node of the candidate path, and the path dominated by the candidate path in the first Pareto optimal path set corresponding to the end node of the candidate path is deleted according to the comparison result, so as to obtain the first Pareto optimal path set after the update operation; wherein, the paths in the first Pareto optimal path set after the update operation do not dominate each other.
9. The method according to claim 6, characterized in that The step of searching the pre-selected path based on the reference path set by the search process to obtain a candidate path, and placing the candidate path into an update queue includes: Determine the end node of the preselected path, and read the first Pareto optimal path set corresponding to the end node of the preselected path from the shared variable; Traversing and comparing the pre-selected path with the paths in the first Pareto optimal path set and the paths in the second Pareto optimal path set corresponding to the end nodes of the pre-selected path, respectively, to obtain a first comparison result; If the first comparison result is that there is no path dominating the pre-selected path, the pre-selected path is extended based on the network topology information to obtain an extended path; Determine the end node of the extended path, and read the first Pareto optimal path set corresponding to the end node of the extended path from the shared variable; Traversing and comparing the extended path with the paths in the first Pareto optimal path set and the paths in the second Pareto optimal path set corresponding to the end nodes of the extended path, respectively, to obtain a second comparison result; If the second comparison result is that there is no path dominating the extended path, the extended path is put into the update queue as the candidate path.
10. The method according to claim 9, characterized in that The extended path includes nodes connected to the end nodes of the pre-selected path.
11. A path determination device, characterized in that: The device comprises: A search module, configured to take out a pre-selected path from a search queue and assign the pre-selected path to a search process; obtain a candidate path by performing a search operation on the pre-selected path based on a reference path set by the search process, and put the candidate path into an update queue; An update module, configured to take out the candidate path from the update queue and assign the candidate path to an update process; perform an update operation on the reference path set based on the candidate path through the update process, and put the candidate path whose end node is not a target end point into the search queue as the pre-selected path; The path output module is used to determine that the path traversal is completed when the search queue and the update queue are empty, and output the target path of the target destination.
12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
