Method, electronic device, and storage medium for path search
By constructing a guiding path to direct the path search direction, the problem of repeated and invalid searches in the Distes Tesla algorithm is solved, achieving a more efficient and accurate path search.
Patent Information
- Application Number
- CN202010943576.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-09
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2040-09-09
AI Technical Summary
The Distes-Tesla algorithm may fail to meet certain constraints in path search, leading to repeated and invalid searches, which reduces the efficiency and accuracy of path search.
By constructing a network structure graph, setting guiding nodes and generating guiding paths to indicate the direction of path search, and reducing repeated searches in invalid directions, the target path is generated by combining the advantages of the Dijkstra algorithm.
It improves the accuracy and efficiency of path search, reduces resource waste, and ensures that path search meets specific constraints.
Smart Images

Figure CN114239192B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the computer field, and in particular, to a path search method, electronic device and storage medium. BACKGROUND
[0002] With the development of network technology, especially the advent of 5G technology, the complexity of the network has increased dramatically, and the structure of the network is becoming more and more complex, and the path search is also becoming more and more complex. For example, in network service transmission, the searched path needs to not only ensure the transmissibility of local services, but also ensure the transmissibility of all network services. With the increase of network traffic and the increase of special requirements such as the increase of mandatory constraints, the difficulty of path search is increased. Currently, Dijkstra algorithm is used to find a transmissible path for all services. The search feature of Dijkstra algorithm is to expand outward from the starting point until the end point is reached.
[0003] However, the path returned by the Dijkstra algorithm may not meet other constraint conditions, such as not including a specific node; and the paths returned piece by piece may be concentrated in an invalid direction, resulting in repeated invalid searches and reducing the search efficiency and accuracy of the path search. SUMMARY
[0004] The main purpose of the embodiments of the present application is to provide a path search method, electronic device and storage medium, which can improve the speed and accuracy of path search.
[0005] To achieve the above purpose, the embodiments of the present application provide a path search method, comprising: constructing a first network structure diagram according to network information of a network to be searched; obtaining a guide node of the first network structure diagram; generating a guide path according to the guide node, the guide path being used to indicate the direction of path search; and generating a target path of the first network structure diagram according to the guide path.
[0006] To achieve the above purpose, the embodiments of the present application also provide an electronic device, comprising: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the path search method described above.
[0007] To achieve the above purpose, the embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the path search method described above.
[0008] The path search method provided in the application constructs a first network structure diagram according to network information of a network to be searched, generates a guide path by setting a guide node, the guide path can indicate the direction of path search, so that the direction of path search can be corrected, repeated search in invalid directions is reduced, the accuracy of search is improved, meanwhile, since repeated search in invalid directions is not needed, the speed of search is improved, the efficiency of search is improved, and the waste of search resources is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0009] Figure 1 is a flow chart of the path search method provided in the first embodiment of the application;
[0010] Figure 2 is a flow chart of the path search method provided in the second embodiment of the application;
[0011] Figure 3 is a schematic diagram of a first network structure diagram in the path search method provided in the second embodiment of the application;
[0012] Figure 4 is a structural block diagram of the network to be searched provided in the second embodiment of the application;
[0013] Figure 5 is a flow chart of the path search method provided in the third embodiment of the application;
[0014] Figure 6 is a structural block diagram of the electronic device provided in the fourth embodiment of the application. DETAILED DESCRIPTION
[0015] To make the objectives, technical solutions and advantages of the embodiments of the application clearer, the embodiments of the application will be described in detail below with reference to the drawings. However, those skilled in the art can understand that, in the embodiments of the application, many technical details are provided to make the readers better understand the application. However, the technical solutions claimed by the application can be implemented even without these technical details and based on various changes and modifications of the following embodiments. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the application, and the embodiments can be combined and referenced with each other on the premise of no contradiction.
[0016] The first implementation of the application relates to a path search method, and a flow thereof is shown in Figure 1
[0017] Step 101: constructing a first network structure diagram according to network information of a network to be searched.
[0018] Step 102: acquiring a guide node of the first network structure diagram.
[0019] Step 103: generating a guide path according to the guide node, the guide path being used to indicate the direction of path searching.
[0020] Step 104: generating a target path of the first network structure diagram according to the guide path.
[0021] The path searching method provided in the application constructs a first network structure diagram according to network information of a network to be searched, generates a guide path by setting a guide node, the guide path can indicate the direction of path searching, so that the direction of path searching can be corrected, repeated searching in invalid directions is reduced, the accuracy of searching is improved, the speed of searching is improved due to the fact that repeated searching in invalid directions is not needed, the efficiency of searching is improved, and the waste of searching resources is reduced.
[0022] The second embodiment of the application relates to a path searching method, which is applied to an electronic device, such as a server or the like, or is deployed on a server side. The second embodiment is a specific description of steps 101-104 in the first embodiment, and the flow is specifically as shown in Figure 2
[0023] Step 201: constructing a first network structure diagram according to network information of a network to be searched.
[0024] Specifically, the network to be searched can be a data transmission network in actual application, can also be a scheduling network, and the like. The path searching method is introduced by taking the transmission network as an example in the application. The station information of each station in the network to be searched and the connection information of stations are acquired, each station is taken as a node, and each station information is taken as node information of the corresponding node; the connection information between stations is taken as edges between nodes, and the station information can include transmission rate, bandwidth, position information, and the like. The first network structure diagram is composed according to the nodes, the node information, and the edges.
[0025] Step 202: acquiring a guide node of the first network structure diagram.
[0026] There are various ways to acquire the guide node, for example, a randomly acquired node is taken as the guide node; or a node corresponding to a specified label is acquired as the guide node.
[0027] Specifically, a node can be randomly selected from the first network structure diagram as the guide node. The guide node can also be acquired by a user. The node information further includes label information of the node, the label information being used to indicate the attribute of the node, for example, the label information A can be used to indicate that the node corresponding to the label information A is a regular node, and the label information B can be used to indicate that the node corresponding to the label information B is a necessary node; the specified label can be the label information used to indicate that the node belongs to the necessary node.
[0028] In another example, a pre-specified geographic area can also be acquired, and a node in the specified geographic area is searched, and any selected node in the specified geographic area is taken as a guide node. For example, if the specified area is X, a node in the X area can be randomly selected as a guide node.
[0029] A specified direction can also be acquired, and a node belonging to the specified direction can be randomly acquired as a guide node.
[0030] In another example, a node directly connected to the starting node can also be acquired as a direct node; and a guide node is acquired from a node other than the direct node.
[0031] Specifically, a node directly connected to the starting node is acquired as a direct node. For example, as shown in FIG. 5, the starting node is node A, and the nodes directly connected to node A are node B, node C, and node D. Then, node B, node C, and node D are taken as direct nodes, and the remaining nodes are node E and node F. Then, one of node E and node F can be selected as a guide node. The selection manner can use the above-mentioned random selection manner, or can be acquired according to a specified label. Figure 3
[0032] Step 203: Acquire a starting node and a target node of path search.
[0033] The starting node and the target node of path search can be determined according to a received search task, and the search task can be sent by other terminals or the current network.
[0034] Step 204: Search a first path between the starting node and the guide node, and search a second path between the target node and the guide node.
[0035] Specifically, Dijkstra algorithm can be used to search a first path between the starting node and the guide node, and search a second path between the target node and the guide node. For example, the starting node is denoted as np, the target node is denoted as nq, and the guide node is denoted as nk. Then, Dijkstra algorithm is used to search all paths between np and nk in the first network structure diagram, and the searched path is taken as the first path. Similarly, Dijkstra algorithm is used to search all paths between nq and nk in the first network structure diagram, and the searched path is taken as the second path. That is, in the example, the first path can include one path from the starting node to the guide node, or can include two or more paths from the starting node to the guide node. The second path includes one path from the target node to the guide node, or can include two or more paths from the target node to the guide node.
[0036] Step 205: According to the preset strategy, a guide path is obtained from the first path and the second path.
[0037] In one example, the preset strategy includes selecting a path with the least number of nodes. For example, if the preset strategy is to select a path with the least number of nodes; the starting node is denoted as np, the target node is denoted as nq, and the guide node is denoted as nk; the first path includes p1, p2, and p3; the second path includes p4, p5, and p6; according to the preset strategy, a path with the least number of nodes is selected from the first path, denoted as P1, and a path with the least number of nodes is selected from the second path, denoted as P2; then, a path with the least number of nodes is selected from P1 and P2 as the guide path, denoted as Pk. Of course, a path with the least number of nodes can be directly selected from p1, p2, p3, p4, p5, and p6 as the guide path.
[0038] In another example, the preset strategy includes selecting a path with the shortest length. For example, if the preset strategy is to select a path with the shortest length; the starting node is denoted as np, the target node is denoted as nq, and the guide node is denoted as nk; the first path includes p1, p2, and p3; the second path includes p4, p5, and p6; according to the preset strategy, a path with the shortest length is selected from the first path, denoted as P1, and a path with the shortest length is selected from the second path, denoted as P2; then, a path with the least number of nodes is selected from P1 and P2 as the guide path, denoted as Pk. Of course, a path with the shortest length can be directly selected from p1, p2, p3, p4, p5, and p6 as the guide path.
[0039] Step 206: Obtain nodes other than the guide node in the guide path as filter nodes.
[0040] Specifically, each node in the guide node is obtained, and nodes other than the guide node are obtained as filter nodes. For example, the guide path Pk includes nodes np, n1, n2, n3, and nk, wherein the guide node is nk, and np, n1, n2, and n3 are all filter nodes.
[0041] Step 207: Delete the filter nodes from the first network structure diagram to generate a second network structure diagram.
[0042] Specifically, the filter nodes can be deleted from the first network structure diagram to generate a second network structure diagram.
[0043] Step 208: Obtain a third path between the guide node and the sink node in the second network structure diagram, and the sink node is the target node or the starting node.
[0044] Specifically, if the guide path is a path between the start node and the guide node, the host node is determined as the target node; if the guide path is a path between the target node and the guide node, the host node is determined as the start node. The third path between the guide node and the host node is searched by using the Dijkstra algorithm. It can be understood that the third path in the second network structure diagram can also be searched by using other search algorithms.
[0045] Step 209: Splicing the guide path and the third path to form a target path of the first network structure diagram.
[0046] Specifically, the guide path and the third path are spliced, and the spliced path is taken as the target path in the first network structure diagram.
[0047] The traditional Dijkstra algorithm searches for a path, which is easy to search in one direction indefinitely and cannot return a path meeting a specific constraint condition within a certain path quantity range. By using the guide node, the search direction can be quickly determined, and the number of searches in invalid directions can be avoided, so that an effective path meeting a special constraint can be quickly searched, and the efficiency of path search is improved. Meanwhile, in the example, the second network structure diagram is regenerated according to the guide path, and the second network structure diagram is searched. In the example, the third path is generated by using the traditional Dijkstra algorithm, and the guide path and the third path are spliced, so that the path search can reduce the search of invalid paths and combine the advantages of the Dijkstra algorithm, and then the target path can be quickly obtained.
[0048] In the example, in order to facilitate the understanding of the application scenario of path search, a specific application scenario is introduced below. For example, the structure of a network design and planning system is as shown in Figure 4 The system mainly includes an engineering module, a network module, a service module, a design module, a planning module, a configuration module and a report module. The engineering module is used to complete the creation of a network, generate a basic engineering network, and the basic engineering network contains sites and optical fibers, and supports the import and export of network engineering; the network module is used to complete the basic configuration of the network, such as the configuration of site device types; the service module is used to complete the creation, import and export of services in the network; the design module is used to complete the design of network transmission links; the planning module is used to complete the planning of service transmission paths and required resources in the network; the configuration module is used to count the resources configured by the service planning in the network; and the report module is used to output the resources configured by the network planning in the form of a report. The path search method in the example can be applied to the planning module in the network design and planning system, and is used to search for a data transmission path, so as to plan a reasonable data transmission path.
[0049] The third embodiment of the present application relates to a path searching method, which is a further improvement of the second embodiment, and mainly improves that before splicing the guide path and the third path to form the target path of the first network structure diagram, the method further comprises judging whether the third path satisfies the constraint condition. The specific process of the third embodiment is shown in Figure 5
[0050] Step 301: constructing a first network structure diagram according to network information of a network to be searched.
[0051] Step 302: obtaining a guide node of the first network structure diagram.
[0052] Step 303: obtaining a starting node and a target node of path searching.
[0053] Step 304: searching a first path between the starting node and the guide node, and searching a second path between the target node and the guide node.
[0054] Step 305: obtaining a guide path from the first path and the second path according to a preset strategy.
[0055] Step 306: obtaining a node in the guide path except the guide node as a filtering node.
[0056] Step 307: deleting the filtering node from the first network structure diagram to generate a second network structure diagram.
[0057] Step 308: obtaining a third path between the guide node and a sink node in the second network structure diagram, the sink node being the target node or the starting node.
[0058] Steps 301 to 308 are substantially the same as steps 201 to 208 in the second embodiment, and will not be described here.
[0059] Step 309: judging whether the third path satisfies a preset constraint condition, if the judging result indicates that the third path satisfies the constraint condition, executing step 310; if the judging result indicates that the third path does not satisfy the constraint condition, returning to step 302.
[0060] Specifically, the preset constraint condition is obtained, for example, each necessary node. If the third path does not satisfy the preset constraint condition, it indicates that the guide path does not play a role in correcting the searched path, and then the step 302 is returned to obtain the guide node again.
[0061] It should be noted that the preset constraints can be updated before determining whether the third path satisfies them. Since the guiding path has already been determined, constraints that the guiding path already satisfies can be deleted from the preset constraints, and the preset constraints can be updated; that is, when searching for paths in the second network structure graph, the new constraints are used for path search. For example, the preset constraints include: passing through nodes A and B. If the guiding path has already passed through node A, then the updated constraints include: passing through node B.
[0062] If the third path has already met the preset constraints, then proceed to step 310.
[0063] Step 310: Connect the guiding path and the third path to form the target path of the first network structure diagram.
[0064] Step 311: If the target path is detected to be a path from the target node to the starting node, reverse the direction of the target path so that the target path is a path from the starting node to the target node.
[0065] Specifically, if the network to be searched has directionality, when the target path is detected as a path from the target node to the starting node, the target path can be reversed so that the target path is a path from the starting node to the target node.
[0066] The path search method in this example verifies the third path before merging the guiding path and the third path, thus ensuring the validity of the third path. If the third path does not meet the preset constraints, it means that the guiding path has not played a role in correcting the search direction. The accuracy of the path search can be improved by re-acquiring the guiding node until the accurate guiding node is obtained.
[0067] The fourth embodiment of the present invention relates to an electronic device, the structural block diagram of which is shown below. Figure 6 As shown, the electronic device includes: at least one processor 401; and a memory 402 communicatively connected to at least one processor 401; wherein the memory 402 stores instructions executable by at least one processor 401, the instructions being executed by at least one processor 401 to enable at least one processor 401 to perform the path search method described above.
[0068] The memory and the processor are connected by a bus, which can include any number of interconnecting buses and bridges, and links the various circuits of the one or more processors and the memory together. The bus can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, and therefore, will not be described any further. A bus interface provides an interface between the bus and a transceiver. The transceiver can be a single device or a plurality of devices such as a plurality of receivers and transmitters, and provides a means for communicating with various other apparatus over a transmission medium. Processed data is transmitted over a wireless medium via an antenna, and further, the antenna receives data and transfers the data to the processor.
[0069] The processor is responsible for managing the bus and general processing, and can also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory can be used for storing data used by the processor while executing operations.
[0070] The fifth embodiment of the present application relates to a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method for fault positioning.
[0071] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiment methods can be completed by programs instructing relevant hardware, and the programs are stored in a storage medium, including a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0072] Those skilled in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
Claims
1. A path search method, characterized in that, include: Based on the network information of the network to be searched, a first network structure graph is constructed. The network to be searched includes a data transmission network. The nodes of the first network structure graph include the station information of each station in the data transmission network, and the edges of the first network structure graph include the connection information between each station. Obtain the guiding node of the first network structure graph; Based on the guiding node, a guiding path is generated, which is used to indicate the direction of path search; Based on the guidance path, a target path for the first network structure diagram is generated so as to perform service transmission according to the target path, wherein the target path includes a data transmission path; The step of obtaining the guiding node for the first network structure graph includes: The randomly selected node is used as the guiding node; Alternatively, the node corresponding to the specified tag can be obtained as the guiding node.
2. The path search method according to claim 1, characterized in that, The step of generating a boot path based on the boot node includes: Obtain the starting node and target node for the path search; Search for a first path from the starting node to the bootstrap node, and search for a second path from the target node to the bootstrap node; According to a preset strategy, the guide path is obtained from the first path and the second path.
3. The path search method according to claim 2, characterized in that, The step of generating the target path of the first network structure graph according to the guiding path includes: Obtain the nodes in the guidance path other than the guidance node as filter nodes; Delete the filter node from the first network structure diagram to generate a second network structure diagram; Obtain the third path from the guide node to the destination node in the second network structure graph, where the destination node is the target node or the starting node; The guiding path and the third path are combined to form the target path of the first network structure graph.
4. The path search method according to claim 3, characterized in that, Before concatenating the guiding path and the third path to form the target path of the first network structure graph, the method further includes: Determine whether the third path meets the preset constraints and obtain the determination result; If the judgment result indicates that the third path satisfies the constraint condition, then the step of splicing the guiding path and the third path to form the target path of the first network structure graph is executed; If the judgment result indicates that the third path does not meet the constraint condition, then return to the step of obtaining the guiding node of the first network structure graph and generating the guiding path, until the regenerated third path meets the constraint condition.
5. The path search method according to claim 3 or 4, characterized in that, After concatenating the guiding path and the third path to form the target path of the first network structure graph, the method further includes: If the target path is detected to be a path from the target node to the starting node, the direction of the target path is reversed so that the target path is a path from the starting node to the target node.
6. The path search method according to claim 2, characterized in that, The preset strategies include: selecting the path with the fewest nodes, or selecting the shortest path.
7. The path search method according to claim 2, characterized in that, The step of obtaining the guiding node for the first network structure graph includes: Obtain the nodes directly connected to the starting node as directly connected nodes; Obtain the boot node from the nodes other than the directly connected nodes.
8. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the path search method as described in any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the path search method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and apparatus for calculating mpls traffic engineering paths
CN102047630A
Path searching method and device, processor and electronic device
CN108268971A