A method, apparatus, device, and medium for processing map data

By flattening the visual positioning map data and mapping virtual address, the problem of excessive memory occupancy of map data storage is solved, efficient data access and memory management are achieved, and application scenarios are expanded.

CN114218131BActive Publication Date: 2025-07-22UISEE TECH BEIJING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111521822.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2025-07-22
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

In the prior art, the data storage method of pre-built visual positioning maps leads to an increase in memory overhead with the increase in map capacity, and deserialization takes a long time, which limits the scale and application scenarios of visual positioning maps.

Method used

Flattening processing is used to divide the map data into multiple flattening map shard data, and map data is mapped to the virtual address space of the process through offset dictionary and virtual address mechanism, and the page cache mechanism is used to reduce the number of data copies to realize single-level memory management.

Benefits of technology

It realizes efficient access to map data, reduces deserialization time, expands the application scenarios of visual positioning technology, and makes memory occupancy safe and controllable, and is not limited by physical memory size, improving map data access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114218131B_ABST
    Figure CN114218131B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a method, apparatus, device and medium for processing map data. The method is applied to an operating system and includes: receiving a data reading request; obtaining map metadata and spatial index data, and determining target flattened map shard data corresponding to a target data item to be accessed and position information to be accessed of the target data item in the target flattened map shard data according to positioning information, map metadata and spatial index data, or according to a current frame and map metadata; determining a target virtual address space mapped by the target flattened map shard data; obtaining an offset dictionary, and determining a virtual address of the target data item according to the offset dictionary, the target virtual address space and the position information to be accessed; and reading data corresponding in a page cache based on the virtual address of the target data item. Embodiments of the present disclosure implement single-level memory management, the memory occupied by the map during operation is safe and controllable, and the efficiency of map data access is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of vehicle map data processing, and particularly to a map data processing method, apparatus, device and medium. Background Art

[0002] With the development of vehicle intelligent technologies, autonomous driving technology has become a hot topic in the field of vehicle research. Extracting visual features of the surrounding environment using a camera and estimating the current pose of the vehicle in real time is one of the main means for autonomous positioning of autonomous vehicles. And the visual positioning method based on a pre-built map is a common method for providing high-precision positioning in a fixed scenario.

[0003] Currently, the storage method of the map data of a pre-built visual positioning map is usually to save it as a file using a certain object serialization method. However, this method has the following defects: The map data must first be deserialized and memory (heap memory) is allocated to become a fully constructed object. The memory overhead of this method increases with the increase of the map capacity, and the deserialization takes a long time, thus causing the scale of the visual positioning map to be limited by memory. Summary of the Invention

[0004] To solve the above technical problems, the present disclosure provides a map data processing method, apparatus, device and medium.

[0005] An embodiment of the present disclosure provides a map data processing method, which is applied to an operating system and includes:

[0006] Receiving a data reading request, where the data reading request is used to read visual positioning map data, the visual positioning map data includes map metadata, spatial index data, and a plurality of flattened map shard data, the flattened map shard data is obtained by processing original map shard data in a flattening tool, and the data reading request includes a current frame or positioning information;

[0007] Obtaining the map metadata and the spatial index data, and determining, according to the positioning information, the map metadata, and the spatial index data, or according to the current frame and the map metadata, the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data;

[0008] Determining the target virtual address space mapped by the target flattened map shard data;

[0009] Obtaining an offset dictionary, and determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed;

[0010] Read the corresponding data in the page cache based on the virtual address of the target data item.

[0011] An embodiment of the present disclosure also provides a method for processing map data, the method including:

[0012] Obtain visual positioning map data;

[0013] Input the original map shard file of the visual positioning map data into a flattening tool to obtain flattened map shard data and an offset dictionary;

[0014] Store the flattened map shard data in a disk.

[0015] An embodiment of the present disclosure also provides a map data processing apparatus, which is set in an operating system and includes:

[0016] A request module, configured to receive a data reading request, where the data reading request is used to read visual positioning map data, the visual positioning map data includes map metadata, spatial index data, and a plurality of flattened map shard data, the flattened map shard data is obtained by inputting the original map shard data into a flattening tool for processing, and the data reading request includes a current frame or positioning information;

[0017] A data module, configured to obtain the map metadata and the spatial index data, and determine the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data according to the positioning information, the map metadata, and the spatial index data, or according to the current frame and the map metadata;

[0018] A first virtual module, configured to determine the target virtual address space mapped by the target flattened map shard data;

[0019] A second virtual module, configured to obtain an offset dictionary, and determine the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed;

[0020] A reading module, configured to read the corresponding data in the page cache based on the virtual address of the target data item.

[0021] An embodiment of the present disclosure also provides a map data processing apparatus, the apparatus including:

[0022] An obtaining module, configured to obtain visual positioning map data;

[0023] A flattening module, configured to input the original map shard file of the visual positioning map data into a flattening tool to obtain flattened map shard data and an offset dictionary;

[0024] A storage module, configured to store the flattened map shard data in a disk.

[0025] An embodiment of the present disclosure further provides an electronic device, which includes: a processor; a memory for storing executable instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the map data processing method provided by the embodiment of the present disclosure.

[0026] An embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program for executing the map data processing method provided by the embodiment of the present disclosure.

[0027] The technical solution provided by the embodiment of the present disclosure has the following advantages compared with the prior art: In the map data processing solution provided by the embodiment of the present disclosure, the operating system can receive a data reading request, where the data reading request is used to read visual positioning map data, and the visual positioning map data includes map metadata, spatial index data, and a plurality of flattened map shard data. The flattened map shard data is obtained by inputting original map shard data into a flattening tool, and the data reading request includes a current frame or positioning information; obtaining map metadata and spatial index data, and determining, according to the positioning information, map metadata, and spatial index data, or according to the current frame and map metadata, the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data; determining the target virtual address space mapped by the target flattened map shard data; obtaining an offset dictionary, and determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed; reading the corresponding data in the page cache based on the virtual address of the target data item. By adopting the above technical solution, through flattening the map data and mapping the map data to the virtual address space of the process, after the operating system receives the data reading request, it can determine the virtual address of the data item according to the map metadata, spatial index data, and offset dictionary, and access the data in the page cache through the virtual address. Utilizing the page cache mechanism can reduce the number of data copies, making the page cache of the operating system the primary cache of the map data, realizing single-level memory management, being able to access data more effectively, and the memory occupied by the map during operation being safe and controllable, not limited by the physical memory size of the operating device, expanding the application scenarios of visual positioning technology, reducing the time-consuming of deserialization, and improving the efficiency of map data access. Description of the Drawings

[0028] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.

[0029] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0030] Figure 1 A schematic diagram of a map access in the related art;

[0031] Figure 2 Another schematic diagram of a map access in the related art

[0032] Figure 3 A schematic flowchart of a map data processing method provided by an embodiment of the present disclosure;

[0033] Figure 4 A schematic diagram of a map access provided by an embodiment of the present disclosure;

[0034] Figure 5 A schematic flowchart of another map data processing method provided by an embodiment of the present disclosure;

[0035] Figure 6 A schematic diagram of a map flattening provided by an embodiment of the present disclosure;

[0036] Figure 7 Another schematic diagram of a map flattening provided by an embodiment of the present disclosure;

[0037] Figure 8 A schematic structural diagram of a map data processing device provided by an embodiment of the present disclosure;

[0038] Figure 9 Another schematic structural diagram of a map data processing device provided by an embodiment of the present disclosure;

[0039] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0040] In the following detailed description, numerous specific details of the present disclosure are set forth by way of example in order to provide a thorough understanding of the relevant disclosure. However, it will be apparent to those of ordinary skill in the art that the present disclosure may be practiced without these details. It should be understood that the terms "system", "device", "unit", and / or "module" used in the present disclosure are a means of distinguishing different components, elements, parts, or assemblies at different levels in an ordered arrangement. However, if other expressions can achieve the same purpose, these terms may be replaced by other expressions.

[0041] It should be understood that when a device, unit, or module is referred to as being "on", "connected to", or "coupled to" another device, unit, or module, it may be directly on, connected to, or coupled to or in communication with the other device, unit, or module, or there may be intervening devices, units, or modules, unless the context clearly dictates otherwise. For example, the term "and / or" used in the present disclosure includes any and all combinations of one or more of the associated listed items.

[0042] The terms used in the present disclosure are for the purpose of describing particular embodiments only and are not intended to limit the scope of the present disclosure. As shown in the specification and claims of the present disclosure, unless the context clearly dictates otherwise, words such as "a", "an", "one", and / or "the" are not specifically singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of the expressly identified features, wholes, steps, operations, elements, and / or components, and such expressions do not constitute an exclusive listing, and other features, wholes, steps, operations, elements, and / or components may also be included.

[0043] Referring to the following description and the accompanying drawings, these or other features and characteristics of the present disclosure, the operating methods, the functions of the relevant elements of the structure, the combination of the parts, and the economy of manufacture can be better understood, where the description and the drawings form a part of the specification. However, it should be clearly understood that the drawings are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of the present disclosure. It can be understood that the drawings are not drawn to scale.

[0044] In the present disclosure, a variety of structure diagrams are used to illustrate various variations according to the embodiments of the present disclosure. It should be understood that the foregoing or following structures are not used to limit the present disclosure. The scope of protection of the present disclosure is defined by the claims.

[0045] The storage method of the visual positioning map is usually to save it as a file in a certain object serialization manner. The advantage of this method is that the storage, loading, and use of the map data can be transparent to the algorithm module, and the algorithm module accesses the map data in the same way as accessing other internal data.

[0046] Exemplarily,Figure 1 It is a schematic diagram of a map access in the related art, Figure 2 It is another schematic diagram of a map access in the related art, Figure 1 shows the access process when the map data of the visual positioning map is stored in a conventional serialized file, Figure 2 shows the access process when the map data of the visual positioning map is stored in a flattened file. As Figure 1 and Figure 2 shown, the vehicle-side device may include the application layer, the memory system, and the disk system in the figure. The visual positioning algorithm module runs in the application layer, and the memory system includes two modules: application layer management and operating system management. Refer to Figure 1 , when the map data of the visual positioning map is stored in the disk system in the form of a serialized file, the user needs to create a storage space in the memory (usually the application layer heap space), indicate to the operating system that the byte stream data of the map data is read from the disk system into this storage space, and the map object needs to be deserialized and reconstructed from the byte stream data. The visual positioning algorithm module can directly access the map object completely reconstructed in the application layer heap space. However, it has the following defects: The map data must first be deserialized and memory (heap memory) must be allocated to become a completely constructed object. The memory overhead of this method increases with the increase of the map capacity, and the deserialization takes a long time, thus causing the scale of the visual positioning map to be restricted by the memory.

[0047] Refer to Figure 2 , when the visual positioning map is divided into several shard files, that is, the flattened files in the figure, and the algorithm module loads the map shards as needed, it still needs to first deserialize the map data to obtain a complete map object and then be used by the algorithm module. In order to meet the global search and random access of the algorithm to the map data, the loaded shard objects must be kept in the memory. Therefore Figure 2 in also has a memory limitation problem.

[0048] Due to the existence of a large number of cross-reference relationships between the data of the visual positioning map and the requirements of global search and random access, as the scale of the applicable scenarios of autonomous driving technology continues to expand, from indoor to outdoor, from limited sites to open roads, the total capacity of the visual positioning map grows rapidly, and the memory demand of its algorithm module increases significantly, so that the vehicle-side device does not have enough memory (physical memory + virtual memory) to run safely. To solve the above problems, the embodiments of the present disclosure provide a method for processing map data, and the method will be introduced below in combination with specific embodiments.

[0049] Figure 3The flowchart of a map data processing method provided by an embodiment of the present disclosure. This method can be executed by a map data processing device, which can be implemented by software and / or hardware and is generally integrated in an electronic device. As Figure 3 shown, this method is applied to an operating system and includes:

[0050] Step 101, receive a data reading request, where the data reading request is used to read visual positioning map data, and the visual positioning map data includes map metadata, spatial index data, and multiple flattened map tile data.

[0051] The map processing method of the embodiment of the present disclosure can be applied to the operating system of a vehicle-mounted device, and the data reading request can be a request sent by the application layer in the vehicle-mounted device to read visual positioning map data.

[0052] The visual positioning map can be understood as map data obtained by using the Simultaneous Localization and Mapping (SLAM) technology, and can include a set of key frames and a large number of visual map points in the scene. The key frames can record the camera 6DoF pose information of the key nodes on the mapping trajectory and its association relationship with the surrounding map elements. The visual map points, also called visual feature point clouds, can record the 3D coordinate points with certain visual features in the mapping environment. These two sets of information and their co-visibility relationship constitute the above-mentioned visual positioning map.

[0053] The visual positioning map data in the embodiment of the present disclosure can be data obtained after map partitioning and flattening processing of the visual positioning map, and specifically can include map metadata, spatial index data, and multiple flattened map tile data. The map metadata can include the most basic attribute information of the visual positioning map, which can include the world coordinates of the origin (Origin), camera parameters (Camera params), directory of key frame pose information (BoW to KF index), key frame lookup table (KF lookup table), directory of key frame brief information (KF brief info catalog), and list of chunk files (Chunk files list), etc. KF represents key frame (Key Frame). The list of chunk files can include relevant information about map tiles, such as tile size, etc.; the spatial index data can use a 3D spatial index data structure, such as a KD-Tree, to establish an index for the camera 3D world coordinates of the key frames. The flattened map tile data can be obtained by processing the original map tile data in a flattening tool. The original map tile data can be multiple tile data obtained by dividing the complete serialized file of the visual positioning map according to a preset partitioning rule.

[0054] Specifically, the operating system can obtain a data reading request sent by the application layer. The data reading request may include the current frame or positioning information. The current frame may be an image frame currently captured by the application layer, and the positioning information may be a relatively coarse-grained position information obtained by the application layer.

[0055] Step 102: Obtain map metadata and spatial index data, and determine the target flattened map slice data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map slice data according to the positioning information, map metadata, and spatial index data, or according to the current frame and map metadata.

[0056] Among them, the data item can be understood as the smallest indivisible unit in the visual positioning map data. In the embodiments of the present disclosure, the data item may include key frames and map points. That is, each flattened map slice data may include a key frame set composed of multiple key frames and a map point set composed of multiple map points. The map point is a coordinate point. The target data item can be understood as the data item in the visual positioning map data corresponding to the above data access request. The target flattened map slice data may be the flattened map slice data where the target data item is located. The position information to be accessed may be the specific position of the target data item in the above target flattened map slice data, that is, which data item it is.

[0057] In an implementation manner of the present disclosure, determining the target flattened map slice data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map slice data according to the positioning information, map metadata, and spatial index data may include: searching in the spatial index data according to the positioning information to determine the identifier of the initial key frame; determining multiple key frames within a preset range near the initial key frame as target key frames according to the identifier of the initial key frame; respectively searching in the key frame lookup table and the key frame brief information directory in the map metadata according to the identifiers of the target key frames to determine the target flattened map slice data corresponding to each target key frame and its position information to be accessed in the target flattened map slice data.

[0058] When the data reading request includes location information, in the embodiments of the present disclosure, a local map can be constructed based on the location information and more refined positioning can be performed. The operating system can first search in the spatial index data according to the location information to determine the initial key frame corresponding to the location information and the identifier of the initial key frame. And according to the tag of the initial key frame, a plurality of key frames near the initial key frame can be determined as target key frames. For example, 10 key frames near the initial key frame can be determined as the target key frames, and the data corresponding to the target key frames is the target data item. Then, according to the identifiers of each target key frame, a search can be performed one by one in the key frame lookup table and the key frame profile information directory in the map metadata to determine the target flattened map slice data corresponding to each target key frame and the position information to be accessed in the target flattened map slice data.

[0059] Optionally, searching in the key frame lookup table and the key frame profile information directory in the map metadata respectively one by one according to the identifiers of the target key frames to determine the target flattened map slice data corresponding to each target key frame and the position information to be accessed in the target flattened map slice data may include: searching in the key frame lookup table according to the identifiers of each target key frame to determine the directory number corresponding to each target key frame; and searching in the key frame profile information directory according to the directory number corresponding to each target key frame to determine the target flattened map slice data corresponding to each target key frame and the position information to be accessed in the target flattened map slice data.

[0060] Among them, the key frame lookup table can store the identifier of the key frame and the corresponding directory number, as well as the basic information of the key frame, such as the spatial position, etc. The key frame profile information directory can store the directory number and the corresponding target item, and the directory item can include the slice information of the key frame. Specifically, after the operating system determines the target key frames, it can search in the key frame lookup table according to the identifier of each target key frame to determine the directory number corresponding to each target key frame, and search in the key frame profile information directory according to each directory number to obtain the target flattened map slice data corresponding to each target key frame, and the position information to be accessed by each target key frame in the target flattened map slice data where it is located.

[0061] In another embodiment of the present disclosure, determining the target flattened map slice data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map slice data according to the current frame and the map metadata may include: extracting the feature description words in the current frame, and determining a plurality of candidate key frames based on the feature description words by using an inverted index; using a relocalization algorithm to determine a reference key frame based on the plurality of candidate key frames; respectively searching one by one in the key frame lookup table and the key frame brief information directory in the map metadata according to the identifier of the reference key frame to determine the target flattened map slice data corresponding to each reference key frame and its position information to be accessed in the target flattened map slice data.

[0062] Among them, the feature description word can be understood as the visual word determined by an algorithm for the visual feature points in the current frame. The inverted index, also known as the reverse index, is an indexing method used to store the mapping of the storage positions of a certain word in a document or a group of documents under full-text search. Through the inverted index, a document list containing this word can be quickly obtained according to a word. In the embodiments of the present disclosure, candidate key frames corresponding to different feature description words are quickly obtained by means of the inverted index.

[0063] When the data reading request includes the current frame, the operating system can first extract the feature description words corresponding to several visual feature points in the current frame, and then determine multiple key frames with the same or similar feature description words as candidate key frames according to the feature description words through the inverted index; then a relocalization algorithm can be used to re-determine a reference key frame similar to the above current frame among the multiple candidate key frames, and the data of the reference key frame is the target data item; similarly to the above, after determining the reference key frame, according to the identifier of the reference key frame, it can be searched one by one in the key frame lookup table and the key frame brief information directory in the map metadata to determine the target flattened map slice data corresponding to each reference key frame and its position information to be accessed in the target flattened map slice data.

[0064] Optionally, the map data processing method of the embodiments of the present disclosure may further include: determining a plurality of co-visible key frames having a co-visibility relationship with the reference key frame; and reading the corresponding data for the plurality of co-visible key frames.

[0065] Among them, the co-visibility relationship can be understood as a relationship determined based on map points observed in common. If different key frames can observe the same map point, it is determined that there is a co-visibility relationship between different key frames. Since the data of the key frame also records the co-visibility relationship with other key frames, after determining the above-mentioned reference key frame and obtaining the data of the reference key frame, multiple co-visibility key frames having a co-visibility relationship with the reference key frame can be obtained, and the data corresponding to the multiple co-visibility key frames is read in the manner of steps 101-step 105, so as to construct a local map based on the data of the reference key frame and the co-visibility key frames.

[0066] Step 103: Determine the target virtual address space mapped by the target flattened map piece data.

[0067] Among them, the virtual address space can be understood as the virtual address space of the process when the visual positioning algorithm runs in the memory.

[0068] In the embodiments of the present disclosure, determining the target virtual address space mapped by the target flattened map piece data may include: allocating a corresponding target virtual address space for the target flattened map piece data in real time, or determining the target virtual address space mapped by the target flattened map piece data according to a pre-established memory mapping relationship, where the memory mapping relationship is a mapping relationship between each flattened map piece data and the virtual address space.

[0069] The memory mapping relationship can be understood as a mapping relationship between each flattened map piece data and a virtual address header of the virtual address space, or a mapping relationship between each data item in each flattened map piece data and the virtual address in the virtual address space, which is not specifically limited. Specifically, after the operating system determines the target flattened map piece data, it can map the target flattened map piece data to the target virtual address space in real time, that is, allocate a corresponding target virtual address space for the target flattened map piece data; or determine the target virtual address space corresponding to the target flattened map piece data by looking up according to the pre-established memory mapping relationship.

[0070] The embodiments of the present disclosure can set the flattened map piece data as a read-only attribute of the file for memory mapping, and map the flattened map piece data to the virtual address space through memory mapping for subsequent use.

[0071] Step 104: Obtain an offset dictionary, and determine the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the location information to be accessed.

[0072] Among them, the offset dictionary can be a dictionary obtained by the flattening tool during the flattening process of the original map shard data. In the embodiments of the present disclosure, this offset dictionary records the offset address of each data item in each flattened map shard data relative to the virtual address header, and the virtual address header can be the virtual address corresponding to the first data item of each flattened map shard data.

[0073] In the embodiments of the present disclosure, the operating system can obtain the offset dictionary, and then can determine the virtual address of the target data item according to the target virtual address space of the above-mentioned target flattened map shard data, this offset dictionary, and the location information to be accessed of the target data item.

[0074] Optionally, determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the location information to be accessed may include: determining the target offset address of the target data item according to the location information to be accessed and the offset dictionary, and determining the virtual address of the target data item according to the virtual address header of the target virtual address space and the target offset address.

[0075] Specifically, the operating system can search in the offset dictionary according to the location information to be accessed to determine the target offset address corresponding to the target data item, and then can offset the above target offset address according to the virtual address header of the target virtual address space to obtain the virtual address of the target data item.

[0076] Step 105: Read the corresponding data in the page cache based on the virtual address of the target data item.

[0077] Among them, the page cache can be a cache in the memory for caching visual positioning map data. In the embodiments of the present disclosure, the page cache technology can be used to divide the disk data into pages and load them into the memory for the application layer to read and write access.

[0078] In the embodiments of the present disclosure, reading the corresponding data in the page cache based on the virtual address of the target data item may include: determining the target physical address of the target data item in the page cache based on the virtual address of the target data item and the mapping relationship between the virtual address and the physical address in the page cache, and reading the data in the target physical address.

[0079] Among them, the mapping relationship between the virtual address and the physical address in the page cache can be pre-constructed. Further, after the operating system determines the virtual address of the target data item, it can determine the target physical address of the target data item in the page cache according to the pre-constructed mapping relationship between the virtual address and the physical address in the page cache, and read the data in the target physical address, then the target data item can be read.

[0080] In some embodiments of the present disclosure, the map data processing method may further include: when the target physical address in the page cache is invalid, obtaining the target data page of the target data item in the target flattened map shard data from the disk; reading the target data page into the page cache, and storing the target data item at the target physical address.

[0081] The data page can be understood as the unit of hierarchical storage of the flattened map shard data on the disk. The concept of single-level store emphasizes that data is organized by pages. A page can reside in memory or on the disk. Where the page is accessed is not important to the process. What is important is that its data format is consistent. The meaning of single-level store can be to store persistent objects by pages and can be mapped into the process space for direct use. A flattened map shard data can include multiple data pages, and the target data page can be the data page where the target data item is located.

[0082] Specifically, when the operating system determines that there is no data in the target physical address in the page cache or the validity period has ended, it obtains the data on the disk in units of pages, that is, it can read the target data page of the target data item in the target flattened map shard data from the disk, store the target data page in the page cache, and store the target data item at the target physical address in the page cache, so that the subsequent application layer can directly access the target data item based on the virtual address of the target data item.

[0083] In the related art, it is relatively stressful for the application layer to bring map data into the page cache by operating file reading. In the embodiments of the present disclosure, for the application layer of the vehicle-mounted device, the map data can be randomly accessed through the memory mapping of the visual positioning map data, and there is no need to maintain the memory used by the map itself, so the pressure is relatively small. The operating system can automatically cache and swap out the map data in the memory in units of pages, and maintain the memory occupancy not exceeding the system's limit on the process.

[0084] The map data processing solution provided by the embodiments of the present disclosure is such that the operating system can receive a data reading request, where the data reading request is used to read visual positioning map data. The visual positioning map data includes map metadata, spatial index data, and multiple flattened map tile data. The flattened map tile data is obtained by processing the original map tile data in a flattening tool. The data reading request includes a current frame or positioning information; obtain the map metadata and spatial index data, and determine the target flattened map tile data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map tile data according to the positioning information, map metadata, and spatial index data, or according to the current frame and map metadata; determine the target virtual address space mapped by the target flattened map tile data; obtain an offset dictionary, and determine the virtual address of the target data item according to the offset dictionary, target virtual address space, and position information to be accessed; read the corresponding data in the page cache based on the virtual address of the target data item. By adopting the above technical solution, through flattening the map data and mapping the map data to the virtual address space of the process, when the operating system receives a data reading request, it can determine the virtual address of the data item according to the map metadata, spatial index data, and offset dictionary, and access the data in the page cache through this virtual address. Utilizing the page cache mechanism can reduce the number of data copies, making the page cache of the operating system the primary cache of the map data, achieving single-level memory management, being able to access data more effectively, and the memory occupied by the map during runtime being safe and controllable, not limited by the physical memory size of the running device, expanding the application scenarios of visual positioning technology, reducing the time-consuming of deserialization, and improving the efficiency of map data access.

[0085] In some embodiments, the map data processing method may further include: performing an editing operation on the data in the page cache, where the editing operation includes a modification operation and / or a deletion operation.

[0086] The modification operation can be understood as the replacement of data, and the deletion operation can be understood as the discarding of data. The operating system can perform a loading operation, a resident operation, a modification operation, and / or a deletion operation on the data in the page cache. For the deletion operation, when the memory occupied by the page cache reaches the threshold configured by the process, the operating system deletes some data based on a preset policy, and the preset policy can be set according to the actual situation. For example, data can be deleted according to the popularity or access volume of the data.

[0087] In the above solution, the operating system can maintain the loading, residency, replacement, or discarding of the data in the page cache, and can maintain the memory occupancy of the page cache not exceeding the system's limit on the process, avoiding the increase in memory overhead as the map capacity increases, and making the memory occupied by the visual positioning map data during runtime safe and controllable.

[0088] Exemplarily,Figure 4 A schematic diagram of map access provided by an embodiment of the present disclosure is as follows Figure 4 As shown, the figure shows the access process of map data implemented based on flattened map shard data and memory mapping in the embodiment of the present disclosure. The vehicle-side device is the same as that in Figure 1 、 Figure 2 The vehicle-side device may include an application layer, a memory system, and a disk system in the figure. The visual positioning algorithm module runs in the application layer. The memory system includes two modules: application layer management and operating system management. The operating system management is the operating system. The map data processing method of the embodiment of the present disclosure may be executed by the operating system.

[0089] As Figure 4 shown, the single-level storage map may be a memory-mapped file of flattened map data, that is, the above-mentioned flattened map shard data. Mark the flattened map shard data as read-only attribute in the memory-mapped file and load it into the process virtual address space where the algorithm module runs. For the flattened map shard data, it can be brought into the page cache through memory mapping operations. After loading and initialization, each data item of the visual positioning map has a virtual address. When the application layer needs to read the data item, it directly accesses it through its virtual address. The operating system is responsible for reading the data from the disk into the page cache in the memory. When the memory occupied by the page cache reaches the threshold configured by the process, the operating system is responsible for automatically recycling some page caches. Due to the read-only attribute of the cached data, the operating system can directly discard the replaced page caches.

[0090] The specific process may include: (1) The operating system sets the upper limit of the memory usage at the process level of the visual positioning algorithm in the application layer. (2) Convert the original map shard data into flattened map shard data. That is, define a method of continuous data storage and relative addressing of data references (that is, flattening processing) to convert the traditionally serialized stored map into flattened map shard data. (3) When the operating system loads the map data, it maps the flattened map shard data into the memory space through memory mapping and allocates an exclusive virtual address space for the process. (4) During runtime, through the access mode agreed upon by flattening, find the relative offset of the accessed data and directly access the map data.

[0091] In the related art, when loading the visual positioning map, multiple levels of data copying are required, and the application layer needs to apply for, maintain, and release memory by itself. This solution provides an optimization solution for the memory occupation during the runtime of the visual positioning map, which can also be called a single-level storage solution. By using the page cache mechanism of the operating system, the number of data copying is reduced, and the page cache directly becomes the first-level cache of the map data, realizing single-level memory management, more effectively accessing data, and safely loading and using visual positioning maps far exceeding the capacity of the main memory.

[0092] Figure 5 As shown in the flowchart of another map data processing method provided by an embodiment of the present disclosure, this method can be executed by a map data processing device, which can be implemented by software and / or hardware and is generally integrated in an electronic device. As Figure 5 shown, this method includes:

[0093] Step 501, obtain visual positioning map data.

[0094] Among them, the visual positioning map data can be a traditional serialized file of the visual positioning map. Specifically, object serialization technology in the category of object-oriented programming languages can be used to persist the map memory data structure into a byte stream file to obtain it.

[0095] In an embodiment of the present disclosure, visual positioning map data can be obtained, and then the visual positioning map data can be divided based on a preset division rule to obtain map metadata, spatial index data, and multiple original map shard files.

[0096] The preset division rule can focus on considering the locality and relevance of map data, and try to make the possibly related map data adjacent in storage. For example, the preset division rule can be to divide according to the mapping trajectory or according to spatial locality. Dividing according to spatial locality can be to divide according to adjacent key frames. The map metadata can include the most basic attribute information of the visual positioning map, which can include the world coordinates of the origin (Origin), camera parameters (Camera params), key frame pose information directory (BoW to KF index), key frame lookup table (KF lookup table), key frame brief information directory (KF brief info catalog), and shard file list (Chunk files list), etc. KF represents KeyFrame. The shard file list can include information related to map shard data, such as shard size, etc. The spatial index data can adopt a 3D spatial index data structure, such as a KD-Tree, to establish an index for the camera 3D world coordinates of key frames. The multiple original map shard files can be multiple map sub-files obtained by decomposing the complete map file.

[0097] Step 502, input the original map shard files of the visual positioning map data into a flattening tool to obtain flattened map shard data and an offset dictionary.

[0098] Among them, the flattening tool can be a tool for implementing the flattening process of map data, and can be a serialization tool that supports zero-copy and does not require encoding and decoding. Specifically, it can be set according to the actual situation. For example, the flattening tool can be FlatBuffers, and the output flattened map shard data can be segmented map data in the FlatBuffers format. FlatBuffers can be a serialization tool with the following characteristics: it does not require packing and unpacking of serialized data; it has high memory and efficiency speed, and is flexible in expansion; it has fewer code dependencies; it has a strong type design, and type checking can be completed during compilation; it is simple to use and can be used across platforms. The offset dictionary can record the offset addresses of each data item in each flattened map shard data relative to the virtual address header.

[0099] In the embodiment of the present disclosure, inputting the original map shard file of the visual positioning map data into the flattening tool to obtain the flattened map shard data may include: inputting the original map shard file of the visual positioning map data into the flattening tool, arranging the original map shard file into a continuous byte stream according to a preset layout, and determining the obtained byte stream file as the flattened map shard data.

[0100] Specifically, inputting a complete plurality of original map shard files of the visual positioning map data into the flattening tool, using the key frames and map points in the original map shard file as object instances, arranging the object instances, object instance sets, and constituent members of the object instances into a continuous byte stream according to a preset layout, determining the obtained byte stream file as the flattened map shard data, and the output data of the flattening tool may further include an offset dictionary. The offset dictionary can store the position of each data item in the flattened map shard data, that is, the offset address relative to the virtual address header, so that the operating system can access the map data in the byte stream file through the offset dictionary.

[0101] Exemplarily, Figure 6 is a schematic diagram of map flattening provided by the embodiment of the present disclosure. As Figure 6 shown in the figure, the figure shows the process of data partitioning and flattening processing of the visual positioning map data. The flattening conversion is the flattening tool, and the traditional visual positioning map file is the above-mentioned visual positioning map data. Inputting the visual positioning map data and the positioning map partitioning algorithm into the flattening tool, first partitioning the visual positioning map data based on the positioning map partitioning algorithm to obtain map metadata, spatial index data, and a plurality of original map shard files, and then the plurality of original map shard files can be flattened through the flattening tool. For the specific process, see Figure 7 Finally, the map metadata, spatial index data, and a plurality of flattened map shard data are output. The plurality of flattened map shard data are as Figure 6Shard 0, Shard 1 to Shard N therein.

[0102] Exemplarily, Figure 7 Another schematic diagram of map flattening provided by an embodiment of the present disclosure is shown in Figure 7 As shown, the figure shows the process of obtaining multiple flattened map shard data by flattening multiple original map shard files through a flattening tool. The specific process is as follows: The visual positioning map object instance in the figure is usually an object instance at runtime in an object-oriented programming language, and determines the key frames and map points in the original map shard file as the object instance; the object instances are divided into several levels in a composite relationship; the object instances are marked and referenced by pointer variables, and can also cross-reference. For example, the long column in the figure represents the key frame in the original map shard file, and the short column represents the map point in the original map shard file; there are cross-references between key frames, such as the co-visibility relationship; there are cross-references between key frames and map points, such as the feature points on the key frame corresponding to the map point. The visual positioning map flattened data is the above-mentioned multiple flattened map shard data, which can be saved in the form of a byte stream to a file. The above object instances, object instance sets, and constituent members of the object instance can all be arranged in a continuous byte stream according to a predefined layout; the output data obtained after flattening includes an offset dictionary, and accessing its constituent members and reference instances only requires looking up the offset dictionary to access the relative address.

[0103] In the above solution, through the flattening tool, each data and the corresponding data position in the original map shard file in the visual positioning map data can be stored in a linear array and saved in the form of a byte stream, that is, the flattened map shard data is obtained. When using it, only the byte stream file needs to be sent out, and when parsing, only the corresponding data needs to be intercepted according to the saved position, and the access efficiency during runtime is high.

[0104] The flattening process of multiple original map shard files can solve the problems that the overall capacity of traditional visual positioning maps is large, and flattening into a single file will lead to poor fault tolerance in transmission, copying, deployment and other links. Moreover, the map data reading and caching rely on the file page cache of the operating system. The flattening data storage can consider the relevance and locality principles of visual positioning data, and improve the access efficiency during runtime.

[0105] Step 503: Store the flattened map shard data on the disk.

[0106] Specifically, after flattening the original map shard files in the visual positioning map data to obtain flattened map shard data, it can be stored on the disk so that the operating system can receive a data reading request sent by the application layer, obtain map metadata and spatial index data, and determine the target flattened map shard data corresponding to the target data item to be accessed and the location information to be accessed of the target data item in the target flattened map shard data according to the positioning information, map metadata, and spatial index data, or according to the current frame and map metadata; determine the target virtual address space mapped by the target flattened map shard data; obtain an offset dictionary, and determine the virtual address of the target data item according to the offset dictionary, target virtual address space, and location information to be accessed; read the corresponding data in the page cache based on the virtual address of the target data item.

[0107] The flattened map shard data in the embodiments of the present disclosure can be a format for storing map data in binary serialization, which satisfies that the layout of map data in the disk file is consistent with the layout in the memory, and the data in the disk can be directly read without being constructed into other memory instances; compared with the related art, it reduces the time-consuming of deserialization, eliminates the copy of data from the page cache to the memory heap space and the maintenance work of the application layer for the memory heap space, realizes single-level memory management, that is, memory management at the operating system level, makes the memory occupied by the map data during runtime safe and controllable, and further improves the robustness of the system.

[0108] The map data processing solution provided by the embodiments of the present disclosure obtains visual positioning map data, inputs the original map shard files of the visual positioning map data into a flattening tool to obtain flattened map shard data and an offset dictionary, and stores the flattened map shard data on the disk. By adopting the above technical solution, through flattening and storing the map data on the disk, the operating system can map the map data to the virtual address space of the process, and when the operating system receives a data reading request, it can determine the virtual address of the data item according to the map metadata, spatial index data, and offset dictionary, and access the data in the page cache through this virtual address. By using the page cache mechanism, the number of data copies can be reduced, and the page cache of the operating system becomes the first-level cache of the map data, realizing single-level memory management, being able to access data more effectively, and the memory occupied by the map during runtime is safe and controllable, not limited by the physical memory size of the running device, expanding the application scenario of visual positioning technology, reducing the time-consuming of deserialization, and improving the efficiency of map data access.

[0109] Figure 8 It is a schematic structural diagram of a map data processing device provided by the embodiments of the present disclosure. The device can be implemented by software and / or hardware and is generally integrated in an electronic device. As Figure 8 shown, the device is set in the operating system and includes:

[0110] A request module 801 for receiving a data reading request, where the data reading request is used to read visual positioning map data, the visual positioning map data includes map metadata, spatial index data, and a plurality of flattened map shard data, the flattened map shard data is obtained by processing original map shard data in a flattening tool, and the data reading request includes a current frame or positioning information;

[0111] A data module 802 for obtaining the map metadata and the spatial index data, and determining target flattened map shard data corresponding to a target data item to be accessed and position information to be accessed of the target data item in the target flattened map shard data according to the positioning information, the map metadata, and the spatial index data, or according to the current frame and the map metadata;

[0112] A first virtual module 803 for determining a target virtual address space mapped by the target flattened map shard data;

[0113] A second virtual module 804 for obtaining an offset dictionary, and determining a virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed;

[0114] A reading module 805 for reading data corresponding to the virtual address of the target data item in a page cache.

[0115] Optionally, the data module 802 includes a first unit for:

[0116] Searching in the spatial index data according to the positioning information to determine an identifier of an initial key frame;

[0117] Determining a plurality of key frames within a preset range near the initial key frame as target key frames according to the identifier of the initial key frame;

[0118] Searching in a key frame lookup table and a key frame brief information directory in the map metadata respectively one by one according to the identifiers of the target key frames to determine target flattened map shard data corresponding to each target key frame and position information to be accessed thereof in the target flattened map shard data.

[0119] Optionally, the first unit is specifically used for:

[0120] Searching in the key frame lookup table according to the identifiers of the target key frames to determine directory numbers corresponding to the target key frames;

[0121] Search in the key frame summary information directory according to the directory numbers corresponding to the target key frames, and determine the target flattened map tile data corresponding to each target key frame and the position information to be accessed in the target flattened map tile data.

[0122] Optionally, the data module 802 includes a second unit for:

[0123] Extract the feature description words in the current frame, and determine multiple candidate key frames based on the feature description words using the inverted index;

[0124] Use the relocalization algorithm to determine the reference key frame based on the multiple candidate key frames;

[0125] Search in the key frame lookup table and the key frame summary information directory in the map metadata respectively one by one according to the identifiers of the reference key frames, and determine the target flattened map tile data corresponding to each reference key frame and the position information to be accessed in the target flattened map tile data.

[0126] Optionally, the device further includes a co-visibility module for:

[0127] Determine multiple co-visible key frames that have a co-visibility relationship with the reference key frame;

[0128] For the multiple co-visible key frames, read the corresponding data.

[0129] Optionally, the first virtual module 803 is used for:

[0130] Allocate a corresponding target virtual address space for the target flattened map tile data in real time, or determine the target virtual address space mapped by the target flattened map tile data according to a pre-established memory mapping relationship, where the memory mapping relationship is the mapping relationship between each flattened map tile data and the virtual address space.

[0131] Optionally, the offset dictionary records the offset addresses of each data item in each flattened map tile data relative to the virtual address header, and the data items include key frames and map points.

[0132] Optionally, the second virtual module 804 is used for:

[0133] Determine the target offset address of the target data item according to the position information to be accessed and the offset dictionary, and determine the virtual address of the target data item according to the virtual address header of the target virtual address space and the target offset address.

[0134] Optionally, the reading module 805 is used for:

[0135] Based on the virtual address of the target data item and the mapping relationship between the virtual address and the physical address in the page cache, determine the target physical address of the target data item in the page cache, and read the data in the target physical address.

[0136] Optionally, the device further includes a cache module for:

[0137] When the target physical address in the page cache is invalid, obtain the target data page of the target data item in the target flattened map shard data from the disk;

[0138] Read the target data page into the target physical address in the page cache.

[0139] Optionally, the device further includes an editing module for:

[0140] Perform an editing operation on the data in the page cache, where the editing operation includes a modification operation and / or a deletion operation.

[0141] The map data processing device provided by the embodiments of the present disclosure can execute the map data processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0142] Figure 9 As shown in the structural schematic diagram of another map data processing device provided by the embodiments of the present disclosure, the device can be implemented by software and / or hardware, and is generally integrated in an electronic device. Such as Figure 9 shown, the device includes:

[0143] An acquisition module 901 for acquiring visual positioning map data;

[0144] A flattening module 902 for inputting the original map shard file of the visual positioning map data into a flattening tool to obtain flattened map shard data and an offset dictionary;

[0145] A storage module 903 for storing the flattened map shard data on the disk.

[0146] Optionally, the flattening module 902 is used for:

[0147] Input the original map shard file of the visual positioning map data into the flattening tool, arrange the original map shard file into a continuous byte stream according to a preset layout, and determine the obtained byte stream file as the flattened map shard data.

[0148] Optionally, the device further includes a partitioning module for:

[0149] Partition the visual positioning map data according to a preset partitioning rule to obtain map metadata, spatial index data, and multiple original map shard files.

[0150] The map data processing device provided by the embodiments of the present disclosure can execute the map data processing method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.

[0151] Figure 10 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As Figure 10 shown, the electronic device 1000 includes a central processing unit (CPU) 1001, which can execute various processes in the foregoing embodiments according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage section 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0152] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed so that a computer program read from it can be installed into the storage section 1008 as needed.

[0153] Specifically, according to the embodiments of the present disclosure, the foregoing method can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a computer-readable medium, and the computer program includes program codes for executing the foregoing obstacle avoidance method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 1009, and / or installed from the removable medium 1011.

[0154] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of apparatuses, 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 segment of a program, or a part of code, which 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 that 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, as well as combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0155] The units or modules involved in the embodiments described in the present disclosure can be implemented in software or in hardware. The described units or modules can also be provided in a processor, and the names of these units or modules do not, in some cases, constitute a limitation on the units or modules themselves.

[0156] In addition, the present disclosure also provides a computer-readable storage medium, which can be the computer-readable storage medium included in the apparatus described in the above embodiments, or can be a computer-readable storage medium that exists separately and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the map data processing method described in the present disclosure.

[0157] In addition to the above methods and devices, embodiments of the present disclosure may also be a computer program product, which includes computer program instructions that, when run by a processor, cause the processor to execute the map data processing method provided by the embodiments of the present disclosure.

[0158] The computer program product can be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0159] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium storing computer program instructions, which, when run by a processor, cause the processor to execute the map data processing method provided by the embodiment of the present disclosure.

[0160] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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.

[0161] According to one or more embodiments of the present disclosure, the present disclosure provides a map data processing method applied to an operating system, including:

[0162] Receiving a data reading request, where the data reading request is used to read visual positioning map data, the visual positioning map data includes map metadata, spatial index data, and a plurality of flattened map shard data, the flattened map shard data is obtained by processing original map shard data in a flattening tool, and the data reading request includes a current frame or positioning information;

[0163] Obtaining the map metadata and the spatial index data, and determining, according to the positioning information, the map metadata, and the spatial index data, or according to the current frame and the map metadata, the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data;

[0164] Determining the target virtual address space mapped by the target flattened map shard data;

[0165] Obtaining an offset dictionary, and determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed;

[0166] Reading the corresponding data in the page cache based on the virtual address of the target data item.

[0167] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, determining the target flattened map slice data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map slice data according to the positioning information, the map metadata, and the spatial index data includes:

[0168] Search in the spatial index data according to the positioning information to determine the identifier of the initial key frame;

[0169] According to the identifier of the initial key frame, determine multiple key frames within a preset range near the initial key frame as target key frames;

[0170] Search in the key frame lookup table and the key frame brief information directory in the map metadata respectively one by one according to the identifiers of the target key frames to determine the target flattened map slice data corresponding to each target key frame and its position information to be accessed in the target flattened map slice data.

[0171] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, searching in the key frame lookup table and the key frame brief information directory in the map metadata respectively one by one according to the identifiers of the target key frames to determine the target flattened map slice data corresponding to each target key frame and its position information to be accessed in the target flattened map slice data includes:

[0172] Search in the key frame lookup table according to the identifiers of each target key frame to determine the directory number corresponding to each target key frame;

[0173] Search in the key frame brief information directory according to the directory number corresponding to each target key frame to determine the target flattened map slice data corresponding to each target key frame and its position information to be accessed in the target flattened map slice data.

[0174] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, determining the target flattened map slice data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map slice data according to the current frame and the map metadata includes:

[0175] Extract the feature description words in the current frame, and use the inverted index based on the feature description words to determine multiple candidate key frames;

[0176] Use the relocalization algorithm to determine the reference key frame based on the multiple candidate key frames;

[0177] Search for each of the identifiers of the reference key frames one by one in the key frame look-up table and the key frame profile information directory in the map metadata, and determine the target flattened map tile data corresponding to each of the reference key frames and the information of the position to be accessed in the target flattened map tile data.

[0178] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, the method further includes:

[0179] Determine a plurality of co-visible key frames that have a co-visibility relationship with the reference key frame;

[0180] For the plurality of co-visible key frames, read the corresponding data.

[0181] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, determining the target virtual address space mapped by the target flattened map tile data includes:

[0182] Allocate a corresponding target virtual address space for the target flattened map tile data in real time, or determine the target virtual address space mapped by the target flattened map tile data according to a pre-established memory mapping relationship, where the memory mapping relationship is the mapping relationship between each flattened map tile data and the virtual address space.

[0183] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, the offset dictionary records the offset addresses of each data item in each of the flattened map tile data relative to the virtual address header, and the data items include key frames and map points.

[0184] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the information of the position to be accessed includes:

[0185] Determine the target offset address of the target data item according to the information of the position to be accessed and the offset dictionary, and determine the virtual address of the target data item according to the virtual address header of the target virtual address space and the target offset address.

[0186] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, reading the corresponding data in the page cache based on the virtual address of the target data item includes:

[0187] Based on the virtual address of the target data item and the mapping relationship between the virtual address and the physical address in the page cache, determine the target physical address of the target data item in the page cache, and read the data in the target physical address.

[0188] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, the method further includes:

[0189] When the target physical address in the page cache is invalid, obtain the target data page of the target data item in the target flattened map shard data from the disk;

[0190] Read the target data page into the page cache, and store the target data item at the target physical address.

[0191] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, the method further includes:

[0192] Perform an editing operation on the data in the page cache, where the editing operation includes a modification operation and / or a deletion operation.

[0193] According to one or more embodiments of the present disclosure, the present disclosure provides a map data processing method, including:

[0194] Obtain visual positioning map data;

[0195] Input the original map shard file of the visual positioning map data into a flattening tool to obtain flattened map shard data and an offset dictionary;

[0196] Store the flattened map shard data on the disk.

[0197] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, inputting the original map shard file of the visual positioning map data into a flattening tool to obtain flattened map shard data includes:

[0198] Input the original map shard file of the visual positioning map data into the flattening tool, arrange the original map shard file into a continuous byte stream according to a preset layout, and determine the obtained byte stream file as the flattened map shard data.

[0199] According to one or more embodiments of the present disclosure, in the map data processing method provided by the present disclosure, the method further includes:

[0200] Divide the visual positioning map data based on a preset division rule to obtain map metadata, spatial index data, and a plurality of the original map shard files.

[0201] According to one or more embodiments of the present disclosure, the present disclosure provides a map data processing device, which is set in an operating system and includes:

[0202] A request module for receiving a data reading request, where the data reading request is used to read visual positioning map data, the visual positioning map data includes map metadata, spatial index data, and a plurality of flattened map shard data, the flattened map shard data is obtained by processing original map shard data in a flattening tool, and the data reading request includes a current frame or positioning information;

[0203] A data module for obtaining the map metadata and the spatial index data, and determining, according to the positioning information, the map metadata, and the spatial index data, or according to the current frame and the map metadata, the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data;

[0204] A first virtual module for determining the target virtual address space mapped by the target flattened map shard data;

[0205] A second virtual module for obtaining an offset dictionary, and determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed;

[0206] A reading module for reading the corresponding data in the page cache based on the virtual address of the target data item.

[0207] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the data module includes a first unit for:

[0208] Searching in the spatial index data according to the positioning information to determine the identifier of the initial key frame;

[0209] Determining a plurality of key frames within a preset range near the initial key frame as target key frames according to the identifier of the initial key frame;

[0210] Searching in the key frame lookup table and the key frame brief information directory in the map metadata respectively according to the identifiers of the target key frames to determine the target flattened map shard data corresponding to each target key frame and its position information to be accessed in the target flattened map shard data.

[0211] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the first unit is specifically used for:

[0212] Searching in the key frame lookup table according to the identifiers of the target key frames to determine the directory numbers corresponding to the target key frames;

[0213] Search in the key frame profile information directory according to the directory numbers corresponding to the target key frames, and determine the target flattened map tile data corresponding to each target key frame and the position information to be accessed in the target flattened map tile data.

[0214] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the data module includes a second unit for:

[0215] Extract the feature description words in the current frame, and determine a plurality of candidate key frames based on the feature description words using an inverted index;

[0216] Use a relocalization algorithm to determine a reference key frame based on the plurality of candidate key frames;

[0217] Search one by one in the key frame lookup table and the key frame profile information directory in the map metadata according to the identifiers of the reference key frames, and determine the target flattened map tile data corresponding to each reference key frame and the position information to be accessed in the target flattened map tile data.

[0218] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the device further includes a co-visibility module for:

[0219] Determine a plurality of co-visible key frames that have a co-visibility relationship with the reference key frame;

[0220] Read the corresponding data for the plurality of co-visible key frames.

[0221] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the first virtual module is used for:

[0222] Allocate a corresponding target virtual address space for the target flattened map tile data in real time, or determine the target virtual address space mapped by the target flattened map tile data according to a pre-established memory mapping relationship, where the memory mapping relationship is the mapping relationship between each flattened map tile data and the virtual address space.

[0223] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the offset dictionary records the offset addresses of each data item in each flattened map tile data relative to the virtual address header, and the data items include key frames and map points.

[0224] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the second virtual module is used for:

[0225] Determine the target offset address of the target data item according to the to-be-accessed location information and the offset dictionary, and determine the virtual address of the target data item according to the virtual address header of the target virtual address space and the target offset address.

[0226] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the reading module is configured to:

[0227] Based on the virtual address of the target data item and the mapping relationship between the virtual address and the physical address in the page cache, determine the target physical address of the target data item in the page cache, and read the data in the target physical address.

[0228] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the device further includes a cache module, configured to:

[0229] When the target physical address in the page cache is invalid, obtain the target data page of the target data item in the target flattened map shard data from the disk;

[0230] Read the target data page into the target physical address in the page cache.

[0231] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the device further includes an editing module, configured to:

[0232] Perform an editing operation on the data in the page cache, where the editing operation includes a modification operation and / or a deletion operation.

[0233] According to one or more embodiments of the present disclosure, the present disclosure provides a map data processing device, including:

[0234] An acquisition module, configured to acquire visual positioning map data;

[0235] A flattening module, configured to input the original map shard file of the visual positioning map data into a flattening tool to obtain flattened map shard data and an offset dictionary;

[0236] A storage module, configured to store the flattened map shard data in a disk.

[0237] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the flattening module is configured to:

[0238] Input the original map shard file of the visual positioning map data into the flattening tool, arrange the original map shard file into a continuous byte stream according to a preset layout, and determine the obtained byte stream file as the flattened map shard data.

[0239] According to one or more embodiments of the present disclosure, in the map data processing device provided by the present disclosure, the device further includes a partitioning module, configured to:

[0240] Partition the visual positioning map data based on a preset partitioning rule to obtain map metadata, spatial index data, and a plurality of the original map shard files.

[0241] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

[0242] A processor;

[0243] A memory for storing executable instructions of the processor;

[0244] The processor is configured to read the executable instructions from the memory and execute the instructions to implement any of the map data processing methods provided by the present disclosure.

[0245] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium storing a computer program for executing any of the map data processing methods provided by the present disclosure.

[0246] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0247] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing map data, characterized in that, Applied to an operating system, including: Receiving a data reading request, wherein the data reading request is used to read visual positioning map data, the visual positioning map data includes map metadata, spatial index data, and a plurality of flattened map shard data, the flattened map shard data is obtained by processing original map shard data in a flattening tool, and the data reading request includes a current frame or positioning information; Obtaining the map metadata and the spatial index data, and determining, according to the positioning information, the map metadata, and the spatial index data, or according to the current frame and the map metadata, the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data; Determining the target virtual address space mapped by the target flattened map shard data; Obtaining an offset dictionary, and determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed, the offset dictionary records the offset addresses of each data item in each flattened map shard data relative to the virtual address header, and the data items include key frames and map points; Reading the corresponding data in the page cache based on the virtual address of the target data item.

2. The method according to claim 1, wherein Determining, according to the positioning information, the map metadata, and the spatial index data, the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data, including: Searching in the spatial index data according to the positioning information to determine the identifier of the initial key frame; Determining a plurality of key frames within a preset range near the initial key frame as target key frames according to the identifier of the initial key frame; Searching respectively one by one according to the identifiers of the target key frames in the key frame lookup table and the key frame brief information directory in the map metadata to determine the target flattened map shard data corresponding to each target key frame and its position information to be accessed in the target flattened map shard data.

3. The method according to claim 2, wherein Searching respectively one by one according to the identifiers of the target key frames in the key frame lookup table and the key frame brief information directory in the map metadata to determine the target flattened map shard data corresponding to each target key frame and its position information to be accessed in the target flattened map shard data, including: Searching in the key frame lookup table according to the identifiers of each target key frame to determine the directory number corresponding to each target key frame; Searching in the key frame brief information directory according to the directory number corresponding to each target key frame to determine the target flattened map shard data corresponding to each target key frame and its position information to be accessed in the target flattened map shard data.

4. The method according to claim 1, wherein Determine the target flattened map slice data corresponding to the target data item to be accessed and the location information to be accessed of the target data item in the target flattened map slice data according to the current frame and the map metadata, including: Extract the feature description words in the current frame, and determine multiple candidate key frames based on the feature description words using an inverted index; Use a relocalization algorithm to determine a reference key frame based on the multiple candidate key frames; Search one by one according to the identifiers of the reference key frames in the key frame lookup table and the key frame summary information directory in the map metadata, and determine the target flattened map slice data corresponding to each reference key frame and its location information to be accessed in the target flattened map slice data.

5. The method according to claim 4, wherein The method further includes: Determine multiple co-visible key frames that have a co-visible relationship with the reference key frame; For the multiple co-visible key frames, read the corresponding data.

6. The method according to claim 1, characterized in that, Determine the target virtual address space mapped by the target flattened map slice data, including: Allocate a corresponding target virtual address space for the target flattened map slice data in real time, or determine the target virtual address space mapped by the target flattened map slice data according to a pre-established memory mapping relationship, where the memory mapping relationship is the mapping relationship between each flattened map slice data and the virtual address space.

7. The method according to claim 1, characterized in that Determine the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the location information to be accessed, including: Determine the target offset address of the target data item according to the location information to be accessed and the offset dictionary, and determine the virtual address of the target data item according to the virtual address header of the target virtual address space and the target offset address.

8. The method according to claim 1, characterized in that, The reading of the corresponding data in the page cache based on the virtual address of the target data item includes: Determine the target physical address of the target data item in the page cache based on the virtual address of the target data item and the mapping relationship between the virtual address and the physical address in the page cache, and read the data in the target physical address.

9. The method according to claim 8, characterized in that, The method further includes: When the target physical address in the page cache is invalid, obtain the target data page of the target data item in the target flattened map slice data from the disk; Read the target data page into the page cache, and store the target data item at the target physical address.

10. The method according to claim 1, wherein The method further includes: Perform an editing operation on the data in the page cache, where the editing operation includes a modification operation and / or a deletion operation.

11. A method for processing map data, characterized in that, Includes: Obtain visual positioning map data; Input the original map slice file of the visual positioning map data into a flattening tool to obtain flattened map slice data and an offset dictionary, where the offset dictionary records the offset address of each data item in each flattened map slice data relative to the virtual address header, and the data items include key frames and map points; Store the flattened map slice data on the disk.

12. The method according to claim 11, wherein Input the original map slice file of the visual positioning map data into a flattening tool to obtain flattened map slice data, including: Input the original map shard file of the visual positioning map data into the flattening tool, arrange the original map shard file into a continuous byte stream according to a preset layout, and determine the obtained byte stream file as the flattened map shard data.

13. The method according to claim 11, wherein The method further includes: Based on a preset partitioning rule, partition the visual positioning map data to obtain map metadata, spatial index data, and multiple original map shard files.

14. A map data processing device, characterized in that, Set in the operating system, including: A request module for receiving a data reading request, where the data reading request is used to read visual positioning map data, the visual positioning map data includes map metadata, spatial index data, and multiple flattened map shard data, the flattened map shard data is obtained by processing the original map shard data input into the flattening tool, and the data reading request includes a current frame or positioning information; A data module for obtaining the map metadata and the spatial index data, and determining the target flattened map shard data corresponding to the target data item to be accessed and the position information to be accessed of the target data item in the target flattened map shard data according to the positioning information, the map metadata, and the spatial index data, or according to the current frame and the map metadata; A first virtual module for determining the target virtual address space mapped by the target flattened map shard data; A second virtual module for obtaining an offset dictionary, and determining the virtual address of the target data item according to the offset dictionary, the target virtual address space, and the position information to be accessed, where the offset dictionary records the offset address of each data item in each flattened map shard data relative to the virtual address header, and the data items include key frames and map points; A reading module for reading the corresponding data in the page cache based on the virtual address of the target data item.

15. A map data processing device, characterized in that, Including: An acquisition module for acquiring visual positioning map data; A flattening module for inputting the original map shard file of the visual positioning map data into the flattening tool to obtain flattened map shard data and an offset dictionary, where the offset dictionary records the offset address of each data item in each flattened map shard data relative to the virtual address header, and the data items include key frames and map points; A storage module for storing the flattened map shard data on the disk.

16. An electronic device, characterized in that, The electronic device includes: A processor; A memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the map data processing method according to any one of claims 1-13 above.

17. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is used to execute the map data processing method according to any one of claims 1-13 above.

Citation Information

Patent Citations

  • Off-line map preservation and real-time relocation for mobile robot

    CN109460267A