CN117111578A - Automatic driving system detection blind area guiding fuzzy test method and system - Google Patents
Automatic driving system detection blind area guiding fuzzy test method and system Download PDFInfo
- Publication number
- CN117111578A CN117111578A CN202311060753.7A CN202311060753A CN117111578A CN 117111578 A CN117111578 A CN 117111578A CN 202311060753 A CN202311060753 A CN 202311060753A CN 117111578 A CN117111578 A CN 117111578A
- Authority
- CN
- China
- Prior art keywords
- scene
- fitness
- vehicle
- scenes
- scenarios
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 54
- 238000010998 test method Methods 0.000 title description 3
- 238000012360 testing method Methods 0.000 claims abstract description 133
- 238000000034 method Methods 0.000 claims abstract description 71
- 230000035772 mutation Effects 0.000 claims abstract description 18
- 230000008859 change Effects 0.000 claims abstract description 9
- 210000005155 neural progenitor cell Anatomy 0.000 claims description 39
- 230000008569 process Effects 0.000 claims description 38
- 238000004422 calculation algorithm Methods 0.000 claims description 23
- 238000004364 calculation method Methods 0.000 claims description 21
- 230000002068 genetic effect Effects 0.000 claims description 19
- 238000004088 simulation Methods 0.000 claims description 13
- 210000000349 chromosome Anatomy 0.000 claims description 11
- 230000001186 cumulative effect Effects 0.000 claims description 10
- 230000000717 retained effect Effects 0.000 claims description 10
- 230000000903 blocking effect Effects 0.000 claims description 9
- 238000010187 selection method Methods 0.000 claims description 5
- 230000006978 adaptation Effects 0.000 claims description 4
- 230000033001 locomotion Effects 0.000 claims description 4
- 230000007246 mechanism Effects 0.000 claims description 4
- 108090000623 proteins and genes Proteins 0.000 claims description 4
- 238000013461 design Methods 0.000 claims description 3
- 230000036039 immunity Effects 0.000 claims description 3
- 230000006870 function Effects 0.000 description 25
- 239000000243 solution Substances 0.000 description 18
- 238000010586 diagram Methods 0.000 description 16
- 230000006399 behavior Effects 0.000 description 7
- 238000004590 computer program Methods 0.000 description 7
- 238000002474 experimental method Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000007547 defect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000033228 biological regulation Effects 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000003542 behavioural effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000013100 final test Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0218—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults
- G05B23/0243—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults model based detection method, e.g. first-principles knowledge model
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24065—Real time diagnostics
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Traffic Control Systems (AREA)
Abstract
Description
技术领域Technical field
本发明属于智能车路系统技术领域,具体涉及一种自动驾驶系统探测盲区导向模糊测试方法及系统。The invention belongs to the technical field of intelligent vehicle road systems, and specifically relates to an automatic driving system detection blind spot guidance fuzzy testing method and system.
背景技术Background technique
随着自动驾驶技术的快速发展,自动驾驶系统的安全性能测试技术也在不断创新和发展。早期的自动驾驶系统测试技术主要集中在车辆性能、传感器精度和电子设备可靠性等方面,而随着自动驾驶系统的复杂性和关键性不断提高,功能安全,算法鲁棒性等方面的测试技术也越来越重要。天气情况的多变、交通环境的复杂、驾驶任务的多样性等外部因素都为自动驾驶汽车测试提出了新的挑战。在自动驾驶系统发展的初期,通常采用实车测试的形式对自动驾驶系统的安全性能进行验证,但实车测试主要适用于进行相对单一的各类功能测试及验证。随着自动驾驶车辆自动驾驶等级的提高,对于测试场景的需求变得复杂且不可预测,实车测试已经不能覆盖其可能面临的全部情况。With the rapid development of autonomous driving technology, the safety performance testing technology of autonomous driving systems is also constantly innovating and developing. Early autonomous driving system testing technologies mainly focused on vehicle performance, sensor accuracy, and electronic equipment reliability. As the complexity and criticality of autonomous driving systems continue to increase, testing technologies on functional safety, algorithm robustness, etc. It is also becoming more and more important. External factors such as changing weather conditions, complex traffic environments, and diverse driving tasks all pose new challenges to autonomous vehicle testing. In the early stages of the development of autonomous driving systems, actual vehicle testing is usually used to verify the safety performance of the autonomous driving system. However, actual vehicle testing is mainly suitable for testing and verifying relatively single types of functions. As the autonomous driving level of autonomous vehicles increases, the requirements for test scenarios have become complex and unpredictable, and real vehicle testing can no longer cover all situations it may face.
仿真测试因其测试场景丰富、测试成本低、测试效率高、场景可重复性高等特点成为各企业和研究机构青睐的方法。相较于实车测试,仿真测试可以以更低的成本发现自动驾驶汽车的功能问题,特别是可以方便地进行“测试驱动开发”,即测试结果参与算法的迭代训练,已成为最有潜力的仿真测试方法之一。Simulation testing has become a method favored by various enterprises and research institutions due to its rich testing scenarios, low testing cost, high testing efficiency, and high scenario repeatability. Compared with real vehicle testing, simulation testing can discover functional problems of autonomous vehicles at a lower cost. In particular, it can easily carry out "test-driven development", that is, test results participate in iterative training of algorithms, and has become the most promising method. One of the simulation testing methods.
模糊测试则是当前仿真测试中主流、有效的软件缺陷检测方法。通过向被测程序不断提供非预期的输入并监视该程序是否出现异常,从而达到探测软件缺陷的目的,是一种基于缺陷注入的自动软件测试技术。它使用大量自动生成的测试用例作为应用程序的输入,以发现应用程序中可能存在的安全缺陷。目前模糊测试技术应用于自动驾驶系统安全性能测试方面的研究,主要是在生成测试场景时采用不同的变异策略,以获得对自动驾驶系统安全性能影响较大的关键违规场景,从而实现减少测试用例数量,提高测试效率的目的。Fuzz testing is the mainstream and effective software defect detection method in current simulation testing. It is an automatic software testing technology based on defect injection that detects software defects by continuously providing unexpected input to the program under test and monitoring whether the program appears abnormal. It uses a large number of automatically generated test cases as input to the application to discover possible security flaws in the application. Currently, fuzzy testing technology is used in research on safety performance testing of autonomous driving systems. It mainly uses different mutation strategies when generating test scenarios to obtain key violation scenarios that have a greater impact on the safety performance of autonomous driving systems, thereby reducing test cases. quantity to improve testing efficiency.
发明内容Contents of the invention
本发明的目的在于针对上述现有技术中关键场景搜索方法生成场景单一、测试效率低等问题,提供一种自动驾驶系统探测盲区导向模糊测试方法及系统,将仿真模拟器中由数组表示而成的具体交通场景抽象为一个测试用例,设计了以传感器探测盲区为导向的适应度函数,用以表示每个测试用例的安全性,对多个用例进行分组、变异、迭代等操作,具有搜索包含多车辆的复杂测试场景的能力。The purpose of the present invention is to provide an automatic driving system detection blind zone guidance fuzzy testing method and system in order to solve the problems of single scene generation and low test efficiency of the key scene search method in the above-mentioned prior art. The simulation simulator is represented by an array. The specific traffic scene is abstracted into a test case, and a fitness function oriented by the sensor detection blind area is designed to represent the safety of each test case. Multiple use cases can be grouped, mutated, iterated, etc., with the ability to search and include Capability of complex test scenarios with multiple vehicles.
为了实现上述目的,本发明有如下的技术方案:In order to achieve the above objects, the present invention has the following technical solutions:
一种自动驾驶系统探测盲区导向模糊测试方法,包括以下步骤:A fuzzy testing method for automatic driving system detection blind spot guidance, including the following steps:
根据模拟器的相关语义限制,随机生成多个初始场景,场景中包含一个内置被测自动驾驶系统的主车辆和若干个交通参与者,设定每个场景的时长,以及间隔时间节点,并取每个时间节点上交通参与者的瞬时速度与变道情况作为可变异参数;According to the relevant semantic restrictions of the simulator, multiple initial scenes are randomly generated. The scenes include a main vehicle with a built-in autonomous driving system under test and several traffic participants. The duration of each scene and the interval time node are set, and the The instantaneous speed and lane changing conditions of traffic participants at each time node are used as variable parameters;
在模拟器中运行各个初始场景,并分别通过根据主车辆传感器探测区域的盲区遮挡情况预先设计的描述场景中各车辆间安全情况的适应度函数计算适应度得分,根据各个初始场景对应得分情况,保留得分较高、安全性能较差的场景,对场景中交通参与者各时间节点的瞬时速度与变道情况进行变异;Run each initial scenario in the simulator, and calculate the fitness score through a pre-designed fitness function describing the safety situation between vehicles in the scenario based on the blind spot occlusion of the main vehicle sensor detection area. According to the corresponding score of each initial scenario, Scenarios with higher scores and poor safety performance are retained, and the instantaneous speed and lane changing conditions of traffic participants at each time node in the scene are mutated;
将经过变异的场景队列,作为新的用例在模拟器中运行,获得新的适应度得分,基于新的得分再次进行变异,以上过程重复进行若干次后,计算所有场景适应度得分的均值,选取得分大于均值的场景进行局部搜索,其他得分小于均值的场景进行随机重启;Run the mutated scenario queue in the simulator as a new use case to obtain a new fitness score, and mutate again based on the new score. After the above process is repeated several times, the mean value of the fitness scores of all scenarios is calculated and selected. Scenes with scores greater than the average are searched locally, and other scenes with scores less than the average are randomly restarted;
随机重启之后,针对适应度得分小于均值的场景,计算各场景间的相似度,保留相似度最低的几个场景作为初始场景,对初始场景更新后再次进行前述步骤;After a random restart, calculate the similarity between scenarios for scenarios with fitness scores less than the mean, and retain the scenarios with the lowest similarity as initial scenarios. After updating the initial scenarios, perform the aforementioned steps again;
基于适应度较高的场景中的参数,再次进行变异,并在模拟器中运行变异后的场景,计算适应度得分,比较变异前后两场景的得分大小,保留较高的一个作为输出场景。Based on the parameters in the scenario with higher fitness, mutate again, run the mutated scenario in the simulator, calculate the fitness score, compare the scores of the two scenarios before and after the mutation, and retain the higher one as the output scenario.
作为一种优选的方案,所述可变异参数在场景中定义取值范围,将主车辆的速度控制在匀速30km/h,交通参与者的速度控制20km/h~120km/h的范围内,交通参与者的变道情况由0、1、2表示,0代表直行不变道,1代表向左变道,2代表向右变道;还对场景中所有车辆行为进行约束,剔除无效场景。As a preferred solution, the variable parameters define a value range in the scene, and the speed of the main vehicle is controlled at a constant speed of 30km/h, and the speed of traffic participants is controlled within the range of 20km/h to 120km/h. The participant's lane changing situation is represented by 0, 1, and 2. 0 represents going straight without changing the lane, 1 represents changing lanes to the left, and 2 represents changing lanes to the right. It also constrains the behavior of all vehicles in the scene and eliminates invalid scenes.
作为一种优选的方案,所述描述场景中各车辆间安全情况的适应度函数,根据主车辆传感器探测区域的盲区遮挡情况按照如下方式设计:若主车辆在同方向进行跟车,设车辆的长度为l,宽度为d,以主车矩形前方中点与前车矩形的左下角为参照点,设与前车的横向距离为x,纵向距离为y,在探测器探测范围内前车对主车遮挡而造成的盲区角度为S,当车辆行驶时,场景中其他车辆距离主车越近,则盲区角度S越大,随着车辆之间相对位置的变化,遮挡角度S的计算方式不同。As a preferred solution, the fitness function describing the safety situation between vehicles in the scene is designed as follows based on the blind area occlusion of the main vehicle sensor detection area: if the main vehicle is following the vehicle in the same direction, let the vehicle The length is l and the width is d. Taking the front midpoint of the rectangle of the main vehicle and the lower left corner of the rectangle of the preceding vehicle as the reference point, assuming that the lateral distance to the preceding vehicle is x and the longitudinal distance is y, within the detection range of the detector, the leading vehicle is opposite The blind spot angle S caused by the occlusion of the main vehicle is S. When the vehicle is driving, the closer other vehicles in the scene are to the main vehicle, the larger the blind spot angle S is. As the relative positions between vehicles change, the occlusion angle S is calculated in different ways. .
作为一种优选的方案,所述随着车辆之间相对位置的变化,遮挡角度S的计算方式分别如下:As a preferred solution, as the relative positions between vehicles change, the occlusion angle S is calculated as follows:
当0<x≤y-d时:When 0<x≤y-d:
当y-d<x≤y时:When y-d<x≤y:
当y<x<y+l时:When y<x<y+l:
作为一种优选的方案,当主车辆传感器探测区域内同时出现两辆以上的非主车辆时,两辆车同时对主车辆传感器探测产生了遮挡,如果这些车辆的盲区角度产生重合时,则认为对应场景为危险场景,反之则安全;As a preferred solution, when two or more non-host vehicles appear in the main vehicle sensor detection area at the same time, the two vehicles simultaneously block the detection of the main vehicle sensor. If the blind spot angles of these vehicles overlap, it is considered that the corresponding The scene is a dangerous scene, otherwise it is safe;
盲区重合角度Sb的计算表达式如下:The calculation expression of blind zone coincidence angle S b is as follows:
Sb=Sarea1∩Sarea2 S b =S area1 ∩S area2
盲区重合角度Sb存在以下关系:当Sb>0时危险,当Sb=0时安全;The blind zone coincidence angle S b has the following relationship: when S b >0, it is dangerous, and when S b =0, it is safe;
定义每辆车的盲区的角度范围为Sarea,根据S的计算结果,Sarea的计算表达式如下:The angular range of each vehicle's blind spot is defined as S area . According to the calculation result of S, the calculation expression of S area is as follows:
当Sb较大时,则此时前车对主车辆传感器探测的遮挡情况较严重,且同时车辆之间的距离也较近;反之当盲区角度重合部分比例较高,但车辆距离较远,以及盲区角度重合部分比例较低,但车辆距离较近,这两种情况出现时,对应场景的危险性较低,且Sb的值也较低。When S b is larger, the blocking situation detected by the main vehicle sensor by the vehicle in front is more serious, and the distance between the vehicles is also closer; conversely, when the blind spot angle overlap ratio is higher, but the distance between the vehicles is farther, And the proportion of blind spot angle overlap is low, but the distance between vehicles is closer. When these two situations occur, the danger of the corresponding scene is low, and the value of S b is also low.
作为一种优选的方案,所述将经过变异的场景队列,作为新的用例在模拟器中运行,获得新的适应度得分,基于新的得分再次进行变异,以上过程重复进行若干次后,计算所有场景适应度得分的均值,选取得分大于均值的场景进行局部搜索,其他得分小于均值的场景进行随机重启的步骤包括:As a preferred solution, the mutated scenario queue is run in the simulator as a new use case to obtain a new fitness score, and is mutated again based on the new score. After the above process is repeated several times, the calculation The average of the fitness scores of all scenes, select scenes with scores greater than the average for local search, and randomly restart scenes with scores less than the average. The steps include:
在给定搜索预算内最大限度的发现具有高对抗性的危险测试场景,定义bt为输入xt∈X模糊迭代次数为t次时所发现的对抗性场景的集合,则对抗性场景yt表达式如下:To maximize the discovery of highly adversarial dangerous test scenarios within a given search budget , define b t as the set of adversarial scenarios discovered when the input x t ∈ The expression is as follows:
yt=max{b1,b2,b3……,bt}y t =max{b 1 ,b 2 ,b 3 ……,b t }
使用基于遗传算法的模糊搜索方法,模糊搜索的最终目标是最大化发现的各种对抗性场景,对应到遗传算法中需要找到子代中的最优个体;Using the fuzzy search method based on genetic algorithm, the ultimate goal of fuzzy search is to maximize the various adversarial scenarios discovered, which corresponds to the need to find the optimal individual among the offspring in the genetic algorithm;
在遗传算法中,个体的适应度分数用于确定该个体的基因是应该被保留还是被淘汰;选择基于车辆领域知识和场景态势设计适应度函数,适应度函数根据场景中车辆相关参数,在每个时间步长内计算主车EV不与其他车辆NPC发生碰撞的情况下可以移动的最大距离α,以及场景中其他车辆对主车雷达的遮挡率β,场景中某一时刻t的适应度函数如下:In the genetic algorithm, the individual's fitness score is used to determine whether the individual's genes should be retained or eliminated; the fitness function is designed based on the vehicle domain knowledge and scene situation. The fitness function is based on the vehicle-related parameters in the scene. Calculate within time steps the maximum distance α that the main vehicle EV can move without colliding with other vehicles NPC, as well as the occlusion rate β of the main vehicle radar by other vehicles in the scene, and the fitness function at a certain time t in the scene as follows:
ft(EV,NPC)=αt+βt f t (EV,NPC)=α t +β t
如果当场景中车辆发生碰撞时,会额外增加一个常数c,作为适应度函数的碰撞补偿:If a vehicle collides in the scene, an additional constant c will be added as the collision compensation of the fitness function:
ft(EV,NPC)=αt+βt+cf t (EV,NPC)=α t +β t +c
在场景模拟的过程中,每个时间步长t测量一次适应度得分,在时间步长t处测量的ft越大,表示在时间t处发生车辆冲突的风险越高;根据场景的动态变化,场景的适应度得分在每个时间步长后会增大或者减小;场景的适应度得分计算表达式如下:During the scene simulation process, the fitness score is measured once at each time step t. The larger the f t measured at time step t, the higher the risk of vehicle conflict at time t; according to the dynamic changes of the scene , the fitness score of the scene will increase or decrease after each time step; the calculation expression of the fitness score of the scene is as follows:
将染色体交叉设计为场景中NPC的交换操作,在每一代中的两个场景内各随机选择一个NPC,通过交换两个场景运行时间内NPC的运动状态,从而完成染色体的交叉操作;染色体变异是在遗传过程中随机选择某个NPC,对其某一时刻的车辆行驶状态进行随机改变。Chromosome crossover is designed as an exchange operation of NPCs in the scene. One NPC is randomly selected in each of the two scenes in each generation, and the movement status of the NPC during the running time of the two scenes is exchanged to complete the chromosome crossover operation; Chromosome mutation is An NPC is randomly selected during the genetic process, and its vehicle driving status at a certain moment is randomly changed.
作为一种优选的方案,场景的选择过程目的是从每代场景中剔除不适合的个体,获得具有更高适应度的个体,使用轮盘赌选择方法来实现这一过程,如果场景的适应度越高,则越容易的选到此场景;在轮盘赌选择方法中,个体的选择概率与其适应度成比例,适应度越大,选中概率也越大;设某一部分xi的适应度值表示为f(xi),对应被选中的概率为p(xi),累积概率为q(xi),计算表达式如下:As a preferred solution, the purpose of the scene selection process is to eliminate unsuitable individuals from each generation of scenes and obtain individuals with higher fitness. The roulette selection method is used to achieve this process. If the fitness of the scene The higher it is, the easier it is to choose this scene; in the roulette selection method, the selection probability of an individual is proportional to its fitness. The greater the fitness, the greater the selection probability; Suppose the fitness value of a certain part x i Expressed as f(xi ) , the corresponding probability of being selected is p( xi ), and the cumulative probability is q( xi ). The calculation expression is as follows:
作为一种优选的方案,所述针对适应度得分小于均值的场景,计算各场景间的相似度,保留相似度最低的几个场景作为初始场景的步骤中,使用随机重启机制来避免陷入局部最优解;As a preferred solution, in the step of calculating the similarity between scenarios for scenarios where the fitness score is less than the mean, and retaining the scenarios with the lowest similarity as the initial scenarios, a random restart mechanism is used to avoid falling into the local minimum. excellent solution;
当迭代过程中的场景适应度得分没有随着时间的推移而提高,此时执行随机重启;When the scene fitness score during the iteration process does not improve over time, a random restart is performed at this time;
通过将当前场景的适应度得分与前几代的平均适应度得分来进行对比,如果当前适应度得分小于前几代的平均值,根据之前记录过的每个场景中的NPC轨迹,在随机初始化NPC轨迹的场景中,选择与所运行过场景相似度最低的场景作为随机重启后遗传算法的新输入;相似性则是通过计算候选场景中的NPC轨迹与之前场景中的NPC轨迹之间的欧氏距离来实现,距离越大,说明场景之间的相似度越低;场景相似度按照如下方式计算:By comparing the fitness score of the current scene with the average fitness score of previous generations, if the current fitness score is less than the average fitness score of previous generations, random initialization is performed based on the previously recorded NPC trajectories in each scene. In the scene of NPC trajectories, the scene with the lowest similarity to the scene that has been run is selected as the new input of the genetic algorithm after random restart; the similarity is calculated by calculating the Euclidean distance between the NPC trajectories in the candidate scenes and the NPC trajectories in the previous scenes. This is achieved by distance. The larger the distance, the lower the similarity between scenes; the scene similarity is calculated as follows:
St npc,1表示NPC1在场景t时刻时的车辆状态,车辆的状态信息包含每辆车的位置信息Lt npc,1和速度信息Vt npc,1,按照如下表达式计算:S t npc,1 represents the vehicle status of NPC1 at scene t. The vehicle status information includes the position information L t npc,1 and speed information V t npc,1 of each vehicle, and is calculated according to the following expression:
St npc,1=Lt npc,1+Vt npc,1 S t npc,1 =L t npc,1 + V t npc,1
用表示不同NPC在时刻t时的欧氏距离,假设不同测试用例中的同一辆NPC的位置信息可以表示为Lt npc,1′与Lt npc,1,则场景Scenario1和Scenario2的场景相似度按照如下表达式进行计算:use Represents the Euclidean distance of different NPCs at time t. Assuming that the position information of the same NPC in different test cases can be expressed as L t npc,1′ and L t npc,1 , then the scene similarity of Scenario1 and Scenario2 Calculate according to the following expression:
作为一种优选的方案,还包括通过覆盖率指标来衡量测试用例的有效性和测试的完备性;As a preferred solution, it also includes measuring the effectiveness of test cases and the completeness of tests through coverage indicators;
使用两个参数作为横纵坐标组成的参数空间来描述场景覆盖率,一个参数为被测车辆与存在遮挡情况车辆之间的欧式距离,另一个参数是所提出的遮挡参数;Use two parameters as the parameter space composed of horizontal and vertical coordinates to describe the scene coverage. One parameter is the Euclidean distance between the vehicle under test and the vehicle with occlusion, and the other parameter is the proposed occlusion parameter;
假设一共执行了n次测试用例,第i个测试用例Ti的参数为(Ai,Bi)覆盖了参数空间中的一小部分,则参数空间的累计覆盖率Cov表示为所有测试用例T覆盖的参数空间面积与总参数空间面积Area之比,表达式如下:Assume that a total of n test cases have been executed, and the parameters of the i-th test case T i are (A i , B i ) covering a small part of the parameter space. Then the cumulative coverage Cov of the parameter space is expressed as all test cases T The ratio of the covered parameter space area to the total parameter space area Area, the expression is as follows:
其中,每个测试用例的覆盖免疫通过计算所在矩形的面积来获得,假设第i个测试用例Ti覆盖的参数区域为矩形(ai,bi)到(Ai,Bi),则其覆盖面积表示为:Among them, the coverage immunity of each test case is obtained by calculating the area of the rectangle. Assume that the parameter area covered by the i-th test case Ti is the rectangle (a i , b i ) to (A i , B i ), then its The coverage area is expressed as:
Area(Ti)=(Ai-ai)×(Bi-bi)Area(T i )=(A i -a i )×(B i -b i )
则累计覆盖率Cov为:Then the cumulative coverage Cov is:
一种自动驾驶系统探测盲区导向模糊测试系统,包括:An automatic driving system detection blind spot guidance fuzzy testing system, including:
初始场景生成模块,用于根据模拟器的相关语义限制,随机生成多个初始场景,场景中包含一个内置被测自动驾驶系统的主车辆和若干个交通参与者,设定每个场景的时长,以及间隔时间节点,并取每个时间节点上交通参与者的瞬时速度与变道情况作为可变异参数;The initial scene generation module is used to randomly generate multiple initial scenes based on the relevant semantic restrictions of the simulator. The scene contains a main vehicle with a built-in autonomous driving system under test and several traffic participants. The duration of each scene is set. and interval time nodes, and take the instantaneous speed and lane changing conditions of traffic participants at each time node as variable parameters;
场景队列变异模块,用于在模拟器中运行各个初始场景,并分别通过根据主车辆传感器探测区域的盲区遮挡情况预先设计的描述场景中各车辆间安全情况的适应度函数计算适应度得分,根据各个初始场景对应得分情况,保留得分较高、安全性能较差的场景,对场景中交通参与者各时间节点的瞬时速度与变道情况进行变异;The scene queue mutation module is used to run each initial scenario in the simulator and calculate the fitness score through a pre-designed fitness function describing the safety situation between vehicles in the scene based on the blind spot occlusion of the main vehicle sensor detection area. According to Each initial scene corresponds to the score, and scenes with higher scores and poor safety performance are retained, and the instantaneous speed and lane changing conditions of traffic participants at each time node in the scene are mutated;
局部搜索模块,用于将经过变异的场景队列,作为新的用例在模拟器中运行,获得新的适应度得分,基于新的得分再次进行变异,以上过程重复进行若干次后,计算所有场景适应度得分的均值,选取得分大于均值的场景进行局部搜索,其他得分小于均值的场景进行随机重启;The local search module is used to run the mutated scene queue as a new use case in the simulator, obtain a new fitness score, and mutate again based on the new score. After the above process is repeated several times, all scene adaptations are calculated. The mean value of the degree score, select the scene with a score greater than the mean value for local search, and randomly restart the other scenes with a score less than the mean value;
初始场景更新模块,用于随机重启之后,针对适应度得分小于均值的场景,计算各场景间的相似度,保留相似度最低的几个场景作为初始场景,对初始场景更新后再次进行前述步骤;The initial scene update module is used after a random restart to calculate the similarity between scenarios for scenarios with fitness scores less than the mean, retain the lowest similarity scenarios as initial scenarios, and perform the aforementioned steps again after updating the initial scenarios;
输出场景选择模块,用于基于适应度较高的场景中的参数,再次进行变异,并在模拟器中运行变异后的场景,计算适应度得分,比较变异前后两场景的得分大小,保留较高的一个作为输出场景。The output scene selection module is used to mutate again based on the parameters in the scene with higher fitness, run the mutated scene in the simulator, calculate the fitness score, compare the scores of the two scenes before and after the mutation, and retain the higher of one as the output scene.
相较于现有技术,本发明至少具有如下的有益效果:Compared with the prior art, the present invention at least has the following beneficial effects:
根据模拟器的相关语义限制,随机生成多个初始场景,场景中包含一个内置被测自动驾驶系统的主车辆和若干个交通参与者,将仿真模拟器中由数组表示而成的具体交通场景抽象为一个测试用例,在模拟器中运行各个初始场景,设计了以传感器探测盲区为导向的适应度函数,用以表示每个测试用例的安全性,本发明结合遗传算法,并设计了一种基于探测盲区的适应度函数来控制测试用例的生成,在给定搜索预算内最大限度的发现具有高对抗性的危险测试场景,使用了基于遗传算法的模糊搜索方法,从一些初始输入开始,选择新的输入,发现新的冲突,对输入进行更新,同时,本发明还使用了随机重启机制来避免陷入局部最优解。自动驾驶系统是基于传感器获取环境信息进行决策和控制的,如果遮挡物阻碍了传感器获取信息的能力,那么自动驾驶系统可能无法做出正确的决策和控制,导致事故发生。本发明测试方法能够有效搜索出导致智能车失去控制或与其他车辆发生碰撞的典型测试用例。According to the relevant semantic restrictions of the simulator, multiple initial scenes are randomly generated. The scenes include a main vehicle with a built-in autonomous driving system under test and several traffic participants. The specific traffic scenes represented by arrays in the simulation simulator are abstracted. For a test case, each initial scenario is run in the simulator, and a fitness function oriented by the sensor detection blind area is designed to represent the safety of each test case. The present invention combines the genetic algorithm and designs a method based on Detect the fitness function of the blind area to control the generation of test cases, and discover highly adversarial dangerous test scenarios to the maximum extent within a given search budget. A fuzzy search method based on genetic algorithms is used. Starting from some initial inputs, new input, discover new conflicts, and update the input. At the same time, the present invention also uses a random restart mechanism to avoid falling into the local optimal solution. The autonomous driving system makes decisions and controls based on sensors obtaining environmental information. If obstructions hinder the sensor's ability to obtain information, the autonomous driving system may not be able to make correct decisions and controls, leading to accidents. The testing method of the present invention can effectively search for typical test cases that cause the smart car to lose control or collide with other vehicles.
进一步的,为了提高测试效率,本发明提出场景车辆行为约束的概念,来减少模糊测试过程中无效测试用例的生成,与适应度函数结合,从而可以有效提高测试效率。Furthermore, in order to improve testing efficiency, the present invention proposes the concept of scene vehicle behavior constraints to reduce the generation of invalid test cases during the fuzz testing process, and combines it with the fitness function to effectively improve testing efficiency.
附图说明Description of drawings
为了更清楚地说明本发明申请中的技术方案,下面将对申请描述中所需要使用的附图作简单地介绍,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the application of the present invention, the drawings needed to be used in the description of the application will be briefly introduced below. The drawings in the description below are only some embodiments of the application. For those of ordinary skill in the art, As far as workers are concerned, other drawings can also be obtained based on these drawings without exerting creative work.
图1是本发明实施例自动驾驶系统探测盲区导向模糊测试方法整体流程图;Figure 1 is an overall flow chart of the blind spot guidance fuzzy testing method for automatic driving system detection according to the embodiment of the present invention;
图2是本发明实施例车辆被动碰撞场景示意图;Figure 2 is a schematic diagram of a vehicle passive collision scenario according to the embodiment of the present invention;
图3是本发明实施例非主车辆冲突场景示意图;Figure 3 is a schematic diagram of a non-host vehicle conflict scenario according to an embodiment of the present invention;
图4是本发明实施例前车对主车传感器探测区域遮挡示意图;Figure 4 is a schematic diagram of the front vehicle blocking the sensor detection area of the main vehicle according to the embodiment of the present invention;
图5(a)是本发明实施例前车在位置1时对主车传感器探测区域遮挡示意图;Figure 5(a) is a schematic diagram of the front vehicle blocking the sensor detection area of the main vehicle when it is in position 1 according to the embodiment of the present invention;
图5(b)是本发明实施例前车在位置2时对主车传感器探测区域遮挡示意图;Figure 5(b) is a schematic diagram of the front vehicle blocking the sensor detection area of the main vehicle when it is in position 2 according to the embodiment of the present invention;
图5(c)是本发明实施例前车在位置3时对主车传感器探测区域遮挡示意图;Figure 5(c) is a schematic diagram of the front vehicle blocking the sensor detection area of the main vehicle when it is in position 3 according to the embodiment of the present invention;
图6(a)是本发明实施例两辆非主车辆在位置1时盲区重合角度示意图;Figure 6(a) is a schematic diagram of the overlap angle of the blind spots when two non-host vehicles are in position 1 according to the embodiment of the present invention;
图6(b)是本发明实施例两辆非主车辆在位置2时盲区重合角度示意图;Figure 6(b) is a schematic diagram of the overlap angle of the blind spots when two non-host vehicles are in position 2 according to the embodiment of the present invention;
图6(c)是本发明实施例两辆非主车辆在位置3时盲区重合角度示意图;Figure 6(c) is a schematic diagram of the overlap angle of the blind spots when two non-host vehicles are in position 3 according to the embodiment of the present invention;
图7是本发明实施例染色体交叉示意图;Figure 7 is a schematic diagram of chromosome crossover according to an embodiment of the present invention;
图8是本发明实施例染色体变异示意图;Figure 8 is a schematic diagram of chromosome variation according to an embodiment of the present invention;
图9(a)是本发明实施例同遮挡角度下场景1示意图;Figure 9(a) is a schematic diagram of scene 1 under the same occlusion angle according to the embodiment of the present invention;
图9(b)是本发明实施例同遮挡角度下场景2示意图;Figure 9(b) is a schematic diagram of scene 2 at the same occlusion angle according to the embodiment of the present invention;
图10是本发明实施例最终测试场景示意图;Figure 10 is a schematic diagram of the final test scenario of the embodiment of the present invention;
图11是本发明实施例遮挡情况与碰撞关系示意图;Figure 11 is a schematic diagram of the relationship between occlusion and collision according to the embodiment of the present invention;
图12是本发明实施例方法与其他方法不同阶段时探测盲区比例图;Figure 12 is a diagram showing the proportion of detection blind areas at different stages between the method according to the embodiment of the present invention and other methods;
图13(a)在模糊器搜索相同代数的情况下危险场景搜索数量对比图;Figure 13(a) Comparison of the number of dangerous scene searches when the fuzzer searches the same algebra;
图13(b)在模糊器搜索相同代数的情况下危险场景搜索平均时间对比图。Figure 13(b) Comparison of the average time of dangerous scene search when the fuzzer searches the same algebra.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行描述和说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请提供的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described and illustrated below in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application. Based on the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without any creative work shall fall within the scope of protection of this application.
请参阅图1,本发明实施例自动驾驶系统探测盲区导向模糊测试方法,包括以下步骤:Please refer to Figure 1. The blind spot guidance fuzzy testing method for automatic driving system detection according to the embodiment of the present invention includes the following steps:
步骤一、根据模拟器的相关语义限制,随机生成4个初始场景,场景中包含1个内置被测自动驾驶系统的主车辆和2个交通参与者,所有车辆的初始位置固定于车道宽为3.7米的三车道高速公路。设每个场景时长为9秒,取3秒为一个时间节点,并取每个时间节点上交通参与者的瞬时速度与变道情况作为可变异参数,图1展示的左侧内容所示即为场景中各参数及其含义与场景的可视化。Step 1: According to the relevant semantic restrictions of the simulator, 4 initial scenes are randomly generated. The scenes include a main vehicle with a built-in autonomous driving system under test and 2 traffic participants. The initial positions of all vehicles are fixed at a lane width of 3.7 meters of three-lane highway. Assume that the duration of each scene is 9 seconds, take 3 seconds as a time node, and take the instantaneous speed and lane change of traffic participants at each time node as variable parameters, as shown on the left side of Figure 1: Visualization of each parameter in the scene and its meaning and scene.
步骤二、获得4个初始场景后,根据主车传感器探测区域的盲区遮挡情况设计了一个描述场景中各车辆间安全情况的适应度函数,在模拟器中运行4个场景,并分别计算其适应度得分,再根据各场景对应得分情况,保留其中得分较高、安全性能较差的场景,对场景中交通参与者各时间节点的瞬时速度与变道情况进行变异。Step 2: After obtaining 4 initial scenes, a fitness function describing the safety situation between vehicles in the scene is designed based on the blind spot occlusion of the main vehicle sensor detection area, and the 4 scenes are run in the simulator, and their adaptations are calculated respectively. degree score, and then according to the corresponding scores of each scene, scenarios with higher scores and poor safety performance are retained, and the instantaneous speed and lane changing conditions of traffic participants at each time node in the scene are mutated.
步骤三、经过变异的场景队列,作为新的用例在模拟器中运行,获得新的适应度得分,基于新的得分再次进行变异,以上过程重复进行5次后,计算所有场景适应度得分的均值,选取得分大于均值的场景进行局部搜索,其他得分小于均值的场景进行随机重启。Step 3. The mutated scenario queue is run in the simulator as a new use case to obtain a new fitness score. It is mutated again based on the new score. After the above process is repeated 5 times, the mean value of the fitness scores of all scenarios is calculated. , select scenes with scores greater than the mean for local search, and other scenes with scores less than the mean for random restart.
步骤四、随机重启,针对适应度得分小于均值的场景,计算其各场景间的相似度,保留相似度最低的4个场景作为初始场景再次进行步骤二至步骤四中所有流程。Step 4: Restart randomly. For scenarios with fitness scores less than the mean, calculate the similarity between the scenarios, and retain the 4 scenarios with the lowest similarity as the initial scenarios to repeat all the processes in steps 2 to 4.
步骤五、局部搜索,即基于适应度较高的场景中的参数,对其再次进行变异,并在模拟器中运行变异后的场景,计算其适应度得分,比较变异前后两场景的得分大小,保留较高的一个作为输出场景。Step 5. Local search, that is, based on the parameters in the scene with higher fitness, mutate it again, run the mutated scene in the simulator, calculate its fitness score, and compare the scores of the two scenes before and after the mutation. Keep the higher one as the output scene.
在一种可能的实施方式中,在步骤一生成测试用例时,为了保证每个测试用例在场景中是有效的,定义了测试场景可变异参数的取值范围,将主车辆的速度控制在匀速30km/h,交通参与者的速度控制20km/h-120km/h的内,交通参与者的变道情况由0、1、2表示,0代表直行不变道,1代表向左变道,2代表向右变道。此外,还对场景中所有车辆行为进行约束,从而在模糊测试中剔除大量无效场景,提高了测试效率。In a possible implementation, when generating test cases in step 1, in order to ensure that each test case is valid in the scenario, the value range of the variable parameters of the test scenario is defined to control the speed of the main vehicle at a constant speed. 30km/h, the speed of traffic participants is controlled within 20km/h-120km/h. The lane changing status of traffic participants is represented by 0, 1, 2. 0 means going straight without changing the lane, 1 means changing lanes to the left, and 2 Means changing lanes to the right. In addition, the behavior of all vehicles in the scene is constrained, thereby eliminating a large number of invalid scenes in the fuzz test and improving testing efficiency.
本发明的主要目的是生成各车辆之间发生碰撞的场景,然而,定义有效的碰撞场景是一个困难的问题,仅仅限制场景的参数会导致多种不同的情况,但场景搜索的目标应该是发现符合真实情况,且对于自动驾驶系统安全性能测试有意义的场景。根据场景测试需求与相关交通法规,定义了图2、图3中所描述的约束。The main purpose of this invention is to generate collision scenarios between vehicles. However, defining effective collision scenarios is a difficult problem. Simply limiting the parameters of the scenario will lead to a variety of different situations, but the goal of scene search should be to discover Scenarios that are consistent with real situations and meaningful for safety performance testing of autonomous driving systems. According to the scenario test requirements and relevant traffic regulations, the constraints described in Figures 2 and 3 are defined.
如图2所示,主车在正常行驶中突然遭遇来自侧后方的车辆碰撞,导致了一起冲突场景,根据相关交通法规,在此次冲突中后车负有全部责任。本发明实施例将发生在主车侧后方的碰撞行为定义为车辆行为约束,如果因此类行为导致的场景冲突,则被视为无效场景。As shown in Figure 2, the main vehicle suddenly encountered a collision with a vehicle from the side and rear during normal driving, resulting in a conflict scene. According to relevant traffic regulations, the rear vehicle bears full responsibility for this conflict. In the embodiment of the present invention, the collision behavior occurring on the side and rear of the host vehicle is defined as a vehicle behavior constraint. If a scene conflict is caused by such behavior, it will be regarded as an invalid scene.
如图3所示,此场景中来自主车侧前方的两辆非主车发生碰撞,但没有对主车的行驶造成任何影响,且因为自动驾驶测试中,对于非主车通常不会设置相关控制算法,所以非主车之间发生的碰撞大多不符合真实交通场景。As shown in Figure 3, in this scenario, two non-host vehicles from the front of the host vehicle collided, but it did not have any impact on the driving of the host vehicle, and because in autonomous driving tests, there is usually no relevant setting for the non-host vehicle. control algorithm, so most collisions between non-host vehicles do not conform to real traffic scenarios.
在一种可能的实施方式中,步骤二所描述的适应度函数,以同向行驶的跟车场景为例,实时计算主车在传感器范围内对前车探测情况。如图4所示的跟车场景,主车在同方向进行跟车,主车配备的传感器设备为一个激光雷达,其中雷达参数:θ=90°,R=100m。In one possible implementation, the fitness function described in step 2 takes the car-following scene traveling in the same direction as an example to calculate in real time the main vehicle's detection of the preceding vehicle within the sensor range. As shown in the car following scene shown in Figure 4, the main car is following the car in the same direction. The sensor device equipped by the main car is a lidar, where the radar parameters are: θ = 90°, R = 100m.
不同车辆位置对主车的遮挡存在差异,因此主车对场景中探测盲区的计算也存在差异。设车辆的长度为l,宽度为d,同时为了方便计算,将每辆车分别视为具有相同长和宽的长方体,以主车矩形前方中点与前车矩形的左下角为参照点,设与前车的横向距离为x,纵向距离为y,定义在探测器探测范围内前车对主车遮挡而造成的盲区角度为S,如图4所示。There are differences in the occlusion of the host vehicle by different vehicle positions, so the calculation of the host vehicle's detection blind spots in the scene is also different. Suppose the length of the vehicle is l and the width is d. At the same time, for the convenience of calculation, each vehicle is regarded as a cuboid with the same length and width. Taking the front midpoint of the main vehicle rectangle and the lower left corner of the front vehicle rectangle as the reference points, let The lateral distance to the front vehicle is x, and the longitudinal distance is y. The blind spot angle caused by the front vehicle blocking the main vehicle within the detection range of the detector is defined as S, as shown in Figure 4.
当车辆行驶时,场景中其他车辆距离主车越近,则盲区角度S就越大。随着车辆之间相对位置的变化,遮挡角度S的计算方式不同。如图5(a)至图5(c)所示,当前车处在探测范围的不同位置时,遮挡角度S的计算方式也不相同,具体计算如公式(1)、(2)、(3)所示。When the vehicle is driving, the closer other vehicles in the scene are to the main vehicle, the larger the blind spot angle S will be. As the relative positions between vehicles change, the occlusion angle S is calculated differently. As shown in Figure 5(a) to Figure 5(c), when the front vehicle is at different positions in the detection range, the calculation method of the occlusion angle S is also different. The specific calculation is as follows: formulas (1), (2), (3) ) shown.
当0<x≤y-d时:When 0<x≤y-d:
当y-d<x≤y时:When y-d<x≤y:
当y<x<y+l时:When y<x<y+l:
当主车雷达探测范围内同时出现两辆以上的非主车时,两辆车同时主车探测器产生了遮挡,如果这些车辆的盲区角度产生重合时,此时认为该场景为危险场景,反之则安全。盲区重合角度Sb的计算公式如下:When two or more non-main vehicles appear within the radar detection range of the main vehicle at the same time, and the main vehicle detector is blocked by the two vehicles at the same time, if the blind spot angles of these vehicles overlap, the scene is considered to be a dangerous scene, and vice versa. Safety. The calculation formula of blind zone coincidence angle S b is as follows:
Sb=Sarea1∩Sarea2(4)S b =S area1 ∩S area2 (4)
盲区重合角度Sb存在以下关系,当Sb>0时危险,当Sb=0时安全。定义每辆车的盲区的角度范围为Sarea,根据S的计算结果,Sarea的计算如公式(5)所示:The blind zone coincidence angle S b has the following relationship. When S b >0, it is dangerous, and when S b =0, it is safe. The angular range of each vehicle's blind spot is defined as S area . According to the calculation result of S, the calculation of S area is as shown in formula (5):
如图6(a)至图6(c)所示,当Sb较大时,说明此时前车对主车传感器的这档情况较为严重,且同时车辆之间的距离也较近。反之当盲区角度重合部分比例较高,但车辆距离较远,以及盲区角度重合部分比例较低,但车辆距离较近,这两种情况出现时,此时场景的危险性较低,且Sb的值也较低。As shown in Figure 6(a) to Figure 6(c), when S b is larger, it means that the situation of the front vehicle to the main vehicle sensor is more serious at this time, and at the same time, the distance between the vehicles is also closer. On the contrary, when the proportion of overlapping blind spot angles is high, but the vehicle distance is far away, and when the proportion of overlapping blind spot angles is low, but the vehicle distance is close, the danger of the scene is low, and S b The value is also lower.
在一种可能的实施方式中,在步骤三中,根本目的是在给定搜索预算内最大限度的发现具有高对抗性的危险测试场景。这可以理解为一个优化问题,怎样从所有有效输入场景的空间X中,在固定迭代次数T内最大化对抗性场景的数量Y。因此,本发明实施例定义bt为输入xt∈X模糊迭代次数为t次时所发现的对抗性场景的集合,则对抗性场景yt可表示如下:In a possible implementation, in step three, the fundamental purpose is to discover highly adversarial dangerous test scenarios to the maximum extent possible within a given search budget. This can be understood as an optimization problem, how to maximize the number of adversarial scenes Y within a fixed number of iterations T from the space X of all valid input scenes. Therefore, the embodiment of the present invention defines b t as the set of adversarial scenarios discovered when the number of fuzzy iterations of input x t ∈X is t times. Then the adversarial scenario y t can be expressed as follows:
yt=max{b1,b2,b3……,bt} (6)y t =max{b 1 ,b 2 ,b 3 ……,b t } (6)
由于输入空间X范围过大,无法使用穷举法进行搜索优化。此外,需要确定搜索重点并将其放在有希望的区域,以优化对抗性场景的搜索效率。本发明实施例使用了基于遗传算法的模糊搜索方法。从一些初始输入开始,模糊搜索器倾向于选择新的输入,发现新的冲突,以生成进一步的输入。本发明实施例提出的模糊搜索算法包含如下三个部分,遗传算法、随机重启模块以及局部搜索模块。算法伪代码如下:Since the range of the input space X is too large, the exhaustive method cannot be used for search optimization. Furthermore, search focus needs to be identified and placed on promising areas to optimize search efficiency in adversarial scenarios. The embodiment of the present invention uses a fuzzy search method based on genetic algorithm. Starting from some initial inputs, fuzzy searchers tend to select new inputs and discover new conflicts to generate further inputs. The fuzzy search algorithm proposed in the embodiment of the present invention includes the following three parts: genetic algorithm, random restart module and local search module. The pseudocode of the algorithm is as follows:
模糊搜索的最终目标是最大化的发现各种对抗性场景,对应到遗传算法中需要找到子代中的最优个体。然而,由于产生碰撞的场景输入较少,需要更多特定违规的指导,以帮助主车发生相对应的冲突。例如,为了获得车辆与行人发生碰撞的场景,需要一个适应度函数来帮助导致车辆与行人的交通违规场景。The ultimate goal of fuzzy search is to maximize the discovery of various adversarial scenarios, which corresponds to the need to find the optimal individual among the offspring in the genetic algorithm. However, due to less input of collision scenarios, more specific violation guidance is needed to help the host vehicle cause corresponding conflicts. For example, in order to obtain a scenario where a vehicle collides with a pedestrian, a fitness function is needed to help lead to a scenario of a traffic violation between a vehicle and a pedestrian.
在遗传算法中,个体的适应度分数用于确定该个体的基因是应该被保留还是被淘汰。出于测试目的,本发明实施例选择基于车辆领域知识和场景态势设计适应度函数。本发明实施例的适应度函数根据场景中车辆相对位置以及车速等相关参数,在每个时间步长内计算主车(EV)不与其他车辆(NPC)发生碰撞的情况下可以移动的最大距离α,以及场景中其他车辆对主车雷达的遮挡率β。则场景中某一时刻t的适应度函数计算公式为:In a genetic algorithm, an individual's fitness score is used to determine whether the individual's genes should be retained or eliminated. For testing purposes, the embodiment of the present invention chooses to design a fitness function based on vehicle domain knowledge and scene situations. The fitness function of the embodiment of the present invention calculates the maximum distance that the main vehicle (EV) can move without colliding with other vehicles (NPC) in each time step based on the relative position of the vehicle in the scene and vehicle speed and other relevant parameters. α, and the occlusion rate β of other vehicles in the scene to the main vehicle radar. Then the calculation formula of the fitness function at a certain moment t in the scene is:
ft(EV,NPC)=αt+βt (7)f t (EV,NPC)=α t +β t (7)
如果当场景中车辆发生碰撞时,会额外增加一个常数c,作为适应度函数的碰撞补偿,目的是在场景进化过程中将更多危险场景得到保留。If a vehicle collides in the scene, an additional constant c will be added as the collision compensation of the fitness function, with the purpose of retaining more dangerous scenes during the scene evolution process.
ft(EV,NPC)=αt+βt+c (8)f t (EV,NPC)=α t +β t +c (8)
在场景模拟的过程中,本发明实施例每0.1s测量一次适应度得分,在时间步长t处测量的ft越大,表示在时间t处发生车辆冲突的风险越高。根据场景的动态变化,场景的适应度得分在每个时间步长后会增大或者减小。场景的适应度得分如下式:During the scene simulation process, the embodiment of the present invention measures the fitness score every 0.1 s. The larger the f t measured at time step t, the higher the risk of vehicle conflict at time t. According to the dynamic changes of the scene, the fitness score of the scene will increase or decrease after each time step. The fitness score of the scene is as follows:
自然界的遗传变异过程比较复杂,遗传算法多次简化之后,最后仅模拟了两处:交叉(Crossover)和变异(Mutation)。The genetic mutation process in nature is relatively complex. After many simplifications, the genetic algorithm finally simulated only two processes: crossover and mutation.
本发明实施例将染色体交叉设计为场景中NPC的交换操作,在每一代中的两个场景内各随机选择一个NPC,通过交换两个场景运行时间内NPC的运动状态(车速和行驶方向),从而完成染色体的交叉操作。如图7所示。In the embodiment of the present invention, chromosome crossover is designed as an exchange operation of NPCs in the scene. One NPC is randomly selected in each of the two scenes in each generation. By exchanging the movement status (vehicle speed and driving direction) of the NPC during the running time of the two scenes, This completes the crossover operation of chromosomes. As shown in Figure 7.
染色体变异是在遗传过程中随机选择某个NPC,对其某一时刻的车辆行驶状态进行随机改变,具体操作如图8所示。Chromosome mutation is to randomly select an NPC during the genetic process and randomly change its vehicle driving status at a certain moment. The specific operation is shown in Figure 8.
在一种可能的实施方式中,在步骤三中,场景的选择过程是为了从每代场景中剔除不适合的个体,从而获得具有更高适应度的个体。本发明使用了轮盘赌选择(roulettewheel selection)方法来实现这一过程,如果场景的适应度较高,则会更频繁的选到此场景。在该方法中,各个个体的选择概率与其适应度成比例,适应度越大,选中概率也越大。但实际在进行轮盘赌选择时个体的选择往往不是依据个体的选择概率,而是根据累计概率来进行选择。In one possible implementation, in step three, the scenario selection process is to eliminate unsuitable individuals from each generation of scenarios to obtain individuals with higher fitness. The present invention uses a roulette wheel selection method to implement this process. If the adaptability of the scene is higher, the scene will be selected more frequently. In this method, the selection probability of each individual is proportional to its fitness. The greater the fitness, the greater the selection probability. However, in actual roulette selection, individual choices are often not based on individual selection probabilities, but on cumulative probabilities.
显然,在个体选择的过程中占总体的比例最高区域被选中的概率最大,因为它占总体的比例最高。但同时一些适应度得分较低的场景也可以在选择过程中幸存下来,这样做的优势是丰富了种群的基因库,避免在进化过程中陷入局部最优。其中每个部分被选中的概率与其适应度值成比例。设某一部分xi的适应度值表示为f(xi),该部分被选中的概率为p(xi),累积概率为q(xi),对应的计算公式如下:Obviously, in the process of individual selection, the area with the highest proportion of the population has the greatest probability of being selected because it accounts for the highest proportion of the population. But at the same time, some scenarios with low fitness scores can also survive the selection process. The advantage of this is that it enriches the gene pool of the population and avoids falling into local optimality during the evolution process. The probability of each part being selected is proportional to its fitness value. Suppose the fitness value of a certain part x i is expressed as f(xi ) , the probability of this part being selected is p( xi ), and the cumulative probability is q(xi ) . The corresponding calculation formula is as follows:
在一种可能的实施方式中,步骤四中本发明实施例还使用了随机重启机制来避免陷入局部最优解。当迭代过程中的场景适应度得分没有随着时间的推移而提高,此时会执行随机重启模块。通过将当前场景的适应度得分与前五代的平均适应度得分来进行对比,如果发现当前适应度得分小于前五代的平均值,此时根据之前记录过的每个场景中的NPC轨迹,在1000个随机初始化NPC轨迹的场景中,选择与所运行过场景相似度最低场景作为随机重启后遗传算法的新输入。相似性则是通过计算候选场景中的NPC轨迹与之前场景中的NPC轨迹之间的欧氏距离来实现的,距离越大,说明场景之间的相似度越低。场景相似度的相关定义如下:In a possible implementation, in step 4, the embodiment of the present invention also uses a random restart mechanism to avoid falling into a local optimal solution. When the scene fitness score during the iteration process does not improve over time, a random restart module will be executed. By comparing the fitness score of the current scene with the average fitness score of the previous five generations, if it is found that the current fitness score is less than the average of the previous five generations, then based on the previously recorded NPC trajectory in each scene, at 1000 Among the scenes with randomly initialized NPC trajectories, the scene with the lowest similarity to the previously run scenes is selected as the new input of the genetic algorithm after random restart. The similarity is achieved by calculating the Euclidean distance between the NPC trajectory in the candidate scene and the NPC trajectory in the previous scene. The larger the distance, the lower the similarity between the scenes. The relevant definitions of scene similarity are as follows:
St npc,1表示NPC1在场景t时刻时的车辆状态,车辆的状态信息包含每辆车的位置信息Lt npc,1和速度信息Vt npc,1,式11如下所示:S t npc,1 represents the vehicle status of NPC1 at scene t. The vehicle status information includes the position information L t npc,1 and speed information V t npc,1 of each vehicle. Equation 11 is as follows:
St npc,1=Lt npc,1+Vt npc,1 (11)S t npc,1 =L t npc,1 +V t npc,1 (11)
用表示不同NPC在时刻t时的欧氏距离,假设不同测试用例中的同一辆NPC的位置信息可以表示为Lt npc,1′与Lt npc,1,则场景Scenario1和Scenario2的场景相似度如下式所示:use Represents the Euclidean distance of different NPCs at time t. Assuming that the position information of the same NPC in different test cases can be expressed as L t npc,1′ and L t npc,1 , then the scene similarity of Scenario1 and Scenario2 As shown in the following formula:
在此基础上,本发明提出了一种新的覆盖率指标来衡量测试用例的有效性和测试的完备性。On this basis, the present invention proposes a new coverage index to measure the effectiveness of test cases and the completeness of tests.
自动驾驶系统是基于传感器获取环境信息,进行决策和控制的。如果遮挡物阻碍了传感器获取信息的能力,那么自动驾驶系统可能无法做出正确的决策和控制,导致事故发生。The autonomous driving system obtains environmental information based on sensors for decision-making and control. If obstructions hinder the sensor's ability to obtain information, the autonomous driving system may not be able to make correct decisions and control, leading to an accident.
因此测试自动驾驶系统在遮挡情况下的性能是非常重要的,因为这种情况可能导致车辆无法识别、跟踪或避免其他车辆、行人、障碍物等,从而危及驾乘人员的生命安全。Therefore, it is very important to test the performance of the autonomous driving system in occlusion situations, because this situation may cause the vehicle to be unable to recognize, track or avoid other vehicles, pedestrians, obstacles, etc., thus endangering the lives of drivers and passengers.
如图9(a)和图9(b)所示,两个场景中的遮挡角度θ1=θ2,但可以明显发现这两个场景的被遮挡情况完全不同,场景1中主车因距离较近,可以探测到部分被遮挡车辆,场景2则因为主车距离较远,导致最前方车辆大部分区域无法被主车探测到。As shown in Figure 9(a) and Figure 9(b), the occlusion angle θ 1 = θ 2 in the two scenes, but it can be clearly found that the occlusion situations in the two scenes are completely different. In scene 1, the main vehicle is blocked due to the distance Closer, partially obscured vehicles can be detected. In scene 2, because the main vehicle is far away, most areas of the frontmost vehicle cannot be detected by the main vehicle.
通过对上述两个场景进一步分析可以发现,在面对场景中车辆的不同行为时,两个场景的危险性会有明显差别,比如在同样在面对前车2向左变道时,场景1虽然被遮挡的角度较少,但因为车距较近,留给主车的反应空间较少,更容易发生危险。Through further analysis of the above two scenes, it can be found that the dangers of the two scenes will be significantly different when faced with different behaviors of vehicles in the scene. For example, when the car 2 in front changes lanes to the left, scene 1 Although there are fewer blocked angles, because the distance between the vehicles is closer, there is less room for the host vehicle to react, making danger more likely to occur.
相比之下,场景2中的主车在面对同样情形时,因为与前车2的距离较远,所以主车有更多的时间来采取措施。与之相反的是,当场景中的前车1向右驶离时,场景1因为主车与前车2不在同一条车道上,没有发生碰撞的风险,而在场景2中,主车虽然与前车2距离较远,但仍处于同一车道当中,所以当前车1驶离时,主车存在与前车2发生碰撞的风险。In contrast, when the main vehicle in scenario 2 faces the same situation, it has more time to take measures because it is far away from the leading vehicle 2. On the contrary, when the front car 1 in the scene drives away to the right, in scene 1 because the main car and the front car 2 are not in the same lane, there is no risk of collision. In scene 2, although the main car and the front car 2 are not in the same lane, there is no risk of collision. The vehicle 2 in front is far away, but still in the same lane, so when the vehicle 1 in front drives away, the main vehicle is at risk of colliding with the vehicle 2 in front.
鉴于此,本发明使用两个参数作为横纵坐标组成的参数空间来描述场景覆盖率,一个参数为被测车辆与存在遮挡情况车辆之间的欧式距离,另一个参数是本发明实施例前文提出的遮挡参数。假设在实验中一共执行了n次测试用例,其中第i个测试用例Ti的参数为(Ai,Bi),覆盖了参数空间中的一小部分。则参数空间的累计覆盖率Cov可以表示为所有测试用例T覆盖的参数空间面积与总参数空间面积Area之比,即:In view of this, the present invention uses two parameters as a parameter space composed of horizontal and vertical coordinates to describe the scene coverage. One parameter is the Euclidean distance between the vehicle under test and the vehicle with occlusion, and the other parameter is the Euclidean distance proposed in the embodiment of the present invention. occlusion parameters. Assume that a total of n test cases are executed in the experiment, and the parameters of the i-th test case T i are (A i , B i ), covering a small part of the parameter space. Then the cumulative coverage Cov of the parameter space can be expressed as the ratio of the parameter space area covered by all test cases T to the total parameter space area Area, that is:
其中,每个测试用例的覆盖免疫可以通过计算其所在矩形的面积来获得。假设第i个测试用例Ti覆盖的参数区域为矩形(ai,bi)到(Ai,Bi),则其覆盖面积可以表示为:Among them, the coverage immunity of each test case can be obtained by calculating the area of the rectangle in which it is located. Assume that the parameter area covered by the i-th test case T i is a rectangle (a i , b i ) to (A i , B i ), then its coverage area can be expressed as:
Area(Ti)=(Ai-ai)×(Bi-bi) (15)Area(T i )=(A i -a i )×(B i -b i ) (15)
将上述公式代入累计覆盖率公式中,得到:Substituting the above formula into the cumulative coverage formula, we get:
以下通过仿真实验对本发明的技术效果做进一步的验证说明。The technical effects of the present invention will be further verified and explained through simulation experiments below.
实验环境:lab environment:
本发明实验过程中使用的机器为:Dell Precison 3640Tower台式机;处理器为:Intel i9-10900K;32G内存;操作系统为64位window10。The machine used in the experiment of this invention is: Dell Precison 3640Tower desktop computer; the processor is: Intel i9-10900K; 32G memory; the operating system is 64-bit window10.
为了保证实验结果的公平性,对于不同的场景生成方法,选用了相同的初始场景。使用的仿真软件为Matlab R2021b中的自动驾驶工具箱,该工具箱提供了驾驶场景、传感器、车辆的功能模块以及3D仿真模块,根据这些模块,可以构建各种需要的自动驾驶仿真模型,用于自动驾驶的仿真。使用根据自动驾驶工具箱提供的helperGridBasedPlanningScenario模块与Motion Planning in Urban EnvironmentsUsing Dynamic Occupancy Grid Map算法作为虚拟安全测试中的测试平台与自动驾驶控制算法,在虚拟驾驶场景中模拟自动驾驶车辆的行为逻辑,通过使用helperGridBasedPlanningScenario模块中提供的模拟传感器数据来执行驾驶任务,包括障碍、路径规划和在给定驾驶场景中控制车辆。In order to ensure the fairness of the experimental results, the same initial scene was selected for different scene generation methods. The simulation software used is the automatic driving toolbox in Matlab R2021b. The toolbox provides driving scenarios, sensors, vehicle functional modules and 3D simulation modules. Based on these modules, various required automatic driving simulation models can be constructed for Simulation of autonomous driving. Use the helperGridBasedPlanningScenario module and Motion Planning in Urban EnvironmentsUsing Dynamic Occupancy Grid Map algorithm provided by the autonomous driving toolbox as the test platform and autonomous driving control algorithm in the virtual safety test to simulate the behavioral logic of the autonomous vehicle in the virtual driving scene. By using The simulated sensor data provided in the helperGridBasedPlanningScenario module is used to perform driving tasks including obstacles, path planning and controlling the vehicle in a given driving scenario.
为了验证本发明方法的有效性,在实验中,每次测试需要将场景迭代100次,最终经过多次实验后,共搜索出3种能导致智能车失去控制或与其他车辆发生碰撞的典型测试用例。In order to verify the effectiveness of the method of the present invention, in the experiment, each test needs to iterate the scene 100 times. Finally, after many experiments, a total of 3 typical tests that can cause the smart car to lose control or collide with other vehicles were searched. Example.
图10是实验过程中搜索到的一个高对抗性测试场景,在此场景中主车在公路上匀速直线行驶。当主车试图超越同方向相邻车道的两辆非主车时,此时右侧车道中的黄车发生变道,主车因速度较快且雷达探测器因非主车1对其产生了遮挡,导致主车无法及时探测到前方变道车辆,最终导致发生碰撞事故。通常情况下,人类驾驶员在遇到视觉盲区时根据实际情况会适当降低车速,尤其发现前方车辆有变道意图时,会有更谨慎的驾驶行为,从而避免发生事故。针对自动驾驶系统,如果判断探测盲区较大且主车速度较周围车辆速度较高,自动驾驶系统应采取保守的驾驶策略并降低车速。Figure 10 is a highly confrontational test scene searched during the experiment. In this scene, the main vehicle is driving in a straight line at a constant speed on the road. When the main car tried to overtake two non-main vehicles in the adjacent lane in the same direction, the yellow car in the right lane changed lanes. The main car was faster and the radar detector was blocked by non-main vehicle 1. , causing the main vehicle to be unable to detect the lane-changing vehicle ahead in time, eventually leading to a collision. Normally, when a human driver encounters a visual blind spot, he or she will reduce the speed appropriately based on the actual situation. Especially when the vehicle in front is found to be intending to change lanes, the human driver will drive more cautiously to avoid accidents. For the automatic driving system, if it is determined that the detection blind spot is large and the speed of the main vehicle is higher than that of surrounding vehicles, the automatic driving system should adopt a conservative driving strategy and reduce the vehicle speed.
为了验证车辆发生碰撞是否与前车对主车的遮挡有关,又进行了如图11所示的补充实验:通过改变红车位置,使红车无法对主车进行遮挡,最终发现主车可以成功识别黄车,并成功进行躲避操作。In order to verify whether the vehicle collision is related to the blocking of the main vehicle by the vehicle in front, a supplementary experiment as shown in Figure 11 was conducted: by changing the position of the red car so that the red car could not block the main vehicle, it was finally found that the main vehicle could successfully Identify the yellow car and successfully perform avoidance maneuvers.
验证方法的有效性需要验证本发明实施例方法是否提升了生成的输入中主车探测盲区的比例。使用本发明实施例方法、AV-fuzzer和random fuzzer,在模糊测试过程中收集每次新生成的输入,模糊测试结束后,测试这些输入中主车探测盲区的比例,并进行比较,结果如图12所示。图12中,横轴代表迭代次数,纵轴代表每代输入相对应的主车探测盲区的比例。从图12可以看出,在测试开始阶段,本发明实施例方法生成输入的主车探测盲区的比例稍低于AV-fuzzer,这是因为本发明实施例方法前期是随机产生输入,测试方法还处于探索和利用的阶段。在测试的中后阶段本发明实施例方法的盲区比例明显高于AV-fuzzer和random fuzzer,这是因为经过前面阶段的探索与利用,基于本发明方法的测试工具利用本发明实施例定义的独特适应度函数学习到的知识选择修改动作,提高了新输入中能够产生非主车对主车造成更多遮挡的可能性,从而提高了探测盲区的比例。To verify the effectiveness of the method, it is necessary to verify whether the method of the embodiment of the present invention improves the proportion of the main vehicle detection blind area in the generated input. Use the method of the embodiment of the present invention, AV-fuzzer and random fuzzer to collect each newly generated input during the fuzz testing process. After the fuzz testing is completed, test the proportion of the main vehicle detection blind area in these inputs and compare them. The results are as shown in the figure 12 shown. In Figure 12, the horizontal axis represents the number of iterations, and the vertical axis represents the proportion of the main vehicle detection blind area corresponding to each generation of input. It can be seen from Figure 12 that at the beginning of the test, the proportion of the main vehicle detection blind area generated by the method of the embodiment of the present invention is slightly lower than that of the AV-fuzzer. This is because the method of the embodiment of the present invention generates input randomly in the early stage, and the test method also In the exploration and utilization stage. In the middle and later stages of testing, the blind area ratio of the method of the embodiment of the present invention is significantly higher than that of the AV-fuzzer and the random fuzzer. This is because after the exploration and utilization in the previous stages, the testing tool based on the method of the present invention utilizes the unique characteristics defined by the embodiment of the present invention. The knowledge learned by the fitness function selects modification actions, which increases the possibility that new inputs can produce more occlusions by non-host vehicles on the host vehicle, thereby increasing the proportion of detection blind spots.
本发明实施例选择AV-fuzzer以及random fuzzer进行对比实验。测试的目标是Matlab2021b内置的路径规划算法,为了评估测试方法的总体效果,将每种方法的初始场景与变异概率设置为相同数值,在同样进行100次迭代搜索之后,对三种模糊器的有效性和效率情况进行了评估,并以图形化的方式进行表示。In the embodiment of the present invention, AV-fuzzer and random fuzzer are selected for comparative experiments. The target of the test is the built-in path planning algorithm of Matlab2021b. In order to evaluate the overall effect of the test method, the initial scenario and mutation probability of each method are set to the same value. After the same 100 iterative searches, the effectiveness of the three fuzzers is Performance and efficiency are evaluated and represented graphically.
图13(a)与图13(b)展示了在模糊器搜索相同代数的情况下,三种方法分别搜索出的危险测试用例数量。本发明实施例提出的BlindSpotsFuzz共搜索出9个不同危险测试用例,AV-fuzzer发现5个危险测试用例,而random fuzzer没有发现任何危险测试用例。在所用时间方面,BlindSpotsFuzz搜索到一个危险测试用例所需要的平均时间最少。综上所述,在相同的模糊测试时间与迭代次数内,BlindSpotsFuzz检测到了最多的危险场景。与其他方法相比,BlindSpotsFuzz能够更多基于发生碰撞的危险测试用例进行变异,并且能够在模糊测试过程中剔除无效测试用例,进一步提升了模糊搜索效率。此外BlindSpotsFuzzr发现9个危险测试用例中有4个没有被其他模糊器检测到,而AV-fuzzer发现的5个测试用例均被BlindSpotsFuzz所检测到,由此可以说明,本发明方法是对当前智能车模糊测试的有力补充。Figure 13(a) and Figure 13(b) show the number of dangerous test cases searched by the three methods when the fuzzer searches the same algebra. The BlindSpotsFuzz proposed in the embodiment of the present invention searched for a total of 9 different dangerous test cases, the AV-fuzzer found 5 dangerous test cases, and the random fuzzer did not find any dangerous test cases. In terms of time, BlindSpotsFuzz takes the least average time to search for a dangerous test case. To sum up, within the same fuzz testing time and number of iterations, BlindSpotsFuzz detected the most dangerous scenarios. Compared with other methods, BlindSpotsFuzz can mutate more dangerous test cases based on collisions, and can eliminate invalid test cases during the fuzz testing process, further improving fuzzy search efficiency. In addition, BlindSpotsFuzzr found that 4 of the 9 dangerous test cases were not detected by other fuzzers, while the 5 test cases found by AV-fuzzer were all detected by BlindSpotsFuzz. This shows that the method of the present invention is an improvement on current smart cars. A powerful addition to fuzz testing.
本发明另一实施例还提出一种自动驾驶系统探测盲区导向模糊测试系统,包括:Another embodiment of the present invention also proposes an automatic driving system detection blind spot guidance fuzzy testing system, including:
初始场景生成模块,用于根据模拟器的相关语义限制,随机生成多个初始场景,场景中包含一个内置被测自动驾驶系统的主车辆和若干个交通参与者,设定每个场景的时长,以及间隔时间节点,并取每个时间节点上交通参与者的瞬时速度与变道情况作为可变异参数;The initial scene generation module is used to randomly generate multiple initial scenes based on the relevant semantic restrictions of the simulator. The scene contains a main vehicle with a built-in autonomous driving system under test and several traffic participants. The duration of each scene is set. and interval time nodes, and take the instantaneous speed and lane changing conditions of traffic participants at each time node as variable parameters;
场景队列变异模块,用于在模拟器中运行各个初始场景,并分别通过根据主车辆传感器探测区域的盲区遮挡情况预先设计的描述场景中各车辆间安全情况的适应度函数计算适应度得分,根据各个初始场景对应得分情况,保留得分较高、安全性能较差的场景,对场景中交通参与者各时间节点的瞬时速度与变道情况进行变异;The scene queue mutation module is used to run each initial scenario in the simulator and calculate the fitness score through a pre-designed fitness function describing the safety situation between vehicles in the scene based on the blind spot occlusion of the main vehicle sensor detection area. According to Each initial scene corresponds to the score, and scenes with higher scores and poor safety performance are retained, and the instantaneous speed and lane changing conditions of traffic participants at each time node in the scene are mutated;
局部搜索模块,用于将经过变异的场景队列,作为新的用例在模拟器中运行,获得新的适应度得分,基于新的得分再次进行变异,以上过程重复进行若干次后,计算所有场景适应度得分的均值,选取得分大于均值的场景进行局部搜索,其他得分小于均值的场景进行随机重启;The local search module is used to run the mutated scene queue as a new use case in the simulator, obtain a new fitness score, and mutate again based on the new score. After the above process is repeated several times, all scene adaptations are calculated. The mean value of the degree score, select the scene with a score greater than the mean value for local search, and randomly restart the other scenes with a score less than the mean value;
初始场景更新模块,用于随机重启之后,针对适应度得分小于均值的场景,计算各场景间的相似度,保留相似度最低的几个场景作为初始场景,对初始场景更新后再次进行前述步骤;The initial scene update module is used after a random restart to calculate the similarity between scenarios for scenarios with fitness scores less than the mean, retain the lowest similarity scenarios as initial scenarios, and perform the aforementioned steps again after updating the initial scenarios;
输出场景选择模块,用于基于适应度较高的场景中的参数,再次进行变异,并在模拟器中运行变异后的场景,计算适应度得分,比较变异前后两场景的得分大小,保留较高的一个作为输出场景。The output scene selection module is used to mutate again based on the parameters in the scene with higher fitness, run the mutated scene in the simulator, calculate the fitness score, compare the scores of the two scenes before and after the mutation, and retain the higher of one as the output scene.
本发明另一实施例还提出一种电子设备,包括:存储器,存储至少一个指令;及处理器,执行所述存储器中存储的指令以实现本发明所述自动驾驶系统探测盲区导向模糊测试方法。Another embodiment of the present invention also provides an electronic device, including: a memory that stores at least one instruction; and a processor that executes the instructions stored in the memory to implement the automatic driving system detection blind spot guidance fuzz testing method of the present invention.
本发明另一实施例还提出一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现本发明所述自动驾驶系统探测盲区导向模糊测试方法。Another embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores at least one instruction. The at least one instruction is executed by a processor in an electronic device to implement the automatic operation of the present invention. Driving system detection blind spot guidance fuzzy testing method.
示例性的,所述存储器中存储的指令可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在计算机可读存储介质中,并由所述处理器执行,以完成本发明所述自动驾驶系统探测盲区导向模糊测试方法。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机程序在服务器中的执行过程。Exemplarily, the instructions stored in the memory may be divided into one or more modules/units, and the one or more modules/units are stored in a computer-readable storage medium and executed by the processor, To complete the automatic driving system detection blind spot guidance fuzzy testing method of the present invention. The one or more modules/units may be a series of computer-readable instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program in the server.
所述电子设备可以是智能手机、笔记本、掌上电脑及云端服务器等计算设备。所述电子设备可包括,但不仅限于,处理器、存储器。本领域技术人员可以理解,所述电子设备还可以包括更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备还可以包括输入输出设备、网络接入设备、总线等。The electronic device may be a computing device such as a smartphone, a notebook, a PDA, a cloud server, etc. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the electronic device may also include more or less components, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, bus etc.
所述处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor may be a Central Processing Unit (CPU), or other general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or an off-the-shelf processor. Programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
所述存储器可以是所述服务器的内部存储单元,例如服务器的硬盘或内存。所述存储器也可以是所述服务器的外部存储设备,例如所述服务器上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器还可以既包括所述服务器的内部存储单元也包括外部存储设备。所述存储器用于存储所述计算机可读指令以及所述服务器所需的其他程序和数据。所述存储器还可以用于暂时地存储已经输出或者将要输出的数据。The memory may be an internal storage unit of the server, such as a hard disk or memory of the server. The memory may also be an external storage device of the server, such as a plug-in hard drive, a smart media card (SMC), a secure digital (SD) card, a flash memory card ( Flash Card), etc. Further, the memory may also include both an internal storage unit of the server and an external storage device. The memory is used to store the computer readable instructions and other programs and data required by the server. The memory may also be used to temporarily store data that has been output or is to be output.
需要说明的是,上述模块单元之间的信息交互、执行过程等内容,由于与方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above-mentioned module units are based on the same concept as the method embodiments, and their specific functions and technical effects can be found in the method embodiments section, which will not be discussed here. Repeat.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units and modules is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs. Module completion means dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be hardware-based. It can also be implemented in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present application. For the specific working processes of the units and modules in the above system, please refer to the corresponding processes in the foregoing method embodiments, and will not be described again here.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, this application can implement all or part of the processes in the methods of the above embodiments by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program When executed by a processor, the steps of each of the above method embodiments may be implemented. Wherein, the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code to the camera device/terminal device, recording media, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electrical carrier signals, telecommunications signals, and software distribution media. For example, U disk, mobile hard disk, magnetic disk or CD, etc.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not detailed or documented in a certain embodiment, please refer to the relevant descriptions of other embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the above-mentioned implementations. The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions in the embodiments of this application, and should be included in within the protection scope of this application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311060753.7A CN117111578A (en) | 2023-08-22 | 2023-08-22 | Automatic driving system detection blind area guiding fuzzy test method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311060753.7A CN117111578A (en) | 2023-08-22 | 2023-08-22 | Automatic driving system detection blind area guiding fuzzy test method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117111578A true CN117111578A (en) | 2023-11-24 |
Family
ID=88801467
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311060753.7A Pending CN117111578A (en) | 2023-08-22 | 2023-08-22 | Automatic driving system detection blind area guiding fuzzy test method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117111578A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117909249A (en) * | 2024-03-20 | 2024-04-19 | 中国汽车技术研究中心有限公司 | Method and equipment for generating test cases of automatic driving scene |
CN118467363A (en) * | 2024-05-16 | 2024-08-09 | 青岛科技大学 | Basic Path Coverage Testing of Parallel Programs Based on Differential Evolution Algorithm |
CN118709576A (en) * | 2024-08-29 | 2024-09-27 | 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) | Accident scenario generation method and system based on autonomous driving virtual simulation |
-
2023
- 2023-08-22 CN CN202311060753.7A patent/CN117111578A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117909249A (en) * | 2024-03-20 | 2024-04-19 | 中国汽车技术研究中心有限公司 | Method and equipment for generating test cases of automatic driving scene |
CN118467363A (en) * | 2024-05-16 | 2024-08-09 | 青岛科技大学 | Basic Path Coverage Testing of Parallel Programs Based on Differential Evolution Algorithm |
CN118709576A (en) * | 2024-08-29 | 2024-09-27 | 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) | Accident scenario generation method and system based on autonomous driving virtual simulation |
CN118709576B (en) * | 2024-08-29 | 2025-01-14 | 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) | Accident scene generation method and system based on automatic driving virtual simulation |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117111578A (en) | Automatic driving system detection blind area guiding fuzzy test method and system | |
US20230159056A1 (en) | Method and apparatus for planning obstacle avoidance path of traveling apparatus | |
CN112997128B (en) | Method, device and system for generating automatic driving scene | |
JP2023027777A (en) | Method and apparatus for predicting motion track of obstacle, and autonomous vehicle | |
US20220097736A1 (en) | Vehicle Control Method and Apparatus, Storage Medium, and Electronic Device | |
CN113609784B (en) | Traffic limit scene generation method, system, equipment and storage medium | |
JP7220169B2 (en) | Information processing method, device, storage medium, and program | |
CN106428009A (en) | Vehicle trajectory determination | |
Gruber et al. | Anytime safety verification of autonomous vehicles | |
CN114511999A (en) | Pedestrian behavior prediction method and device | |
CN116562175B (en) | Method for evaluating influence of vehicle configuration on safety of automatic driving system | |
CN115062202A (en) | Method, device, equipment and storage medium for predicting driving behavior intention and track | |
US20230162539A1 (en) | Driving decision-making method and apparatus and chip | |
CN113971339B (en) | Method and system for simulating mixed traffic of people and vehicles in parking lot scene | |
CN116767218B (en) | Forced lane change decision method for unmanned vehicle, computer equipment and medium | |
CN117002528A (en) | Track planning method, apparatus and storage medium | |
CN118280104A (en) | Urban traffic simulation-based vehicle lane change control method and device | |
CN118095482A (en) | Automatic driving algorithm training method and device | |
CN117208019A (en) | Longitudinal decision method and system under perceived occlusion based on value distribution reinforcement learning | |
Ye et al. | GSAN: Graph self-attention network for interaction measurement in autonomous driving | |
CN117184128A (en) | Automatic driving parking method and device based on path planning | |
Baluja et al. | Prototyping intelligent vehicle modules using evolutionary algorithms | |
Lin et al. | TM-fuzzer: fuzzing autonomous driving systems through traffic management | |
CN118467400A (en) | Simulation background vehicle behavior control method, device, equipment and computer program product | |
CN114148344B (en) | Vehicle behavior prediction method and device and vehicle |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |