Road information storage method and device, computer equipment and readable storage medium
By obtaining vehicle driving data from the historical driving database, the encoding combination is generated and the road is divided into a grid, the problem of low road information acquisition efficiency in existing technology has been solved, and more efficient and accurate road information acquisition has been achieved.
Patent Information
- Application Number
- CN202411432407.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, the process of obtaining road information through real-time latitude and longitude matching road network data by vehicle-time latitude matching is time-consuming and inefficient.
Get the driving data of the vehicle in the preset period from the historical driving database. The coding combination is obtained based on the longitude, latitude and speed, the road is divided into multiple grids, and the road information is stored into the road database.
By obtaining the road information of the current grid where the vehicle is located directly from the road database, the efficiency and accuracy of road information acquisition is improved.
Smart Images

Figure CN119377499A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle network data technology, and in particular to a road information storage method, device, computer equipment, computer-readable storage medium and computer program product. Background Art
[0002] In the application of Internet of Vehicles data, terrain, road type and slope are of great significance for analyzing the vehicle's driving conditions. Different terrains and road types will affect the vehicle's power requirements and transmission efficiency. Therefore, in order to better understand and compare the vehicle's actual driving conditions, road information is crucial.
[0003] In the existing technology, the road network data is mainly matched through the real-time latitude and longitude of the vehicle to obtain the vehicle's current road type, slope information and other road information. However, the data matching process is time-consuming and inefficient. Summary of the invention
[0004] Based on this, it is necessary to provide a road information storage method, device, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of road information acquisition in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for storing road information, the method comprising:
[0006] Acquire the driving data of the vehicle at each moment in a preset time period from a historical driving database, wherein the driving data includes longitude, latitude, heading angle, speed and road information of the road on which the vehicle is located;
[0007] Based on the longitude, the latitude and the speed, obtaining a coding combination corresponding to the moment in a geographic space coding model;
[0008] Based on the heading angle, the coding combination and the preset grid size, the road on which the vehicle is located is divided into a plurality of grids, and based on the road information, road information corresponding to the grids is acquired;
[0009] Based on the coding combination, the road information corresponding to the grid is stored in a road database.
[0010] In one embodiment, the acquiring, based on the longitude, the latitude and the speed, a coding combination corresponding to the moment in a geographic space coding model comprises:
[0011] Obtaining an average speed of the vehicle within the preset time period based on the speed;
[0012] Based on the average speed and the collection frequency of the driving data, acquiring a code length of the code combination;
[0013] Get an initial longitude range and an initial latitude range;
[0014] Acquire a plurality of longitude codes corresponding to the longitude based on the initial longitude range and the code length, and acquire a plurality of latitude codes corresponding to the latitude based on the initial latitude range and the code length;
[0015] The plurality of longitude codes and the plurality of latitude codes are combined to obtain the code combination.
[0016] In one embodiment, the step of obtaining a plurality of longitude codes corresponding to the longitude based on the initial longitude range and the code length includes:
[0017] Dividing the initial longitude range into a plurality of longitude ranges, and determining a longitude code corresponding to each of the plurality of longitude ranges;
[0018] Determine the longitude code corresponding to the longitude range in which the longitude is located among the multiple longitude ranges as the longitude code corresponding to the longitude;
[0019] The longitude range in which the longitude is located is determined as a new initial longitude range, and the step of dividing the initial longitude range into multiple longitude ranges is returned to and continued to be executed until the number of divisions meets the coding length.
[0020] In one embodiment, the acquiring a plurality of latitude codes corresponding to the latitude based on the initial latitude range and the code length includes:
[0021] Dividing the initial latitude range into a plurality of latitude ranges, and determining a latitude code corresponding to each of the plurality of latitude ranges;
[0022] Determine the latitude code corresponding to the latitude range in which the latitude is located among the multiple latitude ranges as the latitude code corresponding to the latitude;
[0023] The latitude range in which the latitude is located is determined as a new initial latitude range, and the step of dividing the initial latitude range into a plurality of latitude ranges is returned to and continued to be executed until the number of divisions meets the coding length.
[0024] In one embodiment, dividing the road on which the vehicle is located into a plurality of grids based on the heading angle, the coding combination and the preset grid size includes:
[0025] Acquire a plurality of preset heading angle ranges, and determine, for each moment in the preset time period, a driving direction of the vehicle on the road based on the preset heading angle range in which the corresponding heading angle is located;
[0026] The road on which the vehicle is located is divided into a plurality of grids based on the driving direction, the coding combination and the preset grid size.
[0027] In one embodiment, the acquiring the road information corresponding to the grid based on the road information includes:
[0028] For each grid, obtaining all moments when the vehicle is in the grid during the preset time period;
[0029] For each type of road information corresponding to all the moments, the median of the road information is determined as the road information corresponding to the grid.
[0030] In one embodiment, the method further comprises:
[0031] Acquire multiple preset directions, and acquire all driving directions corresponding to all moments corresponding to each grid, wherein the multiple preset directions include multiple groups of opposite directions;
[0032] In a case where the all driving directions do not include at least one preset direction among the plurality of preset directions, the road information corresponding to the preset direction not included is determined based on the road information corresponding to the direction opposite to the preset direction not included.
[0033] In a second aspect, the present application further provides a road information storage device, the device comprising:
[0034] A first acquisition module is used to acquire the driving data of the vehicle at each moment in a preset time period from a historical driving database, wherein the driving data includes longitude, latitude, heading angle, speed and road information of the road on which the vehicle is located;
[0035] A second acquisition module, configured to acquire a coding combination corresponding to the moment in a geographic space coding model based on the longitude, the latitude and the speed;
[0036] A division module, configured to divide the road on which the vehicle is located into a plurality of grids based on the heading angle, the coding combination and a preset grid size, and to obtain road information corresponding to the grids based on the road information;
[0037] The storage module is used to store the road information corresponding to the grid into a road database based on the coding combination.
[0038] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.
[0040] The above-mentioned road information storage method, device, computer equipment, computer-readable storage medium and computer program product obtain the driving data of the vehicle at each moment in a preset time period from the historical driving database, and the driving data includes longitude, latitude, heading angle, speed and road information of the road where the vehicle is located; based on longitude, latitude and speed, obtain the corresponding coding combination at the moment in the geographic space coding model; based on the heading angle, coding combination and preset grid size, divide the road where the vehicle is located into multiple grids, and obtain the road information corresponding to the grid based on the road information; based on the coding combination, store the road information corresponding to the grid in the road database. The method provided by the present application can directly obtain the corresponding road information from the road database based on the grid where the vehicle is currently located, which can improve the efficiency and accuracy of road information acquisition. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] FIG1 is a schematic diagram of a flow chart of a method for storing road information in one embodiment;
[0043] FIG2 is a schematic diagram of a flow chart of a method for obtaining longitude code in one embodiment;
[0044] FIG3 is a schematic flow chart of a road information storage method in another embodiment;
[0045] FIG4 is a structural block diagram of a road information storage device in one embodiment;
[0046] FIG. 5 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] In one embodiment, as shown in FIG1 , a road information storage method is provided. This embodiment is illustrated by applying the method to a terminal. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0049] S102. Obtaining driving data of the vehicle at each moment in a preset time period from a historical driving database, the driving data including longitude, latitude, heading angle, speed, and road information of the road on which the vehicle is located.
[0050] The road information may include, but is not limited to, road type, road name, slope value, and terrain information.
[0051] Optionally, after the driving data is acquired, it is necessary to clean the driving data. For example, missing data may be filled and abnormal data may be removed.
[0052] S104. Based on the longitude, latitude and speed, obtain the corresponding coding combination at the moment in the geographic space coding model.
[0053] The geospatial encoding model is used to convert spatial information into a set of codes in a specific form. For example, the geospatial encoding model may be a Geohash encoding model, which is used to convert geographic coordinates (longitude and latitude) into a short string.
[0054] Optionally, in the Geohash coding model, the longitude and latitude within a defined range are approximated and coded according to a binary recursive method to obtain a coding combination.
[0055] S106 , dividing the road on which the vehicle is located into a plurality of grids based on the heading angle, the coding combination and the preset grid size, and acquiring road information corresponding to the grids based on the road information.
[0056] Among them, since at different times, even if the vehicle is at the same position, the vehicle's driving direction may be different, and different driving directions have different corresponding slope values. In order to make the stored slope value more accurate, it is necessary to determine the vehicle's corresponding driving direction at each time based on the heading angle. Optionally, the preset grid size can be 4.8m×4.8m.
[0057] S108. Based on the coding combination, the road information corresponding to the grid is stored in a road database.
[0058] Optionally, the coding combination may be divided into a plurality of sub-combinations, and different sub-combinations may be stored in different partitions in the road database.
[0059] In the above road information storage method, the driving data of the vehicle at each moment in the preset time period is obtained from the historical driving database, and the driving data includes longitude, latitude, heading angle, speed and road information of the road where the vehicle is located; based on longitude, latitude and speed, the corresponding coding combination at the moment in the geographic space coding model is obtained; based on the heading angle, coding combination and preset grid size, the road where the vehicle is located is divided into multiple grids, and the road information corresponding to the grid is obtained based on the road information; based on the coding combination, the road information corresponding to the grid is stored in the road database. The method provided by the present application can directly obtain the corresponding road information from the road database based on the grid where the vehicle is currently located, which can improve the efficiency and accuracy of road information acquisition.
[0060] In some embodiments, based on longitude, latitude and speed, a code combination corresponding to a moment in a geospatial coding model is obtained, including: obtaining an average speed of the vehicle in a preset time period based on the speed; obtaining a code length of the code combination based on the average speed and the collection frequency of driving data; obtaining an initial longitude range and an initial latitude range; obtaining multiple longitude codes corresponding to the longitude based on the initial longitude range and the code length, and obtaining multiple latitude codes corresponding to the latitude based on the initial latitude range and the code length; and combining multiple longitude codes and multiple latitude codes to obtain a code combination.
[0061] The code length is the number of codes. For example, a code length of 9 means that 9 codes are included. The number of codes for multiple longitude codes and the number of codes for multiple latitude codes are both code lengths.
[0062] Optionally, when the acquisition frequency is 1s and the average speed is 40km / h, the distance traveled by the vehicle per second is about 11m, so the encoding length can be set to 9.
[0063] Optionally, the length of the coding combination is the sum of the number of codes of the multiple longitude codes and the multiple latitude codes. All longitude codes can be placed in the odd bits of the coding combination in the order in which the multiple longitude codes are obtained, and all latitude codes can be placed in the even bits of the coding combination in the order in which the multiple latitude codes are obtained. For example, the multiple longitude codes are: 11 01 00 01 01, and the multiple latitude codes are: 10 01 11 01 00, then the coding combination is: 11010011 1010 0011 0001.
[0064] In this embodiment, the code length is determined based on the average speed of the vehicle in a preset time period and the collection frequency of the driving data, so that the determined code length is more accurate.
[0065] In some embodiments, as shown in FIG. 2 , obtaining a plurality of longitude codes corresponding to the longitude based on the initial longitude range and the code length includes:
[0066] S202: Divide the initial longitude range into multiple longitude ranges, and determine the longitude code corresponding to each of the multiple longitude ranges.
[0067] S204. Determine the longitude code corresponding to the longitude range in which the longitude is located among the multiple longitude ranges as the longitude code corresponding to the longitude.
[0068] S206. Determine the longitude range in which the longitude is located as a new initial longitude range, return to the step of dividing the initial longitude range into multiple longitude ranges and continue to execute until the number of divisions meets the coding length.
[0069] Optionally, since the longitude range of the earth is [-180, 180], the longitude range of [-180, 180] is used as the initial longitude range, and the initial longitude range is evenly divided into two longitude ranges [-180, 0) and (0, 180], and the longitude codes corresponding to the longitude ranges [-180, 0) and (0, 180] are determined respectively, and the longitude code corresponding to [-180, 0) is a binary number 0, and the longitude code corresponding to (0, 180] is a binary number 1. For the longitude and latitude coordinates (11 4.3528769, 20.5467932), the longitude coordinate 114.3528769 is within the range of (0, 180], so the first longitude code corresponding to 114.3528769 is 1, and (0, 180] is the new initial longitude range. The new initial longitude range (0, 180] is evenly divided into two longitude ranges [0, 90) and (90, 180], and the above process is repeated until the number of longitude codes obtained reaches the code length. The multiple longitude codes finally obtained are: 11 01 00 01 01.
[0070] In this embodiment, multiple longitude codes corresponding to the longitude are obtained based on the initial longitude range and the code length, so that the obtained longitude code is more accurate, thereby making the subsequently determined code combination more accurate.
[0071] In some embodiments, multiple latitude codes corresponding to the latitude are obtained based on the initial latitude range and the code length, including: dividing the initial latitude range into multiple latitude ranges, and determining the latitude code corresponding to each latitude range in the multiple latitude ranges; determining the latitude code corresponding to the latitude range in the multiple latitude ranges as the latitude code corresponding to the latitude; determining the latitude range in which the latitude is located as the new initial latitude range, returning to the step of dividing the initial latitude range into multiple latitude ranges and continuing to execute until the number of divisions meets the code length.
[0072] Optionally, since the latitude range of the earth is [-90, 90], the latitude range of [-90, 90] is used as the initial latitude range, and the initial latitude range is evenly divided into two latitude ranges [-90, 0) and (0, 90], and the latitude codes corresponding to the latitude ranges [-90, 0) and (0, 90] are determined respectively, and the latitude code corresponding to [-90, 0) is a binary number 0, and the latitude code corresponding to (0, 90] is a binary number 1. For the longitude and latitude coordinates (114. 3528769, 20.5467932), the latitude coordinate 20.5467932 is within the range of (0, 90], so the first latitude code corresponding to 20.5467932 is 1, and (0, 90] is the new initial latitude range. The new initial latitude range (0, 90] is evenly divided into two latitude ranges [0, 45) and (45, 90], and the above process is repeated until the number of latitude codes obtained reaches the code length. The acquisition process of multiple latitude codes is shown in Table 1:
[0073] Table 1
[0074]
[0075] The final multiple latitude codes are: 10 01 11 01 00.
[0076] In this embodiment, multiple latitude codes corresponding to the latitude are obtained based on the initial latitude range and the code length, so that the obtained latitude code is more accurate, thereby making the subsequently determined code combination more accurate.
[0077] In some embodiments, the road on which the vehicle is located is divided into multiple grids based on the heading angle, the code combination and the preset grid size, including: obtaining multiple preset heading angle ranges, and for each moment in a preset time period, determining the driving direction of the vehicle on the road based on the preset heading angle range of the corresponding heading angle; dividing the road on which the vehicle is located into multiple grids based on the driving direction, the code combination and the preset grid size.
[0078] Optionally, the preset heading angle range may include 0 o Up to 180 o and 180 o Up to 360 o There are two heading angle ranges. Since the road has only two directions, forward and reverse, for the same position, it will be located at 0 o Up to 180 o The corresponding driving direction of the heading angle is recorded as 1, and the direction at 180 o Up to 360 o The corresponding driving direction of the heading angle is recorded as 0, as shown in the following formula:
[0079]
[0080] Where angle_direction is the driving direction and road_angle is the heading angle.
[0081] Optionally, the preset grid size can be determined based on the code length. The longer the code length is, the smaller the preset grid size is, and the shorter the code length is, the larger the preset grid size is. The relationship between the code length and the preset grid size is shown in Table 2:
[0082] Table 2
[0083]
[0084] In this embodiment, the driving direction of the vehicle is determined based on the corresponding relationship between the heading angle and the preset heading angle range, so that the determined driving direction is more accurate, thereby making the stored slope value more accurate.
[0085] In some embodiments, obtaining road information corresponding to a grid based on road information includes: for each grid, obtaining all moments when the vehicle is in the grid in a preset time period; for each type of road information corresponding to all moments, determining the median of the road information as the road information corresponding to the grid.
[0086] Optionally, for different moments corresponding to the same driving direction in the same grid, the corresponding road information at each moment is close. Therefore, for the same driving direction in the same grid, the median of each type of road information in the driving direction can be obtained, and then for all driving directions in the same grid, the average of the medians of the road information in all driving directions can be determined as the road information corresponding to the grid.
[0087] In this embodiment, the median of the road information is determined as the road information corresponding to the grid, so that the determined road information corresponding to the grid is more accurate.
[0088] In some embodiments, the method also includes: obtaining multiple preset directions, and obtaining all driving directions corresponding to all moments corresponding to each grid, the multiple preset directions including multiple groups of opposite directions; when all driving directions do not include at least one preset direction among the multiple preset directions, based on the road information corresponding to the direction opposite to the excluded preset direction, determining the road information corresponding to the excluded preset direction.
[0089] Optionally, the opposite number of the slope value corresponding to the direction opposite to the excluded preset direction may be determined as the slope value corresponding to the excluded preset direction.
[0090] In this embodiment, the road information corresponding to the excluded preset direction is determined based on the road information corresponding to the direction opposite to the excluded preset direction, so that the determined road information corresponding to the excluded preset direction is more accurate.
[0091] In one embodiment, as shown in FIG3 , another road information storage method is provided, the method comprising the following contents:
[0092] S1. Filter out longitude, latitude, heading angle, road type, road name, slope value, and terrain signals from the vehicle history driving database, and perform data cleaning on the filtered signals.
[0093] S2. Road direction recognition. Since the road driving directions are different at the same location, the slope values are also different. Therefore, the road direction can be recognized based on the heading angle collected during the vehicle driving process.
[0094] S3. Calculate the Geohash encoding accuracy based on the average driving speed of the vehicle and the frequency of data collection.
[0095] S4. Calculate the Geohash code value of the vehicle's current position based on the vehicle's longitude and latitude and Geohash code accuracy.
[0096] S5. Divide the driving data into grids according to the Geohash code and the road direction, and calculate the terrain, road type and slope value in each grid.
[0097] S6. Supplement the reverse data of the roads in the same grid according to the road direction.
[0098] S7. Perform partition storage according to the 2-bit and 3-bit codes of Geohash, and build a road database based on the historical vehicle driving data.
[0099] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0100] Based on the same inventive concept, the embodiment of the present application also provides a road information storage device for implementing the road information storage method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more road information storage device embodiments provided below can refer to the limitations on the road information storage method above, and will not be repeated here.
[0101] In an exemplary embodiment, as shown in FIG. 4 , a road information storage device 400 is provided, comprising: a first acquisition module 401 , a second acquisition module 402 , a division module 403 and a storage module 404 , wherein:
[0102] The first acquisition module 401 is used to acquire the driving data of the vehicle at each moment in a preset time period from a historical driving database, wherein the driving data includes longitude, latitude, heading angle, speed and road information of the road where the vehicle is located.
[0103] The second acquisition module 402 is used to acquire a coding combination corresponding to the moment in the geographic space coding model based on the longitude, the latitude and the speed.
[0104] The division module 403 is used to divide the road where the vehicle is located into multiple grids based on the heading angle, the coding combination and the preset grid size, and obtain the road information corresponding to the grid based on the road information.
[0105] The storage module 404 is used to store the road information corresponding to the grid into a road database based on the coding combination.
[0106] In some embodiments, the second acquisition module 402 includes:
[0107] The first acquisition unit is used to acquire an average speed of the vehicle within the preset time period based on the speed.
[0108] The second acquisition unit is used to acquire the code length of the code combination based on the average speed and the collection frequency of the driving data.
[0109] The third acquisition unit is used to acquire an initial longitude range and an initial latitude range.
[0110] A fourth acquisition unit is used to acquire multiple longitude codes corresponding to the longitude based on the initial longitude range and the code length, and to acquire multiple latitude codes corresponding to the latitude based on the initial latitude range and the code length.
[0111] A combining unit is used to combine the multiple longitude codes and the multiple latitude codes to obtain the code combination.
[0112] In some embodiments, the fourth acquisition unit is also used to divide the initial longitude range into multiple longitude ranges, and determine the longitude code corresponding to each of the multiple longitude ranges; determine the longitude code corresponding to the longitude range in which the longitude is located in the multiple longitude ranges as the longitude code corresponding to the longitude; determine the longitude range in which the longitude is located as the new initial longitude range, return to the step of dividing the initial longitude range into multiple longitude ranges and continue executing until the number of divisions meets the coding length.
[0113] In some embodiments, the fourth acquisition unit is also used to divide the initial latitude range into multiple latitude ranges, and determine the latitude code corresponding to each latitude range in the multiple latitude ranges; determine the latitude code corresponding to the latitude range in which the latitude is located in the multiple latitude ranges as the latitude code corresponding to the latitude; determine the latitude range in which the latitude is located as the new initial latitude range, return to the step of dividing the initial latitude range into multiple latitude ranges and continue to execute until the number of divisions meets the coding length.
[0114] In some embodiments, the division module 403 is also used to obtain multiple preset heading angle ranges, and for each moment in the preset time period, determine the driving direction of the vehicle on the road based on the preset heading angle range of the corresponding heading angle; and divide the road where the vehicle is located into multiple grids based on the driving direction, the coding combination and the preset grid size.
[0115] In some embodiments, the division module 403 is also used to obtain, for each grid, all moments when the vehicle is in the grid during the preset time period; for each type of road information corresponding to all the moments, determine the median of the road information as the road information corresponding to the grid.
[0116] In some embodiments, the road information storage device 400 is specifically used to obtain multiple preset directions and all driving directions corresponding to all moments corresponding to each grid, wherein the multiple preset directions include multiple groups of opposite directions; when all driving directions do not include at least one preset direction among the multiple preset directions, based on the road information corresponding to the direction opposite to the excluded preset direction, the road information corresponding to the excluded preset direction is determined.
[0117] Each module in the above-mentioned road information storage device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0118] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, a near field communication (NFC) or other technologies. When the computer program is executed by the processor, a road information storage method is implemented.
[0119] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0120] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining driving data of a vehicle at each moment in a preset time period from a historical driving database, the driving data including longitude, latitude, heading angle, speed and road information of the road on which the vehicle is located; obtaining a code combination corresponding to the moment in a geographic space coding model based on the longitude, the latitude and the speed; dividing the road on which the vehicle is located into multiple grids based on the heading angle, the code combination and a preset grid size, and obtaining road information corresponding to the grid based on the road information; and storing the road information corresponding to the grid in a road database based on the code combination.
[0121] In one embodiment, the processor executes a computer program to obtain a code combination corresponding to the moment in the geospatial coding model based on the longitude, the latitude and the speed, including: obtaining an average speed of the vehicle in the preset time period based on the speed; obtaining a code length of the code combination based on the average speed and the collection frequency of the driving data; obtaining an initial longitude range and an initial latitude range; obtaining multiple longitude codes corresponding to the longitude based on the initial longitude range and the code length, and obtaining multiple latitude codes corresponding to the latitude based on the initial latitude range and the code length; and combining the multiple longitude codes and the multiple latitude codes to obtain the code combination.
[0122] In one embodiment, the method implemented by the processor when executing a computer program to obtain multiple longitude codes corresponding to the longitude based on the initial longitude range and the code length includes: dividing the initial longitude range into multiple longitude ranges, and determining the longitude code corresponding to each longitude range in the multiple longitude ranges; determining the longitude code corresponding to the longitude range in which the longitude is located in the multiple longitude ranges as the longitude code corresponding to the longitude; determining the longitude range in which the longitude is located as a new initial longitude range, returning to the step of dividing the initial longitude range into multiple longitude ranges and continuing to execute until the number of divisions meets the code length.
[0123] In one embodiment, the method implemented by the processor when executing a computer program to obtain multiple latitude codes corresponding to the latitude based on the initial latitude range and the code length includes: dividing the initial latitude range into multiple latitude ranges, and determining the latitude code corresponding to each latitude range in the multiple latitude ranges; determining the latitude code corresponding to the latitude range in which the latitude is located in the multiple latitude ranges as the latitude code corresponding to the latitude; determining the latitude range in which the latitude is located as a new initial latitude range, returning to the step of dividing the initial latitude range into multiple latitude ranges and continuing to execute until the number of divisions meets the code length.
[0124] In one embodiment, the method implemented when a processor executes a computer program to divide the road where the vehicle is located into multiple grids based on the heading angle, the code combination and the preset grid size includes: obtaining multiple preset heading angle ranges, and for each moment in the preset time period, determining the driving direction of the vehicle on the road based on the preset heading angle range in which the corresponding heading angle is located; dividing the road where the vehicle is located into multiple grids based on the driving direction, the code combination and the preset grid size.
[0125] In one embodiment, the method of obtaining the road information corresponding to the grid based on the road information implemented when the processor executes the computer program includes: for each grid, obtaining all moments when the vehicle is in the grid during the preset time period; for each type of road information corresponding to all the moments, determining the median of the road information as the road information corresponding to the grid.
[0126] In one embodiment, the method implemented when the processor executes the computer program also includes: obtaining multiple preset directions, and obtaining all driving directions corresponding to all moments corresponding to each grid, the multiple preset directions including multiple groups of opposite directions; when all the driving directions do not include at least one preset direction among the multiple preset directions, based on the road information corresponding to the direction opposite to the excluded preset direction, determining the road information corresponding to the excluded preset direction.
[0127] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining driving data of a vehicle at each moment in a preset time period from a historical driving database, the driving data including longitude, latitude, heading angle, speed and road information of the road on which the vehicle is located; based on the longitude, the latitude and the speed, obtaining a coding combination corresponding to the moment in a geographic space coding model; based on the heading angle, the coding combination and a preset grid size, dividing the road on which the vehicle is located into multiple grids, and obtaining road information corresponding to the grids based on the road information; based on the coding combination, storing the road information corresponding to the grids in a road database.
[0128] In one embodiment, the computer program implemented when executed by the processor obtains the code combination corresponding to the moment in the geospatial coding model based on the longitude, the latitude and the speed, including: obtaining the average speed of the vehicle in the preset time period based on the speed; obtaining the code length of the code combination based on the average speed and the collection frequency of the driving data; obtaining an initial longitude range and an initial latitude range; obtaining multiple longitude codes corresponding to the longitude based on the initial longitude range and the code length, and obtaining multiple latitude codes corresponding to the latitude based on the initial latitude range and the code length; combining the multiple longitude codes and the multiple latitude codes to obtain the code combination.
[0129] In one embodiment, the computer program implemented when executed by the processor obtains multiple longitude codes corresponding to the longitude based on the initial longitude range and the code length, including: dividing the initial longitude range into multiple longitude ranges, and determining the longitude code corresponding to each longitude range in the multiple longitude ranges; determining the longitude code corresponding to the longitude range in which the longitude is located in the multiple longitude ranges as the longitude code corresponding to the longitude; determining the longitude range in which the longitude is located as a new initial longitude range, returning to the step of dividing the initial longitude range into multiple longitude ranges and continuing to execute until the number of divisions meets the code length.
[0130] In one embodiment, the computer program implemented when executed by the processor obtains multiple latitude codes corresponding to the latitude based on the initial latitude range and the code length, including: dividing the initial latitude range into multiple latitude ranges, and determining the latitude code corresponding to each latitude range in the multiple latitude ranges; determining the latitude code corresponding to the latitude range in which the latitude is located in the multiple latitude ranges as the latitude code corresponding to the latitude; determining the latitude range in which the latitude is located as a new initial latitude range, returning to the step of dividing the initial latitude range into multiple latitude ranges and continuing to execute until the number of divisions meets the code length.
[0131] In one embodiment, the computer program implemented when executed by the processor divides the road where the vehicle is located into multiple grids based on the heading angle, the code combination and the preset grid size, including: obtaining multiple preset heading angle ranges, and for each moment in the preset time period, determining the driving direction of the vehicle on the road based on the preset heading angle range in which the corresponding heading angle is located; dividing the road where the vehicle is located into multiple grids based on the driving direction, the code combination and the preset grid size.
[0132] In one embodiment, the computer program implemented when executed by the processor obtains the road information corresponding to the grid based on the road information, including: for each grid, obtaining all moments when the vehicle is in the grid during the preset time period; for each type of road information corresponding to all the moments, determining the median of the road information as the road information corresponding to the grid.
[0133] In one embodiment, the method implemented when the computer program is executed by the processor also includes: obtaining multiple preset directions, and obtaining all driving directions corresponding to all moments corresponding to each grid, the multiple preset directions including multiple groups of opposite directions; when all the driving directions do not include at least one preset direction among the multiple preset directions, based on the road information corresponding to the direction opposite to the excluded preset direction, determining the road information corresponding to the excluded preset direction.
[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0135] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0136] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0137] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A road information storage method, characterized in that: The method comprises: Acquire the driving data of the vehicle at each moment in a preset time period from a historical driving database, wherein the driving data includes longitude, latitude, heading angle, speed and road information of the road on which the vehicle is located; Based on the longitude, the latitude and the speed, obtaining a coding combination corresponding to the moment in a geographic space coding model; Based on the heading angle, the coding combination and the preset grid size, the road on which the vehicle is located is divided into a plurality of grids, and based on the road information, road information corresponding to the grids is acquired; Based on the coding combination, the road information corresponding to the grid is stored in a road database.
2. The method according to claim 1, characterized in that The acquiring, based on the longitude, the latitude and the speed, a coding combination corresponding to the moment in a geographic space coding model comprises: Obtaining an average speed of the vehicle within the preset time period based on the speed; Based on the average speed and the collection frequency of the driving data, acquiring a code length of the code combination; Get an initial longitude range and an initial latitude range; Acquire a plurality of longitude codes corresponding to the longitude based on the initial longitude range and the code length, and acquire a plurality of latitude codes corresponding to the latitude based on the initial latitude range and the code length; The plurality of longitude codes and the plurality of latitude codes are combined to obtain the code combination.
3. The method according to claim 2, characterized in that The step of acquiring a plurality of longitude codes corresponding to the longitude based on the initial longitude range and the code length includes: Dividing the initial longitude range into a plurality of longitude ranges, and determining a longitude code corresponding to each of the plurality of longitude ranges; Determine the longitude code corresponding to the longitude range in which the longitude is located among the multiple longitude ranges as the longitude code corresponding to the longitude; The longitude range in which the longitude is located is determined as a new initial longitude range, and the step of dividing the initial longitude range into multiple longitude ranges is returned to and continued to be executed until the number of divisions meets the coding length.
4. The method according to claim 2, characterized in that: The acquiring a plurality of latitude codes corresponding to the latitude based on the initial latitude range and the code length comprises: Dividing the initial latitude range into a plurality of latitude ranges, and determining a latitude code corresponding to each of the plurality of latitude ranges; Determine the latitude code corresponding to the latitude range in which the latitude is located among the multiple latitude ranges as the latitude code corresponding to the latitude; The latitude range in which the latitude is located is determined as a new initial latitude range, and the step of dividing the initial latitude range into a plurality of latitude ranges is returned to and continued to be executed until the number of divisions meets the coding length.
5. The method according to claim 1, characterized in that The method of dividing the road on which the vehicle is located into a plurality of grids based on the heading angle, the coding combination and the preset grid size includes: Acquire a plurality of preset heading angle ranges, and determine, for each moment in the preset time period, a driving direction of the vehicle on the road based on the preset heading angle range in which the corresponding heading angle is located; The road on which the vehicle is located is divided into a plurality of grids based on the driving direction, the coding combination and the preset grid size.
6. The method according to claim 1, characterized in that The acquiring the road information corresponding to the grid based on the road information includes: For each grid, obtaining all moments when the vehicle is in the grid during the preset time period; For each type of road information corresponding to all the moments, the median of the road information is determined as the road information corresponding to the grid.
7. The method according to any one of claims 5 or 6, characterized in that: The method further comprises: Acquire multiple preset directions, and acquire all driving directions corresponding to all moments corresponding to each grid, wherein the multiple preset directions include multiple groups of opposite directions; In a case where the all driving directions do not include at least one preset direction among the plurality of preset directions, the road information corresponding to the preset direction not included is determined based on the road information corresponding to the direction opposite to the preset direction not included.
8. A road information storage device, characterized in that: The device comprises: A first acquisition module is used to acquire the driving data of the vehicle at each moment in a preset time period from a historical driving database, wherein the driving data includes longitude, latitude, heading angle, speed and road information of the road on which the vehicle is located; A second acquisition module, configured to acquire a coding combination corresponding to the moment in a geographic space coding model based on the longitude, the latitude and the speed; A division module, configured to divide the road on which the vehicle is located into a plurality of grids based on the heading angle, the coding combination and a preset grid size, and to obtain road information corresponding to the grids based on the road information; The storage module is used to store the road information corresponding to the grid into a road database based on the coding combination.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.