Raster map processing method, device, system, electronic device and computer medium

By determining the target grid map in the mobile robot and compressing and encoding, the problem of excessive memory consumption of grid maps in the mobile robot is solved, and memory and communication efficiency improvement is achieved without reducing accuracy and efficiency.

CN113589802BActive Publication Date: 2024-11-01YUANLI JUHE (CHONGQING) ROBOTICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110714926.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-25
Publication Date
2024-11-01
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

When mobile robots use grid maps for positioning and navigation, as the scene area increases, the memory consumption of grid maps increases exponentially, resulting in reduced processor performance and increased storage pressure. It is difficult for existing technology to effectively reduce memory. Consumption.

Method used

The target area in the original raster map is determined based on the working trajectory of the mobile robot, and the target raster map is generated based on the raster data in the target area, and the target raster map is compressed and encoded to reduce the amount of stored data.

Benefits of technology

Without reducing positioning accuracy and navigation path planning performance, the memory consumption of mobile robots on grid maps is significantly reduced, storage efficiency and communication efficiency are improved, and work efficiency is avoided due to map switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113589802B_ABST
    Figure CN113589802B_ABST
Patent Text Reader

Abstract

The present application discloses a grid map processing method, device, system, electronic device and computer medium. The method includes: determining a target area in an original grid map based on the working trajectory of a mobile robot; generating a target grid map based on grid data in the target area. This implementation can reduce the memory consumption of the grid map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of robotics technology, and specifically to a raster map processing method, device, system, electronic device, and computer medium. Background Art

[0002] A mobile robot is a machine device that can move automatically to perform work. It can accept human command to move, and can also run pre-programmed programs to move autonomously. Mobile robots usually use grid maps for positioning and navigation. The grid map will increase exponentially as the scene area increases, resulting in increased storage pressure on the mobile robot and reduced processor performance. Summary of the invention

[0003] The embodiments of the present application provide a raster map processing method, device, system, electronic device and computer medium, which can reduce the memory consumption of the raster map.

[0004] In a first aspect, an embodiment of the present application provides a grid map processing method, the method comprising: determining a target area in an original grid map based on a working trajectory of a mobile robot; and generating a target grid map based on grid data in the target area.

[0005] In a second aspect, an embodiment of the present application provides a grid map processing method, which is applied to a mobile robot. The method includes: in response to obtaining a target grid map, compressing and encoding the target grid map to obtain encoded data, wherein the target grid map is determined based on the working trajectory of the mobile robot; and storing the encoded data locally.

[0006] In a third aspect, an embodiment of the present application provides a grid map processing device, which includes: a determination unit, configured to determine a target area in an original grid map based on a working trajectory of a mobile robot; and a generation unit, configured to generate a target grid map based on grid data within the target area.

[0007] In a fourth aspect, an embodiment of the present application provides a grid map processing device, which is applied to a mobile robot. The device includes: an encoding unit, which is configured to compress and encode the target grid map in response to obtaining the target grid map to obtain encoded data; and a storage unit, which is configured to store the encoded data locally.

[0008] In a fifth aspect, an embodiment of the present application provides a raster map processing system, comprising: a server, used to determine a target area in an original raster map based on a working trajectory of a mobile robot; generate a target raster map based on raster data in the target area; send the target raster data to a mobile robot; the mobile robot, used to compress and encode the target raster map to obtain encoded data; and store the encoded data locally.

[0009] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in the first aspect or the second aspect.

[0010] In a seventh aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect or the second aspect.

[0011] The grid map processing method, device, system, electronic device and computer medium provided in the embodiments of the present application determine the target area in the original grid map based on the working trajectory of the mobile robot, and generate a target grid map based on the grid data in the target area. The generated target grid map can cover the working trajectory of the mobile robot while removing a large number of unnecessary areas, thereby reducing memory consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0013] Figure 1 is a flowchart of a raster map processing method according to an embodiment of the present application;

[0014] Figure 2 is a schematic diagram of a grid map in a grid map processing method according to an embodiment of the present application;

[0015] Figure 3 is a flowchart of a raster map processing method according to yet another embodiment of the present application;

[0016] Figure 4 is a flowchart of a raster map processing method according to yet another embodiment of the present application;

[0017] Figure 5 is a structural schematic diagram of a raster map processing device according to an embodiment of the present application;

[0018] Figure 6is a structural schematic diagram of a raster map processing device according to another embodiment of the present application;

[0019] Figure 7 is a system architecture diagram of a raster map processing system according to yet another embodiment of the present application;

[0020] Figure 8 It is a schematic diagram of the structure of a computer system for implementing an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] Please refer to Figure 1 , which shows a process 100 of an embodiment of a grid map processing method according to the present application. The grid map processing method includes the following steps 101-102:

[0024] Step 101, based on the working trajectory of the mobile robot, determine the target area in the original grid map.

[0025] In this embodiment, the grid map of a specific space (which can be recorded as the original grid map) can be stored in the execution subject of the grid map processing method (such as a server or an electronic device such as a mobile robot). At least one mobile robot can be deployed in the above-mentioned specific space. The above-mentioned mobile robot may include but is not limited to AGV (Automated Guided Vehicle), AMR (Autonomous Mobile Robots), shuttle vehicles and other devices that can automatically locate and navigate based on grid maps.

[0026] Raster map is a commonly used high-precision map and a product of digital rasterization of the real environment. Raster map includes a large number of grids of equal size (also called grid units, pixels, etc.). Each grid corresponds to an area in the real environment and has corresponding grid data. The grid data can be expressed in numerical form, also known as grid value, pixel value, pixel value, etc., to indicate the probability that the grid is occupied. Based on the grid data of a grid, it can be known whether the grid is occupied, and thus the grid data can be used to determine whether the real environment area corresponding to the grid is passable.

[0027] Usually, each mobile robot may have a specific working area or working route in the above-mentioned specific space, and the working area or working route of each mobile robot usually only occupies a part of the above-mentioned specific space. Therefore, for a single mobile robot, the data required for its work is only the local grid data of the original grid map. In view of this, in this embodiment, the target area in the original grid map can be determined based on the working trajectory of the mobile robot, and the target area is a local area in the original grid map. The working trajectory here may refer to the trajectory in the grid map, that is, the working trajectory of the mobile robot in the actual environment corresponds to the corresponding trajectory in the grid map. The target area of ​​the grid map may include the working trajectory. Based on the working trajectory, the above-mentioned execution subject can determine the target area in the original grid map in a variety of ways (such as automatic recognition, manual box selection, etc.).

[0028] Step 102: Generate a target grid map based on the grid data in the target area.

[0029] In this embodiment, the target area may include multiple grids, each grid having corresponding grid data to represent the probability of the grid being occupied. The above execution entity may extract the grid data in the target area to obtain a target grid map.

[0030] The origin of the target grid map may be a vertex of the target area, such as the point (x min ,y min ). where x min =x1-len / res,y min =y1-len / res. At this time, the coordinates of each grid in the target area in the target grid map can be obtained by translating the coordinates of the grid in the original grid map (x min ,y min ) method.

[0031] It is understandable that if the above-mentioned execution subject is a server, then after the target grid map is generated, the target grid map can be sent to the mobile robot, so that the mobile robot can work based on the target grid map or further perform compression encoding and other processing.

[0032] By determining the target area in the original grid map based on the working trajectory of the mobile robot and generating a target grid map based on the grid data in the target area, the generated target grid map can cover the working trajectory of the mobile robot while removing a large number of unnecessary areas and reducing memory consumption.

[0033] In addition, since the resolution of the grid map is not reduced during the above processing, the positioning accuracy and navigation path planning performance of the mobile robot will not be reduced. At the same time, since the mobile robot does not need to switch maps during the work process, the working efficiency of the mobile robot will not be reduced. Therefore, the memory consumption of the grid map on the mobile robot can be reduced without losing accuracy and reducing work efficiency.

[0034] In some optional embodiments, the target area in the original grid map can be determined by manually selecting a frame by the user. Specifically, the above-mentioned execution subject can detect the first selection operation of the user on the working trajectory of the mobile robot in the original grid map. The first selection operation can be used to select a rectangular area surrounding the working trajectory from the original grid map. After the first selection operation is completed, the area selected by the first selection operation can be determined as the target area, thereby, the target area where the working trajectory of the mobile robot in the original grid map is located can be flexibly obtained. Since the target area is a local area in the original grid map, the size of the target grid map subsequently generated based on the target area can be effectively reduced, thereby improving the loading efficiency of the grid map and reducing the memory consumption of the mobile robot.

[0035] In some optional embodiments, the above-mentioned execution body can automatically determine the target area in the original grid map. Specifically, the minimum horizontal coordinate x1, the minimum vertical coordinate y1, the maximum horizontal coordinate x2 and the maximum vertical coordinate y2 of the working trajectory of the mobile robot in the original grid map can be determined first. Then, based on x1, y1, x2, y2, the resolution of the original grid map (which can be recorded as res) and the measurement length of the laser sensor installed in the mobile robot (which can be recorded as len), the target area in the original grid map can be determined. In the process of determining the target area based on x1, y1, x2, y2, res and len, the minimum horizontal coordinate x1 of the target area can be calculated first. min , minimum value of y coordinate min , the maximum value of the horizontal axis x max and the maximum value of the ordinate y max Among them, x min =x1-len / res,y min =y1-len / res,x max =x2+len / res,y max =y2-+len / res. Then, the coordinate (x min ,y min ) and coordinates (x max ,y max) as the diagonal vertices, and the rectangular area formed by the diagonal vertices is determined as the target area. Combining the measurement length of the laser sensor to determine the target area can not only ensure that the mobile robot is located in the target area, but also enable the mobile robot to obtain laser data around it when it is at the edge of the working track. This implementation method can automatically determine the target area in the original grid map based on the working track of the mobile robot, effectively reducing the size of the target grid map generated subsequently, while reducing labor costs.

[0036] In some optional embodiments, the execution subject may first automatically determine the target area in the original grid map, and then adjust the target area based on the area manually selected by the user to further reduce the target area. Specifically, after the target area is automatically determined by the above implementation method, the execution subject may also detect the user's second selection operation for the working track in the target area. The second selection operation may be used to select a sub-area surrounding the working track from the target area. After the second selection operation is completed, the execution subject may determine the area selected by the second selection operation as the target area.

[0037] As an example, Figure 2 A schematic diagram of a grid map is shown. The grid map includes the working trajectory of mobile robot A (as shown by label 201) and the working trajectory of mobile robot B (as shown by label 202). The above-mentioned execution subject can automatically identify the target area of ​​mobile robot A (as shown by label 203) and the target area of ​​mobile robot B (as shown by label 204) respectively according to the working trajectory of mobile robot A and the working trajectory of mobile robot B. On this basis, the user can further manually select in the target area to obtain the manually selected area (as shown by label 205 and label 206). After obtaining the area manually selected by the user, the above-mentioned execution subject can use the area manually selected by the user as the new target area to replace the original target area.

[0038] This method can further reduce the target area by first automatically determining the target area and then adjusting the target area based on the area manually selected by the user, which helps to further reduce the size of the target grid map generated subsequently, thereby further reducing the memory consumption of the grid map on the mobile robot. In addition, when the working trajectory is temporarily changed, the automatically selected target area can be flexibly adjusted by manually selecting the target area, avoiding errors in the target area.

[0039] In some optional embodiments, before generating the target grid map based on the grid data in the target area, the execution subject may further detect a third selection operation of the user in the target area for an area outside the working track. The third selection operation may be used to select an area outside the working track from the target area. The area selected by the third selection operation may be a regular shape or an irregular shape, which is not specifically limited here. As an example, the area selected by the user through the third selection operation may be Figure 2 As shown by the reference numeral 207 in the figure, the area is located in the target area and does not contain the working track of the mobile robot. After the third selection operation is completed, the execution subject can use the area selected by the third selection operation as a non-working area and set the raster data in the non-working area to the initial value. This implementation method improves the efficiency of subsequent compression coding of the target raster map by setting the data that will not be used in the target area as the initial value.

[0040] Further references Figure 3 , which shows a process 300 of another embodiment of the grid map processing method according to the present application. The execution subject of the grid map processing method can be an electronic device such as a server or a mobile robot. The grid map processing method includes the following steps 301 to 304:

[0041] Step 301, based on the working trajectory of the mobile robot, determine the target area in the original grid map.

[0042] Step 301 of this embodiment can be found in Figure 1 The step 101 of the corresponding embodiment will not be described in detail here.

[0043] Step 302: Generate a target grid map based on the grid data in the target area.

[0044] Step 302 of this embodiment can be found in Figure 1 The step 102 of the corresponding embodiment will not be described in detail here.

[0045] Step 303: compress and encode the target grid map to obtain encoded data.

[0046] In this embodiment, the execution subject can compress and encode the target grid map to obtain encoded data. Here, various commonly used compression encoding methods such as run length encoding, column encoding, quadtree encoding, etc. can be used to compress and encode the target grid map.

[0047] The original data type of raster data is usually a double-precision floating point type (double). Since raster data is usually an integer in the range of [0,255], and the range of values ​​that can be represented by double-precision floating point types is [0,2047], there is a problem of a large amount of memory waste when storing raster data in double-precision floating point types. In view of this, in some optional implementations of this embodiment, the raster data in the target raster map can first be converted from the original data type (i.e., double type) to the target data type, such as 8-bit unsigned integer type (uint8), character type (char), etc., to obtain a raster map to be compressed. Then, the raster map to be compressed is compressed and encoded to obtain encoded data. Since the range of raster data is [0,255], converting the original data type (such as double type) to the target data type (such as uint8, char type) does not cause a decrease in the accuracy of the raster data, and at the same time saves the memory usage of the raster data.

[0048] Step 304, storing the encoded data in the mobile robot.

[0049] It should be noted that if Figure 3 The illustrated embodiment is executed by a server, and storing the coded data in the mobile machine specifically includes: the server sends the coded data to the mobile robot.

[0050] In this embodiment, after the coded data is obtained, the coded data can be stored in the mobile robot. The mobile robot can query the grid data of a certain position from the coded data, and thus perform positioning and navigation based on the grid data. Since the size of the coded data of the target grid map is greatly reduced compared to the original grid map, transmitting the coded data to the mobile robot can greatly improve the communication efficiency between the server and the mobile robot.

[0051] It should be noted that if Figure 3 The embodiment shown is executed by a mobile robot, and the mobile robot can also transmit the obtained coded data to the server, so that the server and the robot store the coded data at the same time. Similarly, since the size of the coded data of the target grid map is greatly reduced compared to the original grid map, the communication efficiency between the server and the mobile robot can be greatly improved.

[0052] In this embodiment, by determining the target area in the original grid map based on the working trajectory of the mobile robot, and generating the target grid map based on the grid data in the target area, the generated target grid map can cover the working trajectory of the mobile robot while removing a large number of unnecessary areas, thereby reducing the memory consumption of the mobile robot. In addition, by compressing and encoding the target grid map to obtain encoded data, the mobile robot stores the encoded data, which can further reduce the memory consumption of the mobile robot.

[0053] In addition, since the resolution of the grid map is not reduced during the above processing, the positioning accuracy and navigation path planning performance of the mobile robot will not be reduced. At the same time, since the mobile robot does not need to switch maps when using the encoded data to work, the working efficiency of the mobile robot will not be reduced. Therefore, the memory consumption of the grid map on the mobile robot can be reduced without losing accuracy and reducing working efficiency.

[0054] In some optional embodiments, in step 303, the raster map to be compressed may be compressed and encoded by using a run-length encoding method. Run-length encoding, also known as "run length encoding" or "run length encoding", is a statistical encoding that belongs to lossless compression encoding and is an important encoding method for raster data compression. The specific process of compressing and encoding the raster map to be compressed by using a run-length encoding method can be seen in the following sub-steps S11 to S12:

[0055] Sub-step S11 , dividing the raster data in the raster map to be compressed into a plurality of vectors according to the number of rows or columns.

[0056] Here, the execution subject may divide the raster data in the raster map to be compressed into a plurality of vectors according to the number of rows. In this case, each row of raster data in the raster map to be compressed corresponds to a row vector. Similarly, the execution subject may also divide the raster data in the raster map to be compressed into a plurality of vectors according to the number of columns. In this case, each column of raster data in the raster map to be compressed corresponds to a column vector.

[0057] Optionally, the above-mentioned execution body can also determine whether to divide the raster data according to the number of rows or the number of columns based on the size of the number of rows and the number of columns. Specifically, if the number of rows of the raster map to be compressed is greater than the number of columns, the raster data in the raster map to be compressed can be divided into multiple column vectors according to the number of columns. If the number of rows of the raster map to be compressed is less than or equal to the number of columns, the raster data in the raster map to be compressed is divided into multiple row vectors according to the number of rows. Thus, the raster data can be divided based on the short side of the raster map to be compressed, so that fewer vectors are obtained after the division, so as to improve the compression coding efficiency.

[0058] Sub-step S12, compressing and encoding the multiple vectors using a run-length encoding method to obtain encoding data corresponding to each vector.

[0059] Here, if the above multiple vectors are column vectors, then for each of the above multiple vectors, the row sequence corresponding to the first raster data in the vector and the first raster data can be recorded in the form of a tuple, and the tuple form can be <row sequence, raster data>. For each raster data from the second raster data in the vector, if the raster data is different from the previous raster data, the row sequence corresponding to the raster data and the raster data can be recorded in the form of a tuple. Finally, the recorded tuples can be summarized to obtain the encoded data corresponding to the vector.

[0060] Similarly, if the above multiple vectors are row vectors, then for each of the multiple vectors, the column sequence corresponding to the first raster data in the vector and the first raster data can be recorded in the form of a two-tuple, and the two-tuple form can be <column sequence, raster data>. For each raster data from the second raster data in the vector, if the raster data is different from the previous raster data, the column sequence corresponding to the raster data and the raster data can be recorded in the form of a two-tuple. Finally, the recorded two-tuples are summarized to obtain the encoded data corresponding to the vector.

[0061] The following is a specific example. In this example, the grid in the grid map to be compressed has 5 rows and 10 columns. After dividing the grid in the grid map to be compressed according to the number of rows, 5 row vectors can be obtained. In order of rows, they are: [1 1 1 1 0 0 0 0 1 1] [1 1110 0 0 0 1 1] [111111 0 0 0 0] [1 1 1 1 0 0 0 0 0 0] [1 1 1 1 1 1 1 1 0 0]

[0067] The first raster data (i.e., the first column of raster data) in the vector corresponding to the first row is 1, and the corresponding column order is 1, which can be recorded as <1,1>. The raster data in the fifth column is 0, which is different from the previous raster data, and is recorded as <5,0>. The raster data in the ninth column is 1, which is different from the previous raster data, and is recorded as <9,1>. Therefore, the run-length encoding result of the vector corresponding to the first row is <1,1><5,0><9,1>. Similarly, the run-length encoding result of the vector corresponding to the second row is <1,1><5,0><9,1>. The run-length encoding result of the vector corresponding to the third row is <1,1><7,0>. The run-length encoding result of the vector corresponding to the fourth row is <1,1><5,0>. The run-length encoding result of the vector corresponding to the fifth row is <1,1><9,0>.

[0068] Since the basic principle of run-length encoding is to use the data and the column sequence (or row sequence) used to characterize the position of the data as a code when a certain data in a row (or column) changes, the same data can be represented by the same code, so that the length of the encoded data is less than the length of the original data. As in the above example, through run-length encoding, 50 raster data in the raster map to be compressed can be compressed into 12 binary encoded data, which greatly reduces the amount of data and reduces the memory usage of the mobile robot.

[0069] In some optional embodiments, after the encoded data is obtained by run-length encoding, or after the encoded data is stored in the mobile robot, the grid data corresponding to a certain grid can be quickly found based on the encoded data. Specifically, the target row (or target column) to be queried can be first determined, and then the target binary group in the target row (or target column) can be determined, so as to read the required target grid data from the target binary group. The following two scenarios are described in detail:

[0070] In some scenarios, if the column vector is compressed and encoded, multiple columns of encoded data can be obtained, and each column of encoded data may include at least one tuple. When a raster data query request for a target raster is received, the target coordinates of the target raster in the target raster map can be first determined. Among them, the coordinate conversion relationship between the original raster map and the target raster map can be referred to in the aforementioned step 102, which will not be repeated here. After determining the target coordinates, the target column and index value of the encoded data can be determined based on the target coordinates. Among them, the ordinate value in the target coordinates can refer to the target column, and the abscissa value in the target coordinates can be the index value. Afterwards, the last tuple (which can be used as the target tuple) whose row order is less than or equal to the index value can be queried from the encoded data corresponding to the target column. Finally, the raster data in the last tuple is converted from the target data type to the original data type to obtain the target raster data, and the target raster data is returned.

[0071] In other scenarios, if the row vector is compressed and encoded, multiple rows of encoded data can be obtained, and each row of encoded data can include at least one tuple. When a raster data query request for a target raster is received, the target coordinates of the target raster in the target raster map can be first determined. Among them, the coordinate conversion relationship between the original raster map and the target raster map can be referred to in the aforementioned step 102, which will not be repeated here. After determining the target coordinates, the target row and index value of the encoded data can be determined based on the target coordinates. Among them, the horizontal coordinate value in the target coordinates can refer to the target row, and the vertical coordinate value in the target coordinates can be the index value. Afterwards, the last tuple (which can be used as the target tuple) whose column order is less than or equal to the index value can be queried from the encoded data corresponding to the target row. Finally, the raster data in the last tuple is converted from the target data type to the original data type to obtain the target raster data, and the target raster data is returned.

[0072] The following is an explanation using the example in sub-step S12. In this example, the first row of coded data is <1,1><5,0><9,1>. The second row of coded data is <1,1><5,0><9,1>. The third row of coded data is <1,1><7,0>. The fourth row of coded data is <1,1><5,0>. The fifth row of coded data is <1,1><9,0>. If you need to find the grid data of the grid with coordinates (2,6) in the target grid map, you can use the second row as the target row and 6 as the index value to query the last binary group with a column order less than or equal to 6 from the second row of coded data <1,1><5,0><9,1>. Since the column order in the first binary group <1,1> in this row of coded data is 1 and the column order in the second binary group <5,0> is 5, the last binary group with a column order less than or equal to 6 is the second binary group <5,0>. Thus, the encoded data 0 in the tuple <5,0> can be extracted and converted into the original data type before being returned.

[0073] It is understandable that if the raster data of a certain raster is directly queried from the original raster map or the target raster map, it is necessary to first perform the step of determining the row where the raster is located, and then perform the operation of determining the column where the raster is located, so as to read the required target raster data. Therefore, compared with the original query method, the operation of determining the target row (or target column) to be queried from the encoded data in this implementation method does not reduce the query efficiency. In addition, since too many useless areas are not selected in the raster map to be compressed, the amount of data in each row (or column) in the encoded data is very small, so the operation of determining the target tuple from the target row (or target column) and reading the target raster data therefrom will not lead to a decrease in the query efficiency. Therefore, the query efficiency of the raster data can be guaranteed by performing raster data query based on the encoded data obtained by run-length encoding.

[0074] The method provided by the above-mentioned embodiment of the present application determines the target area in the original grid map based on the working trajectory of the mobile robot, and generates the target grid map based on the grid data in the target area, so that the generated target grid map can cover the working trajectory of the mobile robot while removing a large number of unnecessary areas, thereby reducing memory consumption. In addition, by compressing and encoding the target grid map to obtain encoded data, the mobile robot can store the encoded data, which can further reduce the memory consumption of the mobile robot.

[0075] Further references Figure 4 , which shows a process 400 of another embodiment of the grid map processing method according to the present application. The execution subject of the grid map processing method can be an electronic device such as a mobile robot. The grid map processing method includes the following steps 401-402:

[0076] Step 401, in response to obtaining the target grid map, compressing and encoding the target grid map to obtain encoded data. The target grid map is determined according to the working trajectory of the mobile robot. Specifically, the target grid map corresponds to a local area in the original grid map determined according to the working trajectory of the mobile robot.

[0077] For example, the mobile robot may receive the target grid map from a server.

[0078] In this embodiment, after acquiring the target grid map, the execution subject may compress and encode the target grid map to obtain the encoded data. Here, various commonly used compression encoding methods such as run length encoding, column encoding, quadtree encoding, etc. may be used to compress and encode the target grid map. In practice, the target grid map may be generated by the server and sent to the execution subject, or may be generated by the execution subject. The generation method of the target grid map may refer to the description in the above embodiment, which will not be repeated here.

[0079] The original data type of raster data is usually a double-precision floating point type (double). Since raster data is usually an integer in the range of [0,255], and the range of values ​​that can be represented by double-precision floating point types is [0,2047], there is a problem of a large amount of memory waste when storing raster data in double-precision floating point types. In view of this, in some optional implementations of this embodiment, the raster data in the target raster map can first be converted from the original data type (i.e., double type) to the target data type, such as 8-bit unsigned integer type (uint8), character type (char), etc., to obtain a raster map to be compressed. Then, the raster map to be compressed is compressed and encoded to obtain encoded data. Since the range of raster data is [0,255], converting the original data type (such as double type) to the target data type (such as uint8, char type) does not cause a decrease in the accuracy of the raster data, and at the same time saves the memory usage of the raster data.

[0080] Step 402: Store the encoded data locally.

[0081] In this embodiment, after the coded data is obtained, the coded data may be stored locally. The execution subject may query the raster data of a certain position from the coded data, thereby performing positioning and navigation based on the raster data.

[0082] It should be noted that after obtaining the coded data, the execution subject can also transmit the obtained coded data to the server, so that the server and the mobile robot store the coded data at the same time. Since the amount of coded data is greatly reduced compared to the original grid map, the communication efficiency between the server and the mobile robot can be greatly improved.

[0083] By compressing and encoding the target raster map to obtain encoded data and storing the encoded data locally in the mobile robot, the memory consumption of the mobile robot can be reduced.

[0084] In addition, since the resolution of the grid map is not reduced during the above processing, the positioning accuracy and navigation path planning performance of the mobile robot will not be reduced. At the same time, since the mobile robot does not need to switch maps when using the encoded data to work, the working efficiency of the mobile robot will not be reduced. Therefore, the memory consumption of the grid map on the mobile robot can be reduced without losing accuracy and reducing working efficiency.

[0085] In some optional embodiments, in step 401, the raster map to be compressed may be compressed and encoded by using a run-length encoding method. Specifically, the raster data in the raster map to be compressed may be first divided into a plurality of vectors according to the number of rows or columns. Then, the plurality of vectors may be compressed and encoded by using a run-length encoding method to obtain the encoded data corresponding to each vector.

[0086] Among them, when the raster data in the raster map to be compressed is divided into multiple vectors according to the number of rows or columns, the above-mentioned execution body can also determine whether to divide the raster data according to the number of rows or columns based on the size of the number of rows and the number of columns. Specifically, if the number of rows of the raster map to be compressed is greater than the number of columns, the raster data in the raster map to be compressed can be divided into multiple column vectors according to the number of columns. If the number of rows of the raster map to be compressed is less than or equal to the number of columns, the raster data in the raster map to be compressed is divided into multiple row vectors according to the number of rows. Therefore, the raster data can be divided based on the short side of the raster map to be compressed, so that fewer vectors are obtained after the division, so as to improve the compression coding efficiency.

[0087] Among them, when the run-length encoding method is used to compress and encode multiple vectors, if the multiple vectors are column vectors, then for each of the multiple vectors, the row sequence corresponding to the first raster data in the vector and the first raster data can be recorded in the form of a two-tuple, and the two-tuple form can be <row sequence, raster data>. For each raster data from the second raster data in the vector, if the raster data is different from the previous raster data, the row sequence corresponding to the raster data and the raster data can be recorded in the form of a two-tuple. Finally, the recorded two-tuples can be summarized to obtain the encoded data corresponding to the vector. Similarly, if the multiple vectors are row vectors, then for each of the multiple vectors, the column sequence corresponding to the first raster data in the vector and the first raster data can be recorded in the form of a two-tuple, and the two-tuple form can be <column sequence, raster data>. For each raster data from the second raster data in the vector, if the raster data is different from the previous raster data, the column sequence corresponding to the raster data and the raster data can be recorded in the form of a two-tuple. Finally, the recorded two-tuples are summarized to obtain the encoded data corresponding to the vector.

[0088] Since the basic principle of run-length encoding is to use the data and the column sequence (or row sequence) used to characterize the position of the data as a code when a certain data in a row (or column) changes, the same data can be represented by the same code, so that the length of the encoded data is less than the length of the original data. As in the above example, through run-length encoding, 50 raster data in the raster map to be compressed can be compressed into 12 binary encoded data, which greatly reduces the amount of data and reduces the memory usage of the mobile robot.

[0089] In some optional embodiments, after the encoded data is stored locally, the raster data corresponding to a certain raster can be quickly found based on the encoded data. Specifically, the target row (or target column) to be queried can be first determined, and then the target tuple in the target row (or target column) can be determined, so as to read the required target raster data from the target tuple. The following two scenarios are described in detail:

[0090] In some scenarios, if the column vector is compressed and encoded, multiple columns of encoded data can be obtained, and each column of encoded data may include at least one tuple. When a raster data query request for a target raster is received, the target coordinates of the target raster in the target raster map can be first determined. After the target coordinates are determined, the target column and index value of the encoded data can be determined based on the target coordinates. Among them, the ordinate value in the target coordinates can refer to the target column, and the abscissa value in the target coordinates can be the index value. Afterwards, the last tuple (which can be used as the target tuple) whose row order is less than or equal to the index value can be queried from the encoded data corresponding to the target column. Finally, the raster data in the last tuple is converted from the target data type to the original data type to obtain the target raster data, and the target raster data is returned.

[0091] In other scenarios, if the row vector is compressed and encoded, multiple rows of encoded data can be obtained, and each row of encoded data may include at least one 2-tuple. When a raster data query request for a target raster is received, the target coordinates of the target raster in the target raster map can be first determined. After determining the target coordinates, the target row and index value of the encoded data can be determined based on the target coordinates. Among them, the horizontal coordinate value in the target coordinates can refer to the target row, and the vertical coordinate value in the target coordinates can be the index value. Afterwards, the last 2-tuple (which can be used as the target 2-tuple) whose column order is less than or equal to the index value can be queried from the encoded data corresponding to the target row. Finally, the raster data in the last 2-tuple is converted from the target data type to the original data type to obtain the target raster data, and the target raster data is returned.

[0092] It is understandable that if the raster data of a certain raster is directly queried from the original raster map or the target raster map, it is necessary to first perform the step of determining the row where the raster is located, and then perform the operation of determining the column where the raster is located, so as to read the required target raster data. Therefore, compared with the original query method, the operation of determining the target row (or target column) to be queried from the encoded data in this implementation method does not reduce the query efficiency. In addition, since too many useless areas are not selected in the raster map to be compressed, the amount of data in each row (or column) in the encoded data is very small, so the operation of determining the target tuple from the target row (or target column) and reading the target raster data therefrom will not lead to a decrease in the query efficiency. Therefore, the query efficiency of the raster data can be guaranteed by performing raster data query based on the encoded data obtained by run-length encoding.

[0093] Further references Figure 5 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a raster map processing device. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to electronic devices such as servers and mobile robots.

[0094] like Figure 5 As shown, the grid map processing device 500 of this embodiment includes: a determination unit 501, which is configured to determine the target area in the original grid map based on the working trajectory of the mobile robot; a generation unit 502, which is configured to generate a target grid map based on the grid data in the above target area.

[0095] In some optional implementations of the present embodiment, the above-mentioned determination unit 501 is further configured to: detect a first selection operation of the user on the working trajectory of the mobile robot in the original grid map; and determine the area selected by the above-mentioned first selection operation as the target area.

[0096] In some optional implementations of the present embodiment, the determination unit 501 is further configured to: determine the minimum horizontal coordinate, the minimum vertical coordinate, the maximum horizontal coordinate and the maximum vertical coordinate of the working trajectory of the mobile robot in the original grid map; determine the target area in the original grid map based on the minimum horizontal coordinate, the minimum vertical coordinate, the maximum horizontal coordinate, the maximum vertical coordinate, the resolution of the original grid map and the measurement length of the laser sensor installed in the mobile robot.

[0097] In some optional implementations of this embodiment, the above-mentioned device also includes a first detection unit, which is configured to: detect a second selection operation of the user on the above-mentioned work trajectory in the above-mentioned target area; and replace the above-mentioned target area with the area selected by the above-mentioned second selection operation.

[0098] In some optional implementations of the present embodiment, the device further includes a second detection unit, which is configured to: detect a third selection operation performed by the user in the target area on an area outside the working trajectory; use the area selected by the third selection operation as a non-working area, and set the raster data in the non-working area to an initial value.

[0099] In some optional implementations of this embodiment, the above-mentioned device also includes: an encoding unit, configured to compress and encode the above-mentioned target grid map to obtain encoded data; and a storage unit, configured to store the above-mentioned encoded data in the above-mentioned mobile robot.

[0100] In some optional implementations of this embodiment, the encoding unit is further configured to: convert the raster data in the target raster map from the original data type to the target data type to obtain the raster map to be compressed; and compress and encode the raster map to be compressed to obtain encoded data.

[0101] In some optional implementations of this embodiment, the encoding unit is further configured to: divide the raster data in the raster map to be compressed into multiple vectors according to the number of rows or columns; and compress and encode the multiple vectors using run-length encoding to obtain encoded data corresponding to each vector.

[0102] In some optional implementations of the present embodiment, the encoding unit is further configured to: if the number of rows of the raster map to be compressed is greater than the number of columns, divide the raster data in the raster map to be compressed into multiple column vectors according to the number of columns; if the number of rows of the raster map to be compressed is less than or equal to the number of columns, divide the raster data in the raster map to be compressed into multiple row vectors according to the number of rows.

[0103] In some optional implementations of the present embodiment, the encoding unit is further configured as follows: if the multiple vectors are column vectors, for each of the multiple vectors, the row sequence corresponding to the first raster data in the vector and the first raster data are recorded in the form of a tuple; for each raster data starting from the second raster data in the vector, if the raster data is different from the previous raster data, the row sequence corresponding to the raster data and the raster data are recorded in the form of a tuple; the recorded tuples are summarized to obtain the encoded data corresponding to the vector.

[0104] In some optional implementations of the present embodiment, the encoding unit is further configured as follows: if the multiple vectors are row vectors, for each of the multiple vectors, the column sequence corresponding to the first raster data in the vector and the first raster data are recorded in the form of a tuple; for each raster data starting from the second raster data in the vector, if the raster data is different from the previous raster data, the column sequence corresponding to the raster data and the raster data are recorded in the form of a tuple; the recorded tuples are summarized to obtain the encoded data corresponding to the vector.

[0105] In some optional implementations of this embodiment, the above-mentioned device also includes a first query unit, which is configured to: in response to receiving a raster data query request for the target raster, determine the target coordinates of the above-mentioned target raster in the above-mentioned target raster map; based on the above-mentioned target coordinates, determine the target column and index value of the above-mentioned encoded data; query the last two-tuple whose row order is less than or equal to the above-mentioned index value from the encoded data corresponding to the above-mentioned target column; convert the raster data in the above-mentioned last two-tuple from the above-mentioned target data type to the above-mentioned original data type to obtain the target raster data; and return the above-mentioned target raster data.

[0106] In some optional implementations of this embodiment, the above-mentioned device also includes a second query unit, which is configured to: in response to receiving a raster data query request for the target raster, determine the target coordinates of the above-mentioned target raster in the above-mentioned target raster map; based on the above-mentioned target coordinates, determine the target row and index value of the above-mentioned encoded data; query the last two-tuple whose column order is less than or equal to the above-mentioned index value from the encoded data corresponding to the above-mentioned target row; convert the raster data in the above-mentioned last two-tuple from the above-mentioned target data type to the above-mentioned original data type to obtain the target raster data; and return the above-mentioned target raster data.

[0107] The device provided by the above-mentioned embodiment of the present application determines the target area in the original grid map based on the working trajectory of the mobile robot, and generates a target grid map based on the grid data in the target area. The generated target grid map can cover the working trajectory of the mobile robot while removing a large number of unnecessary areas, thereby reducing memory consumption.

[0108] In addition, since the resolution of the grid map is not reduced during the above processing, the positioning accuracy and navigation path planning performance of the mobile robot will not be reduced. At the same time, since the mobile robot does not need to switch maps during the work process, the working efficiency of the mobile robot will not be reduced. Therefore, the memory consumption of the grid map on the mobile robot can be reduced without losing accuracy and reducing work efficiency.

[0109] Further references Figure 6As an implementation of the methods shown in the above figures, the present application provides an embodiment of a raster map processing device. Figure 4 Corresponding to the method embodiment shown, the device may be a mobile robot, or the device may be applied to electronic devices such as mobile robots.

[0110] like Figure 6 As shown, the grid map processing device 600 of this embodiment includes: an encoding unit 601, which is configured to compress and encode the target grid map in response to obtaining the target grid map to obtain encoded data; and a storage unit 602, which is configured to store the encoded data locally.

[0111] In some optional implementations of this embodiment, the encoding unit 601 is further configured to: convert the raster data in the target raster map from the original data type to the target data type to obtain the raster map to be compressed; and compress and encode the raster map to be compressed to obtain encoded data.

[0112] In some optional implementations of this embodiment, the encoding unit 601 is further configured to: divide the raster data in the raster map to be compressed into multiple vectors according to the number of rows or columns; and compress and encode the multiple vectors using a run-length encoding method to obtain encoded data corresponding to each vector.

[0113] In some optional implementations of this embodiment, the encoding unit 601 is further configured to: if the number of rows of the raster map to be compressed is greater than the number of columns, divide the raster data in the raster map to be compressed into multiple column vectors according to the number of columns; if the number of rows of the raster map to be compressed is less than or equal to the number of columns, divide the raster data in the raster map to be compressed into multiple row vectors according to the number of rows.

[0114] In some optional implementations of this embodiment, the encoding unit 601 is further configured to: if the multiple vectors are column vectors, for each of the multiple vectors, record the row sequence corresponding to the first raster data in the vector and the first raster data in the form of a tuple; for each raster data from the second raster data in the vector, the raster data is different from the previous raster data, record the row sequence corresponding to the raster data and the raster data in the form of a tuple; summarize the recorded tuples to obtain the encoded data corresponding to the vector;

[0115] If the above-mentioned multiple vectors are row vectors, for each of the above-mentioned multiple vectors, the column sequence corresponding to the first raster data in the vector and the above-mentioned first raster data are recorded in the form of a tuple; for each raster data starting from the second raster data in the vector, the raster data is different from the previous raster data, the column sequence corresponding to the raster data and the raster data are recorded in the form of a tuple; the recorded tuples are summarized to obtain the encoded data corresponding to the vector.

[0116] In some optional implementations of the present embodiment, the apparatus further includes a query unit configured to: in response to receiving a raster data query request for a target raster, determine the target coordinates of the target raster in the target raster map; if the multiple vectors are column vectors, determine the target column and index value of the encoded data based on the target coordinates; query the last 2-tuple whose row order is less than or equal to the index value from the encoded data corresponding to the target column; if the multiple vectors are row vectors, determine the target row and index value of the encoded data based on the target coordinates; query the last 2-tuple whose column order is less than or equal to the index value from the encoded data corresponding to the target row; convert the raster data in the last 2-tuple from the target data type to the original data type to obtain the target raster data; and return the target raster data.

[0117] The device provided by the above-mentioned embodiment of the present application can reduce the memory consumption of the mobile robot by compressing and encoding the target grid map to obtain encoded data, and storing the encoded data locally in the mobile robot.

[0118] In addition, since the resolution of the grid map is not reduced during the above processing, the positioning accuracy and navigation path planning performance of the mobile robot will not be reduced. At the same time, since the mobile robot does not need to switch maps when using the encoded data to work, the working efficiency of the mobile robot will not be reduced. Therefore, the memory consumption of the grid map on the mobile robot can be reduced without losing accuracy and reducing working efficiency.

[0119] Further references Figure 7 , which shows a system architecture 700 of a grid map processing system according to yet another embodiment of the present application. Figure 7 As shown, the raster map processing system may include a server 701 and a mobile robot 702 .

[0120] In this embodiment, the server 701 can be used to determine the target area in the original grid map based on the working trajectory of the mobile robot; generate the target grid map based on the grid data in the target area; and send the target grid data to the mobile robot. The mobile robot 702 can be used to compress and encode the target grid map to obtain encoded data; and store the encoded data locally.

[0121] It should be noted that the step of compressing and encoding the target grid map to obtain the encoded data may also be performed by the server 701, and the server 701 sends the obtained encoded data to the mobile robot 702. In addition, the server 701 may also store the encoded data.

[0122] In some optional implementations of the present embodiment, the server 701 may be further configured to detect a first frame selection operation performed by a user on the working trajectory of the mobile robot in the original grid map; and determine the area selected by the first frame selection operation as the target area.

[0123] In some optional implementations of the present embodiment, the server 701 may be further used to determine the minimum horizontal coordinate, the minimum vertical coordinate, the maximum horizontal coordinate and the maximum vertical coordinate of the working trajectory of the mobile robot in the original grid map; based on the above-mentioned minimum horizontal coordinate, the above-mentioned minimum vertical coordinate, the above-mentioned maximum horizontal coordinate, the above-mentioned maximum vertical coordinate, the resolution of the above-mentioned original grid map and the measurement length of the laser sensor installed in the above-mentioned mobile robot, determine the target area in the above-mentioned original grid map.

[0124] In some optional implementations of this embodiment, the server 701 may be further used to detect a second selection operation of the user on the above-mentioned work trajectory in the above-mentioned target area before generating a target raster map based on the raster data in the above-mentioned target area; and replace the above-mentioned target area with the area selected by the above-mentioned second selection operation.

[0125] In some optional implementations of the present embodiment, the server 701 may be further used to detect a third selection operation performed by the user in the target area for an area outside the working trajectory before generating a target raster map based on the raster data in the target area; the area selected by the third selection operation is used as a non-working area, and the raster data in the non-working area is set to an initial value.

[0126] In some optional implementations of this embodiment, the mobile robot 702 can be further used to convert the raster data in the above-mentioned target raster map from the original data type to the target data type to obtain the raster map to be compressed; and compress and encode the above-mentioned raster map to be compressed to obtain encoded data.

[0127] In some optional implementations of the present embodiment, the mobile robot 702 may be further used to divide the raster data in the above-mentioned raster map to be compressed into multiple vectors according to the number of rows or columns; and compress and encode the above-mentioned multiple vectors using a run-length encoding method to obtain the encoded data corresponding to each vector.

[0128] In some optional implementations of the present embodiment, the mobile robot 702 may be further used to divide the raster data in the raster map to be compressed into multiple column vectors according to the number of columns if the number of rows of the raster map to be compressed is greater than the number of columns; and to divide the raster data in the raster map to be compressed into multiple row vectors according to the number of rows if the number of rows of the raster map to be compressed is less than or equal to the number of columns.

[0129] In some optional implementations of the present embodiment, the mobile robot 702 may be further used to, if the above-mentioned multiple vectors are column vectors, record, for each of the above-mentioned multiple vectors, the row sequence corresponding to the first raster data in the vector and the above-mentioned first raster data in the form of a tuple; for each raster data starting from the second raster data in the vector, the raster data is different from the previous raster data, record the row sequence corresponding to the raster data and the raster data in the form of a tuple; summarize the recorded tuples to obtain the encoded data corresponding to the vector.

[0130] In some optional implementations of the present embodiment, the mobile robot 702 may be further used to, if the above-mentioned multiple vectors are row vectors, record, for each of the above-mentioned multiple vectors, the column sequence corresponding to the first raster data in the vector and the above-mentioned first raster data in the form of a tuple; for each raster data starting from the second raster data in the vector, the raster data is different from the previous raster data, record the column sequence corresponding to the raster data and the raster data in the form of a tuple; summarize the recorded tuples to obtain the encoded data corresponding to the vector.

[0131] In some optional implementations of the present embodiment, the mobile robot 702 may be further used to determine the target coordinates of the target grid in the target grid map in response to receiving a raster data query request for the target grid; determine the target column and index value of the encoded data based on the target coordinates; query the last two-tuple whose row order is less than or equal to the index value from the encoded data corresponding to the target column; convert the raster data in the last two-tuple from the target data type to the original data type to obtain the target raster data; and return the target raster data.

[0132] In some optional implementations of the present embodiment, the mobile robot 702 may be further used to determine the target coordinates of the target grid in the target grid map in response to receiving a raster data query request for the target grid; determine the target row and index value of the encoded data based on the target coordinates; query the last two-tuple whose column order is less than or equal to the index value from the encoded data corresponding to the target row; convert the raster data in the last two-tuple from the target data type to the original data type to obtain the target raster data; and return the target raster data.

[0133] The system provided by the above-mentioned embodiment of the present application determines the target area in the original grid map based on the working trajectory of the mobile robot through the server, and generates the target grid map based on the grid data in the target area, so that the generated target grid map can cover the working trajectory of the mobile robot while removing a large number of unnecessary areas, thereby reducing memory consumption. In addition, the mobile robot compresses and encodes the target grid map to obtain coded data, and the mobile robot stores the coded data, which can further reduce the memory consumption of the mobile robot. Since the resolution of the grid map is not reduced in the above-mentioned processing process, it will not cause the reduction of the positioning accuracy and navigation path planning performance of the mobile robot. At the same time, since the mobile robot does not need to switch maps when using the coded data to work, it will not cause the reduction of the working efficiency of the mobile robot. Therefore, the memory consumption of the grid map on the mobile robot can be reduced without losing accuracy and reducing work efficiency.

[0134] Reference below Figure 8 , which shows a schematic structural diagram of an electronic device for implementing some embodiments of the present application. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0135] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0136] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a disk, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 8 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0137] In particular, according to some embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of some embodiments of the present application are executed.

[0138] It should be noted that the computer-readable medium described in some embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0139] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0140] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines the target area in the original grid map based on the working trajectory of the mobile robot; generates the target grid map based on the grid data in the target area. Alternatively, the electronic device: in response to obtaining the target grid map, compresses and encodes the target grid map to obtain encoded data; and stores the encoded data in the mobile robot.

[0141] Computer program code for performing the operations of some embodiments of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++; and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, or may be connected to an external computer (e.g., through the Internet using an Internet service provider), including a local area network (LAN) or a wide area network (WAN).

[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0143] The units described in some embodiments of the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a first determination unit, a second determination unit, a selection unit, and a third determination unit. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0144] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0145] The above description is only some preferred embodiments of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with (but not limited to) the technical features with similar functions disclosed in the embodiments of the present application to form a technical solution.

Claims

1. A raster map processing method, characterized in that: include: Based on the working trajectory of the mobile robot in the actual environment corresponding to the corresponding trajectory in the original grid map, determining the target area in the original grid map, the target area of ​​the original grid map is a local area in the original grid map, and the working trajectory is included in the target area of ​​the original grid map; The target area is determined based on a first selection operation of a user on the working track of the mobile robot in the original grid map, or the target area is determined based on a minimum value of a horizontal coordinate, a minimum value of a vertical coordinate, a maximum value of a horizontal coordinate, and a maximum value of a vertical coordinate of the working track of the mobile robot in the original grid map; A target grid map is generated based on the grid data in the target area.

2. The method according to claim 1, characterized in that: The step of determining the target area in the original grid map based on the working trajectory of the mobile robot includes: Detecting a first frame selection operation of a user on a working track of the mobile robot in the original grid map; The area selected by the first selection operation is determined as the target area.

3. The method according to claim 1, characterized in that The step of determining the target area in the original grid map based on the working trajectory of the mobile robot includes: Determine the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate of the working trajectory of the mobile robot in the original grid map; The target area in the original grid map is determined based on the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, the maximum value of the vertical coordinate, the resolution of the original grid map, and the measurement length of the laser sensor installed in the mobile robot.

4. The method according to claim 3, characterized in that: Before generating a target grid map based on the grid data in the target area, the method further includes: Detecting a second selection operation of the user on the work track in the target area; The target area is replaced with the area selected by the second selection operation.

5. The method according to claim 1, characterized in that Before generating a target grid map based on the grid data in the target area, the method further includes: Detecting a third selection operation of the user in the target area on an area outside the working track; The area selected by the third selection operation is used as a non-working area, and the raster data in the non-working area is set to an initial value.

6. The method according to claim 2, characterized in that Before generating a target grid map based on the grid data in the target area, the method further includes: Detecting a third selection operation of the user in the target area on an area outside the working track; The area selected by the third selection operation is used as a non-working area, and the raster data in the non-working area is set to an initial value.

7. The method according to claim 3, characterized in that Before generating a target grid map based on the grid data in the target area, the method further includes: Detecting a third selection operation of the user in the target area on an area outside the working track; The area selected by the third selection operation is used as a non-working area, and the raster data in the non-working area is set to an initial value.

8. The method according to claim 4, characterized in that Before generating a target grid map based on the grid data in the target area, the method further includes: Detecting a third selection operation of the user in the target area on an area outside the working track; The area selected by the third selection operation is used as a non-working area, and the raster data in the non-working area is set to an initial value.

9. The method according to claim 1, characterized in that: After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

10. The method according to claim 2, characterized in that After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

11. The method according to claim 3, characterized in that After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

12. The method according to claim 4, characterized in that After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

13. The method according to claim 5, characterized in that After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

14. The method according to claim 6, characterized in that After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

15. The method according to claim 7, characterized in that After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

16. The method according to claim 8, characterized in that After generating the target grid map, the method further includes: Compressing and encoding the target grid map to obtain encoded data; The encoded data is stored in the mobile robot.

17. The method according to any one of claims 1 to 16, characterized in that: The step of compressing and encoding the target grid map to obtain encoded data includes: Converting the raster data in the target raster map from an original data type to a target data type to obtain a raster map to be compressed; The raster map to be compressed is compressed and encoded to obtain encoded data.

18. The method according to claim 17, characterized in that The step of compressing and encoding the raster map to be compressed to obtain encoded data includes: Dividing the raster data in the to-be-compressed raster map into a plurality of vectors according to the number of rows or columns; The multiple vectors are compressed and encoded by using a run-length encoding method to obtain encoding data corresponding to each vector.

19. The method according to claim 18, characterized in that The step of dividing the raster data in the raster map to be compressed into a plurality of vectors according to the number of rows or columns includes: If the number of rows of the to-be-compressed raster map is greater than the number of columns, dividing the raster data in the to-be-compressed raster map into a plurality of column vectors according to the number of columns; If the number of rows of the to-be-compressed grid map is less than or equal to the number of columns, the grid data in the to-be-compressed grid map is divided into a plurality of row vectors according to the number of rows.

20. The method according to claim 19, characterized in that The compressing and encoding the multiple vectors by using the run-length encoding method to obtain the encoded data corresponding to each vector includes: If the multiple vectors are column vectors, for each of the multiple vectors, the row sequence corresponding to the first raster data in the vector and the first raster data are recorded in the form of a tuple; for each raster data starting from the second raster data in the vector, the raster data is different from the previous raster data, the row sequence corresponding to the raster data and the raster data are recorded in the form of a tuple; the recorded tuples are summarized to obtain the encoded data corresponding to the vector.

21. The method according to claim 19, characterized in that The compressing and encoding the multiple vectors by using the run-length encoding method to obtain the encoded data corresponding to each vector includes: If the multiple vectors are row vectors, for each of the multiple vectors, the column sequence corresponding to the first raster data in the vector and the first raster data are recorded in the form of a tuple; for each raster data starting from the second raster data in the vector, the raster data is different from the previous raster data, the column sequence corresponding to the raster data and the raster data are recorded in the form of a tuple; the recorded tuples are summarized to obtain the encoded data corresponding to the vector.

22. The method according to claim 20, characterized in that The method further comprises: In response to receiving a grid data query request for a target grid, determining a target coordinate of the target grid in the target grid map; Based on the target coordinates, determining a target column and an index value of the encoded data; Query the last two-tuple whose row order is less than or equal to the index value from the encoded data corresponding to the target column; Convert the raster data in the last 2-tuple from the target data type to the original data type to obtain target raster data; Returns the target raster data.

23. The method according to claim 21, characterized in that The method further comprises: In response to receiving a grid data query request for a target grid, determining a target coordinate of the target grid in the target grid map; Based on the target coordinates, determining a target row and an index value of the encoded data; Query the last two-tuple whose column order is less than or equal to the index value from the encoded data corresponding to the target row; Convert the raster data in the last 2-tuple from the target data type to the original data type to obtain target raster data; Returns the target raster data.

24. A raster map processing method, characterized in that: Applied to a mobile robot, the method comprises: In response to acquiring the target grid map, compressing and encoding the target grid map to obtain encoded data, and the trajectory is determined; storing the encoded data locally; The target grid map is generated according to the following steps: Based on the working trajectory of the mobile robot in the actual environment corresponding to the corresponding trajectory in the original grid map, a target area in the original grid map is determined, the target area of ​​the original grid map is a local area in the original grid map, and the working trajectory is included in the target area of ​​the original grid map; the target area is determined based on a first box selection operation of the user on the working trajectory of the mobile robot in the original grid map, or the target area is determined based on the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate of the working trajectory of the mobile robot in the original grid map; A target grid map is generated based on the grid data in the target area.

25. The method according to claim 24, characterized in that The step of compressing and encoding the target grid map to obtain encoded data includes: Converting the raster data in the target raster map from an original data type to a target data type to obtain a raster map to be compressed; The raster map to be compressed is compressed and encoded to obtain encoded data.

26. The method according to claim 25, characterized in that The step of compressing and encoding the raster map to be compressed to obtain encoded data includes: Dividing the raster data in the to-be-compressed raster map into a plurality of vectors according to the number of rows or columns; The multiple vectors are compressed and encoded by using a run-length encoding method to obtain encoding data corresponding to each vector.

27. The method according to claim 26, characterized in that The step of dividing the raster data in the raster map to be compressed into a plurality of vectors according to the number of rows or columns includes: If the number of rows of the to-be-compressed raster map is greater than the number of columns, dividing the raster data in the to-be-compressed raster map into a plurality of column vectors according to the number of columns; If the number of rows of the to-be-compressed grid map is less than or equal to the number of columns, the grid data in the to-be-compressed grid map is divided into a plurality of row vectors according to the number of rows.

28. The method according to claim 27, characterized in that The compressing and encoding the multiple vectors by using the run-length encoding method to obtain the encoded data corresponding to each vector includes: If the multiple vectors are column vectors, for each of the multiple vectors, the row sequence corresponding to the first raster data in the vector and the first raster data are recorded in the form of a tuple; for each raster data from the second raster data in the vector, the raster data is different from the previous raster data, the row sequence corresponding to the raster data and the raster data are recorded in the form of a tuple; the recorded tuples are summarized to obtain the encoded data corresponding to the vector; If the multiple vectors are row vectors, for each of the multiple vectors, the column sequence corresponding to the first raster data in the vector and the first raster data are recorded in the form of a tuple; for each raster data starting from the second raster data in the vector, the raster data is different from the previous raster data, the column sequence corresponding to the raster data and the raster data are recorded in the form of a tuple; the recorded tuples are summarized to obtain the encoded data corresponding to the vector.

29. The method according to claim 28, characterized in that The method further comprises: In response to receiving a grid data query request for a target grid, determining a target coordinate of the target grid in the target grid map; If the multiple vectors are column vectors, determine the target column and index value of the encoded data based on the target coordinates; query the last 2-tuple whose row order is less than or equal to the index value from the encoded data corresponding to the target column; If the multiple vectors are row vectors, determine the target row and index value of the encoded data based on the target coordinates; query the last two-tuple whose column order is less than or equal to the index value from the encoded data corresponding to the target row; Convert the raster data in the last 2-tuple from the target data type to the original data type to obtain target raster data; Returns the target raster data.

30. A raster map processing device, characterized in that: include: A determination unit is configured to determine a target area in an original grid map by automatic identification or manual selection based on a corresponding track in a grid map corresponding to a working track of the mobile robot in an actual environment, wherein the target area of ​​the original grid map is a local area in the original grid map, and the working track is included in the target area of ​​the original grid map; The automatic identification is completed based on the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate of the working track of the mobile robot in the original grid map; the manual selection is completed based on the first selection operation of the user on the working track of the mobile robot in the original grid map; The generating unit is configured to generate a target grid map based on the grid data in the target area.

31. A raster map processing device, characterized in that: The device comprises: The encoding unit is configured to compress and encode the target grid map in response to obtaining the target grid map to obtain encoded data, wherein the target grid map is determined according to the working trajectory of the mobile robot; specifically, the target grid map is generated based on the grid data in the target area, and the target area is determined based on the first box selection operation of the user for the working trajectory of the mobile robot in the original grid map, or the target area is determined based on the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate of the working trajectory of the mobile robot in the original grid map; The storage unit is configured to store the encoded data locally.

32. A raster map processing system, characterized in that: include: The server is used to determine the target area in the original grid map by automatic identification or manual selection based on the working trajectory of the mobile robot in the actual environment corresponding to the corresponding trajectory in the grid map, wherein the target area of ​​the original grid map is a local area in the original grid map, and the working trajectory is included in the target area of ​​the original grid map; The automatic identification is completed based on the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate of the working track of the mobile robot in the original grid map; the manual selection is completed based on the first selection operation of the user on the working track of the mobile robot in the original grid map; based on the grid data in the target area, a target grid map is generated; and the target grid data is sent to the mobile robot; The mobile robot is used to compress and encode the target grid map to obtain encoded data; and store the encoded data locally.

33. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 29.

34. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 29 is implemented.