Path query method and device and storage medium

By storing the shortest path information into the Redis database, the traditional path query algorithm has solved the problems of low efficiency, high resource consumption and poor real-time performance under high equipment number, and efficient and stable path query is achieved to meet the real-time of large-scale device management systems. Sexual needs.

CN119127938APending Publication Date: 2024-12-13合肥欣奕华智能机器股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411134827.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

When the number of devices reaches 1,000 or 10,000, traditional path query algorithms lead to low efficiency, high resource consumption and poor real-time performance, and cannot meet the real-time requirements in high concurrency scenarios.

Method used

By storing the shortest path information to the Redis database, the system directly feedbacks the query results when receiving the path query request, reducing computing resource consumption, and using the high performance and flexible data structure of the Redis database to quickly and efficiently conduct path query.

Benefits of technology

It improves the real-time nature of path query, reduces computing resource consumption, optimizes system performance, and meets the efficient and stable path planning and scheduling needs of large-scale equipment management systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127938A_ABST
    Figure CN119127938A_ABST
Patent Text Reader

Abstract

The invention provides a path query method and device and a storage medium, relates to a database technology, and is used for improving the real-time performance of path query. The method is applied to a path query system, the path query system is provided with a Redis database, the Redis database stores shortest path information among a plurality of nodes, and the method comprises the following steps: obtaining path query information used for querying the shortest path between a first node and a second node, and querying whether the information of the shortest path between the first node and the second node is stored in the Redis database, the information of the shortest path comprising the node information and / or the path identifier between the first node and the second node, and inputting the information of the shortest path under the condition that the information of the shortest path between the first node and the second node is stored in the Redis database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, particularly to the field of path query optimization technology, and more particularly to a path query method, device, and storage medium. Background Art

[0002] In some industries, equipment management can be effectively managed through systems. For example, in the warehousing field, automated warehouse systems can be used to manage the information of goods stored in the warehouse; in the logistics field, logistics systems can be used to manage the logistics information of items; in the production field, factory production line management systems can be used to manage the production information of items on the production line.

[0003] In some scenarios, the system typically performs real-time path planning and scheduling when managing devices. In some scenarios (such as path query scenarios with high real-time requirements), if the system manages a large number of devices (e.g., thousands or tens of thousands of devices), the system must traverse a large number of devices to calculate the paths between them, resulting in lower real-time performance of path query. Summary of the Invention

[0004] The present application provides a path query method, device, and storage medium for improving the real-time performance of path query.

[0005] To achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, a path query method is provided, which is applied to a path query system, wherein the path query system is provided with a Redis database, and the Redis database stores shortest path information between multiple nodes. The method includes: obtaining path query information for querying the shortest path between a first node and a second node, querying whether the shortest path information between the first node and the second node is stored in the Redis database, the shortest path information including node information and / or a path identifier between the first node and the second node, and inputting the shortest path information if the shortest path information between the first node and the second node is stored in the Redis database.

[0007] Optionally, the Redis database also stores node information of multiple nodes, and the method further includes: detecting status information of the multiple nodes, and status information of the nodes included in the stored shortest path information; when the status information of the multiple nodes is used to indicate that the node is unavailable, and / or the status information of the nodes included in the shortest path information is used to indicate that the node is unavailable, updating the path information stored in the Redis database.

[0008] Optionally, the method further includes: when the shortest path information between the first node and the second node is not stored in the Redis database, calculating the shortest path between the first node and the second node, and storing the shortest path information between the first node and the second node in the Redis database.

[0009] Optionally, the method further includes: updating the shortest path information stored in the Redis database based on a preset update mechanism.

[0010] Optionally, the above-mentioned "updating the shortest path information stored in the Redis database based on a preset update mechanism" includes: when the available memory in the Redis database is less than a preset threshold, updating the shortest path information in the Redis database based on the storage time and / or query number of the shortest path information; or, updating the shortest path information in the Redis database based on the effective storage time corresponding to each shortest path information; or, updating the shortest path information in the Redis database according to business needs.

[0011] Optionally, the “updating the shortest path information in the Redis database” includes: updating the shortest path information in the Redis database in an asynchronous update manner.

[0012] In a second aspect, a path query device is provided, which is applied to a path query system, wherein the path query system is provided with a Redis database, and the Redis database stores shortest path information between multiple nodes. The device includes: an acquisition unit, which is used to obtain path query information for querying the shortest path between a first node and a second node; a query unit, which is used to query whether the shortest path information between the first node and the second node is stored in the Redis database, and the shortest path information includes node information and / or a path identifier between the first node and the second node; and an output unit, which is used to input the shortest path information between the first node and the second node if the shortest path information between the first node and the second node is stored in the Redis database.

[0013] Optionally, the Redis database also stores node information of multiple nodes, and the device also includes: a detection unit, used to detect status information of the multiple nodes, and status information of the nodes included in the stored shortest path information; an update unit, used to update the path information stored in the Redis database when the status information of the multiple nodes is used to indicate that the node is unavailable, and / or the status information of the nodes included in the shortest path information is used to indicate that the node is unavailable.

[0014] Optionally, the device also includes: a processing unit, used to calculate the shortest path between the first node and the second node when the shortest path information between the first node and the second node is not stored in the Redis database, and store the shortest path information between the first node and the second node in the Redis database.

[0015] Optionally, the updating unit is specifically configured to update the shortest path information stored in the Redis database based on a preset updating mechanism.

[0016] Optionally, the update unit is specifically used to update the shortest path information in the Redis database based on the storage time and / or query number of the shortest path information when the available memory in the Redis database is less than a preset threshold; or, based on the effective storage time corresponding to each shortest path information, update the shortest path information in the Redis database; or, according to business needs, update the shortest path information in the Redis database.

[0017] Optionally, the update unit is specifically used to update the shortest path information in the Redis database using an asynchronous update method.

[0018] In a third aspect, a path query device is provided, comprising: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the path query method of the first aspect.

[0019] In a fourth aspect, a computer-readable storage medium is provided, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by a processor of a path query device, the device is enabled to execute the path query method of the first aspect described above.

[0020] In a fifth aspect, a computer program product is provided, which includes instructions. When the instructions are executed by a computer, the computer program product is able to execute the path query method of the first aspect.

[0021] The technical solution provided by the embodiments of the present application provides at least the following beneficial effects: After a path query system receives path query information for querying the shortest path between a first node and a second node, the path query system can query whether the shortest path information between the first node and the second node is stored in a Redis database. If the shortest path information between the first node and the second node is stored in the Redis database, the system outputs the shortest path information between the first node and the second node. In this application, the Redis database is used as a path cache layer, and the shortest path information between multiple nodes is stored in the Redis database. Because Redis has high performance and a flexible data structure, it is well suited for processing real-time analysis. Therefore, the path query system can leverage the characteristics of the Redis database to quickly and efficiently perform path queries, improving the real-time performance of path queries. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 A schematic diagram of the structure of a path query system provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of a path between nodes provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of a path query method provided in an embodiment of the present application Figure 1 ;

[0026] Figure 4 A schematic diagram of a path query method provided in an embodiment of the present application Figure 2 ;

[0027] Figure 5 A schematic diagram of a path query method provided in an embodiment of the present application Figure 3 ;

[0028] Figure 6 A schematic diagram of the structure of a path query device provided in an embodiment of the present application Figure 1 ;

[0029] Figure 7 A schematic diagram of the structure of a path query device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION

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

[0031] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or solution described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0032] It should also be noted that in the embodiments of the present application, "of", "corresponding" and "corresponding" can sometimes be used interchangeably. It should be pointed out that when the distinction between them is not emphasized, the meanings they intend to express are consistent.

[0033] In order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order.

[0034] Typically, device management systems can calculate the shortest paths between multiple devices using path query algorithms (such as Dijkstra and A*). This approach is highly efficient when the number of devices is small, but can present challenges when the number of devices reaches thousands, tens of thousands, or even higher.

[0035] 1. Efficiency Issues: When the number of devices reaches thousands or tens of thousands, traditional path query algorithms require the device management system to traverse a large number of nodes and edges, resulting in high computational complexity. This leads to low path calculation efficiency and cannot meet the real-time requirements of the system.

[0036] 2. Resource consumption: Path query consumes a lot of computing resources, especially in high-concurrency scenarios. Frequent path query will occupy a lot of server resources, thus affecting the stability and performance of the system.

[0037] 3. Real-time performance issues. For scenarios where real-time routing is critical, routing results must be returned within a short period of time to ensure the system's responsiveness. However, due to performance issues (such as insufficient hardware configuration), the current system does not provide high real-time routing performance.

[0038] In view of this, the present application provides a path query method that stores the calculated shortest path information in a Redis database. This allows the system to directly feedback the query results upon receiving a path query request, eliminating the need for recalculation. This reduces computing resource consumption, shortens path query time, and improves user experience and system performance. Specifically, the present application optimizes path queries by introducing a Redis database, effectively resolving issues such as high resource consumption, poor real-time performance, low data consistency, and low system performance, providing efficient and stable path planning and scheduling services for large-scale device management systems.

[0039] The technical solution of this application is described below with reference to the accompanying drawings.

[0040] like Figure 1 As shown, an embodiment of the present application provides a path query system, which may include a Redis database. The Redis database may be used to store path information between multiple nodes.

[0041] The path information may include node identifiers and / or path identifiers. Figure 2 As shown, the path between node 1 and node 2 may include two paths (path 1 and path 2, respectively). The nodes on path 1 include node 3 and node 4 (also referred to as intermediate nodes), and path 2 includes node 5. The path information of path 1 may include the identifier of node 3, the identifier of node 4, or may include S1, S2, and S3. S1 represents the path between node 1 and node 3, S2 represents the path between node 3 and node 4, and S3 represents the path between node 4 and node 2. The path information of path 2 may include the identifier of node 5, or may include S4 and S5. Among them, S4 represents the path between node 1 and node 5, and S5 represents the path between node 5 and node 2.

[0042] Furthermore, in order to effectively manage the information in the Redis database. Figure 1 As shown, the path query system may further include a front-end device. The front-end device is communicatively connected to the Redis database. For example, the front-end device may be communicatively connected to the Redis database via an application program interface (API).

[0043] The front-end device may be used to receive a path query instruction and perform a path query in a Redis database in response to the path query instruction.

[0044] In some scenarios, the front-end device can also be used to manage path information in the Redis database. For example, the front-end device can update the path information in the Redis database. In another example, the front-end device can also access the Redis database in response to a path query instruction and query the path information.

[0045] In this application, the front-end device can be an electronic device, such as a computer, a personal computer, or a server. The server can be a physical server, a virtual server, or a cloud platform, etc., without limitation.

[0046] The following combination Figure 1 system, and describes the path query method provided in this application.

[0047] Figure 3 The figure is a flowchart of a path query method according to some exemplary embodiments.

[0048] S301: Obtain path query information.

[0049] The path query information is used to query the shortest path between the first node and the second node. The shortest path may include one or more of the following: a path with the shortest data transmission delay between the first node and the second node, a path with the fewest nodes between the first node and the second node, a path with the shortest data transmission time between the first node and the second node, and a path with the shortest path length between the first node and the second node.

[0050] In one possible implementation, the front-end device may obtain path query information in response to a user's query operation. The query operation may be an operation in which the user inputs query information through an input device of the front-end device. The query information may include identifiers / names of the first node and the second node.

[0051] In another possible implementation, the front-end device may receive path query information from the user equipment. The path query information may be generated by the user equipment in response to a user's query operation and sent to the front-end device.

[0052] In one example, a semiconductor production line often contains numerous AMHS equipment units, where handling robots frequently perform material handling operations. To move from one node to another, the operator of the equipment unit may need to select a route, choose a starting point and an end point, and query the corresponding path query information.

[0053] The AMHS equipment unit refers to the various components and equipment that make up the Automated Material Handling System (AMHS). These devices work together to quickly and accurately transport carriers loaded with wafers in semiconductor production lines, thereby optimizing production efficiency and product quality.

[0054] In another example, a logistics system contains multiple logistics warehousing nodes, with multiple routes between them, such as national highways, expressways, and provincial roads. During transportation by logistics trucks, goods pass through many intermediate nodes. By inputting the starting point information at each node, logistics staff can query route information between nodes.

[0055] In another possible implementation, the path information is queried through system scheduling allocation.

[0056] In one application scenario, a semiconductor manufacturing plant can have front-end equipment equipped with a material control system (MCS) to monitor logistics equipment, such as material handling equipment. For example, this system can manage the equipment information of an automatic material handling system (AMHS).

[0057] In another example, in a logistics system, the front-end device can be configured with a logistics management system, based on which the storage nodes can be managed.

[0058] S302: Query a preset database to determine whether the shortest path information between the first node and the second node is stored.

[0059] Among them, the preset database may include a Redis database, a MySQL database, a MongoDB database, etc. Of course, other databases that support high read and write performance may also be used.

[0060] In one example, the preset database is a Redis database. The Redis database is a memory-based key-value database. A key represents a node, and a value represents a path between nodes.

[0061] It should be noted that the Redis database can process data based on memory and has high read and write performance, making it suitable for storing hot data (such as hot products, consultations, news, etc.). In this application, based on the high read and write performance of the Redis database, path information between nodes can be stored. This facilitates fast path queries, thereby improving query efficiency.

[0062] A memory access takes approximately 120 nanoseconds (ns), while a solid-state disk (SSD) access takes approximately 50-150 microseconds (us), a performance gap of nearly 1,000 times. Furthermore, the Redis database utilizes a single-threaded model and a more efficient data structure (RESP), resulting in low operational complexity and minimal communication latency, resulting in extremely high real-time performance.

[0063] Based on the characteristics of the Redis database, the shortest path information between nodes obtained by calculation is stored in the memory of the Redis database. Subsequently, after receiving the path query information including the starting point and the end point, the query results can be directly obtained from the Redis database, so that the retrieved path information can be quickly read without recalculating, saving computing resources.

[0064] The shortest path information includes node information and / or path identifiers included in the shortest path between nodes.

[0065] In one possible implementation, after receiving the path query information, the front-end device can traverse the node information stored in the Redis database. If the Redis database stores a key-value pair corresponding to the first node and the second node, it means that the Redis database stores the shortest path information between the first node and the second node. If the Redis database does not store a key-value pair corresponding to the first node and the second node, for example, if the key corresponding to the first node and the second node is stored but there is no value between the keys, it means that the Redis database does not store the shortest path information between the first node and the second node.

[0066] S303: When the shortest path information between the first node and the second node is stored in the Redis database, output the shortest path information between the first node and the second node.

[0067] In one example, the front-end device can directly display the shortest path information between the first node and the second node, or send the queried shortest path information to the user device used by the user, so that the user device displays the shortest path information after receiving the shortest path information.

[0068] In one example, combining Figure 2 , the data transmission delay of path 1 is greater than the data transmission delay of path 2, the data transmission time of path 1 is less than the data transmission time of path 2, and the path length of path 1 is greater than the path length of path 2.

[0069] If a user queries the path with the shortest data transmission delay between the first and second nodes, the front-end device can output path 2. If a user queries the path with the shortest data transmission time between the first and second nodes, the front-end device can output path 1. If a user queries the path with the shortest path length between the first and second nodes, the front-end device can output path 2. If a user queries the path with the fewest nodes between the first and second nodes, the front-end device can output path 2. In this way, users can select the appropriate path based on actual business needs.

[0070] For example, if the business data to be transmitted requires the shortest latency, the user can select path 1 for data transmission. Similarly, the shortest path between nodes can be quickly queried through the Redis database to facilitate the subsequent transmission of business data.

[0071] based on Figure 3 According to a technical solution, in this application, after a path query system receives path query information for querying the shortest path between a first node and a second node, the path query system can query whether the shortest path information between the first node and the second node is stored in the Redis database. If the shortest path information between the first node and the second node is stored in the Redis database, the shortest path information between the first node and the second node is output. In this application, the Redis database is used as a path cache layer, and the shortest path information between multiple nodes is stored in the Redis database. Since Redis has high performance and a flexible data structure, it is very suitable for processing real-time analysis. Therefore, the path query system can use the characteristics of the Redis database to quickly and efficiently perform path queries, thereby improving the real-time performance of path queries.

[0072] In some embodiments, when the shortest path information between the first node and the second node is stored in the Redis database, the front-end device can calculate the shortest path between the first node and the second node, and store the calculated shortest path information between the first node and the second node in the Redis database.

[0073] Specifically, the front-end device can calculate the shortest path between the first node and the second node based on a preset path algorithm. The preset algorithm can be set as needed, for example, it can be a Dijkstra algorithm or an A* algorithm. Of course, it can also be other algorithms without limitation.

[0074] It should be noted that the shortest path information between nodes stored in the Redis database can also be calculated using the above-mentioned preset path algorithm and stored in the Redis database in the form of key-value pairs. For example, the starting and ending points of the path are used as keys, and the shortest path information is used as the value.

[0075] Based on this embodiment, when the path information matching the query information is not stored in the Redis database, the shortest path between the relevant nodes can be recalculated based on a preset algorithm, and the calculated shortest path information can be stored in the Redis database for subsequent query use.

[0076] In some other embodiments, Figure 4 As shown, the method provided in the embodiment of the present application may further include S401 to S402.

[0077] S401: Detect status information of multiple nodes stored in a Redis database, and status information of intermediate nodes included in the stored shortest path information.

[0078] The node status information can be used to indicate whether the node is available or in normal operation. For example, the node status information may include normal operation, offline, down, abnormal operation, etc. The intermediate nodes included in the stored shortest path information refer to the nodes that constitute the path. For example, Figure 2 As shown, node 3 and node 4 are intermediate nodes of path 1, and node 5 is an intermediate node of path 2.

[0079] In one example, the front-end device can periodically or in real time detect the status information of multiple nodes and intermediate nodes stored, for example, by interacting with the nodes through instructions to obtain the node status information. Specific details can be referred to the existing technology and will not be described in detail.

[0080] S402. When the status information of any node among the multiple nodes indicates that the node is unavailable, and / or the status information of the intermediate node included in the shortest path information between the multiple nodes indicates that the intermediate node is unavailable, update the path information stored in the Redis database.

[0081] Wherein, updating the path information stored in the Redis database may include updating the path information of the node being unavailable. Figure 2 If node 3 is unavailable, the front-end device can delete the path information of path 1 stored in the Redis database; if both node 3 and node 5 are unavailable, the front-end device can recalculate the shortest path information between node 1 and node 2, and replace the path information between node 1 and node 2 stored in the Redis database with the recalculated shortest path information.

[0082] In another possible implementation, when the status information of multiple nodes indicates that the node is unavailable, and / or the shortest path information between multiple nodes includes the status information of the node indicating that the node is unavailable, the path information stored in the Redis database is updated. For details, please refer to Figure 3 The description of the illustrated embodiment will not be repeated here.

[0083] based on Figure 4 The technical solution is to timely update the path information stored in the Redis database when it is determined that the status information of the node stored in the Redis database is abnormal, thereby ensuring the accuracy of the path information.

[0084] In another embodiment, in the above S402, the front-end device may update the shortest path information stored in the Redis database based on a preset update mechanism.

[0085] Among them, the preset mechanism may include the following mechanism 1 to mechanism 3.

[0086] Mechanism 1: When the available memory of the Redis database is less than a preset threshold, the shortest path information stored in the Redis database is updated based on the storage time and / or query times of the shortest path information in the Redis database.

[0087] The available memory of the Redis database may refer to the remaining memory or cache space of the Redis database. The preset threshold value may be set as needed and is not limited.

[0088] Alternatively, if the percentage of available memory in the Redis database falls below a preset ratio, the shortest path information stored in the Redis database is updated based on the storage time and / or query count of the shortest path information in the Redis database. The preset ratio can be set as needed and is not limited. For example, it can be 10%, 30%, etc.

[0089] In one example, when the available memory in the Redis database is lower than a preset threshold, the front-end device can delete the shortest path information whose storage time exceeds a preset time period and / or the number of queries is less than a preset number of times to increase the available memory of the Redis database.

[0090] Mechanism 2: Based on the effective storage duration corresponding to each shortest path information, the shortest path information in the Redis database is updated.

[0091] The effective storage duration corresponding to the shortest path information may refer to the validity period of the shortest path information. That is, the shortest path information is valid during the effective storage duration. After the effective storage duration, the shortest path information may change or become abnormal.

[0092] In one example, each path information in the Redis database is set with a corresponding valid storage duration. If the storage duration of a certain path information exceeds the corresponding valid storage duration, the path information stored in the Redis database can be deleted. In this way, all path information in the Redis database can be valid information.

[0093] Mechanism 3: Update the shortest path information stored in the Redis database according to business needs.

[0094] The service requirements may include the type of service to be transmitted, the type of data required by the service, etc.

[0095] In one example, after receiving a service to be transmitted, if the path information stored in the Redis database cannot meet the transmission requirements of the service data, the front-end device can update the path information stored in the Redis database. For example, if the service to be transmitted is a low-latency service between a first node and a second node, but the transmission latency of the path between the first and second nodes stored in the Redis database cannot meet the requirements for this low-latency service, the front-end device can update the path information between the first and second nodes stored in the Redis database.

[0096] Furthermore, if all paths between the first node and the second node cannot meet the low-latency service, a prompt message can be output, which is used to prompt that the path information between the first node and the second node cannot meet the service requirements, or output the path with the shortest delay.

[0097] In another embodiment, the front-end device may also update the shortest path information stored in the Redis database by sampling an asynchronous update method.

[0098] Asynchronous updates may refer to updates based on message queue technology. For example, a front-end device may write the calculated shortest path information between nodes into a message queue, which is used to store the shortest path information in a Redis database.

[0099] In some other embodiments, in the embodiments of the present application, in order to adapt to high concurrency scenarios, the number of Redis databases can be multiple. The roadbed information stored in the multiple Redis databases can be the same, partially the same, or completely different.

[0100] In one example, if the multiple nodes are located in the same region, the path information stored in the multiple Redis databases can be identical. In this way, after receiving the multiple path query information, the front-end device can balance the received path query information based on the traffic of the multiple Redis databases. For example, the received path query information can be evenly distributed to each Redis database, or a Redis database with a higher traffic volume can be allocated less path query information.

[0101] In another example, if the multiple nodes are in different regions or of different types, a Redis database can store path information between nodes of the same region or type. In this way, the front-end device can select the corresponding Redis database for path query based on the region or type of the node to be queried.

[0102] In another example, in order to balance the Redis databases, the path information of nodes with a query count higher than a preset count may be stored in multiple Redis databases, and the path information of nodes with a query count lower than a preset count may be stored in one Redis database.

[0103] In one application scenario, in the manufacturing sector, an MCS manages a large number of AMHS devices. To ensure that each AMHS device is correctly identified, configured, and controlled, the MCS typically generates a large amount of status update data. This status update data can include the real-time status and location information of the AMHS devices.

[0104] This state update data is updated frequently, concurrently, and in large quantities. Therefore, during the design and implementation process, to meet the needs of high-concurrency scenarios and ensure that the MCS system can handle high-concurrency query requests, technologies such as Redis clusters and distributed locks can be used to support high-concurrency access.

[0105] In one embodiment, Figure 5 As shown, an embodiment of the present application provides a path query method, the method comprising:

[0106] S501: Obtain path query information.

[0107] The path query information may include the starting point and the end point of the queried path.

[0108] S502: Query the Redis database to determine whether the shortest path information between the starting point and the end point is stored.

[0109] If the shortest path information between the starting point and the end point is stored in the Redis database, S503 is executed; if the shortest path information between the starting point and the end point is not stored in the Redis database, S504 is executed.

[0110] S503: Check whether the shortest path information is valid.

[0111] If valid, output the shortest path information between the starting point and the end point; if invalid, execute S504-S505.

[0112] S504: Calculate the shortest path between the starting point and the end point.

[0113] S505: Store the calculated shortest path information between the starting point and the end point in the Redis database.

[0114] based on Figure 5 The technical solution can effectively use the Redis database as a path cache layer, avoiding repeated calculations, improving query efficiency, and ensuring the accuracy and real-time performance of path query results.

[0115] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, the path query device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easy for those skilled in the art to realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0116] Figure 6 FIG. 1 is a schematic diagram showing the structure of a path query device according to an exemplary embodiment. Figure 6 As shown, the path query system 60 provided in the embodiment of the present application includes an acquisition unit 601, a query unit 602 and an output unit 603.

[0117] An acquisition unit 601 is configured to acquire path query information for querying the shortest path between a first node and a second node. A query unit 602 is configured to query whether a Redis database stores the shortest path information between the first node and the second node, where the shortest path information includes node information and / or a path identifier between the first node and the second node. An output unit 603 is configured to input the shortest path information between the first node and the second node if the shortest path information between the first node and the second node is stored in the Redis database.

[0118] Optionally, the Redis database also stores node information of multiple nodes, such as Figure 6As shown, the device 60 also includes: a processing unit 604, which is used to detect the status information of the multiple nodes and the status information of the nodes included in the stored shortest path information; an updating unit 605, which is used to update the path information stored in the Redis database when the status information of the multiple nodes is used to indicate that the node is unavailable, and / or the status information of the nodes included in the shortest path information is used to indicate that the node is unavailable.

[0119] Optionally, the processing unit 604 is used to calculate the shortest path between the first node and the second node when the shortest path information between the first node and the second node is not stored in the Redis database, and store the shortest path information between the first node and the second node in the Redis database.

[0120] Optionally, the updating unit 605 is specifically configured to update the shortest path information stored in the Redis database based on a preset updating mechanism.

[0121] Optionally, the update unit 605 is specifically used to update the shortest path information in the Redis database based on the storage time and / or query times of the shortest path information when the available memory in the Redis database is less than a preset threshold; or, based on the effective storage time corresponding to each shortest path information, update the shortest path information in the Redis database; or, according to business needs, update the shortest path information in the Redis database.

[0122] Optionally, the updating unit 605 is specifically configured to update the shortest path information in the Redis database using an asynchronous update method.

[0123] Figure 7 This is a schematic diagram of the structure of a path query device provided by this application. Figure 7 The path query device 70 may include at least one processor 701 and a memory 702 for storing processor-executable instructions. The processor 701 is configured to execute the instructions in the memory 702 to implement the path query method in the above embodiment.

[0124] In addition, the path query device 70 may further include a communication bus 703 and at least one communication interface 704 .

[0125] The processor 701 may be a central processing unit (CPU), a microprocessor unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the present application.

[0126] The communication bus 703 may include a path for transmitting information between the aforementioned components.

[0127] The communication interface 704 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0128] The memory 702 may be a read-only memory (ROM) or other static storage device that can store static information and instructions, a random access memory (RAM) or other dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processing unit 701 via a bus. The memory may also be integrated with the processing unit 701.

[0129] The memory 702 is used to store instructions for executing the solution of the present application, and the execution is controlled by the processor 701. The processor 701 is used to execute the instructions stored in the memory 702, thereby realizing the functions of the method of the present application.

[0130] As an example, combining Figure 6 The functions implemented by the acquisition unit 601 and the query unit 602 in the path query device 60 are similar to those implemented by Figure 7 The functions of the processor 701 in are the same.

[0131] In a specific implementation, as an embodiment, the processor 701 may include one or more CPUs, such as Figure 7 CPU0 and CPU1 in.

[0132] In a specific implementation, as an embodiment, the path query device 70 may include multiple processors, such as Figure 7701 and processor 707 in FIG. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0133] In a specific implementation, as an embodiment, the path query device 70 may further include an output device 705 and an input device 706. The output device 705 communicates with the processor 701 and can display information in a variety of ways. For example, the output device 705 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 706 communicates with the processor 701 and can receive user input in a variety of ways. For example, the input device 706 can be a mouse, keyboard, touch screen device, or sensor device.

[0134] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the path query device 70, and the path query device 70 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0135] In addition, the present application also provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of a path query device, the path query device can execute the path query method provided in the above embodiment.

[0136] In addition, the present application also provides a computer program product, including computer instructions. When the computer instructions are executed on a path query device, the path query device executes the path query method provided in the above embodiment.

[0137] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the inventions herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not invented herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the claims.

Claims

1. A path query method, It is characterized in that Applied to a path query system, the path query system is provided with a Redis database, the Redis database stores the shortest path information between multiple nodes, the method comprises: Acquire path query information, where the path query information is used to query the shortest path between the first node and the second node; Query whether the Redis database stores the shortest path information between the first node and the second node; the shortest path information includes node information and / or path identifier between the first node and the second node; In a case where the shortest path information between the first node and the second node is stored in the Redis database, the shortest path information between the first node and the second node is output.

2. The method according to claim 1, It is characterized in that The Redis database also stores node information of the multiple nodes, and the method further includes: Detecting status information of each node among the plurality of nodes, and status information of intermediate nodes included in the stored shortest path information; When the status information of any node among the multiple nodes is used to indicate that the node is unavailable, and / or the status information of the intermediate node included in the shortest path information between the multiple nodes is used to indicate that the intermediate node is unavailable, the path information stored in the Redis database is updated.

3. The method according to claim 1 or 2, It is characterized in that The method further comprises: In the case that the shortest path information between the first node and the second node is not stored in the Redis database, the shortest path between the first node and the second node is calculated, and the calculated shortest path information between the first node and the second node is stored in the Redis database.

4. The method according to claim 2, It is characterized in that The updating of the path information stored in the Redis database includes: Based on a preset update mechanism, the shortest path information stored in the Redis database is updated.

5. The method according to claim 4, It is characterized in that The updating of the shortest path information stored in the Redis database based on the preset update mechanism includes: When the available memory of the Redis database is less than a preset threshold, based on the storage time and / or query times of the shortest path information in the Redis database, the shortest path information stored in the Redis database is updated; or, Based on the effective storage duration corresponding to each piece of shortest path information, the shortest path information stored in the Redis database is updated; or, According to business needs, the shortest path information stored in the Redis database is updated.

6. The method according to claim 4 or 5, It is characterized in that The updating of the shortest path information in the Redis database includes: The shortest path information stored in the Redis database is updated in an asynchronous update manner.

7. A path query device, It is characterized in that Applied to a path query system, the path query system is provided with a Redis database, the Redis database stores the shortest path information between multiple nodes, and the path query device includes an acquisition unit, a determination unit and an output unit; The acquiring unit is used to acquire path query information, where the path query information is used to query the shortest path between the first node and the second node; The query unit is used to query whether the Redis database stores the shortest path information between the first node and the second node; the shortest path information includes the node information and / or the path identifier between the first node and the second node; The output unit is used to output the shortest path information between the first node and the second node when the shortest path information between the first node and the second node is stored in the Redis database.

8. A path query device, It is characterized in that The device comprises: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute instructions to implement the path query method according to any one of claims 1 to 6.

9. A computer-readable storage medium having instructions stored thereon, It is characterized in that When the instructions in the computer-readable storage medium are executed by a processor of a path query device, the device is enabled to execute the path query method according to any one of claims 1 to 6.

10. A computer program product, It is characterized in that The computer program product comprises instructions, and when the instructions are executed by a computer, the computer program product is enabled to execute the path query method according to any one of claims 1 to 6.