Security area determination method and device, electronic equipment and storage medium
By meshing and grayscale conversion of the target map, and using the safe area prediction model to determine the safe area, the problem of low efficiency of traditional geometric algorithms is solved and more efficient and accurate path planning is achieved.
Patent Information
- Application Number
- CN202410727654.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-03
AI Technical Summary
When the existing technology determines the safe area, the use of traditional geometric algorithms may lead to low processing efficiency, requiring repeated adjustments, and the resulting safe area is not suitable for path planning.
By meshing the target map, performing grayscale conversion based on the overlapping state of the grid and obstacle areas, a grayscale map is generated, which is input into the safe area prediction model, and the coordinate sequence is output to determine the safe area and optimize path planning.
It improves the efficiency and accuracy of safe area determination, ensures that the path planning point is within the drivable area, avoids collision with obstacles, and improves the processing efficiency of unmanned vehicle path planning.
Smart Images

Figure CN118583183A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of intelligent driving, and more specifically, to a method, device, electronic device and storage medium for determining a safe area. Background Art
[0002] In the process of path planning for unmanned vehicles, it is necessary to ensure that each path point is within the drivable area of the map to prevent the unmanned vehicle from colliding with obstacles. Therefore, during the planning process, a safety area can be set to restrict the location of the path points. When determining the safety area, the related technology analyzes the drivable area and obstacle area in the map, and then uses traditional geometric algorithms to calculate the safety area.
[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: the safety area determined by using traditional geometric algorithms may not be suitable for path planning, and therefore needs to be repeatedly adjusted, resulting in low processing efficiency. Summary of the invention
[0004] In view of this, the present disclosure provides a method, device, electronic device and storage medium for determining a safe area.
[0005] One aspect of the present disclosure provides a method for determining a safe area, comprising: gridding a target map for path planning to obtain a grid map, wherein the target map includes an obstacle area and a drivable area, wherein the drivable area includes an initial path planning point; performing grayscale conversion on the grid map according to an overlapping state between each grid in the grid map and the obstacle area to obtain a grayscale map, wherein grids with different overlapping states in the grayscale map correspond to different grayscale values, and the grayscale value of the grid where the initial path planning point is located is a preset grayscale value; inputting the grayscale map into a safe area prediction model, and outputting a coordinate sequence corresponding to the initial path planning point; determining a safe area in the target map based on the coordinate sequence, and optimizing the driving path where the initial path planning point is located based on the safe area, wherein the safe area is a maximum driving area in the drivable area that includes the initial path planning point and does not overlap with the obstacle area.
[0006] According to an embodiment of the present disclosure, the above-mentioned grid map is gray-scale converted according to the overlapping state of each grid in the above-mentioned grid map and the above-mentioned obstacle area to obtain a gray-scale map, including: determining the gray-scale value of each of the above-mentioned grids according to the overlapping state of each grid in the above-mentioned grid map and the above-mentioned obstacle area, wherein the gray-scale value of the grid in the above-mentioned overlapping state is the minimum gray-scale value, and the gray-scale value of the grid in the above-mentioned overlapping state is the maximum gray-scale value; processing the above-mentioned grid map according to the gray-scale value of each of the above-mentioned grids to generate an intermediate map; setting the gray-scale value of the grid where the above-mentioned initial path planning point is located in the above-mentioned intermediate map to the above-mentioned preset gray-scale value to generate the above-mentioned gray-scale map.
[0007] According to an embodiment of the present disclosure, the above-mentioned grayscale map is input into the safe area prediction model, and a coordinate sequence corresponding to the above-mentioned initial path planning points is output, including: inputting the above-mentioned grayscale image into the convolutional neural network of the above-mentioned safe area prediction model for feature extraction, and outputting the feature vector of the above-mentioned grayscale image; inputting the above-mentioned feature vector into the long short-term memory network of the above-mentioned safe area prediction model for feature learning, and outputting the above-mentioned coordinate sequence.
[0008] According to an embodiment of the present disclosure, the above-mentioned safe area prediction model is trained in the following manner: obtaining a sample map and a coordinate sequence label corresponding to the above-mentioned sample map, wherein the above-mentioned sample map includes a drivable sample area and an obstacle sample area, wherein the above-mentioned drivable sample area includes an obstacle avoidance sample query point; inputting the above-mentioned sample map and the coordinate sequence label into the initial safe area prediction model, and outputting a predicted coordinate sequence; calculating the coordinate distance between each coordinate in the above-mentioned predicted coordinate sequence and the corresponding coordinate in the above-mentioned coordinate sequence label; optimizing the above-mentioned initial safe area prediction model according to the sum of multiple of the above-mentioned coordinate distances to obtain a trained safe area prediction model.
[0009] According to an embodiment of the present disclosure, the above-mentioned determination of a safe area in the above-mentioned target map based on the above-mentioned coordinate sequence includes: connecting each coordinate in sequence according to the arrangement order of multiple coordinates in the above-mentioned coordinate sequence to obtain a closed safe area, wherein the multiple coordinates in the above-mentioned coordinate sequence correspond to the vertex coordinates of the above-mentioned safe area.
[0010] According to an embodiment of the present disclosure, the above method also includes: planning the driving path of the unmanned vehicle in the above target map according to a preset starting position and a preset end position, wherein the above driving path includes multiple initial path planning points; performing data optimization on the multiple initial path planning points respectively to generate multiple path planning optimization points to smooth the above driving path; and generating a new driving path based on the multiple path planning optimization points.
[0011] According to an embodiment of the present disclosure, the driving path where the initial path planning point is located is optimized based on the safety area, including: determining the linear function of each edge in the safety area based on multiple vertex coordinates of the safety area; constructing multiple linear inequalities based on the multiple linear functions to characterize the safety area using the multiple linear inequalities; performing collision detection on the path planning optimization point corresponding to the initial path planning point based on the multiple linear inequalities to obtain a detection result; when the detection result indicates that the path planning optimization point is within the safety area, generating an optimized driving path based on the path planning optimization point.
[0012] Another aspect of the present disclosure provides a safety area determination device, including: a map division module, used to grid-divide a target map for path planning to obtain a grid map, wherein the target map includes an obstacle area and a drivable area, wherein the drivable area includes an initial path planning point; a grayscale conversion module, used to grayscale convert the grid map according to the overlapping state of each grid in the grid map and the obstacle area to obtain a grayscale map, wherein grids with different overlapping states in the grayscale map correspond to different grayscale values, and the grayscale value of the grid where the initial path planning point is located is a preset grayscale value; a coordinate prediction module, used to input the grayscale map into a safety area prediction model, and output a coordinate sequence corresponding to the initial path planning point; an area determination module, used to determine a safety area in the target map based on the coordinate sequence, and optimize the driving path where the initial path planning point is located based on the safety area, wherein the safety area is the maximum driving area in the drivable area that includes the initial path planning point and does not overlap with the obstacle area.
[0013] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above method.
[0014] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0015] Another aspect of the present disclosure provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.
[0016] According to the embodiments of the present disclosure, by dividing the target map into grids and converting the grid map into grayscale according to the overlapping state between each grid in the grid map and the obstacle area, the regional information in the target map is more intuitive and clear, and it is convenient for the model to extract and analyze features. The grayscale map is input into the safety area prediction model, the safety area is predicted, and the coordinate sequence corresponding to the initial path planning point is output. By using the safety area prediction model to determine the safety area, the determination process is more convenient and more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 An exemplary system architecture to which the method and apparatus for determining a safe area of the present disclosure may be applied is schematically shown;
[0019] Figure 2 A flowchart of a method for determining a safe area according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 A schematic diagram of determining a safety area in a safety area determination method according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 4 A flowchart of driving route optimization according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 5 A block diagram schematically shows a security zone determination device according to an embodiment of the present disclosure; and
[0023] Figure 6 A block diagram of an electronic device suitable for implementing a method for determining a security area according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0027] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0028] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security, and national security.
[0029] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0030] The embodiments of the present disclosure provide a method, device, electronic device and storage medium for determining a safe area. The method includes gridding a target map for path planning to obtain a grid map, wherein the target map includes an obstacle area and a drivable area, wherein the drivable area includes an initial path planning point; grayscale conversion is performed on the grid map according to the overlapping state of each grid in the grid map and the obstacle area to obtain a grayscale map, wherein the grayscale values corresponding to grids with different overlapping states in the grayscale map are different, and the grayscale value of the grid where the initial path planning point is located is a preset grayscale value; the grayscale map is input into a safe area prediction model, and a coordinate sequence corresponding to the initial path planning point is output; the safe area is determined in the target map based on the coordinate sequence, and the driving path where the initial path planning point is located is optimized based on the safe area, wherein the safe area is the largest driving area in the drivable area that includes the initial path planning point and does not overlap with the obstacle area.
[0031] Figure 1 The following schematically shows an exemplary system architecture to which the method and apparatus for determining a safe area of the present disclosure can be applied. Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0032] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0033] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only for example).
[0034] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0035] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0036] It should be noted that the security area determination method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the security area determination device provided in the embodiment of the present disclosure can generally be set in the server 105. The security area determination method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Correspondingly, the security area determination device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Alternatively, the security area determination method provided in the embodiment of the present disclosure can also be executed by the terminal devices 101, 102, or 103, or can also be executed by other terminal devices different from the terminal devices 101, 102, or 103. Accordingly, the security area determination device provided in the embodiment of the present disclosure may also be set in the terminal device 101 , 102 , or 103 , or in other terminal devices different from the terminal device 101 , 102 , or 103 .
[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0038] Figure 2 The flowchart of the method for determining a safe area according to an embodiment of the present disclosure is schematically shown.
[0039] like Figure 2 As shown, the method includes operations S210 to S240.
[0040] In operation S210, the target map for path planning is gridded to obtain a grid map, wherein the target map includes an obstacle area and a drivable area, wherein the drivable area includes an initial path planning point
[0041] In operation S220, the grid map is converted into grayscale according to the overlapping state between each grid in the grid map and the obstacle area to obtain a grayscale map, wherein the grayscale values corresponding to grids with different overlapping states in the grayscale map are different, and the grayscale value of the grid where the initial path planning point is located is a preset grayscale value.
[0042] In operation S230, the grayscale map is input into the safety area prediction model, and a coordinate sequence corresponding to the initial path planning points is output.
[0043] In operation S240, a safety area is determined in the target map based on the coordinate sequence, and the driving path where the initial path planning point is located is optimized based on the safety area, wherein the safety area is the largest driving area in the drivable area that includes the initial path planning point and does not overlap with the obstacle area.
[0044] According to the embodiments of the present disclosure, in the process of path planning for the unmanned vehicle, a rough planning can be first performed on the target map, and then the planned path can be optimized to obtain the final driving path. In the process of optimizing the path, it is necessary to ensure that each path point is within the drivable area of the target map to prevent the unmanned vehicle from colliding with obstacles. Therefore, the path optimization process can be restricted by setting a safety area.
[0045] According to an embodiment of the present disclosure, in the process of determining the safe area, it is necessary to first analyze the target map used for the planned path. Specifically, the target map is discretized, and the target map is gridded using grids of preset length and preset width to obtain a grid map. The preset length and preset width can be selected based on the accuracy of determining the safe area. The smaller the preset length and preset width, the more accurate the discretized grid map is, which is convenient for determining the safe area.
[0046] According to the embodiment of the present disclosure, the target map includes obstacle areas and drivable areas. To distinguish the two, it is necessary to perform collision detection on each grid in the grid map, that is, to check the overlapping state of each grid in the grid map with the obstacle area. The grids overlapping with the obstacle area and the grids not overlapping with the obstacle area are set to different grayscale values, so as to more intuitively distinguish the obstacle area from the drivable area.
[0047] According to an embodiment of the present disclosure, the grid map is gray-converted according to the gray value of each grid. During the conversion, the gray value of the grid where the initial path planning point is located is set to a preset gray value, and the preset gray value is different from the gray values of other grids, so that the initial path planning point can be represented in the gray image.
[0048] According to an embodiment of the present disclosure, the grayscale map is input into the safety area prediction model to predict the safety area to obtain a coordinate sequence corresponding to the initial path planning point. The coordinate sequence includes multiple coordinates, each coordinate corresponds to the vertex coordinate of the safety area in the target map. Specifically, the safety area can be an irregular convex polygon.
[0049] According to an embodiment of the present disclosure, the safety area prediction model used in the safety area prediction may be a model including a convolutional neural network and a long short-term memory network for extracting and learning features. The safety area prediction model may also be other models that can analyze and predict images.
[0050] According to the embodiments of the present disclosure, by dividing the target map into grids and converting the grid map into grayscale according to the overlapping state between each grid in the grid map and the obstacle area, the regional information in the target map is more intuitive and clear, and it is convenient for the model to extract and analyze features. The grayscale map is input into the safety area prediction model, the safety area is predicted, and the coordinate sequence corresponding to the initial path planning point is output. By using the safety area prediction model to determine the safety area, the determination process is more convenient and more efficient.
[0051] Figure 3 The schematic diagram of determining a safety area in the safety area determination method according to an embodiment of the present disclosure is schematically shown.
[0052] According to an embodiment of the present disclosure, the grid map is converted into grayscale according to the overlapping state between each grid in the grid map and the obstacle area to obtain a grayscale map, including: determining the grayscale value of each grid according to the overlapping state between each grid in the grid map and the obstacle area, wherein the grayscale value of the grid in which the overlapping state occurs is the minimum grayscale value, and the grayscale value of the grid in which the overlapping state does not occur is the maximum grayscale value; processing the grid map according to the grayscale value of each grid to generate an intermediate map; setting the grayscale value of the grid where the initial path planning point in the intermediate map is located to a preset grayscale value to generate a grayscale map.
[0053] According to an embodiment of the present disclosure, the grid map obtained after the target map is gridded still includes the obstacle area and the drivable area. Collision detection is performed on each grid in the grid map in turn, that is, it is determined whether each grid has an overlapping area with the obstacle area, thereby determining the overlapping state of each grid.
[0054] According to the embodiment of the present disclosure, the grayscale value range of the image is 0-255, the color corresponding to the minimum grayscale value 0 is white, and the color corresponding to the maximum grayscale value 255 is black. The grayscale value of the grid whose overlapping state is overlapped is set to the minimum grayscale value, and the grayscale value of the grid whose overlapping state is not overlapped is set to the maximum grayscale value. By using white to represent the drivable area and black to mark the obstacle area, it is easy to distinguish the obstacle area from the drivable area in the grid map.
[0055] According to an embodiment of the present disclosure, after the division of the drivable area and the obstacle area is completed, an intermediate map is obtained. The grids in the intermediate map that overlap with the initial path planning points are determined, and the grayscale values of the grids that overlap with the initial path planning points are set to preset grayscale values, thereby generating a grayscale map. Among them, the preset grayscale value is not the maximum grayscale value and the minimum grayscale value. The preset grayscale value can select a grayscale value that can be distinguished from the maximum grayscale value and the minimum grayscale value, for example, it can be set to 127.
[0056] like Figure 3 As shown, in the grayscale map 310 , the white area is the drivable area 320 , the black area is the obstacle area 330 , and the gray dot between the drivable area 320 and the obstacle area 330 is the initial path planning point 340 .
[0057] According to an embodiment of the present disclosure, by dividing the target map into grids and converting the grid map into grayscale according to the overlapping state between each grid in the grid map and the obstacle area, the area information in the target map is made more intuitive and clear, and it is convenient for the model to extract and analyze features.
[0058] According to an embodiment of the present disclosure, a grayscale map is input into a safe area prediction model, and a coordinate sequence corresponding to the initial path planning points is output, including: inputting a grayscale image into a convolutional neural network of the safe area prediction model for feature extraction, and outputting a feature vector of the grayscale image; inputting the feature vector into a long short-term memory network of the safe area prediction model for feature learning, and outputting a coordinate sequence.
[0059] According to the embodiments of the present disclosure, the safe area prediction model includes a convolutional neural network and a long short-term memory network. In the process of predicting the safe area, the grayscale map is input into the convolutional neural network, and the grayscale image is extracted using the convolutional neural network. The extracted features are then input into the long short-term memory network for feature learning, thereby obtaining the coordinate sequence of the safe area. In the process of feature learning, the classic gradient descent and back propagation process can be used.
[0060] According to an embodiment of the present disclosure, the long short-term memory network in the safety area prediction model can also be replaced by a recurrent neural network, or can also be replaced by a deep learning model (Transformer model) of the self-attention mechanism in the field of natural language processing and image processing.
[0061] According to the embodiments of the present disclosure, the grayscale map is input into the safety area prediction model, the safety area is predicted, and the coordinate sequence corresponding to the initial path planning point is output. By using the safety area prediction model to determine the safety area, the determination process is more convenient and more efficient.
[0062] According to an embodiment of the present disclosure, a safe area prediction model is trained in the following manner: a sample map and a coordinate sequence label corresponding to the sample map are obtained, wherein the sample map includes a drivable sample area and an obstacle sample area, wherein the drivable sample area includes an obstacle avoidance sample query point; the sample map and the coordinate sequence label are input into an initial safe area prediction model, and a predicted coordinate sequence is output; the coordinate distance between each coordinate in the predicted coordinate sequence and the corresponding coordinate in the coordinate sequence label is calculated; and the initial safe area prediction model is optimized according to the sum of multiple coordinate distances to obtain a trained safe area prediction model.
[0063] According to an embodiment of the present disclosure, the safe area prediction model is trained by using supervised learning. The input of the training set consists of the drivable sample area and obstacle sample area in the sample map and the obstacle avoidance sample query points in the drivable sample area. In the actual operation of unmanned vehicles, a large number of such sample maps will be accumulated. The output of the training set (coordinate sequence label) is composed of the vertex coordinates xy of the optimal safe area containing the obstacle avoidance sample query point on each sample map. Among them, the coordinate sequence label can be obtained by manual marking (people can easily find a safe area that contains the obstacle avoidance sample query point and is the best).
[0064] According to the embodiments of the present disclosure, after obtaining the training set, the open source deep learning library Pytorch (machine learning library) or TensorFlow (symbolic mathematics system) can be used to train the convolutional neural network and the long short-term memory network. Specifically, the safety area prediction problem can be modeled as a regression problem. The coordinate sequence label of the i-th sample in the training set is ,in Indicates the first Vertices. Represents the total number of vertices in the safe area given in advance. The input of training samples is the predicted coordinate sequence of the output .
[0065] According to an embodiment of the present disclosure, the coordinate distance between each coordinate in the predicted coordinate sequence and the corresponding coordinate in the coordinate sequence label is calculated during the training process. Based on the sum of multiple coordinate distances, the initial safe area prediction model is optimized to obtain a trained safe area prediction model. After the initial safe area prediction is fully trained, it can be deployed online for the prediction of safe areas. The calculation formula is as follows:
[0066]
[0067] in, Represents the sum of multiple coordinate distances.
[0068] Figure 3 The schematic diagram of determining a safety area in the safety area determination method according to an embodiment of the present disclosure is schematically shown.
[0069] According to an embodiment of the present disclosure, determining a safe area in a target map based on a coordinate sequence includes: connecting each coordinate in sequence according to an arrangement order of multiple coordinates in the coordinate sequence to obtain a closed safe area, wherein the multiple coordinates in the coordinate sequence correspond to the vertex coordinates of the safe area.
[0070] According to the embodiments of the present disclosure, when determining a safe area, the coordinates in the coordinate sequence can be marked in the target map first, and then the coordinates can be connected in sequence in the target map according to the arrangement order of each coordinate, and the coordinate points can be connected end to end to obtain a closed safe area.
[0071] like Figure 3 As shown, in the target map 350 in which the safety area prediction is completed according to the initial path planning points, the convex polygon between the obstacle area and the drivable area and including the initial path planning points is the safety area 360 .
[0072] According to the embodiments of the present disclosure, by determining the safety area based on the coordinate points, it is convenient to display the safety area so that relevant staff can intuitively observe the location of the safety area.
[0073] According to an embodiment of the present disclosure, the safety area determination method also includes: planning the driving path of the unmanned vehicle in the target map according to a preset starting position and a preset end position, wherein the driving path includes multiple initial path planning points; performing data optimization on the multiple initial path planning points respectively to generate multiple path planning optimization points to smooth the driving path; and generating a new driving path based on the multiple path planning optimization points.
[0074] According to an embodiment of the present disclosure, in the process of roughly planning the driving path of the unmanned vehicle, a preset starting position and a preset end position are first determined on the target map, and then a path planning algorithm is used to plan a path from the preset starting position to the preset end position on the target map. Among them, the path planning algorithm can select the A star algorithm. In the process of using the A star algorithm for path planning, it is necessary to ensure that the planned driving path does not intersect with the obstacle area in the target map. If the driving path intersects with the obstacle area, the driving path needs to be replanned.
[0075] According to an embodiment of the present disclosure, the planned driving path includes multiple initial path planning points, and data optimization is performed on the multiple initial path planning points to generate multiple path planning optimization points. In the process of optimizing the initial path planning points, in order to make the driving path smoother, the positions of the initial path planning points will be appropriately adjusted, and the adjusted path planning optimization points cannot be located in the obstacle area of the target map. The commonly used method in the optimization process is numerical optimization, which models the path planning problem as an optimization problem. The calculation formula is as follows:
[0076]
[0077] in, represents the position of the unmanned vehicle at time k, Represents the control quantity of the unmanned vehicle (such as forward speed, front wheel angle, etc.), function represents the kinematic model of the unmanned vehicle, M represents the path planned for M future moments (M initial path planning points), and the function Represents the obstacle avoidance and safety constraints of the unmanned vehicle (for example, the driving path cannot intersect with the obstacle area), function Indicates the physical limit constraints of the control quantity of the unmanned vehicle (such as the front wheel turning angle cannot be too large, etc.), It means the unmanned vehicle starts from point A. Used to measure the last point position on the planned path and the position of point B The size of the deviation.
[0078] According to an embodiment of the present disclosure, the purpose of optimizing the driving path is to find a set of control quantities , so that the corresponding path The end point is as close to point B as possible, while satisfying constraints such as obstacle avoidance and the physical limits of the unmanned vehicle. In the optimization process, a suitable function needs to be found , so that as long as , the unmanned vehicle does not collide with the obstacle at time k. An intuitive and simple method is to determine a safe area, and when adjusting the initial path planning points, ensure that the path planning optimization points are within the safe area to achieve the effect of no collision. By restricting the path optimization points during the driving path optimization process, the final new driving path is more accurate and safer.
[0079] According to an embodiment of the present disclosure, the driving path where the initial path planning point is located is optimized based on the safety area, including: determining the linear function of each edge in the safety area based on multiple vertex coordinates of the safety area; constructing multiple linear inequalities based on the multiple linear functions to characterize the safety area using multiple linear inequalities; based on the multiple linear inequalities, performing collision detection on the path planning optimization point corresponding to the initial path planning point to obtain a detection result; when the detection result indicates that the path planning optimization point is within the safety area, generating an optimized driving path based on the path planning optimization point.
[0080] According to an embodiment of the present disclosure, in the process of performing collision detection on the path planning optimization point, linear inequalities can be used for detection. Specifically, based on the coordinates of multiple vertices in the safety area, a linear function of each edge in the safety area is determined. Multiple linear inequalities are constructed based on multiple linear functions to characterize the safety area using multiple linear inequalities. For example:
[0081]
[0082] in, is the i-th edge in the safety area, x is the horizontal coordinate of the vertex in the safety area, and y is the vertical coordinate of the vertex in the safety area.
[0083] According to an embodiment of the present disclosure, based on multiple linear inequalities, collision detection is performed on the path planning optimization points corresponding to the initial path planning points to determine whether each path planning optimization point satisfies all linear inequalities, thereby obtaining a detection result. When the detection result indicates that all path planning optimization points are within the safety area, that is, the path planning optimization points satisfy all linear inequalities, multiple path planning optimization points are connected in sequence to generate an optimized driving path. By using the safety area as a restriction condition in the process of optimizing the driving path, the optimization process is made more convenient.
[0084] Figure 4 A flowchart of driving route optimization according to an embodiment of the present disclosure is schematically shown.
[0085] like Figure 4 As shown, the method includes operations S410 to S430.
[0086] In operation S410, a driving path of the unmanned vehicle is planned in a target map according to a preset starting position and a preset end position.
[0087] In operation S420, a safety area prediction model is used to determine a safety area corresponding to each initial path planning point in the driving path.
[0088] In operation S430, each initial path planning point is optimized based on the safety area to generate an optimized driving path.
[0089] According to the embodiments of the present disclosure, by using the safety area prediction model to determine the safety area, the determination process is made more convenient and more efficient. And by using the safety area as a restriction condition in the process of optimizing the driving path, the optimization process is made more convenient, and the new driving path finally obtained is more accurate and safer.
[0090] Figure 5 The block diagram of a security area determination device according to an embodiment of the present disclosure is schematically shown.
[0091] like Figure 5 As shown, the safe area determination device 500 includes a map division module 510, a grayscale conversion module 520, a coordinate prediction module 530 and an area determination module 540.
[0092] The map division module 510 is used to divide the target map used for path planning into grids to obtain a grid map, wherein the target map includes an obstacle area and a drivable area, wherein the drivable area includes an initial path planning point.
[0093] The grayscale conversion module 520 is used to perform grayscale conversion on the grid map according to the overlapping state between each grid in the grid map and the obstacle area to obtain a grayscale map, wherein the grayscale values corresponding to grids with different overlapping states in the grayscale map are different, and the grayscale value of the grid where the initial path planning point is located is a preset grayscale value.
[0094] The coordinate prediction module 530 is used to input the grayscale map into the safety area prediction model and output a coordinate sequence corresponding to the initial path planning points.
[0095] The area determination module 540 is used to determine the safe area in the target map based on the coordinate sequence, and optimize the driving path where the initial path planning point is located based on the safe area, wherein the safe area is the largest driving area in the drivable area that includes the initial path planning point and does not overlap with the obstacle area.
[0096] According to an embodiment of the present disclosure, the grayscale conversion module 520 includes a grayscale determination submodule, a map processing submodule, and a map generation submodule.
[0097] The grayscale determination submodule is used to determine the grayscale value of each grid according to the overlapping state of each grid and the obstacle area in the grid map, wherein the grayscale value of the grid in which the overlapping state occurs is the minimum grayscale value, and the grayscale value of the grid in which the overlapping state does not occur is the maximum grayscale value.
[0098] The map processing submodule is used to process the grid map according to the gray value of each grid to generate an intermediate map.
[0099] The map generation submodule is used to set the grayscale value of the grid where the initial path planning point is located in the intermediate map to a preset grayscale value to generate a grayscale map.
[0100] According to an embodiment of the present disclosure, the coordinate prediction module 530 includes a feature extraction submodule and a feature learning submodule.
[0101] The feature extraction submodule is used to input the grayscale image into the convolutional neural network of the safe area prediction model for feature extraction and output the feature vector of the grayscale image.
[0102] The feature learning submodule is used to input the feature vector into the long short-term memory network of the safe area prediction model for feature learning and output a coordinate sequence.
[0103] According to an embodiment of the present disclosure, the safety area determination device 500 further includes a sample acquisition module, a coordinate prediction module, a distance calculation module and a model optimization module.
[0104] A sample acquisition module, used to acquire a sample map and a coordinate sequence label corresponding to the sample map, wherein the sample map includes a drivable sample area and an obstacle sample area, wherein the drivable sample area includes an obstacle avoidance sample query point;
[0105] A coordinate prediction module, used for inputting the sample map and the coordinate sequence label into the initial safe area prediction model, and outputting a predicted coordinate sequence;
[0106] A distance calculation module is used to calculate the coordinate distance between each coordinate in the predicted coordinate sequence and the corresponding coordinate in the coordinate sequence label;
[0107] The model optimization module is used to optimize the initial safety area prediction model according to the sum of multiple coordinate distances to obtain a trained safety area prediction model.
[0108] According to an embodiment of the present disclosure, the region determination module 540 includes a region determination submodule.
[0109] The area determination submodule is used to connect the coordinates in sequence according to the arrangement order of multiple coordinates in the coordinate sequence to obtain a closed safety area, wherein the multiple coordinates in the coordinate sequence correspond to the vertex coordinates of the safety area.
[0110] According to an embodiment of the present disclosure, the safety area determination device 500 further includes a path planning module, a path optimization module and a path generation module.
[0111] A path planning module is used to plan the driving path of the unmanned vehicle in the target map according to a preset starting position and a preset end position, wherein the driving path includes a plurality of initial path planning points;
[0112] A path optimization module is used to optimize the data of multiple initial path planning points respectively, generate multiple path planning optimization points, and smooth the driving path;
[0113] The path generation module is used to generate a new driving path based on multiple path planning optimization points.
[0114] According to an embodiment of the present disclosure, the safety area determination device 500 further includes a function determination module, an inequality determination module, a collision detection module and an operation execution module.
[0115] A function determination module, used for determining a linear function of each edge in the safety area based on multiple vertex coordinates of the safety area;
[0116] An inequality determination module, used for constructing a plurality of linear inequalities according to a plurality of linear functions, so as to characterize the safety area by using the plurality of linear inequalities;
[0117] A collision detection module is used to perform collision detection on the path planning optimization points corresponding to the initial path planning points based on multiple linear inequalities to obtain a detection result;
[0118] The operation execution module is used to generate an optimized driving path based on the path planning optimization point when the detection result indicates that the path planning optimization point is within the safety area.
[0119] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0120] For example, the safety area determination device 500 includes any of the map division module 510, the grayscale conversion module 520, the coordinate prediction module 530, and the area determination module 540, which can be combined into one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, the safe area determination device 500 includes at least one of the map division module 510, the grayscale conversion module 520, the coordinate prediction module 530, and the area determination module 540, which can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a proper combination of any of them. Alternatively, the safe area determination device 500 includes at least one of the map division module 510, the grayscale conversion module 520, the coordinate prediction module 530, and the area determination module 540, which can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0121] It should be noted that the security area determination device part in the embodiment of the present disclosure corresponds to the security area determination method part in the embodiment of the present disclosure. The description of the security area determination device part specifically refers to the security area determination method part, which will not be repeated here.
[0122] Figure 6 A block diagram of an electronic device suitable for implementing a method for determining a security area according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0123] like Figure 6As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0124] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other through bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0125] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The system 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0126] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0127] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0128] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0129] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .
[0130] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the security area determination method provided by the embodiment of the present disclosure.
[0131] When the computer program is executed by the processor 601, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0132] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0133] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0135] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for determining a safe area, comprising: Gridding a target map for path planning to obtain a grid map, wherein the target map includes an obstacle area and a drivable area, wherein the drivable area includes an initial path planning point; According to the overlapping state between each grid in the grid map and the obstacle area, the grid map is gray-converted to obtain a gray-scale map, wherein the gray-scale values corresponding to grids with different overlapping states in the gray-scale map are different, and the gray-scale value of the grid where the initial path planning point is located is a preset gray-scale value; Inputting the grayscale map into a safe area prediction model, and outputting a coordinate sequence corresponding to the initial path planning points; A safety area is determined in the target map based on the coordinate sequence, and the driving path where the initial path planning point is located is optimized based on the safety area, wherein the safety area is a maximum driving area in the drivable area that includes the initial path planning point and does not overlap with the obstacle area.
2. The method according to claim 1, wherein: The grayscale conversion of the grid map to obtain a grayscale map according to the overlapping state between each grid in the grid map and the obstacle area includes: Determine the grayscale value of each grid according to the overlapping state between each grid in the grid map and the obstacle area, wherein the grayscale value of the grid in the overlapping state is the minimum grayscale value, and the grayscale value of the grid in the overlapping state is the maximum grayscale value; Processing the grid map according to the grayscale value of each grid to generate an intermediate map; The grayscale value of the grid where the initial path planning point is located in the intermediate map is set to the preset grayscale value to generate the grayscale map.
3. The method according to claim 1, wherein: The step of inputting the grayscale map into a safe area prediction model and outputting a coordinate sequence corresponding to the initial path planning point comprises: Inputting the grayscale image into the convolutional neural network of the safe area prediction model to extract features, and outputting a feature vector of the grayscale image; The feature vector is input into the long short-term memory network of the safety area prediction model for feature learning, and the coordinate sequence is output.
4. The method according to claim 1, wherein: The safety area prediction model is trained in the following way: Acquire a sample map and a coordinate sequence label corresponding to the sample map, wherein the sample map includes a drivable sample area and an obstacle sample area, wherein the drivable sample area includes an obstacle avoidance sample query point; Inputting the sample map and the coordinate sequence label into an initial safe area prediction model, and outputting a predicted coordinate sequence; Calculating the coordinate distance between each coordinate in the predicted coordinate sequence and the corresponding coordinate in the coordinate sequence label; The initial safety area prediction model is optimized according to the sum of the multiple coordinate distances to obtain a trained safety area prediction model.
5. The method according to claim 1, wherein: The determining of a safe area in the target map based on the coordinate sequence includes: According to the arrangement order of the multiple coordinates in the coordinate sequence, the coordinates are connected in sequence to obtain a closed safety area, wherein the multiple coordinates in the coordinate sequence correspond to the vertex coordinates of the safety area.
6. The method according to claim 1, further comprising: According to a preset starting position and a preset end position, planning a driving path of the unmanned vehicle in the target map, wherein the driving path includes a plurality of the initial path planning points; Performing data optimization on the multiple initial path planning points respectively to generate multiple path planning optimization points to smooth the driving path; Based on the plurality of path planning optimization points, a new driving path is generated.
7. The method according to claim 1, wherein: The optimizing the driving path where the initial path planning point is located based on the safety area includes: Determine a linear function of each edge in the safety area based on a plurality of vertex coordinates of the safety area; Constructing a plurality of linear inequalities according to the plurality of linear functions, so as to characterize the safety area by using the plurality of linear inequalities; Based on the plurality of linear inequalities, performing collision detection on the path planning optimization points corresponding to the initial path planning points to obtain a detection result; When the detection result indicates that the path planning optimization point is within the safety area, an optimized driving path is generated based on the path planning optimization point.
8. A safe area determination device, comprising: A map division module, used for dividing a target map for path planning into a grid to obtain a grid map, wherein the target map includes an obstacle area and a drivable area, wherein the drivable area includes an initial path planning point; A grayscale conversion module, used for performing grayscale conversion on the grid map according to the overlapping state between each grid in the grid map and the obstacle area to obtain a grayscale map, wherein the grayscale values corresponding to grids with different overlapping states in the grayscale map are different, and the grayscale value of the grid where the initial path planning point is located is a preset grayscale value; A coordinate prediction module, used for inputting the grayscale map into a safe area prediction model and outputting a coordinate sequence corresponding to the initial path planning points; An area determination module is used to determine a safe area in the target map based on the coordinate sequence, and optimize the driving path where the initial path planning point is located based on the safe area, wherein the safe area is the largest driving area in the drivable area that includes the initial path planning point and does not overlap with the obstacle area.
9. An electronic device, comprising: one or more processors; a memory for storing one or more programs, 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 7.
10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.
