Vehicle processing method, device, computer equipment and storage medium
By using the traffic basic diagram in the autonomous driving simulation scenario, the problem of manual setup in the prior art resulting in the failure of the vehicle to meet the traffic laws and the inefficient setting of the vehicle is solved, and more efficient and reasonable traffic vehicle generation is achieved.
Patent Information
- Application Number
- CN202210378157.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2042-04-12
AI Technical Summary
In the prior art, in the autonomous driving simulation scenario, traffic vehicles need to be manually set up, resulting in the vehicle not complying with traffic laws and inefficient setup.
By automatically generating traffic vehicles that conform to traffic laws in a designated area, the traffic basic diagram is used to describe the relationship between traffic flow, traffic density and speed in the traffic network, so as to achieve the delivery point to generate traffic vehicles around a fixed position according to the traffic basic diagram.
The rationality of traffic vehicles and vehicle setup efficiency are improved to ensure that the generated traffic vehicles are in line with objective traffic laws.
Smart Images

Figure CN114780646B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, specifically to the field of autonomous driving, and in particular to a vehicle processing method, device, computer equipment and storage medium. Background Art
[0002] In simulation scenarios such as autonomous driving simulation, it is usually necessary to set up background traffic vehicles that continuously enter the simulation system in the map to verify the decision-making algorithm of the test vehicle in the traffic flow. Among them, the test vehicle refers to a simulation vehicle equipped with a decision-making algorithm (or autonomous driving algorithm) that needs to be tested and verified. It can be the main vehicle or other vehicles in the simulation scene, without limitation; background traffic vehicles can be referred to as traffic vehicles, which refer to other vehicles used to influence the driving decision-making behavior of the test vehicle in the simulation scene. At present, users usually manually add several traffic vehicles in turn and define the driving behavior of each traffic vehicle separately; this method of manually relying on vehicle settings may cause the traffic vehicles generated by users to not conform to traffic laws, and will be inefficient due to cumbersome operations. Summary of the invention
[0003] The embodiments of the present application provide a vehicle processing method, apparatus, computer equipment and storage medium, which can automatically and continuously generate traffic vehicles that comply with traffic laws in a specified area, thereby improving the rationality of traffic vehicles and the efficiency of vehicle settings.
[0004] In one aspect, an embodiment of the present application provides a vehicle processing method, the method comprising:
[0005] Determining a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area;
[0006] Whenever the departure time of the exit point arrives, the exit point is controlled to generate traffic vehicles that comply with traffic laws in the exit area according to the basic traffic map; wherein the basic traffic map is used to describe the relationship between traffic flow, vehicle density and speed in the traffic network.
[0007] On the other hand, an embodiment of the present application provides a vehicle processing device, the device comprising:
[0008] a determining unit, configured to determine a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area;
[0009] The processing unit is used to control the exit point to generate traffic vehicles that comply with traffic laws in the exit area according to the basic traffic map whenever the exit time of the exit point arrives; wherein the basic traffic map is used to describe the relationship between traffic flow, vehicle density and speed in the traffic network.
[0010] In another aspect, an embodiment of the present application provides a computer device, the computer device comprising an input interface and an output interface, the computer device further comprising:
[0011] a processor adapted to implement one or more instructions; and,
[0012] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the following steps:
[0013] Determining a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area;
[0014] Whenever the departure time of the exit point arrives, the exit point is controlled to generate traffic vehicles that comply with traffic laws in the exit area according to the basic traffic map; wherein the basic traffic map is used to describe the relationship between traffic flow, vehicle density and speed in the traffic network.
[0015] On the other hand, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores one or more instructions, wherein the one or more instructions are suitable for being loaded by a processor and executing the following steps:
[0016] Determining a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area;
[0017] Whenever the departure time of the exit point arrives, the exit point is controlled to generate traffic vehicles that comply with traffic laws in the exit area according to the basic traffic map; wherein the basic traffic map is used to describe the relationship between traffic flow, vehicle density and speed in the traffic network.
[0018] On the other hand, an embodiment of the present application provides a computer program product, which includes a computer program; when the computer program is executed by a processor, the above-mentioned vehicle processing method is implemented.
[0019] The embodiment of the present application can determine the exit area of the exit point from the road area according to the reference point of the exit point in the road area. The exit area can be a circular area determined based on a certain radius with the reference point as the center; whenever the exit time of the exit point arrives, the exit point is controlled to generate traffic vehicles in the exit area according to the basic traffic map. Since the basic traffic map describes the relationship between traffic flow, traffic density and speed in the traffic network, the traffic density and speed corresponding to the traffic vehicles generated by combining the basic traffic map are in line with objective traffic laws. It can be seen that the embodiment of the present application can support the user to simply set some parameters (such as parameters for generating the basic traffic map, etc.), so that the exit point can automatically generate some traffic vehicles that conform to traffic laws in the exit area with a certain radius around a fixed position (reference point) according to the basic traffic map, which can effectively ensure the rationality of traffic vehicles and the efficiency of vehicle setting. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1a It is a schematic diagram of a basic traffic map provided in an embodiment of the present application;
[0022] Figure 1b is a schematic diagram of another basic traffic map provided in an embodiment of the present application;
[0023] Figure 2 It is a flow chart of a vehicle processing method provided in an embodiment of the present application;
[0024] Figure 3a is a schematic diagram of a vehicle exit area provided in an embodiment of the present application;
[0025] Figure 3b It is a schematic diagram of whether a vehicle exit area covers a lane provided in an embodiment of the present application;
[0026] Figure 3c is a schematic diagram of determining an area based on the center of mass of a vehicle provided in an embodiment of the present application;
[0027] Figure 4 is a flow chart of a vehicle processing method provided by another embodiment of the present application;
[0028] Figure 5a is a schematic diagram of a lane centerline adjacent to a reference point provided in an embodiment of the present application;
[0029] Figure 5b It is a schematic diagram of a main lane for determining a vehicle exit point provided in an embodiment of the present application;
[0030] Figure 5c It is a schematic diagram of a lane for determining a vehicle exit point provided in an embodiment of the present application;
[0031] Figure 5d is a schematic diagram of an exit lane of a main lane provided in an embodiment of the present application;
[0032] Figure 5e This is a schematic diagram of a vehicle departure area covering a portion of an irrelevant area provided in an embodiment of the present application;
[0033] Figure 5f It is a schematic diagram of an exit line of a main lane and an exit line of a slave lane provided in an embodiment of the present application;
[0034] Figure 5g is a schematic diagram of determining a current location provided by an embodiment of the present application;
[0035] Figure 6 It is a schematic diagram of a process of generating traffic vehicles in a vehicle exit area provided by an embodiment of the present application;
[0036] Figure 7 is a structural schematic diagram of a vehicle processing device provided in an embodiment of the present application;
[0037] Figure 8 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0039] The embodiments of the present application relate to artificial intelligence (AI) technology. The so-called artificial intelligence technology refers to the theory, method, technology and application system of using digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc.
[0040] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as autonomous driving, unmanned driving, common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, drones, robots, smart medical care, smart customer service, smart video services, etc. Among them, autonomous driving technology can usually include autonomous driving simulation and real vehicle testing (i.e. controlling the vehicle to drive on the actual lane), and autonomous driving simulation, as a zero-risk, fast-iteration, and reproducible testing method, has laid a solid foundation for the use of autonomous driving technology on the road. The so-called autonomous driving simulation can also be called road traffic simulation, which is an important tool for studying complex traffic problems; especially when a system is too complex to be described by a simple and abstract mathematical model, the role of traffic simulation is more prominent. Autonomous driving simulation can clearly assist in analyzing and predicting the location and causes of traffic jams, comparing and evaluating relevant plans for urban planning, traffic engineering, and traffic management, and trying to avoid or prepare for the problem before it becomes a reality. In summary, traffic simulation technology is a simulation model technology that uses simulation hardware and simulation software to reflect system behavior or processes through simulation experiments, with the help of certain numerical calculations and problem solving.
[0041] For autonomous driving simulation, traffic simulation or any simulation scenario that requires continuous generation of traffic vehicles at a specific location, the embodiment of the present application proposes a vehicle processing method. The vehicle processing method can support users to simply set some parameters (such as traffic density, free flow speed and other parameters used to generate a basic traffic map), and automatically generate some traffic vehicles that conform to traffic laws in an area of a certain radius around a fixed location through a basic traffic map, thereby effectively improving the rationality of traffic vehicles and the efficiency of vehicle settings; and the vehicle processing method also sets a set of rules for generating traffic vehicles, so as to ensure the diversity of vehicle states while ensuring the consistency of vehicle states of traffic vehicles generated by different simulation software according to the same scene file.
[0042] The fundamental diagram of traffic flow mentioned above can also be called a macro fundamental diagram. In traffic flow theory, the fundamental diagram of traffic flow can be used to describe the relationship between macro traffic flow (referred to as traffic flow), traffic density (or vehicle density) and speed in a traffic network. Specifically, the fundamental diagram of traffic flow can be set in a coordinate system with traffic density as the horizontal axis and traffic capacity as the vertical axis. A typical fundamental diagram of traffic flow can be approximated as Figure 1a The two straight line segments and the horizontal axis form a triangle. Each point on the straight line segment can represent a traffic state of the vehicle (such as traffic capacity, traffic density, speed, etc.). Figure 1a The first straight line segment 11 in the graph describes the free-running state of the vehicle, and its slope is the free-flow speed V max (i.e., the speed of the vehicle not affected by upstream and downstream conditions, according to Figure 1a For the example shown, V max is 80 km / h). When the traffic density increases from 0 to the critical density K cr (according to Figure 1a In the example shown, it can be seen that K cr During the process of free flow speed (25 vehicles / km), the free flow speed remains unchanged, but the traffic capacity gradually increases and reaches the maximum traffic capacity Q when the traffic density reaches the critical density. max (according to Figure 1a In the example shown, it can be seen that Q max As the number of vehicles continues to increase and the traffic density continues to increase, the speed of vehicles gradually slows down and the vehicles enter a congested state, and the traffic capacity also decreases. Figure 1a As shown in the second straight line segment 22 in FIG. 1 , and when the traffic density increases to the blocking density K jam (according to Figure 1a In the example shown, it can be seen that K jamWhen the traffic density and speed of each vehicle in the traffic flow are both reduced to 0 (140 vehicles / km), the traffic flow enters a completely congested stop state, and the speed and traffic capacity of each vehicle in the traffic flow are reduced to 0. It can be seen that for any vehicle, if the traffic density and speed corresponding to the vehicle meet the relationship described by the basic traffic diagram, it means that the vehicle complies with the traffic law. For example, when the traffic density is large, the vehicle may be in a congested state (the speed of the vehicle is small).
[0043] It should be noted that the blocking density K in the basic traffic diagram jam It depends on the distance between vehicles when the traffic is completely congested, so 140 vehicles / km can be taken as the default value, or other values can be taken as the default value, without limitation. Maximum traffic capacity Q max and free flow speed V max Parameters related to road types can be obtained through parameter correction or querying relevant specifications. Figure 1b It can be seen that: from the blocking density K jam , maximum traffic capacity Q max and the free flow speed V max These three parameters can uniquely determine the two straight line segments in the basic traffic diagram; or, by the blocking density K jam , maximum traffic capacity Q max and the critical density K cr These three parameters can also uniquely determine the two straight line segments in the basic traffic diagram; or, by the blocking density K jam , free flow speed V max and the critical density K cr These three parameters can also uniquely determine two straight line segments in the basic traffic map, and so on. There is no limitation on the method of obtaining the basic traffic map. For example, the user can give the free flow speed V in the scenario file. max , blocking density K jam , critical density K cr , maximum traffic capacity Q max The simulator can generate a corresponding basic traffic map by taking values of related parameters such as the default values of these parameters, or the simulator can directly use the default values of these parameters to generate the corresponding basic traffic map; for example, different default basic maps can be set inside the simulator to describe the basic traffic attributes of road areas of different road types, so as to obtain the corresponding basic traffic map according to the road type involved in the current simulation.
[0044] Furthermore, given the traffic density, the traffic state of the vehicle can be uniquely determined based on the basic traffic map, thereby determining the vehicle's speed; that is, the traffic density k corresponding to the vehicle can be determined first, and then the traffic state can be determined based on the basic traffic map and the traffic density k, thereby obtaining the vehicle's speed V. Specifically, the unit of speed V is meters per second; its calculation formula is: if k≤K cr , then V=V max ; if k>K cr , then V=(kQ max / (K cr -K jam )+K jam Q max / (K jam -K cr )) / k. It is worth mentioning that Figure 1a-1b It is only an exemplary representation of the basic traffic map and is not limited to this; in other embodiments, other basic traffic maps of custom shapes can also be selected, as long as the corresponding curve can be reproduced through relevant parameters, and the traffic state of the traffic (vehicle spacing, speed, etc.) can be described by traffic density or other parameters. Furthermore, since the vehicle spacing D (i.e., the spacing between the reference points of two vehicles, the reference point can be the center of mass or center point of the vehicle, etc.) and the traffic density k are inversely related, when the traffic density k is given, the vehicle spacing D of the corresponding vehicle can also be calculated, that is, D=1 / k. In other words, when the traffic density is given, the vehicle spacing D and speed V corresponding to the corresponding vehicle can be calculated.
[0045] In a specific implementation, the vehicle processing method proposed in the embodiment of the present application can be executed by a computer device, which can be a terminal or a server; or, the vehicle processing method can also be executed by a terminal and a server together, without limitation. For the convenience of explanation, the following description is given by taking the computer device executing the vehicle processing method as an example. Among them, the terminal mentioned here can include but is not limited to: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, a smart TV, a smart car terminal, etc.; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and basic cloud computing services such as big data and artificial intelligence platforms, etc. Further, the computer device may include simulation software, and the logical algorithm involved in the vehicle processing method can be embedded in the simulation software to continuously generate background traffic vehicles (i.e., traffic vehicles) that conform to traffic laws in an area within a certain radius around a specific location during the simulation process. Among them, the simulation software mentioned here can be a micro traffic simulation software (TAD Sim), which can include but is not limited to simulation software that requires networking or simulation software that does not require networking; it can be understood that traffic simulation is divided into macro simulation, meso simulation and micro simulation according to the accuracy and scope of the simulation. Micro traffic simulation takes individual vehicle behavior as the research object and describes the simulation of the status of each vehicle in the traffic system.
[0046] Combine the following Figure 2 The flowchart shown in FIG. 1 illustrates the specific process of the vehicle processing method proposed in the embodiment of the present application. Figure 2 , the vehicle processing method may include the following steps S201-S202:
[0047] S201, determining a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area.
[0048] In the Open Scenario (an international standard for describing autonomous driving simulation test scenarios) developed by ASAM (Association for Standardization of Automation and Measuring Systems), a method for continuously generating vehicle sources within a certain radius of a specific location (center reference point) is defined; specifically, the relevant description of the vehicle source in the Open Scenario is as follows:
[0049] Class TrafficSourceAction / / Collective traffic source action
[0050] Applied Stereotypes: / / Applied Stereotypes:
[0051] XSDcomplex Type / / XSD complex type
[0052] Defines a source of traffic at a specific position. / / Defines a source of traffic at a specific position.
[0053] Used in: / /
[0054] TrafficAction / / Traffic Action
[0055]
[0056] Among them, radius in the above table is the radius, rate is the frequency of vehicles generated by the exit point (which can be called the exit frequency), velocity is the speed, position is the central reference point position of the exit point, trafficdefinition is the traffic flow definition, double is a double-precision floating point type, XSDattribute is an XSD attribute, and XSD is a file type. Further, the Description of radius in the above table is "Defines the radius of the traffic source where vehicles appear around the specific position. Unit: m. Range: [0...inf[."; the corresponding Chinese interpretation is roughly: defines the radius of the traffic source where vehicles appear around a specific position; unit: meter; range: [0...inf[. The Description of rate in the above table is "Defines the rate on which vehiclesappear at the source location. Unit: vehicles / s. Range: [0...inf[."; the corresponding Chinese interpretation is roughly: defines the rate at which vehicles appear at the source location; unit: vehicles / second; range: [0...inf[. The Description of velocity in the above table is "The optional starting velocity of a scenarioobject.Unit: vehicles / s.Range: [0...inf[."; the corresponding Chinese explanation is roughly: the optional starting velocity of the scenario object; unit: vehicles / second; range: [0…inf[. The Description of position in the above table is "Defines the position of the traffic source"; the corresponding Chinese explanation is roughly: defines the position of the traffic source. The Description of trafficdefinition in the above table is "Defines the vehicle andcontroller distribution for the source"; the corresponding Chinese explanation is roughly: defines the vehicle and controller distribution of the source.
[0057] Based on this, in order to ensure consistency with the standard as much as possible, the exit point mentioned in the embodiment of the present application can be compatible with the relevant description of the exit point mentioned in the above OpenScenario; that is, the exit point mentioned in the embodiment of the present application can be understood as a method or code for continuously generating vehicles. Exemplarily, the exit point can have multiple attributes such as radius, rate, velocity, position and trafficdefinition; that is, the embodiment of the present application can use radius to define the radius of the exit point, rate to define the frequency of traffic vehicles generated by the exit point, velocity to define the initial speed of traffic vehicles generated by the exit point, position to define the position of the central reference point of the exit point, and so on. Among them, the central reference point indicated by position can be understood as the reference point of the exit point in the road area.
[0058] Based on the above description, in a specific implementation, before executing step S201, the computer device may first obtain the scene file, and obtain the radius and position of the exit point by parsing the scene file, so as to determine the reference point (i.e., the center reference point) of the exit point in the road area according to the position. Then, in the specific implementation process of step S201, the computer device may use the reference point as the center of the circle, and determine a circle area with a certain radius (i.e., the value of the radius) in the road area as the exit area of the exit point, such as Figure 3a As shown; the vehicle exit area here can also be called the vehicle exit circle, which is the area that supports the vehicle exit point to generate traffic vehicles. It should be understood that since the traffic vehicles are generated in the circle area defined by radius with the reference point (pre-defined) as the center, the reference point needs to be set in the road area of the target road (including at least one lane) where the vehicle is ready to exit in the road area, and cannot be set outside the road area of the target road where the vehicle is ready to exit or outside the map.
[0059] It should be noted that the road area includes one or more lanes. Since the reference point and radius are defined by the user, the exit area determined by step S201 may be larger or moderate, so that the exit area can cover at least one lane in the road area; the exit area determined by step S201 may also be smaller, so that the exit area cannot cover any lane in the road area, and there is no limitation on this. The meaning of the exit area covering the lane is that the exit area intersects with the lane centerline of the lane; the so-called lane centerline refers to the line used to mark the center of the lane, that is, the distance from the lane centerline to the left and right sides of the lane is equal. For example, see Figure 3b As shown: Figure 3b The left figure in FIG. exemplarily shows the situation where the exit area does not cover lane 1. Figure 3bThe right figure in exemplarily shows the situation where the vehicle exit area covers lane 1.
[0060] Furthermore, the embodiments of the present application may also set a validity period for the exit point, so that the exit point continues to generate traffic vehicles within the validity period. Specifically, the validator of the exit point can be set by time or number of vehicles. For example, the user can set the time period when the exit point is activated, such as activating the exit point from time t1 to t2, and the exit point is invalid at times other than the activation, and no vehicles are generated; then, the validity period in this case may include the activation time period of the exit point, and the activation time period is the time period between t1 and t2. For another example, the user can set the duration T of the exit point, such as automatically activating the exit point from the simulation start time t'=0, and terminating at time T, the exit point is invalid, and no vehicles are generated thereafter; then, the validity period in this case may include the activation time period of the exit point, and the activation time period is the time period between the simulation start time and time T. For another example, the user can set the maximum number of vehicles that can be dispatched from the exit point (i.e., the target number). When the number of vehicles generated at the exit point reaches the maximum number, the exit point becomes invalid and no vehicles are generated at the exit point. The validity period in this case may include the time period between the simulation start time and the target time. The so-called target time refers to the time when the number of vehicles generated at the exit point is equal to the target number. It can be seen that the validity period of the exit point may include the activation time period of the exit point, or the time period from the simulation start time to the target time.
[0061] S202, whenever the departure time of the departure point arrives, the departure point is controlled to generate traffic vehicles that comply with traffic rules in the departure area according to the basic traffic map.
[0062] Among them, step S202 can be executed during the simulation process; the departure time of the departure point mentioned in step S202 refers to: the time when the departure point needs to generate traffic vehicles. Specifically, the first departure time of the departure point includes: the starting time of the activation time period of the departure point. For example, if the activation time period of the departure point is the time period between t1 and t2, the first departure time can be t1; if the activation time period is the time period between the simulation start time and time T, the first departure time can be the simulation start time. The non-first departure time of the departure point is determined based on the previous departure time and the departure time interval of the departure point. The so-called departure time interval can be called the departure interval, which refers to the time required for each two vehicles to be generated; that is, the non-first departure time can be understood as: the time reached after a departure time interval based on the previous departure time. For example, assuming that the first departure time is the simulation start time (ie, t'=0), and the first departure time interval is t1, then the second departure time is t1; if the second departure time is t2, then the second departure time is (t1+t2), and so on.
[0063] It should be noted that, in one embodiment, the departure frequency of the departure point can be set to r vehicles / second (r is a positive integer), and the relationship between the departure time interval and the departure frequency of the departure point can be set to an inverse relationship; then in this embodiment, the departure time interval of the departure point is a fixed value, that is, the departure time interval is equal to 1 / r seconds, and its distribution is not limited here. That is, in this case, when the first departure time arrives, the time interval between each subsequent departure time and the previous departure time is the same, and the departure point can be used to generate a traffic vehicle every 1 / r seconds. In another embodiment, the departure frequency of the departure point can be set to r vehicles / second, and the number of departures from the departure point is set to follow the Poisson distribution; then in this embodiment, the departure time interval of the departure point follows an exponential distribution. That is, in this case, when the first departure time arrives, the time interval between each subsequent departure time and the previous departure time is determined from the exponential distribution. Exemplarily, the formula for exponential distribution can be P(X>t)=e -rt , where t is the departure time, X is a random variable, and P is the probability. It can be seen that in the specific implementation, there should be relevant parameters to ensure that the computer device can obtain the departure time of the departure point through the parameters to follow the exponential distribution or fixed value.
[0064] In a specific implementation, whenever the departure time of the exit point arrives, if the exit area covers at least one lane in the road area (i.e., the exit area intersects with the lane centerline of at least one lane), the computer device may trigger the execution of the step of controlling the exit point to generate a traffic vehicle in the exit area in accordance with the traffic basic map according to the basic traffic map. In this specific implementation, the specific method of controlling the exit point to generate a traffic vehicle in accordance with the traffic law in the exit area in accordance with the basic traffic map may be: in at least one lane covered by the exit area, a point located in the exit area is selected as the current position; specifically, a point located in the exit area may be selected on the lane centerline of at least one lane covered by the exit area as the current position. Then, it may be determined whether the current position meets the feasible conditions according to the position information of the current position. If it is determined that the previous position meets the feasible conditions according to the position information of the current position, the exit point may be controlled to generate a traffic vehicle at the current position; and an initial speed is set for the traffic vehicle generated at the current position based on the basic traffic map, so that the generated traffic vehicle meets the traffic law.
[0065] In another specific implementation, whenever the departure time of the exit point arrives, the computer device can trigger the execution of the step of controlling the exit point to generate a traffic vehicle that complies with the traffic law in the exit area according to the basic traffic map. In this specific implementation, the specific method of controlling the exit point to generate a traffic vehicle that complies with the traffic law in the exit area according to the basic traffic map can be: randomly selecting a position in the exit area as the current position, and judging whether the current position meets the feasible conditions according to the position information of the current position. If the current position meets the feasible conditions, it means that the current position is feasible, and the exit point can be controlled to generate a traffic vehicle at the current position; and the initial speed is set for the traffic vehicle generated at the current position based on the basic traffic map, so that the generated traffic vehicle complies with the traffic law. If the current position does not meet the feasible conditions, the next departure time of the exit point can be waited for; or, if the current position does not meet the feasible conditions, a new current position is reselected in the exit area, and the above process (i.e., judging whether the current position meets the feasible conditions and other steps) is iterated until a current position that meets the feasible conditions is found. It should be noted that this implementation does not require a constraint on whether the vehicle exit area covers at least one lane in the road area. Furthermore, in this implementation, if the vehicle exit area covers at least one lane in the road area, when the computer device randomly selects the current position in the vehicle exit area, it may be selected on the lane centerline of each lane covered by the vehicle exit area, or may be selected from a position other than the lane centerline of each lane covered by the vehicle exit area, and there is no limitation on this.
[0066] Based on the above two implementations, it can be known that in the process of executing step S202, the embodiment of the present application needs to first find a feasible position (i.e., a position that satisfies the feasible conditions), and then control the exit point to generate traffic vehicles. Among them, the feasible conditions may include at least one of the following: position relevance and position placement; when the feasible conditions include both position relevance and position placement, the position is feasible means that the position is both relevant and can be placed. Considering that the various traffic vehicles generated by the exit point are used to influence the driving behavior of the test vehicle in the road area; therefore, the definitions of position relevance and position placement are as follows:
[0067] Position correlation: Considering that from the perspective of testing the autonomous driving algorithm (i.e., the decision-making algorithm), vehicles on the same road as the vehicle (i.e., the test vehicle) and traveling in the same direction as the vehicle have the greatest impact on the vehicle, such vehicles can be considered to be related vehicles, and the locations where they are placed can be called related locations. Therefore, here we consider the generation of traffic vehicles on the same road as the vehicle and traveling in the same direction as the vehicle. If the range of the exit area covers other areas (such as lanes with different lane directions from the lane where the vehicle is located, or roads / intersections in different directions, etc.), these other areas are considered to be irrelevant areas, that is, the positions in these areas are all irrelevant positions, in which case the next position can be polled to generate traffic vehicles. Based on this, position correlation can be understood as: being on the road where the test vehicle is located and in the same lane direction as the lane where the test vehicle is located.
[0068] Position can be placed: that is, a car can be placed at the position. Considering that the position of the vehicle mentioned in the embodiments of the present application refers to the position of the reference point of the vehicle, the reference point of the vehicle can be the center of mass or center point of the vehicle, etc.; taking the reference point as the center of mass as an example, assuming that the center of mass coincides with the geometric center of the rectangle representing the vehicle, then if half of the length of the vehicle is extended to both sides based on the center of mass in the longitudinal direction, and half of the width of the vehicle is extended to both sides based on the center of mass in the transverse direction, the area formed (such as Figure 3c In the area 31), if there are no obstacles (such as cones, stones, vehicles) that prevent new vehicles from being placed in the area, it can be considered that a vehicle can be placed at this position. Based on this, for any position, if there are no obstacles in the area determined at any position based on the size of the vehicle, it means that any area can be placed. It should be noted that the embodiment of the present application can be applied to the situation where traffic vehicles are generated on the center line of the lane and the initial heading angle is the same as the direction of the lane. Among them, the lateral direction refers to the direction perpendicular to the lane where the test vehicle is located (that is, the direction of the lane normal of the target lane), and the longitudinal direction refers to the direction parallel to the lane where the test vehicle is located.
[0069] The embodiment of the present application can determine the exit area of the exit point from the road area according to the reference point of the exit point in the road area. The exit area can be a circular area determined based on a certain radius with the reference point as the center; whenever the exit time of the exit point arrives, the exit point is controlled to generate traffic vehicles in the exit area according to the basic traffic map. Since the basic traffic map describes the relationship between traffic flow, traffic density and speed in the traffic network, the traffic density and speed corresponding to the traffic vehicles generated by combining the basic traffic map are in line with objective traffic laws. It can be seen that the embodiment of the present application can support the user to simply set some parameters (such as parameters for generating the basic traffic map, etc.), so that the exit point can automatically generate some traffic vehicles that conform to traffic laws in the exit area with a certain radius around a fixed position (reference point) according to the basic traffic map, which can effectively ensure the rationality of traffic vehicles and the efficiency of vehicle setting.
[0070] Based on the above Figure 2 The method embodiment shown is a flowchart of another vehicle processing method provided by the embodiment of the present application; in the embodiment of the present application, the vehicle processing method is still described by taking a computer device executing the method as an example. In addition, at the beginning of the simulation, the embodiment of the present application can start a simulation clock, which can be referred to as a simulation clock for short, and can be used to indicate the change of simulation time; each time the simulation clock advances one step (i.e. one grid, one step or one grid equals one time step), it can trigger the computer device to execute the simulation operations required for the simulation process, such as detecting whether the departure time of the departure point has arrived, etc. See Figure 4 As shown, the vehicle processing method may include the following steps S401-S407:
[0071] S401, determining a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area, wherein the vehicle exit area is a circular area with the reference point as the center and radius as the radius.
[0072] S402: Based on the position of the reference point in the road area, determine at least one lane centerline adjacent to the reference point in the road area.
[0073] Among them, any lane centerline adjacent to the reference point means: there is no other lane centerline between any lane centerline and the reference point. Generally speaking, along the lane direction of the lane where the reference point is located, there may be a lane centerline adjacent to the left side of the reference point, and there may also be a lane centerline adjacent to the right side of the reference point, that is, there may usually be two lane centerlines adjacent to the reference point. However, it should be understood that there may be some special cases where there is a lane centerline adjacent to the reference point in the road area; for example, see Figure 5aAs shown in the left and right figures: along the lane direction of the lane where the reference point is located, when the reference point is close to the leftmost boundary of the road area, there may be no lane centerline adjacent to the left side of the reference point, and there is only a lane centerline adjacent to the right side of the reference point; or, when the reference point is close to the rightmost boundary of the road area, there may be no lane centerline adjacent to the right side of the reference point, and there is only a lane centerline adjacent to the left side of the reference point.
[0074] S403, based on the distance between the reference point and each lane centerline, select a lane centerline corresponding to the minimum distance from at least one lane centerline; and use the lane where the selected lane centerline is located as the main lane of the exit point.
[0075] In a specific implementation, a perpendicular line may be drawn from the reference point to each lane centerline of at least one lane centerline, so that the length of each perpendicular line is determined as the distance between the reference point and the corresponding lane centerline. Then, the computer device may select the lane centerline corresponding to the smallest distance from at least one lane centerline; it should be noted that if there are two lane centerlines adjacent to the reference point, and the distance between the reference point and each of the two lane centerlines is the same, the computer device may select the lane centerline located to the left of the reference point from the two lane centerlines from the driver's perspective (i.e., the lane direction of the lane where the reference point is located). After selecting the lane centerline, the computer device uses the lane where the selected lane centerline is located as the main lane of the exit point.
[0076] It can be seen that the embodiment of the present application can draw a perpendicular line from a given reference point to the adjacent lane centerline, and the lane where the lane centerline with the shortest perpendicular line segment is located is defined as the main lane of the exit point; if the perpendicular line segment distances from the reference point to the lane centerlines on both sides are the same, then the lane where the lane centerline on the left side (from the driver's perspective) is located can be selected as the main lane. Of course, in other embodiments, a lane centerline can be randomly selected from the two lane centerlines, or the lane centerline located to the right of the reference point can be selected, and this is not limited. It should be understood that if the lane centerline of the main lane intersects with the exit area, it can be determined that the main lane is covered by the exit area. It should also be understood that no matter how large the radius R of the exit area is, the exit point can have at least one main lane in the road area; and the main lane may or may not be covered by the exit area. For example, see Figure 5bAs shown, the reference point 52 in the exit area 51 is adjacent to the lane centerline of the lane 53 in the road area, and is adjacent to the lane centerline of the lane 54; but the distance between the reference point 52 and the lane centerline of the lane 53 is smaller than the distance between the reference point 52 and the lane centerline of the lane 54, so the lane 53 can be selected as the main lane of the exit point. However, since the exit area 51 is small, the lane 53 is not covered by the exit area 51.
[0077] Furthermore, if the exit area has the same direction as the main lane and the centerlines of other lanes located on the same road intersect, then these other lanes may be defined as slave lanes of the exit point. That is to say, the computer device may also query the road area for lanes that meet the lane conditions based on the positional relationship between the lane centerlines of each lane in the road area and the exit area; the lane conditions here include: the lane direction is the same as the lane direction of the main lane, and the lane centerline intersects with the exit area. If there is a lane that meets the lane conditions in the road area, the lane that meets the lane conditions will be used as the slave lane of the exit point, and it will be determined that the slave lane is covered by the exit area. It should be understood that when the radius R of the exit area is small, there may be no slave lane at the exit point; when the radius R of the exit area is large, there may be one or more slave lanes at the exit point. For example, see Figure 5c As shown in the left figure in , the exit area in this case does not intersect with any lane centerline, so there is no lane at the exit point; Figure 5c As shown in the right figure of , the exit area in this case intersects with the center lines of lanes 53, lane 54 and lane 55 respectively, and lane 53 is the main lane of the exit point, and lanes 54 and 55 are in the same direction as lane 53, so there can be two slave lanes, lane 54 and lane 55, at the exit point.
[0078] S404, whenever the departure time of the departure point arrives, if the departure area covers at least one lane in the road area, the departure point is controlled to generate traffic vehicles that comply with traffic rules in the departure area according to the basic traffic map. Specifically, the specific implementation method of the step of controlling the departure point to generate traffic vehicles that comply with traffic rules in the departure area according to the basic traffic map may at least include the following steps s11-s13:
[0079] s11, in at least one lane covered by the exit area, select a point located in the exit area as the current position.
[0080] In a specific implementation of step s11, the computer device may randomly select a point in the vehicle exit area from at least one lane covered by the vehicle exit area as the current position; in this case, the selected current position may be located on the lane center line of a lane, or may not be located on the lane center line of any lane, and there is no limitation on this.
[0081] In another specific implementation of step s11, the computer device may select a point as the current position on the exit line of each lane covered by the exit area, and the exit line of each lane is located in the exit area. Since the lane covered by the exit area means that the exit area intersects with the lane centerline of the lane, the method for determining the exit line of any lane covered by the exit area includes: determining the two intersection points between the lane centerline of any lane and the exit area, and determining the exit line of any lane in the line segment between the two intersection points. Specifically, the computer device may directly determine the line segment between the two intersection points as the exit line of any lane. That is to say, in this embodiment of the present application, for any lane covered by the exit area (such as the main lane or the slave lane), the line segment on the lane centerline of the lane that is cut off by the exit area (the line segment between the two intersection points) may be defined as the exit line of the lane; such as Figure 5d As shown, a line segment 56 where the lane centerline of the main lane is intercepted by the exit area can be defined as the exit line of the main lane.
[0082] Alternatively, as can be seen from the above, the road area may include the road surface area of the target road for the vehicle to be dispatched, and the reference point is located in the road surface area; the so-called target road for the vehicle to be dispatched may include at least one lane, and each traffic vehicle generated by the dispatch point may travel on each lane of the target road. Considering that the road area may include other irrelevant areas (or irrelevant areas) in addition to the road surface area of the target road; and there may be a problem of matching the reference point and the radius setting, resulting in the dispatch area covering all or part of the irrelevant area, such as Figure 5eAs shown. In this case, the line segment between the two intersections between the lane centerline and the exit area will be cut off by the irrelevant area; the so-called line segment being cut off by the irrelevant area means that part of the line segment is located in the target area, and the target area here refers to the overlapping area between the irrelevant area and the road surface area in the road area except the road surface area. In this case, it can be considered that the exit line of any lane is shortened, and the remaining line segments between the two intersections that are not located in the target area can be determined as the exit line of any lane. Based on this, when the computer device determines the exit line of any lane in the line segment between the two intersections, it can first detect the target area in the exit area. If the target area is not detected, or the target area is detected but the line segment between the two intersections is not located in the target area, the line segment between the two intersections can be used as the exit line of any lane; if the target area is detected and part of the line segment between the two intersections is located in the target area, the remaining line segment between the two intersections that is not located in the target area can be used as the exit line of any lane.
[0083] It can be seen that, in the embodiment of the present application, for any lane (such as a main lane or a secondary lane) covered by the exit area, when the line segment intercepted by the exit area is intercepted by an irrelevant area, the remaining line segment of the line segment intercepted by the exit area that is not within the target area can be defined as the exit line of the lane; Figure 5f As shown: the line segment between the two intersection points between the lane centerline of the main lane and the exit area, and the line segment between the two intersection points between the lane centerline of the secondary lane and the exit area are both cut off by the irrelevant area, so the exit line of the main lane can be Figure 5f The line segment marked by 57 in the figure can be the exit line of the lane. Figure 5f It should be understood that when the reference point is located on the lane centerline of the main lane, the line segment between the two intersection points between the lane centerline of the main lane and the exit area is the diameter of the exit area; then, if the line segment between the two intersection points between the lane centerline of the main lane and the exit area is not cut off by an irrelevant area, it can be known that the longest exit line is the diameter of the exit area.
[0084] Based on the above description, when the computer device selects a point as the current position on the exit line of each lane covered by the exit area, there are several implementation methods as follows:
[0085] Implementation method one: As can be seen from the above, when the vehicle exit area is small, it may only intersect with the center line of one lane, and the lane center line of the main lane of the vehicle exit point is closest to the center of the vehicle exit area (i.e., the reference point); then it can be seen that: the lane center line intersecting with the vehicle exit area at this time is the lane center line of the main lane. It can be seen that when the number of lanes of at least one lane covered by the vehicle exit area is 1, the at least one lane is the main lane of the vehicle exit point. In this case, when the computer device selects a point on the vehicle exit line of each lane covered by the vehicle exit area as the current position, it can randomly select a point on the vehicle exit line of the main lane as the current position. In other words, when the vehicle exit area is small and it only intersects with the center line of one lane, the lane where the lane center line is located is the main lane, and the line segment on the lane center line of the main lane intercepted by the vehicle exit area is the only vehicle exit line in this case, as mentioned above Figure 5e shown.
[0086] Implementation method two: As can be seen from the foregoing, when the vehicle exit area is large, in addition to intersecting with the center line of the main lane, it may also intersect with the center lines of other lanes. It can be seen that when the number of lanes of at least one lane covered by the vehicle exit area is greater than 1, the at least one lane includes: the main lane at the vehicle exit point and the secondary lanes at the vehicle exit point, and the number of secondary lanes is a positive integer. In this case, when the computer device selects a point on the vehicle exit line of each lane covered by the vehicle exit area as the current position, the main lane of the vehicle exit point and each secondary lane may be placed in a lane selection pool for lane selection. Then, a lane is selected from the lane selection pool as the current lane; specifically, the implementation methods of this step may include the following:
[0087] In one implementation, the probability of vehicles leaving each lane can be set to be the same (i.e., the probability of traffic vehicles being generated from each lane is the same). In this implementation, when the computer device selects a lane from the lane selection pool as the current lane, it can use the first lane selection algorithm to randomly select a lane from the lane selection pool as the current lane according to the probability equal selection strategy; the first lane selection algorithm and the random seed used for randomly selecting the lane are not limited here, and it is only necessary to ensure that the selected lane can be reproduced after the first lane selection algorithm and the random seed are defined.
[0088] In another implementation, the exit probabilities of each lane may be set to be different. For example, if it is necessary to ensure that the number of traffic vehicles generated in a certain lane is greater than the number of traffic vehicles generated in other lanes, a lane-level probability parameter may be set, and the probability parameter is used to indicate the exit probability of the lane. Under this implementation, when the computer device selects a lane from the lane selection pool as the current lane, it may use a second lane selection algorithm to select a lane from the lane selection pool as the current lane; the second lane selection algorithm is not limited here, for example, the logic followed by the second lane selection algorithm is: the lane with a greater exit probability has a greater possibility (probability) of being selected; it should be understood that the second lane selection algorithm and parameters such as the exit probability of each lane should be set to ensure that the lane selection can be reproduced based on these parameters later.
[0089] In another embodiment, when the computer device selects a lane from the lane selection pool as the current lane, it may also select a lane from the lane selection pool as the current lane according to the priority of each lane; wherein the priority of the main lane is higher than the priority of the secondary lane. Alternatively, the computer device may also select a lane from the lane selection pool as the current lane in the order from left to right along the lane direction, and so on.
[0090] After determining the current lane through any of the above implementations, the computer device may select a point from the exit line of the current lane as the current position. In one implementation, the computer device may randomly select a point from the exit line of the current lane as the current position; the random seed used for random point selection and the algorithm used for selecting points are not limited here (such as the selected points are evenly distributed on the exit line), but it should be ensured that the selected points can be reproduced after the algorithm and random seed for selecting points are defined. In another implementation, multiple candidate points may be pre-set on the center line of each lane. Since the exit line is located on the center line of the lane, the computer device may select a candidate point that has not been selected from all candidate points on the exit line of the current lane according to the lane direction as the current position.
[0091] s12, if the current position is determined to meet the feasible conditions according to the position information of the current position, the vehicle exit point is controlled to generate a traffic vehicle at the current position.
[0092] Specifically, the location information of the current position may include: the lane direction of the lane where the current position is located, and the area indication information corresponding to the current position, and the area indication information is used to indicate: the area determined at the current position based on the vehicle size. The specific determination method of the area can be referred to in the above Figure 3cBased on this, the computer device may determine whether the current position meets the feasible conditions based on the position information of the current position by determining whether the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, and whether there are obstacles in the area indicated by the detection area indication information. If the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, and there are no obstacles in the area, then the current position is determined to meet the feasible conditions. If the lane direction of the lane where the current position is located is different from the lane direction of the lane where the test vehicle is located, or if the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, but there are obstacles in the area, then the current position is determined to not meet the feasible conditions.
[0093] s13, setting an initial speed for the traffic vehicles generated at the current position based on the basic traffic map, so that the generated traffic vehicles comply with traffic rules.
[0094] In a specific implementation, when the computer device sets the initial speed for the traffic vehicle generated at the current position based on the basic traffic map, it can determine the first speed for the traffic vehicle generated at the current position. The first speed is preset, that is, the first speed in this case is a fixed value, and the first speeds corresponding to each traffic vehicle generated at the exit point are the same; or, the first speed is generated by speed distribution, that is, the first speed in this case is generated in real time, and the first speeds corresponding to each traffic vehicle generated at the exit point may be the same or different. The speed distribution mentioned here refers to: when the vehicle speed is a random variable, the distribution that the vehicle speed conforms to; its expression form can be a function or other forms, which are not limited. For example, the vehicle speed conforms to a normal distribution N(μ k , σ k 2 ), the mean and variance are μ k and σ k 2 , then the speed distribution can be understood as a normal distribution; in this case, the user can set the mean and variance in the scenario file to allow the simulator to construct the speed distribution, or use other methods to set the speed distribution, which is not limited. The speed distribution can be used in combination with random numbers to generate the first speed of the traffic vehicle; specifically, a corresponding random number can be generated for the currently generated traffic vehicle, so that a value is taken from the speed distribution based on the generated random number, and the taken value is determined as the first speed.
[0095] Furthermore, considering that the random numbers generated by the simulator through the computer program are all pseudo-random numbers, in order to maintain consistency, a random number generation method and a random number seed can be given to ensure that the random number sequences generated by users using different simulators are consistent. There is no restriction on the selection of speed distribution, random number generation method and random number seed, but it should be ensured that when these parameters are given, no matter what simulator the user uses, these parameters can be used to restore a completely consistent random number sequence {y1, y2, y3, ..., y n}, so that each simulator can obtain a completely consistent first speed sequence {v1, v2, v3, …, v n}, the values in these first speed sequences can be assigned to the traffic vehicles i (i=1, 2, 3, ..., n) generated at the departure point, where n is the number of traffic vehicles to be generated (n can be an option, that is, it is not necessary to set the value of n). In other words, the embodiment of the present application does not limit the speed distribution, random number generation method, etc., as long as it can ensure that the same results can be reproduced in different simulators. n The generation of} has the dual characteristics of randomness and consistency, so it can ensure that the first speed of traffic vehicles has a certain degree of diversity and randomness.
[0096] In addition to determining the first speed for the traffic vehicle generated at the current position, the vehicle spacing corresponding to the traffic vehicle generated at the current position can also be determined. Let the time when the traffic vehicle is generated at the current position be the i-th vehicle departure time of the departure point; and when i is greater than 1, the traffic vehicle generated at the current position corresponds to a vehicle departure time interval, and the vehicle departure time interval is the interval between the i-th vehicle departure time and the i-1-th vehicle departure time. Assume that the vehicle departure frequency is r vehicles / second, and the departure time interval at the departure point is equal to a fixed value of 1 / r seconds, that is, the average time interval between each two traffic vehicles generated at the departure point is 1 / r seconds. If the departure point (or departure area) covers m lanes (m is a positive integer), and the probability of traffic vehicles being generated from each lane is the same, then for the same lane, the average time interval between every two traffic vehicles is m / r seconds; if the first speed of the generated traffic vehicle is v meters / second, and assuming that the corresponding first speed remains unchanged before the next traffic vehicle on the same lane is generated, then the vehicle spacing (average vehicle-to-vehicle distance) between two traffic vehicles on the same lane is m×v / r meters; and the traffic density is the inverse of the vehicle spacing, so the corresponding traffic density of each lane is r / (m×v) (the unit is vehicle / meter / lane).
[0097] Based on this principle, when the departure time follows an exponential distribution, ti is used to represent the traffic vehicle generated at the ith departure time corresponding to a departure time, and vi is used to represent the traffic vehicle generated at the ith departure time corresponding to a departure time. ’represents the first speed of the traffic vehicle generated at the i-th departure time, then ti is used to replace 1 / r in the above formula m×v / r, and vi is used ’ Substituting v in m×v / r, we can get the vehicle spacing di corresponding to the traffic vehicle generated at the i-th departure time, di=vi ’ ×ti×m. It should be understood that the calculation formula of di can also be applied to the case where the departure time interval is a fixed value. Based on this, when the departure area covers at least one lane in the road area, the computer device can determine the vehicle spacing corresponding to the traffic vehicle generated at the current position in the following manner: multiply the departure time interval corresponding to the generated traffic vehicle, the first speed and the number of lanes covered by the departure area to obtain the vehicle spacing corresponding to the traffic vehicle generated at the current position.
[0098] After determining the vehicle spacing, the computer device may determine the corresponding traffic density based on the determined vehicle spacing; specifically, the inverse of the determined vehicle spacing may be determined as the corresponding traffic density, and ki is used to represent the traffic density, then ki=1 / di. Then, the computer device determines the speed corresponding to the determined traffic density in the basic traffic map as the second speed (represented by vi”). Then, the computer device may set the minimum speed between the first speed and the second speed as the initial speed of the traffic vehicle generated at the current position. Furthermore, in order to make the generated traffic conform to traffic laws, in a scenario where the first speed is a fixed value, the first speed initially given by the user may be lower than or equal to the second speed calculated by the basic traffic map.
[0099] At the same time, if there is a congested traffic flow very close to the downstream of the exit point, the speed of the newly generated traffic vehicle should not cause it to collide with the downstream congested vehicle as soon as it is generated because it has no time to brake. Based on this, the computer device can also observe whether there are other vehicles within the range of the vehicle spacing from the current position in the lane where the current position is located, along the downstream direction of the current position. If there are no other vehicles, the step of setting the minimum speed of the first speed and the second speed as the initial speed of the traffic vehicle generated at the current position is triggered; if there are other vehicles, the driving speed (i.e., the vehicle speed) of the other vehicles can be determined, and the minimum speed of the first speed, the second speed, and the driving speed can be set as the initial speed of the traffic vehicle generated at the current position. Optionally, if there are multiple other vehicles, the computer device can determine the driving speed of the other vehicle closest to the current position, so as to set the minimum speed of the first speed, the second speed, and the driving speed as the initial speed of the traffic vehicle generated at the current position.
[0100] In summary, when a vehicle can be generated from m lanes at the exit point, when time ti has passed and a vehicle i is generated, a first speed vi can be generated according to the preset speed distribution. ’ , and calculate the corresponding vehicle spacing vi ’ ×ti×m, the corresponding traffic density is the inverse of the vehicle spacing ki=1 / di, and then the corresponding second speed vi is obtained according to the basic traffic diagram (the speed is obtained from the vehicle density). At the same time, it is possible to observe whether there are other vehicles within the range of di (parallel to the lane in the Frenet coordinate system (using the center line of the road as the reference line and the coordinate system established by the tangent vector and normal vector of the reference line) in the downstream of the lane. If there are other vehicles j closest to the traffic vehicle i and with a speed of vj, then the initial speed vi of the traffic vehicle i is the minimum of the above-mentioned speeds, that is, vi=min(vi ’ ,vi”,vj). The comparison with vj is introduced to avoid collision when traffic vehicle i is just generated and there is other slower vehicle j downstream and it has no time to brake. Optionally, the embodiment of the present application may also stipulate that lane change is not allowed when the traffic vehicle generated at the exit point is still in the exit area. Moreover, after setting the initial speed for the traffic vehicle, the simulation clock can be controlled to continue to advance to trigger the detection of whether the next exit time has arrived.
[0101] It should be noted that the above is an example of how to set the initial speed for a traffic vehicle, taking the case where i is greater than 1 as an example. When i=1, that is, the moment when a traffic vehicle is generated at the current position is the first departure moment of the departure point, the initial speed for the traffic vehicle can also be set according to the above logic, and the vehicle spacing in this case can be defaulted to 0. Alternatively, the computer device can directly set the first speed as the initial speed of the traffic vehicle.
[0102] Furthermore, if it is determined according to the location information of the current location that the current location does not meet the feasible condition, the computer device may execute different logics according to the difference between the two implementation modes mentioned in the aforementioned step s11; specifically, as follows:
[0103] If the computer device determines the current position through the implementation method 1 mentioned in the aforementioned step s11, that is, the exit area only covers the main lane of the exit point, and the computer device randomly selects a point on the exit line of the main lane as the current position, then if it is determined that the current position does not meet the feasible conditions based on the position information of the current position, the computer device can control the simulation clock to continue to advance. Alternatively, the computer device can also jump to step s11 to re-select the current position on the exit line of the main lane until the current position that meets the feasible conditions is found. Alternatively, the computer device can jump to step s11 to re-select the current position on the exit line of the main lane, and determine whether the current position meets the feasible conditions through step s12; after iterating step s11 for a preset number of times, if the current position that meets the feasible conditions is still not found, the simulation clock is controlled to continue to advance.
[0104] If the computer device determines the current position through the second implementation method mentioned in the aforementioned step s11, that is, the exit area covers the main lane and the secondary lane of the exit point, the computer device selects a lane from the lane selection pool as the current lane by putting the main lane and each secondary lane of the exit point into the lane selection pool, and selects a lane from the lane selection pool as the current lane, thereby selecting a point from the exit line of the current lane as the current position. If the current position is determined not to meet the feasible conditions according to the position information of the current position, the computer device can remove the current lane from the lane selection pool. In one implementation method, when the computer device determines that the current position does not meet the feasible conditions, the current vehicle can be directly removed from the lane selection pool; in another implementation method, the computer device can also jump to step s11 to reselect the current position on the exit line of the current lane, and determine whether the current position meets the feasible conditions through step s12; after iteratively executing step s11 for a preset number of times, if the current position that meets the feasible conditions is still not found, the current lane is removed from the lane selection pool. After removing the current lane, the computer device can determine whether there is a lane in the lane selection pool. If there is a lane in the lane selection pool, the current lane is reselected from the lane selection pool until the current position that meets the feasible conditions is found, or until there is no lane in the lane selection pool. If there is no lane in the lane selection pool, the simulation clock is controlled to continue to advance.
[0105] S405, whenever the departure time of the departure point arrives, if the departure area does not cover any lane in the road area, a perpendicular line is drawn from the reference point to the lane centerline of the main lane of the departure point to obtain the foot of the perpendicular, and the position of the foot of the perpendicular is determined as the current position; for example, see Figure 5g As shown, the position of the vertical foot 59 can be determined as the current position. After the current position is determined, the computer device can then perform subsequent steps S406-S407.
[0106] S406, if it is determined that the current position meets the feasible conditions according to the position information of the current position, the vehicle exit point is controlled to generate a traffic vehicle at the current position; and an initial speed is set for the traffic vehicle generated at the current position based on the basic traffic map, so that the generated traffic vehicle complies with traffic rules.
[0107] It should be noted that the specific implementation process of setting the initial speed for the traffic vehicles generated at the current position based on the basic traffic map in this case is the same as the specific implementation process of the aforementioned step s13, and will not be repeated here. However, there are some differences in the specific details of how to determine the vehicle spacing between the two specific implementation processes; in the scenario corresponding to step S406 (i.e., when the vehicle exit area does not cover any lane in the road area), the computer device determines the vehicle spacing corresponding to the traffic vehicles generated at the current position in the following manner: multiply the vehicle exit time corresponding to the generated traffic vehicles by the first speed to obtain the vehicle spacing corresponding to the traffic vehicles generated at the current position.
[0108] S407, if the current position is determined not to meet the feasible conditions according to the position information of the current position, the simulation clock is controlled to continue to advance. Each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived, so that when the departure time is detected to have arrived, the process jumps to step S404.
[0109] Based on the description of the above steps S401-S407, it can be known that the embodiment of the present application can realize that the exit point can automatically generate some traffic vehicles that conform to traffic rules in the exit area with a certain radius around the fixed position (reference point) according to the traffic basic map by supporting the user to simply set some parameters (such as parameters for generating the traffic basic map, etc.), so as to effectively ensure the rationality of traffic vehicles and the efficiency of vehicle setting. In addition, by setting a set of rules for generating traffic vehicles, the consistency of the vehicle states of traffic vehicles generated by different simulation software according to the same scene file can be ensured while ensuring the diversity of vehicle states.
[0110] Based on the above Figure 4 As can be seen from the description of the method embodiment, the embodiment of the present application can define the polling order of the traffic vehicles generated by the exit point in the exit area to ensure that the positions and order of the traffic vehicles generated by the exit point in the exit area are consistent, thereby ensuring that different simulators can parse the same results. Specifically, when there are main lanes and slave lanes at the exit point, an exemplary polling order can be as follows:
[0111] 1. At t = 0 (i.e., when the first vehicle departure time arrives), lane selection is performed first. One method of lane selection may be: putting all slave lanes and main lanes together as a lane selection pool, and making equal probability selections to select the current lane; the lane selection algorithm is not limited here, but it should be ensured that after the algorithm and random seed are defined, the user can reproduce the selected lane.
[0112] 2. After the lane is selected, select a point on the exit line of the current lane. The method can be: randomly select a point on the exit line of the selected current lane. The algorithm for selecting the point is not limited here (such as the selected points are evenly distributed on the exit line), but it should be ensured that after the algorithm and random seed are defined, the user can reproduce the selected point.
[0113] 3. If this point cannot be placed (i.e., it does not meet the feasible conditions), that is, a vehicle has already occupied the position where a new traffic vehicle is to be generated, then the current lane will be removed from the lane selection pool, and the lane selection and the point selection on the exit line will be re-made. If the re-selected point still cannot be placed, continue the above process. If all main lanes and slave lanes have been searched and no point that can be placed is found, wait for the next vehicle exit time and continue the above process. If a point that can be placed can be found, a traffic vehicle will be generated, and the initial speed of the traffic vehicle will be calculated according to the above method, and the number of traffic vehicles generated at the exit point will be increased by one.
[0114] 4. The simulation continues. When the simulation clock advances to the next departure time determined by the next time interval based on a fixed value or exponential distribution, the next available point is found according to the above lane selection / departure line point selection process to generate the corresponding traffic vehicle and assign the initial speed.
[0115] 5. Repeat the above steps within the validity period of the departure point. After the departure point becomes invalid, no more vehicles will be generated.
[0116] Combine the following Figure 6 The flowchart shown further illustrates the specific process of continuously generating traffic vehicles in the vehicle exit area according to the polling sequence defined in the embodiment of the present application:
[0117] Step a: Perform simulation initialization settings, determine the speed distribution (or fixed first speed) given by the user, and determine the exit area of the exit point in the road area according to the reference point and radius of the exit point given by the user, and distinguish the main lane and the secondary lane of the exit point in the road area. In addition, i=1 can also be assigned.
[0118] Step b: Determine whether the simulation is finished, or whether the activation time period of the exit point has passed, or whether the number of traffic vehicles generated at the exit point has reached the maximum number. If yes (i.e. including at least one of the simulation is finished, the activation time period has passed, and the maximum number has been reached), it is determined that the exit process of the exit point is completed. If no, (no here means that the simulation has not ended, the activation time period has not passed, and the maximum number has not been reached), then execute step c.
[0119] Step c: Determine whether the simulation clock has advanced to the next departure time of the departure point. If yes, execute step d; if no, control the simulation clock to continue to advance.
[0120] Step d: Determine whether the exit area covers at least one lane. If not, execute step e; if yes, execute step h.
[0121] Step e: Draw a perpendicular line from the reference point to the center line of the main lane, take the position of the foot of the perpendicular as the current position, and execute step f.
[0122] Step f: Determine whether the current position is feasible (i.e., whether it meets the feasibility conditions). If it is feasible, execute step g; if it is not feasible, control the simulation clock to continue to advance.
[0123] Step g: Control the exit point to generate a traffic vehicle at the current position and calculate the initial speed of the traffic vehicle; then, add one to the number of traffic vehicles that have been generated at the exit point and execute i=i+1.
[0124] Step h: Determine whether the exit area only covers the main lane. If yes, select a point on the exit line of the main lane as the current position and jump to step f; if no, put the main lane and the secondary lane into the lane selection pool and execute step i.
[0125] Step i: Select a lane in the lane selection pool, then select a point on the exit line of the selected current lane as the current position, and then execute step j.
[0126] Step j: Determine whether the current position is feasible. If it is feasible, jump to step g; if it is not feasible, remove the current lane from the lane selection pool and execute step k.
[0127] Step k: Determine whether there are any lanes in the lane selection pool. If yes, jump to step i; if no, control the simulation clock to continue to advance.
[0128] It should be noted that, in the above process, each time the simulation clock advances one step, step b can be triggered. Moreover, each time the above step h is executed, the lane selection pools involved are independent of each other and do not affect each other. It can also be understood that each time the generated traffic vehicle is set with an initial speed, it can start driving in the road area; therefore, although the current position determined when each iteration of step e is executed is the position of the vertical foot, each time the current position is judged to be feasible, there may still be a situation where the current position is feasible. For example, if the initial speed of the traffic vehicle generated at the position of the vertical foot last time is large, then when judging whether the current position is feasible this time, the traffic vehicle generated last time has traveled far, and the current position can be made feasible (i.e., a traffic vehicle can be placed at the current position). Of course, there may also be a situation where the current position is not feasible; for example, if the initial speed of the traffic vehicle generated at the position of the vertical foot last time is small, then when judging whether the current position is feasible this time, the traffic vehicle generated last time has only traveled a short distance, and the area between its position and the current position cannot place a traffic vehicle, and the current position will be made infeasible.
[0129] It should also be noted that Figure 2 , Figure 4 as well as Figure 6 All of the examples are based on the example of generating traffic vehicles in combination with the basic traffic map; if the user does not want to generate traffic vehicles in the way of the basic traffic map, but wants to generate them according to his own wishes, he can add switch parameters in the scene file, so that the user can generate a group of vehicles with any spacing and speed combination (not necessarily in accordance with traffic laws) according to his own needs. In addition, if the user does not want to generate traffic vehicles only on the same road as the test vehicle, or on the road in the same direction, he can also add switch parameters to generate traffic vehicles on the road in the opposite direction of the road where the test vehicle is located.
[0130] Based on the above Figure 2 , Figure 4 as well as Figure 6From the relevant description, it can be known that the embodiment of the present application can continuously generate traffic flow vehicles with various states at a fixed position based on the basic traffic map through simple parameter settings before the simulation starts, and ensure that the vehicle states (position, speed) generated when the same parameter settings are set are completely consistent in a standardized form, thereby ensuring the consistency of the generated scene. By introducing some parameters, the traffic vehicles continuously generated at the designated location not only conform to the traffic laws and meet the diversity of vehicle states, but also can obtain a unique vehicle state when parsed by different simulators. For example, the introduced parameters may include: ① Parameters that define the elements of the basic traffic map, such as blocking density, free flow speed, critical density, maximum capacity, etc. ② Parameters used to define speed distribution, such as defining the mean variance of the normal distribution, the method involved in generating random numbers and random seeds. ③ Random algorithms for lane selection and line point selection, as well as random seeds. ④ The validity period of the exit point (time period or number of vehicles).
[0131] Based on the description of the above vehicle processing method embodiment, the present application embodiment also discloses a vehicle processing device, which may be a computer program (including program code) running in a computer device. The vehicle processing device may execute Figure 2 , Figure 4 as well as Figure 6 The steps in the method flow are shown. Figure 7 , the vehicle processing device can run the following units:
[0132] A determination unit 701 is used to determine a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area;
[0133] The processing unit 702 is used to control the exit point to generate traffic vehicles that comply with traffic laws in the exit area according to the basic traffic map whenever the exit time of the exit point arrives; wherein the basic traffic map is used to describe the relationship between traffic flow, vehicle density and speed in the traffic network.
[0134] In one embodiment, the first departure time of the departure point includes: the start time of the activation time period of the departure point;
[0135] The non-first departure time of the departure point is determined based on the previous departure time and the departure time interval of the departure point; wherein the departure time interval of the departure point is a fixed value, or the departure time interval of the departure point obeys an exponential distribution.
[0136] In another embodiment, the exit point generates a traffic vehicle within the validity period;
[0137] The validity period includes: the activation time period of the exit point, or the time period from the simulation start time to the target time; the target time refers to: the time when the number of traffic vehicles generated at the exit point is equal to the target number.
[0138] In another embodiment, the road area includes one or more lanes; and whenever the exit time of the exit point arrives, if the exit area covers at least one lane in the road area, the trigger processing unit 702 executes the step of controlling the exit point to generate traffic vehicles that comply with traffic rules in the exit area according to the basic traffic map;
[0139] Wherein, when the processing unit 702 is used to control the vehicle exit point to generate traffic vehicles that conform to traffic rules in the vehicle exit area according to the basic traffic map, it can be specifically used to:
[0140] In at least one lane covered by the exit area, a point located in the exit area is selected as the current position;
[0141] If it is determined according to the position information of the current position that the current position meets the feasible condition, the vehicle exit point is controlled to generate a traffic vehicle at the current position;
[0142] An initial speed is set for the traffic vehicle generated at the current position based on the basic traffic map, so that the generated traffic vehicle complies with traffic rules.
[0143] In another implementation, the processing unit 702 may also be configured to:
[0144] Determine at least one lane centerline adjacent to the reference point from the road region based on the position of the reference point in the road region;
[0145] According to the distance between the reference point and each lane centerline, a lane centerline corresponding to the smallest distance is selected from the at least one lane centerline; and the lane where the selected lane centerline is located is used as the main lane of the exit point;
[0146] If the lane centerline of the main lane intersects the vehicle exit area, it is determined that the main lane is covered by the vehicle exit area.
[0147] In another implementation, the processing unit 702 may also be configured to:
[0148] According to the positional relationship between the lane centerline of each lane in the road area and the vehicle exit area, a lane satisfying a lane condition is searched in the road area; the lane condition includes: a lane direction is the same as a lane direction of the main lane, and a lane centerline intersects the vehicle exit area;
[0149] If there is a lane satisfying the lane condition in the road area, the lane satisfying the lane condition is used as a secondary lane of the exit point, and it is determined that the secondary lane is covered by the exit area.
[0150] In another implementation, when the processing unit 702 is used to select a point located in the vehicle exit area as the current position from at least one lane covered by the vehicle exit area, it can be specifically used to:
[0151] Selecting a point on the exit line of each lane covered by the exit area as the current position, and the exit line of each lane is located in the exit area;
[0152] Among them, the lane covered by the exit area means that the exit area intersects with the lane centerline of the lane; the method for determining the exit line of any lane covered by the exit area includes: determining two intersection points between the lane centerline of any lane and the exit area, and determining the exit line of any lane in the line segment between the two intersection points.
[0153] In another implementation manner, when the processing unit 702 is used to determine the exit lane of any lane in the line segment between the two intersection points, it can be specifically used to:
[0154] Detecting a target area in the vehicle exit area, wherein the road area includes: a road surface area of a target road where the vehicle is to exit, and the reference point is located in the road surface area; the target area includes: an irrelevant area in the road area except the road surface area, and an overlapping area with the road surface area;
[0155] If the target area is not detected, or if the target area is detected but the line segment between the two intersection points is not located in the target area, the line segment between the two intersection points is used as the exit line of any lane;
[0156] If the target area is detected and part of the line segments between the two intersection points are located in the target area, the remaining line segments between the two intersection points that are not located in the target area are used as the exit lines of any lane.
[0157] In another implementation manner, when the number of lanes of the at least one lane covered by the exit area is 1, the at least one lane is a main lane of the exit point;
[0158] Accordingly, when the processing unit 702 is used to select a point on the exit line of each lane covered by the exit area as the current position, it can be specifically used to randomly select a point on the exit line of the main lane as the current position.
[0159] In another embodiment, when the simulation starts, the simulation clock is started, and each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived; the processing unit 702 can also be used to:
[0160] If it is determined according to the position information of the current position that the current position does not meet the feasibility condition, the simulation clock is controlled to continue to advance.
[0161] In another embodiment, when the number of lanes of the at least one lane covered by the exit area is greater than 1, the at least one lane includes: a main lane of the exit point and a secondary lane of the exit point; accordingly, when the processing unit 702 is used to select a point as the current position on the exit line of each lane covered by the exit area, it can be specifically used to:
[0162] Put the main lane and each secondary lane of the exit point into a lane selection pool;
[0163] A lane is selected from the lane selection pool as the current lane, and a point is selected from the exit line of the current lane as the current position.
[0164] In another embodiment, when the simulation starts, the simulation clock is started, and each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived; the processing unit 702 can also be used to:
[0165] If it is determined according to the position information of the current position that the current position does not meet the feasibility condition, then the current lane is removed from the lane selection pool;
[0166] After eliminating the current lane, determining whether there is a lane in the lane selection pool;
[0167] If a lane exists in the lane selection pool, reselecting the current lane from the lane selection pool until a current position that satisfies the feasible condition is found, or until no lane exists in the lane selection pool;
[0168] If there is no lane in the lane selection pool, the simulation clock is controlled to continue to advance.
[0169] In another implementation, the processing unit 702 may also be configured to:
[0170] Whenever the exit time of the exit point arrives, if the exit area does not cover any lane in the road area, a perpendicular line is drawn from the reference point to the lane centerline of the main lane of the exit point to obtain the foot of the perpendicular, and the position of the foot of the perpendicular is determined as the current position;
[0171] If it is determined according to the location information of the current location that the current location satisfies the feasible condition, the vehicle exit point is controlled to generate a traffic vehicle at the current location; and an initial speed is set for the traffic vehicle generated at the current location based on the basic traffic map so that the generated traffic vehicle complies with the traffic law;
[0172] If it is determined according to the position information of the current position that the current position does not meet the feasible conditions, the simulation clock is controlled to continue to advance; each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived.
[0173] In another implementation manner, when the processing unit 702 is used to set the initial speed for the traffic vehicle generated at the current position based on the basic traffic map, it can be specifically used to:
[0174] Determining a first speed for the traffic vehicle generated at the current position; the first speed is preset, or the first speed is generated by a speed distribution;
[0175] Determine the vehicle spacing corresponding to the traffic vehicles generated at the current position, and determine the corresponding traffic density according to the determined vehicle spacing; and determine the speed corresponding to the determined traffic density in the basic traffic map as the second speed;
[0176] The minimum speed between the first speed and the second speed is set as the initial speed of the traffic vehicle generated at the current position.
[0177] In another implementation, the processing unit 702 may also be configured to:
[0178] In the lane where the current position is located, along the downstream direction of the current position, observe whether there are other vehicles within the range of the vehicle spacing from the current position;
[0179] If there are no other vehicles, triggering the step of setting the minimum speed between the first speed and the second speed as the initial speed of the traffic vehicle generated at the current position;
[0180] If there are other vehicles, the travel speeds of the other vehicles are determined, and the minimum speed among the first speed, the second speed and the travel speed is set as the initial speed of the traffic vehicle generated at the current position.
[0181] In another implementation, when the time when a traffic vehicle is generated at the current position is the i-th vehicle departure time of the vehicle departure point, and i is greater than 1, the traffic vehicle generated at the current position corresponds to a vehicle departure time interval, and the vehicle departure time interval is the interval between the i-th vehicle departure time and the i-1-th vehicle departure time; wherein:
[0182] In the case where the exit area covers at least one lane in the road area, the processing unit 702, when used to determine the vehicle spacing corresponding to the traffic vehicles generated at the current position, can be specifically used to: multiply the exit time distance corresponding to the generated traffic vehicles, the first speed and the number of lanes covered by the exit area to obtain the vehicle spacing corresponding to the traffic vehicles generated at the current position;
[0183] In the case that the exit area does not cover any lane in the road area, the processing unit 702, when used to determine the vehicle distance corresponding to the traffic vehicles generated at the current position, can be specifically used to: multiply the exit time distance corresponding to the generated traffic vehicles by the first speed to obtain the vehicle distance corresponding to the traffic vehicles generated at the current position.
[0184] In another embodiment, each traffic vehicle generated by the exit point is used to influence the driving behavior of the test vehicle in the road area;
[0185] The position information of the current position includes: the lane direction of the lane where the current position is located, and the area indication information corresponding to the current position, and the area indication information is used to indicate: the area determined at the current position based on the vehicle size; the processing unit 702 can also be used to:
[0186] If the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, and there is no obstacle in the area, then it is determined that the current position meets the feasibility condition;
[0187] If the lane direction of the lane where the current position is located is different from the lane direction of the lane where the test vehicle is located, or if the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, but there is an obstacle in the area, it is determined that the current position does not meet the feasibility conditions.
[0188] According to another embodiment of the present application, Figure 7The various units in the vehicle processing device shown can be individually or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple functionally smaller units to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, other units can also be included based on the vehicle processing device. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0189] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 , Figure 4 or Figure 6 A computer program (including program code) for each step involved in the corresponding method shown in Figure 7 The vehicle processing device shown in the embodiment of the present application is used to implement the vehicle processing method of the embodiment of the present application. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.
[0190] The embodiment of the present application can determine the exit area of the exit point from the road area according to the reference point of the exit point in the road area. The exit area can be a circular area determined based on a certain radius with the reference point as the center; whenever the exit time of the exit point arrives, the exit point is controlled to generate traffic vehicles in the exit area according to the basic traffic map. Since the basic traffic map describes the relationship between traffic flow, traffic density and speed in the traffic network, the traffic density and speed corresponding to the traffic vehicles generated by combining the basic traffic map are in line with objective traffic laws. It can be seen that the embodiment of the present application can support the user to simply set some parameters (such as parameters for generating the basic traffic map, etc.), so that the exit point can automatically generate some traffic vehicles that conform to traffic laws in the exit area with a certain radius around a fixed position (reference point) according to the basic traffic map, which can effectively ensure the rationality of traffic vehicles and the efficiency of vehicle setting.
[0191] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides a computer device. Figure 8, the computer device at least includes a processor 801, an input interface 802, an output interface 803 and a computer storage medium 804. Among them, the processor 801, the input interface 802, the output interface 803 and the computer storage medium 804 in the computer device can be connected via a bus or other means. The computer storage medium 804 can be stored in the memory of the computer device, and the computer storage medium 804 is used to store a computer program, and the computer program includes program instructions. The processor 801 is used to execute the program instructions stored in the computer storage medium 804. The processor 801 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to realize the corresponding method flow or corresponding function.
[0192] In one embodiment, the processor 801 described in the embodiment of the present application can be used to perform a series of vehicle processing, specifically including: determining the exit area of the exit point from the road area according to a reference point of the exit point in the road area; whenever the exit time of the exit point arrives, controlling the exit point to generate traffic vehicles that comply with traffic laws in the exit area according to a basic traffic map; wherein the basic traffic map is used to describe the relationship between traffic flow, traffic density and speed in the traffic network, and so on.
[0193] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer storage medium provides a storage space that stores the operating system of the computer device. In addition, one or more instructions suitable for being loaded and executed by the processor 801 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0194] In one embodiment, the processor may load and execute one or more instructions stored in the computer storage medium to implement the above-mentioned Figure 2 , Figure 4 or Figure 6Corresponding steps in the method embodiment shown; in a specific implementation, one or more instructions in the computer storage medium can be loaded by the processor and execute the following steps:
[0195] Determining a vehicle exit area of the vehicle exit point from the road area according to a reference point of the vehicle exit point in the road area;
[0196] Whenever the departure time of the exit point arrives, the exit point is controlled to generate traffic vehicles that comply with traffic laws in the exit area according to the basic traffic map; wherein the basic traffic map is used to describe the relationship between traffic flow, vehicle density and speed in the traffic network.
[0197] In one embodiment, the road area includes one or more lanes; and whenever the exit time of the exit point arrives, if the exit area covers at least one lane in the road area, the step of controlling the exit point to generate traffic vehicles that comply with traffic rules in the exit area according to the basic traffic map is triggered;
[0198] Wherein, when controlling the exit point to generate traffic vehicles that conform to traffic rules in the exit area according to the basic traffic map, the one or more instructions may be loaded and specifically executed by the processor:
[0199] In at least one lane covered by the exit area, a point located in the exit area is selected as the current position;
[0200] If it is determined according to the position information of the current position that the current position meets the feasible condition, the vehicle exit point is controlled to generate a traffic vehicle at the current position;
[0201] An initial speed is set for the traffic vehicle generated at the current position based on the basic traffic map, so that the generated traffic vehicle complies with traffic rules.
[0202] In another implementation, the one or more instructions may be loaded and specifically executed by a processor:
[0203] Determine at least one lane centerline adjacent to the reference point from the road region based on the position of the reference point in the road region;
[0204] According to the distance between the reference point and each lane centerline, a lane centerline corresponding to the smallest distance is selected from the at least one lane centerline; and the lane where the selected lane centerline is located is used as the main lane of the exit point;
[0205] If the lane centerline of the main lane intersects the vehicle exit area, it is determined that the main lane is covered by the vehicle exit area.
[0206] In another implementation, the one or more instructions may be loaded and specifically executed by a processor:
[0207] According to the positional relationship between the lane centerline of each lane in the road area and the vehicle exit area, a lane satisfying a lane condition is searched in the road area; the lane condition includes: a lane direction is the same as a lane direction of the main lane, and a lane centerline intersects the vehicle exit area;
[0208] If there is a lane satisfying the lane condition in the road area, the lane satisfying the lane condition is used as a secondary lane of the exit point, and it is determined that the secondary lane is covered by the exit area.
[0209] In another embodiment, when a point located in the vehicle exit area is selected as the current position in at least one lane covered by the vehicle exit area, the one or more instructions may be loaded and specifically executed by the processor:
[0210] Selecting a point on the exit line of each lane covered by the exit area as the current position, and the exit line of each lane is located in the exit area;
[0211] Among them, the lane covered by the exit area means that the exit area intersects with the lane centerline of the lane; the method for determining the exit line of any lane covered by the exit area includes: determining two intersection points between the lane centerline of any lane and the exit area, and determining the exit line of any lane in the line segment between the two intersection points.
[0212] In another implementation, when determining the exit lane of any lane in the line segment between the two intersection points, the one or more instructions may be loaded and specifically executed by the processor:
[0213] Detecting a target area in the vehicle exit area, wherein the road area includes: a road surface area of a target road where the vehicle is to exit, and the reference point is located in the road surface area; the target area includes: an irrelevant area in the road area except the road surface area, and an overlapping area with the road surface area;
[0214] If the target area is not detected, or if the target area is detected but the line segment between the two intersection points is not located in the target area, the line segment between the two intersection points is used as the exit line of any lane;
[0215] If the target area is detected and part of the line segments between the two intersection points are located in the target area, the remaining line segments between the two intersection points that are not located in the target area are used as the exit lines of any lane.
[0216] In another implementation manner, when the number of lanes of the at least one lane covered by the exit area is 1, the at least one lane is a main lane of the exit point;
[0217] Correspondingly, when a point is selected as the current position on the exit line of each lane covered by the exit area, the one or more instructions can be loaded and specifically executed by the processor: a point is randomly selected as the current position on the exit line of the main lane.
[0218] In another implementation manner, when the simulation starts, the simulation clock is started, and each time the simulation clock advances one step, it triggers detection of whether the departure time of the departure point has arrived; the one or more instructions can be loaded and specifically executed by the processor:
[0219] If it is determined according to the position information of the current position that the current position does not meet the feasibility condition, the simulation clock is controlled to continue to advance.
[0220] In another implementation, when the number of lanes of at least one lane covered by the exit area is greater than 1, the at least one lane includes: a main lane of the exit point and a secondary lane of the exit point; accordingly, when a point is selected as the current position on the exit line of each lane covered by the exit area, the one or more instructions may be loaded and specifically executed by the processor:
[0221] Put the main lane and each secondary lane of the exit point into a lane selection pool;
[0222] A lane is selected from the lane selection pool as the current lane, and a point is selected from the exit line of the current lane as the current position.
[0223] In another implementation manner, when the simulation starts, the simulation clock is started, and each time the simulation clock advances one step, it triggers detection of whether the departure time of the departure point has arrived; the one or more instructions can be loaded and specifically executed by the processor:
[0224] If it is determined according to the position information of the current position that the current position does not meet the feasibility condition, then the current lane is removed from the lane selection pool;
[0225] After eliminating the current lane, determining whether there is a lane in the lane selection pool;
[0226] If a lane exists in the lane selection pool, reselecting the current lane from the lane selection pool until a current position that satisfies the feasible condition is found, or until no lane exists in the lane selection pool;
[0227] If there is no lane in the lane selection pool, the simulation clock is controlled to continue to advance.
[0228] In another implementation, the one or more instructions may be loaded and specifically executed by a processor:
[0229] Whenever the exit time of the exit point arrives, if the exit area does not cover any lane in the road area, a perpendicular line is drawn from the reference point to the lane centerline of the main lane of the exit point to obtain the foot of the perpendicular, and the position of the foot of the perpendicular is determined as the current position;
[0230] If it is determined according to the location information of the current location that the current location satisfies the feasible condition, the vehicle exit point is controlled to generate a traffic vehicle at the current location; and an initial speed is set for the traffic vehicle generated at the current location based on the basic traffic map so that the generated traffic vehicle complies with the traffic law;
[0231] If it is determined according to the position information of the current position that the current position does not meet the feasible conditions, the simulation clock is controlled to continue to advance; each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived.
[0232] In another embodiment, when setting the initial speed for the traffic vehicle generated at the current position based on the basic traffic map, the one or more instructions may be loaded and specifically executed by the processor:
[0233] Determining a first speed for the traffic vehicle generated at the current position; the first speed is preset, or the first speed is generated by a speed distribution;
[0234] Determine the vehicle spacing corresponding to the traffic vehicles generated at the current position, and determine the corresponding traffic density according to the determined vehicle spacing; and determine the speed corresponding to the determined traffic density in the basic traffic map as the second speed;
[0235] The minimum speed between the first speed and the second speed is set as the initial speed of the traffic vehicle generated at the current position.
[0236] In another implementation, the one or more instructions may be loaded and specifically executed by a processor:
[0237] In the lane where the current position is located, along the downstream direction of the current position, observe whether there are other vehicles within the range of the vehicle spacing from the current position;
[0238] If there are no other vehicles, triggering the step of setting the minimum speed between the first speed and the second speed as the initial speed of the traffic vehicle generated at the current position;
[0239] If there are other vehicles, the travel speeds of the other vehicles are determined, and the minimum speed among the first speed, the second speed and the travel speed is set as the initial speed of the traffic vehicle generated at the current position.
[0240] In another implementation, when the time when a traffic vehicle is generated at the current position is the i-th vehicle departure time of the vehicle departure point, and i is greater than 1, the traffic vehicle generated at the current position corresponds to a vehicle departure time interval, and the vehicle departure time interval is the interval between the i-th vehicle departure time and the i-1-th vehicle departure time; wherein:
[0241] In the case where the exit area covers at least one lane in the road area, when determining the vehicle spacing corresponding to the traffic vehicles generated at the current position, the one or more instructions may be loaded by the processor and specifically executed: multiplying the exit time distance corresponding to the generated traffic vehicles, the first speed and the number of lanes covered by the exit area to obtain the vehicle spacing corresponding to the traffic vehicles generated at the current position;
[0242] In the case that the vehicle exit area does not cover any lane in the road area, when determining the vehicle distance corresponding to the traffic vehicles generated at the current position, the one or more instructions can be loaded and specifically executed by the processor: multiplying the vehicle exit time distance corresponding to the generated traffic vehicles by the first speed to obtain the vehicle distance corresponding to the traffic vehicles generated at the current position.
[0243] In another embodiment, each traffic vehicle generated by the exit point is used to influence the driving behavior of the test vehicle in the road area;
[0244] The position information of the current position includes: the lane direction of the lane where the current position is located, and the area indication information corresponding to the current position, and the area indication information is used to indicate: the area determined at the current position based on the vehicle size; the one or more instructions can be loaded and specifically executed by the processor:
[0245] If the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, and there is no obstacle in the area, then it is determined that the current position meets the feasibility condition;
[0246] If the lane direction of the lane where the current position is located is different from the lane direction of the lane where the test vehicle is located, or if the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, but there is an obstacle in the area, it is determined that the current position does not meet the feasibility conditions.
[0247] The embodiment of the present application can determine the exit area of the exit point from the road area according to the reference point of the exit point in the road area. The exit area can be a circular area determined based on a certain radius with the reference point as the center; whenever the exit time of the exit point arrives, the exit point is controlled to generate traffic vehicles in the exit area according to the basic traffic map. Since the basic traffic map describes the relationship between traffic flow, traffic density and speed in the traffic network, the traffic density and speed corresponding to the traffic vehicles generated by combining the basic traffic map are in line with objective traffic laws. It can be seen that the embodiment of the present application can support the user to simply set some parameters (such as parameters for generating the basic traffic map, etc.), so that the exit point can automatically generate some traffic vehicles that conform to traffic laws in the exit area with a certain radius around a fixed position (reference point) according to the basic traffic map, which can effectively ensure the rationality of traffic vehicles and the efficiency of vehicle setting.
[0248] It should be noted that according to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above Figure 2 , Figure 4 or Figure 6 It should be understood that the above disclosure is only the preferred embodiment of the present application, and certainly cannot be used to limit the scope of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. A vehicle handling method, characterized in that: include: Determining an exit area of the exit point from the road area according to a reference point of the exit point in the road area; the road area includes one or more lanes; Whenever the exit time of the exit point arrives, if the exit area covers at least one lane in the road area, a point is selected as the current position on the exit line of each lane covered by the exit area, and the exit line of each lane is located in the exit area; wherein, the lane covered by the exit area means that the exit area intersects with the lane center line of the lane; the method for determining the exit line of any lane covered by the exit area includes: determining two intersection points between the lane center line of any lane and the exit area, and determining the exit line of any lane in the line segment between the two intersection points; If it is determined according to the position information of the current position that the current position meets the feasible condition, the vehicle exit point is controlled to generate a traffic vehicle at the current position; An initial speed is set for the traffic vehicles generated at the current position based on a basic traffic map so that the generated traffic vehicles comply with traffic rules; wherein the basic traffic map is used to describe the relationship between traffic flow, vehicle density and speed in a traffic network.
2. The method according to claim 1, characterized in that The first departure time of the departure point includes: the starting time of the activation time period of the departure point; The non-first departure time of the departure point is determined based on the previous departure time and the departure time interval of the departure point; wherein the departure time interval of the departure point is a fixed value, or the departure time interval of the departure point obeys an exponential distribution.
3. The method according to claim 1, characterized in that The said exit point generates traffic vehicles within the validity period; The validity period includes: the activation time period of the exit point, or the time period from the simulation start time to the target time; the target time refers to: the time when the number of traffic vehicles generated at the exit point is equal to the target number.
4. The method according to claim 1, characterized in that The method further comprises: Determine at least one lane centerline adjacent to the reference point from the road region based on the position of the reference point in the road region; According to the distance between the reference point and each lane centerline, a lane centerline corresponding to the smallest distance is selected from the at least one lane centerline; and the lane where the selected lane centerline is located is used as the main lane of the exit point; If the lane centerline of the main lane intersects the vehicle exit area, it is determined that the main lane is covered by the vehicle exit area.
5. The method according to claim 4, characterized in that The method further comprises: According to the positional relationship between the lane centerline of each lane in the road area and the vehicle exit area, a lane satisfying a lane condition is searched in the road area; the lane condition includes: a lane direction is the same as a lane direction of the main lane, and a lane centerline intersects the vehicle exit area; If there is a lane satisfying the lane condition in the road area, the lane satisfying the lane condition is used as a secondary lane of the exit point, and it is determined that the secondary lane is covered by the exit area.
6. The method according to claim 1, characterized in that Determining the exit line of any lane in the line segment between the two intersection points includes: Detecting a target area in the vehicle exit area, wherein the road area includes: a road surface area of a target road where the vehicle is to exit, and the reference point is located in the road surface area; the target area includes: an irrelevant area in the road area except the road surface area, and an overlapping area with the road surface area; If the target area is not detected, or if the target area is detected but the line segment between the two intersection points is not located in the target area, the line segment between the two intersection points is used as the exit line of any lane; If the target area is detected and part of the line segments between the two intersection points are located in the target area, the remaining line segments between the two intersection points that are not located in the target area are used as the exit lines of any lane.
7. The method according to claim 1, characterized in that When the number of lanes of the at least one lane covered by the exit area is 1, the at least one lane is the main lane of the exit point; The selecting a point on the exit line of each lane covered by the exit area as the current position includes: randomly selecting a point on the exit line of the main lane as the current position.
8. The method according to claim 7, characterized in that When the simulation starts, the simulation clock is started, and each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived; the method further includes: If it is determined according to the position information of the current position that the current position does not meet the feasibility condition, the simulation clock is controlled to continue to advance.
9. The method according to claim 1, characterized in that When the number of lanes of the at least one lane covered by the exit area is greater than 1, the at least one lane includes: a main lane of the exit point and a secondary lane of the exit point; The step of selecting a point on the exit line of each lane covered by the exit area as the current position includes: Put the main lane and each secondary lane of the exit point into a lane selection pool; A lane is selected from the lane selection pool as the current lane, and a point is selected from the exit line of the current lane as the current position.
10. The method according to claim 9, characterized in that When the simulation starts, the simulation clock is started, and each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived; the method further includes: If it is determined according to the position information of the current position that the current position does not meet the feasibility condition, then the current lane is removed from the lane selection pool; After eliminating the current lane, determining whether there is a lane in the lane selection pool; If a lane exists in the lane selection pool, reselecting the current lane from the lane selection pool until a current position that satisfies the feasible condition is found, or until no lane exists in the lane selection pool; If there is no lane in the lane selection pool, the simulation clock is controlled to continue to advance.
11. The method according to claim 1, characterized in that The method further comprises: Whenever the exit time of the exit point arrives, if the exit area does not cover any lane in the road area, a perpendicular line is drawn from the reference point to the lane centerline of the main lane of the exit point to obtain the foot of the perpendicular, and the position of the foot of the perpendicular is determined as the current position; If it is determined according to the location information of the current location that the current location satisfies the feasible condition, the vehicle exit point is controlled to generate a traffic vehicle at the current location; and an initial speed is set for the traffic vehicle generated at the current location based on the basic traffic map so that the generated traffic vehicle complies with the traffic law; If it is determined according to the position information of the current position that the current position does not meet the feasible conditions, the simulation clock is controlled to continue to advance; each time the simulation clock advances one step, it triggers the detection of whether the departure time of the departure point has arrived.
12. The method according to claim 1 or 11, characterized in that The step of setting an initial speed for the traffic vehicle generated at the current position based on the basic traffic map comprises: Determining a first speed for the traffic vehicle generated at the current position; the first speed is preset, or the first speed is generated by a speed distribution; Determine the vehicle spacing corresponding to the traffic vehicles generated at the current position, and determine the corresponding traffic density according to the determined vehicle spacing; and determine the speed corresponding to the determined traffic density in the basic traffic map as the second speed; The minimum speed between the first speed and the second speed is set as the initial speed of the traffic vehicle generated at the current position.
13. The method according to claim 12, characterized in that The method further comprises: In the lane where the current position is located, along the downstream direction of the current position, observe whether there are other vehicles within the range of the vehicle spacing from the current position; If there are no other vehicles, triggering the step of setting the minimum speed between the first speed and the second speed as the initial speed of the traffic vehicle generated at the current position; If there are other vehicles, the travel speeds of the other vehicles are determined, and the minimum speed among the first speed, the second speed and the travel speed is set as the initial speed of the traffic vehicle generated at the current position.
14. The method according to claim 13, characterized in that When the time when a traffic vehicle is generated at the current position is the i-th vehicle departure time of the vehicle departure point, and i is greater than 1, the traffic vehicle generated at the current position corresponds to a vehicle departure time interval, and the vehicle departure time interval is the interval between the i-th vehicle departure time and the i-1-th vehicle departure time; wherein: In the case where the exit area covers at least one lane in the road area, the determining the vehicle spacing corresponding to the traffic vehicles generated at the current position includes: multiplying the exit time distance corresponding to the generated traffic vehicles, the first speed and the number of lanes covered by the exit area to obtain the vehicle spacing corresponding to the traffic vehicles generated at the current position; In a case where the vehicle exit area does not cover any lane in the road area, determining the vehicle spacing corresponding to the traffic vehicles generated at the current position includes: multiplying the vehicle exit time corresponding to the generated traffic vehicles by the first speed to obtain the vehicle spacing corresponding to the traffic vehicles generated at the current position.
15. The method according to claim 1 or 11, characterized in that: Each traffic vehicle generated by the exit point is used to influence the driving behavior of the test vehicle in the road area; The position information of the current position includes: the lane direction of the lane where the current position is located, and the area indication information corresponding to the current position, and the area indication information is used to indicate: the area determined at the current position based on the vehicle size; the method also includes: If the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, and there is no obstacle in the area, then it is determined that the current position meets the feasibility condition; If the lane direction of the lane where the current position is located is different from the lane direction of the lane where the test vehicle is located, or if the lane direction of the lane where the current position is located is the same as the lane direction of the lane where the test vehicle is located, but there is an obstacle in the area, it is determined that the current position does not meet the feasibility conditions.
16. A vehicle processing device, characterized in that: include: A determination unit, configured to determine an exit area of the exit point from the road area according to a reference point of the exit point in the road area; the road area includes one or more lanes; A processing unit is used for selecting a point as the current position on the exit line of each lane covered by the exit area whenever the exit time of the exit point arrives, if the exit area covers at least one lane in the road area, and the exit line of each lane is located in the exit area; wherein, the lane covered by the exit area means that the exit area intersects with the lane centerline of the lane; the method for determining the exit line of any lane covered by the exit area includes: determining two intersection points between the lane centerline of any lane and the exit area, and determining the exit line of any lane in the line segment between the two intersection points; if it is determined that the current position meets the feasible conditions according to the position information of the current position, then controlling the exit point to generate a traffic vehicle at the current position; setting an initial speed for the traffic vehicle generated at the current position based on the basic traffic map, so that the generated traffic vehicle complies with the traffic law; wherein, the basic traffic map is used to describe the relationship between traffic flow, traffic density and speed in the traffic network.
17. A computer device comprising an input interface and an output interface, characterized in that: Also includes: a processor adapted to implement one or more instructions; as well as, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the vehicle processing method as described in any one of claims 1-15.
18. A computer storage medium, characterized in that: The computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the vehicle processing method as described in any one of claims 1-15.
19. A computer program product, characterized in that The computer program product comprises a computer program; when the computer program is executed by a processor, the vehicle processing method as described in any one of claims 1 to 15 is implemented.
Citation Information
Patent Citations
Driving simulation method, device and equipment and storage medium
CN110069887A