Method and apparatus for outputting information
The use of a bitMap and distributed computing with MongoDB addresses inefficiencies in route network matrix systems, improving query and write efficiency and reducing database load, enabling rapid computation and update of route data in large networks.
Patent Information
- Application Number
- CN201910788379.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-26
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2039-08-26
AI Technical Summary
The existing road network matrix system has low query and write efficiency under large-scale data, which cannot meet the execution of multi-dimensional road network tasks, and lacks the concept of road network version, which leads to the system being unable to provide stable external services during the update process.
The status of each point pair information in the road network is marked by a bitmap, and the uncalculated point pair is indicated through the status bitmap, the outlet identification is assigned and the road network calculation is performed. The road network data is stored using the mongo database, distributed task distribution and incremental verification are adopted, and the road network version concept is introduced to support road network updates.
It significantly improves query and write efficiency, reduces database pressure, supports multi-task concurrency, and realizes stable updates and version management of road network data.
Smart Images

Figure CN110489512B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technologies, and particularly to methods and apparatuses for outputting information. Background Art
[0002] With the development of the logistics industry's business and the increase in business complexity, the method of solely relying on manual labor for order and vehicle arrangement during the distribution process can no longer meet the current business development of enterprises. Therefore, it has become extremely important to use algorithms to assist or replace manual labor in finding the route with the optimal cost or time. This can save costs for enterprises. For example, if a customer has 7,000 outlets, the data volume of a single dimension requires nearly 49 million data points. The road network supports multi-dimensional initialization of the road network matrix, such as supporting dimensions for cars, 4.2-meter box trucks, and map driving strategies (time priority, distance priority), etc. (a data volume of 49 million * the number of dimensions), and the data volume is extremely large.
[0003] The existing road network matrix system uses the MySQL database for storage. Under the scale of nearly tens of millions of data, both the query efficiency and the write efficiency are greatly restricted. For example, if multiple users are currently using multi-dimensional road networks, such a query volume is extremely large, causing great pressure on the database. Moreover, the scheduling method adopted by the existing system cannot meet the scenario where multiple road network tasks are executed simultaneously within the cluster. Nor can it achieve the maximization of resource (map service resource) utilization.
[0004] The existing solutions have the following deficiencies:
[0005] 1) Deficiencies in storage. Using MySQL for storage is extremely inefficient in scenarios with a large number of cut-off points in multi-dimensional road networks. Road network data is distinguished by tables to determine whether it is a unique road network, which will result in a batch of road network table structures needing to be pre-set in the system, making it difficult to maintain and consuming resources.
[0006] 2) In terms of road network update, there is no status maintenance during the road network update process, resulting in determining the integrity of the data of a road network relying on reading the database for operation.
[0007] 3) The old system does not have the concept of road network version. If there is an update operation for a road network, the road network is in the process of execution and cannot provide external services. Summary of the Invention
[0008] Embodiments of the present disclosure propose methods and apparatuses for outputting information.
[0009] In a first aspect, an embodiment of the present disclosure provides a method for outputting information, including: in response to receiving a road network calculation task including the longitude and latitude information of at least one network point, assigning a network point identifier to each network point in the at least one network point; assembling a status bitmap of road network data according to the network point identifiers of the at least one network point, where each value in the status bitmap represents whether the road network data between a pair of network points has been calculated; performing the road network calculation task based on the longitude and latitude information of the uncalculated network points indicated in the status bitmap to obtain road network data; in response to detecting that the road network calculation task has been completed, checking the status of the road network data between each network point and marking it in the status bitmap; in response to detecting that all the values in the status bitmap have been marked as completed, outputting the road network data and the status bitmap.
[0010] In some embodiments, the method further includes: in response to detecting that not all the values in the status bitmap have been marked as completed, obtaining the information of the uncompleted network point pairs from the status bitmap, and recalculating the road network data between the uncompleted network point pairs.
[0011] In some embodiments, performing the road network calculation task based on the longitude and latitude information of the uncalculated network points indicated in the status bitmap to obtain road network data includes: splitting the road network calculation task into at least one task package according to a predetermined task processing capability; sequentially sending the at least one task package to a computing node, so that the computing node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network points in the at least one task package, and stores the road network data in a mongo database.
[0012] In some embodiments, checking the status of the road network data between each network point and marking it in the status bitmap includes: calculating the uncompleted network point pairs according to the values in the status bitmap; looking up whether there is road network data for the uncompleted network point pairs in the database storing the road network data; if so, marking the corresponding value of the uncompleted network point pairs in the status position as completed.
[0013] In some embodiments, recalculating the road network data between the uncompleted network point pairs includes: forming the information of the uncompleted network point pairs into a recalculation task package; sending the recalculation task package to a computing node, so that the computing node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network point pairs in the recalculation task package, and stores the road network data in a mongo database.
[0014] In some embodiments, the method further includes: in response to receiving a road network update request including the network point information to be updated, updating the status bitmap according to the network point information to be updated; obtaining the information of the uncompleted network point pairs from the updated status bitmap, and calculating the road network data between the uncompleted network point pairs.
[0015] In some embodiments, the method further includes: assigning a new version number to the updated road network data and the status bitmap.
[0016] In a second aspect, an embodiment of the present disclosure provides an apparatus for outputting information, including: a receiving unit configured to, in response to receiving a road network calculation task including the longitude and latitude information of at least one network point, assign a network point identifier to each network point in the at least one network point; an assembling unit configured to assemble a status bitmap of the road network data according to the network point identifiers of the at least one network point, where each value in the status bitmap represents whether the road network data between a pair of network points is calculated; a calculating unit configured to execute a road network calculation task based on the longitude and latitude information of the uncalculated network points indicated in the status bitmap to obtain road network data; a marking unit configured to, in response to detecting that the road network calculation task is completed, check the status of the road network data between each network point and mark it in the status bitmap; and an output unit configured to, in response to detecting that all the values in the status bitmap are marked as completed, output the road network data and the status bitmap.
[0017] In some embodiments, the calculating unit is further configured to: in response to detecting that not all the values in the status bitmap are marked as completed, obtain the information of the uncompleted network point pairs from the status bitmap and recalculate the road network data between the uncompleted network point pairs.
[0018] In some embodiments, the apparatus further includes an unpacking unit configured to: split the road network calculation task into at least one task packet according to a predetermined task processing capability; and sequentially send the at least one task packet to a calculation node, so that the calculation node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network points in the at least one task packet, and stores the road network data in a mongo database.
[0019] In some embodiments, the marking unit is further configured to: calculate the uncompleted network point pairs according to the values in the status bitmap; look up whether there is road network data for the uncompleted network point pairs in the database storing the road network data; and if so, mark the corresponding values of the uncompleted network point pairs in the status position as completed.
[0020] In some embodiments, the calculating unit is further configured to: form the information of the uncompleted network point pairs into a recalculation task packet; and send the recalculation task packet to a calculation node, so that the calculation node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network point pairs in the recalculation task packet, and stores the road network data in a mongo database.
[0021] In some embodiments, the device further includes an updating unit configured to: in response to receiving a road network updating request including the information of the network points to be updated, update the status bitmap according to the information of the network points to be updated; obtain the information of the unfinished network point pairs from the updated status bitmap, and calculate the road network data between the unfinished network point pairs.
[0022] In some embodiments, the updating unit is further configured to: assign a new version number to the updated road network data and status bitmap.
[0023] In a third aspect, an embodiment of the present disclosure provides an electronic device for outputting information, including: one or more processors; a storage device storing one or more programs thereon, which, when executed by the one or more processors, cause the one or more processors to implement the method according to any one of the first aspect.
[0024] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium storing a computer program thereon, wherein the program, when executed by a processor, implements the method according to any one of the first aspect.
[0025] The method and device for outputting information provided by the embodiments of the present disclosure use a bitmap to mark the status of each point pair information in the road network. The memory consumption is very small, and there is no need to read such a large amount of data, improving the query efficiency and writing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Other features, objects, and advantages of the present disclosure will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings:
[0027] Figure 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
[0028] Figure 2 is a flowchart of an embodiment of the method for outputting information according to the present disclosure;
[0029] Figure 3 is a flowchart of another embodiment of the method for outputting information according to the present disclosure;
[0030] Figure 4 is a schematic diagram of an application scenario of the method for outputting information according to the present disclosure; Figure 5 is a schematic structural diagram of an embodiment of the device for outputting information according to the present disclosure;
[0031] Figure 6 is a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0032] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. Additionally, it should be noted that for the convenience of description, only the parts related to the relevant invention are shown in the drawings.
[0033] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the drawings and embodiments.
[0034] Figure 1 An exemplary system architecture 100 is shown, which shows embodiments of a method for outputting information or a device for outputting information to which the present disclosure can be applied.
[0035] As Figure 1 shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0036] Users can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 101, 102, 103, such as map applications, navigation applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0037] The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices with a display screen and supporting navigation functions, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop portable computers, and desktop computers, etc. When the terminal devices 101, 102, 103 are software, they may be installed in the above-mentioned electronic devices. It may be implemented as multiple software or software modules (for example, to provide distributed services), or it may be implemented as a single software or software module. No specific limitation is made here.
[0038] Server 105 may be a server that provides various services. For example, it may be a road network analysis server that supports the maps displayed on terminal devices 101, 102, and 103. The road network analysis server may analyze and process data such as received road network analysis requests, and feedback the processing results (such as the shortest time route or the shortest distance route) to the terminal devices.
[0039] It should be noted that the server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it may be implemented as multiple software or software modules (such as multiple software or software modules for providing distributed services), or as a single software or software module. Specific limitations are not made here.
[0040] It should be noted that the method for outputting information provided by the embodiments of the present disclosure is generally executed by server 105. Correspondingly, the device for outputting information is generally disposed in server 105.
[0041] It should be understood that Figure 1 the numbers of the terminal devices, the network, and the servers in
[0042] are merely illustrative. According to the implementation requirements, there may be any number of terminal devices, networks, and servers. Figure 2 Continuing to refer to
[0043] FIG.
[0044] In this embodiment, the execution subject of the method for outputting information (such as Figure 1 the server shown in
[0045] can receive a road network calculation task from the terminal used by the user for road network query through a wired connection method or a wireless connection method. The road network calculation task includes the longitude and latitude information of at least one network point. Here, the network point refers to a specific location on the road network. The road network calculation task can be stored in a database, such as MySQL. The server assigns a unique network point identifier to each network point. The network point identifiers can be assigned in ascending order in the order of the received network points from first to last. The current road network calculation task is to calculate the map data (including but not limited to time and distance) between two network points in different dimensions.
[0046] In this embodiment, each value in the status bitmap represents whether the road network data between a pair of network nodes has been calculated. The status of data with different dimensions between network nodes needs to be mapped to each bit position in the bitMap. Each bit position stores the data status between the two points in this dimension (0: indicating that the calculation is not completed, 1: indicating that the calculation is completed). Figure 4 The generation process of the single-dimension road network matrix is shown by the black and white grids. Since the points on the diagonal of the road network are the driving distances and times from the network node to itself during initialization and are independent of the dimension, the values of the points on the diagonal are black during initialization (white represents uncalculated points, and black represents calculated points). Sorting according to the internal network node identifiers, and then based on the longitude and latitude values of each network node, the specific position of each network node pair in the road network in the bitMap can be calculated, and a 01 digital string is obtained to represent the status of the road network data. Thus, the calculation status of the network node pair can be clearly seen without reading from the database. To save space, the values of the points on the diagonal can be filtered out, and the length of the bitMap is: the number of network nodes * the number of network nodes - the number of network nodes.
[0047] Step 203: Execute a road network calculation task based on the longitude and latitude information of the uncalculated network nodes indicated in the status bitmap to obtain road network data.
[0048] In this embodiment, initially, except for the driving distances and times from itself to itself, which are known, the road network data of other network node pairs have not been calculated. Therefore, except for the network node pairs on the diagonal in the road network matrix, all are uncalculated network node pairs. By calling map resources, the driving distances, driving times, and other road network data between the uncalculated network node pairs are calculated. The road network data includes but is not limited to driving distances and driving times. The generated status bitmap is stored in memory before all markings are completed. Therefore, based on the status bitmap, the road network data (such as time, distance, etc.) of the uncalculated network node pairs can be calculated within milliseconds. And the number of interactions with the database is reduced, thereby reducing the pressure on the database.
[0049] The calculated road network data can be stored in a database, including but not limited to a MySQL database and a mongo database. Using a mongo database as a persistence solution, the road networks of users can be isolated according to collections. Without a preset collection, it is automatically created and easy to maintain. While for MySQL, it is necessary to distinguish whether it is a unique road network according to tables, and a batch of road network table structures need to be set in advance, which is difficult to maintain and consumes resources.
[0050] Step 204: In response to detecting that the road network calculation task has been completed, check the status of the road network data between each network node and mark it in the status bitmap.
[0051] In this embodiment, after the road network calculation task has been completed (it has been calculated once, but it is not guaranteed that results are obtained for all, and it is possible that the calculation for some node pairs fails), it is possible to check in the database whether the road network data for each node has been stored, that is, to check the status of the road network data between each node. If the road network data has been calculated, the status is "calculated and completed"; otherwise, it is "not calculated yet". It is necessary to estimate the calculation completion time and then check the status of the road network data between each node in the database after the calculation completion time has been reached. Record the status of the road network data between each stored node as "calculated and completed", that is, set the corresponding position of the node pair in the status bitmap to 1. For example, after calculating the travel time and distance from node A (node identifier 102) to node B (node identifier 308), data will be filled in the corresponding position in the road network matrix. After the task is completed, the position in the status bitmap that needs to be updated will be located according to the coordinate position of the filled data.
[0052] The incremental verification method is adopted in this embodiment. The incremental verification mainly applies to the following scenario: after the task data packets of the entire road network have been sent, based on the value of the bitMap, calculate the nodes that have not been completed, and then check in the database whether they are completed, rather than calculating the status of all node pairs in the entire road network in a full-scale manner.
[0053] Step 205: In response to detecting that all the values in the status bitmap are marked as "completed", output the road network data and the status bitmap.
[0054] In this embodiment, if all the values in the status bitmap are marked as 1, it means that all the values in the status bitmap are marked as "completed". If the current road network calculation task is successfully completed, then after storing the status positions in the memory into a file, the status positions and the calculated road network data are placed in a specified file system. The access path to this file system can be returned to the terminal, and the user can directly access the file system through the terminal to use the road network data.
[0055] Step 206: In response to detecting that not all the values in the status bitmap are marked as "completed", obtain the information of the uncompleted node pairs from the status bitmap, and recalculate the road network data between the uncompleted node pairs.
[0056] In this embodiment, due to possible timeouts in the map service or situations where there is no route the first time but there is a route the second time, etc., the calculation for some node pairs may fail and the road network data cannot be obtained. In such cases, the information of the uncompleted node pairs can be obtained from the status bitmap, and the road network data between the uncompleted node pairs can be recalculated. There is no need to calculate everything again.
[0057] In some alternative implementation manners of this embodiment, the method further includes: in response to receiving a road network update request including the network point information to be updated, updating the status bitmap according to the network point information to be updated; obtaining the information of the unfinished network point pairs from the updated status bitmap, and calculating the road network data between the unfinished network point pairs. This implementation manner reflects that the status bitmap can be inherited, and when performing road network update, the information of the network point pairs that have been calculated can be quickly assembled according to the parent bitmap of the status bitmap, so that there is no need to read the database. Especially, it is very helpful for the customer's requirement of modifying the usage time of the road network. It can be completed at the minute level in a road network of 6000 points, meeting the customer delivery requirements.
[0058] In some alternative implementation manners of this embodiment, the method further includes: assigning a new version number to the updated road network data and status bitmap. The concept of road network version is proposed. The main role of the road network version is that during the process of road network update, the previous version can also provide stable services, thus being not affected by the tasks that are running.
[0059] Further referring to Figure 3 , which shows the process 300 of another embodiment of the method for outputting information. The process 300 of the method for outputting information includes the following steps:
[0060] Step 301, in response to receiving a road network calculation task including the longitude and latitude information of at least one network point, assigning a network point identifier to each network point in the at least one network point.
[0061] Step 302, assembling the status bitmap of the road network data according to the network point identifiers of the at least one network point.
[0062] Steps 301 - 302 are basically the same as steps 201 - 202, so they will not be elaborated here.
[0063] Step 303, splitting the road network calculation task into at least one task package according to the predetermined task processing capacity.
[0064] In this embodiment, the task processing capacity refers to QPS. The distributed tasks are executed in chunks. When assembling a 6000 - point road network, a large number of interactions with the map service are required. For example, when the QPS is 1000, when a single machine cannot complete the requests of 1000 QPS, distributed task distribution is required. Currently, the MQ (message queue) method is used to distribute tasks. The distribution form adopts the data packet format, and the longitude and latitude information of the network point pairs that need to be requested for this request is stored in the data packet. The master node controls the sending rate of the messages to maximize the utilization of QPS.
[0065] Step 304: Send at least one task package to the computing nodes in sequence, so that the computing nodes calculate the road network data between each network point according to the obtained map resources and the latitude and longitude information of the network points in at least one task package, and store the road network data in the mongo database.
[0066] In this embodiment, the calculation process is executed by at least one computing node, which can improve the calculation speed. This implementation method supports post-processing of status. Since the currently set system uses the method of post-processing network point pair information, that is, the status of the network point pair is not immediately checked after requesting map data. Because the calculation of network point pair information is executed by the computing node, but the information for maintaining the status is maintained by the master node, so we do not immediately verify the point pair status. Instead, we wait until the master node has sent all data packets and then check the point pair status and assemble the bitMap information.
[0067] Step 305: In response to detecting that the road network calculation task has been completed, check the status of the road network data between each network point and mark it in the status bitmap.
[0068] In this embodiment, the completion time of the road network calculation task can be estimated according to the predetermined task processing capacity. After reaching the completion time, the master node checks the status of the road network data between each network point from the database storing the road network data. If the road network data between a certain network point pair is detected, the corresponding position of this network point pair on the status bitmap is marked as calculation completed, that is, modified to 1.
[0069] Step 306: In response to detecting that all the values in the status bitmap are marked as completed, output the road network data and the status bitmap.
[0070] Step 306 is basically the same as step 205, so it will not be elaborated here.
[0071] Step 307: In response to detecting that not all the values in the status bitmap are marked as completed, obtain the information of the uncompleted network point pairs from the status bitmap, and form the information of the uncompleted network point pairs into a recalculation task package.
[0072] Step 307 is basically the same as step 206, except that there is an additional packaging process. According to the processing capacity, the information of the uncompleted network point pairs may require more than one task package to be completed.
[0073] From Figure 3 it can be seen that compared with the Figure 2 corresponding embodiment, the process 300 of the method for outputting information in this embodiment reflects the steps of using a distributed system for calculation. Thus, the solution described in this embodiment can further improve the query efficiency and reduce the database pressure.
[0074] Continue to refer to Figure 4 ,Figure 4 is a schematic diagram of an application scenario of the method for outputting information according to this embodiment. In Figure 4 the application scenario, the customer requests the server to calculate the map service data (including but not limited to time and distance) between network points in pairs. After receiving the calculation request, the main node of the server first reads the road network task submitted by the user from the database. Since the map resources are limited (QPS limit), there will be different strategies in task distribution. The road network main node obtains the unfinished road network tasks. According to the road network tasks, it obtains the network point information (network point identifier, longitude and latitude information) included in the road network. Then, according to the strategy, it assembles a task snapshot. This part is the main core part. The task snapshot includes the following contents: a) road network point information; b) status bitmap; c) the number of times the road network requests map retry; d) the number of task packets sent. The road network main node reads the information of the unfinished point pairs from the status bitmap of the task snapshot. The main node issues task packets to the calculation nodes. The calculation nodes receive the messages and request map resources, and store the returned map information (distance, time, etc.) in the mongo database. The road network main node checks whether the task packets of the road network are completed. After the task packets are completed and issued, it checks the status of the point pairs at one time. Then it returns to the road network main node to read the information of the unfinished point pairs from the status bitmap of the task snapshot and makes the next request for the unfinished point pairs (due to possible timeouts in map services, there may be situations where there is no route the first time but there is a route the second time). Until all the values in the status bitmap in the road network snapshot are marked as completed, the assembly stage of the road network is completed. Finally, it enters the data file stage of the road network. The file is mainly the final file provided for the algorithm and is stored in the specified file system.
[0075] Further referring to Figure 5 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for outputting information. This device embodiment corresponds to Figure 2 the method embodiment shown, and this device can be specifically applied to various electronic devices.
[0076] As Figure 5As shown in the figure, the device 500 for outputting information in this embodiment includes: a receiving unit 501, an assembling unit 502, a calculating unit 503, a marking unit 504, and an output unit 505. Among them, the receiving unit 501 is configured to, in response to receiving a road network calculation task including the longitude and latitude information of at least one network point, assign a network point identifier to each network point in the at least one network point. The assembling unit 502 is configured to assemble a status bitmap of road network data according to the network point identifiers of the at least one network point, where each value in the status bitmap represents whether the road network data between a pair of network points has been calculated. The calculating unit 503 is configured to execute a road network calculation task based on the longitude and latitude information of the uncalculated network points indicated in the status bitmap to obtain road network data. The marking unit 504 is configured to, in response to detecting that the road network calculation task has been completed, check the status of the road network data between each network point and mark it in the status bitmap. The output unit 505 is configured to, in response to detecting that all the values in the status bitmap have been marked as completed, output the road network data and the status bitmap.
[0077] In some optional implementation manners of this embodiment, the calculating unit 503 is further configured to: in response to detecting that not all the values in the status bitmap have been marked as completed, obtain the information of the uncompleted network point pairs from the status bitmap, and recalculate the road network data between the uncompleted network point pairs.
[0078] In some optional implementation manners of this embodiment, the device 500 further includes an unpacking unit (not shown in the figure), which is configured to: split the road network calculation task into at least one task packet according to a predetermined task processing capability; send the at least one task packet to a calculation node in sequence, so that the calculation node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network points in the at least one task packet, and stores the road network data in a mongo database.
[0079] In some optional implementation manners of this embodiment, the marking unit 504 is further configured to: calculate the uncompleted network point pairs according to the values in the status bitmap; check whether there is road network data for the uncompleted network point pairs in the database storing the road network data; if so, mark the corresponding values of the uncompleted network point pairs in the status position as completed.
[0080] In some optional implementation manners of this embodiment, the calculating unit 503 is further configured to: form the information of the uncompleted network point pairs into a recalculation task packet; send the recalculation task packet to a calculation node, so that the calculation node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network point pairs in the recalculation task packet, and stores the road network data in a mongo database.
[0081] In some alternative implementations of this embodiment, the apparatus 500 further includes an update unit (not shown in the drawings), which is configured to: in response to receiving a road network update request including the network point information to be updated, update the status bitmap according to the network point information to be updated; obtain the information of the unfinished network point pairs from the updated status bitmap, and calculate the road network data between the unfinished network point pairs.
[0082] In some alternative implementations of this embodiment, the update unit is further configured to: assign a new version number to the updated road network data and status bitmap.
[0083] Next, refer to Figure 6 , which shows a schematic structural diagram of an electronic device (such as the server in Figure 1 ) 600 suitable for implementing the embodiments of the present disclosure. Figure 6 The server shown is only an example and should not impose any limitations on the functions and usage scopes of the embodiments of the present disclosure.
[0084] As Figure 6 shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0085] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 6 shows the electronic device 600 having various devices, it should be understood that it is not required to implement or include all the shown devices. Instead, more or fewer devices may be implemented or included. Figure 6 Each block shown in
[0086] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed. It should be noted that the computer-readable medium described in the embodiments of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the embodiments of the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0087] The above computer-readable medium may be included in the above electronic device; or may exist separately without being assembled into the electronic device. The above computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: in response to receiving a road network calculation task including the longitude and latitude information of at least one network point, assign a network point identifier to each of the at least one network point; assemble a status bitmap of road network data according to the network point identifiers of the at least one network point, wherein each value in the status bitmap represents whether the road network data between a pair of network points has been calculated; perform a road network calculation task based on the longitude and latitude information of the uncalculated network points indicated in the status bitmap to obtain road network data; in response to detecting that the road network calculation task has been completed, check the status of the road network data between each network point and mark it in the status bitmap; in response to detecting that all the values in the status bitmap have been marked as completed, output the road network data and the status bitmap.
[0088] Computer program code for performing the operations of the embodiments of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).
[0089] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0090] The units involved in the embodiments described in this disclosure can be implemented in software or in hardware. The described units can also be provided in a processor. For example, it can be described as: a processor includes a receiving unit, an assembling unit, a calculating unit, a marking unit, and an output unit. Among them, the names of these units do not constitute a limitation on the unit itself in some cases. For example, the receiving unit can also be described as "a unit that allocates a network point identifier to each of at least one network point in response to receiving a road network calculation task including the longitude and latitude information of at least one network point".
[0091] The above description is only for the preferred embodiments of this disclosure and the explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in this disclosure.
Claims
1. A method for outputting information, comprising: In response to receiving a road network calculation task including the latitude and longitude information of at least one network point, assigning a network point identifier to each of the at least one network point; Assembling a status bitmap of road network data according to the network point identifiers of the at least one network point, wherein each value in the status bitmap represents whether the road network data between a pair of network points has been calculated, and the status bitmap is stored in memory before all markings are completed; Performing a road network calculation task based on the latitude and longitude information of the uncalculated network points indicated in the status bitmap to obtain road network data, wherein the road network data is stored in a database, and according to the value of the status bitmap, calculating the uncompleted network points and verifying in the database whether they are completed; In response to detecting that the road network calculation task has been completed, checking the status of the road network data between each network point and marking it in the status bitmap; In response to detecting that all values in the status bitmap are marked as completed, outputting the road network data and the status bitmap.
2. The method according to claim 1, wherein The method further includes: In response to detecting that not all values in the status bitmap are marked as completed, obtaining the information of the uncompleted network point pairs from the status bitmap and recalculating the road network data between the uncompleted network point pairs.
3. The method according to claim 1, wherein The performing a road network calculation task based on the latitude and longitude information of the uncalculated network points indicated in the status bitmap to obtain road network data includes: Splitting the road network calculation task into at least one task package according to a predetermined task processing capacity; Sending the at least one task package to a computing node in sequence, so that the computing node calculates the road network data between each network point according to the obtained map resources and the latitude and longitude information of the network points in the at least one task package, and stores the road network data in a mongo database.
4. The method according to claim 1, wherein The checking the status of the road network data between each network point and marking it in the status bitmap includes: Calculating the uncompleted network point pairs according to the value of the status bitmap; Searching in the database storing the road network data whether there is road network data for the uncompleted network point pairs; If it exists, marking the value corresponding to the uncompleted network point pair in the status position as completed.
5. The method according to claim 2, wherein, The recalculating the road network data between the uncompleted network point pairs includes: Forming the information of the uncompleted network point pairs into a recalculation task package; Sending the recalculation task package to a computing node, so that the computing node calculates the road network data between each network point according to the obtained map resources and the latitude and longitude information of the network point pairs in the recalculation task package, and stores the road network data in a mongo database.
6. The method according to claim 1, wherein, The method further includes: In response to receiving a road network update request including the network point information to be updated, updating the status bitmap according to the network point information to be updated; Obtaining the information of the uncompleted network point pairs from the updated status bitmap and calculating the road network data between the uncompleted network point pairs.
7. The method according to claim 6, wherein The method further includes: Assigning a new version number to the updated road network data and status bitmap.
8. An apparatus for outputting information, comprising: A receiving unit, configured to, in response to receiving a road network calculation task including the longitude and latitude information of at least one network point, assign a network point identifier to each of the at least one network point; An assembling unit, configured to assemble a status bitmap of road network data according to the network point identifiers of the at least one network point, wherein each value in the status bitmap represents whether the road network data between a pair of network points has been calculated, and the status bitmap is stored in memory before all markings are completed; A calculating unit, configured to perform a road network calculation task based on the longitude and latitude information of the network points indicated as not calculated in the status bitmap to obtain road network data, wherein the road network data is stored in a database, and according to the value of the status bitmap, calculate the network points that have not been completed, and check in the database whether they are completed; A marking unit, configured to, in response to detecting that the road network calculation task has been completed, check the status of the road network data between each network point and mark it in the status bitmap; An output unit, configured to, in response to detecting that all the values in the status bitmap are marked as completed, output the road network data and the status bitmap.
9. The device according to claim 8, wherein The calculating unit is further configured to: In response to detecting that not all the values in the status bitmap are marked as completed, obtain the information of the uncompleted network point pairs from the status bitmap, and recalculate the road network data between the uncompleted network point pairs.
10. The apparatus according to claim 8, wherein, The apparatus further includes an unpacking unit, configured to: Split the road network calculation task into at least one task package according to a predetermined task processing capacity; Send the at least one task package to a computing node in sequence, so that the computing node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network points in the at least one task package, and stores the road network data in a mongo database.
11. The apparatus according to claim 8, wherein, The marking unit is further configured to: Calculate the uncompleted network point pairs according to the value of the status bitmap; Search in the database storing the road network data whether there is road network data for the uncompleted network point pairs; If it exists, mark the corresponding value of the uncompleted network point pair in the status position as completed.
12. The device according to claim 9, wherein, The calculating unit is further configured to: Form the information of the uncompleted network point pairs into a recalculation task package; Send the recalculation task package to a computing node, so that the computing node calculates the road network data between each network point according to the obtained map resources and the longitude and latitude information of the network point pairs in the recalculation task package, and stores the road network data in a mongo database.
13. The apparatus according to claim 8, wherein, The apparatus further includes an updating unit, configured to: In response to receiving a road network update request including the network point information to be updated, update the status bitmap according to the network point information to be updated; Obtain the information of the uncompleted network point pairs from the updated status bitmap, and calculate the road network data between the uncompleted network point pairs.
14. The apparatus according to claim 13, wherein, The updating unit is further configured to: Assign a new version number to the updated road network data and status bitmap.
15. An electronic device for outputting information, including: One or more processors; A storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors such that the one or more processors implement the method according to any one of claims 1-7.
16. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by a processor, it implements the method according to any one of claims 1-7.
Citation Information
Patent Citations
Routing method adapting to make-and-break connection data transmission of spatial network link
CN106059920A
Path estimation method, system, device and storage medium based on road network node
CN108776668A