Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a scenario library construction method according to an embodiment of the present invention, where the method may be applied to a case where a test scenario included in a test scenario library does not meet a test task requirement when testing a vehicle function, and the method may be performed by a scenario library construction device, where the scenario library construction device may be implemented in a hardware and/or software form, and the scenario library construction device may be configured in a terminal and/or a server. As shown in fig. 1, the method includes:
s110, acquiring at least one test scene category associated with at least one test task, and determining the category duty ratio of each test scene category.
The test tasks may be tasks for testing different functions of the vehicle. For example, when an autopilot function of a vehicle is to be tested, its corresponding test tasks may include, but are not limited to, an adaptive cruise test, an automatic emergency brake test, a congested road condition ride test, and the like. It should be noted that the test tasks may include test tasks under actual conditions, and may also include test tasks expected to be implemented in the future, which is not particularly limited in this embodiment. The test scenario categories may be functional requirements that need to be met for performing a test task. By way of example, when the test task is an adaptive cruise test, its associated test scenario categories may include, but are not limited to, performing an appropriate vehicle launch, performing an appropriate lane change, and identifying and responding to a temporary static obstacle, etc., when the test task is an automatic emergency brake test, its associated test scenario categories may include, but are not limited to, identifying and responding to a front stop vehicle, identifying and responding to a temporary static obstacle, and identifying and responding to a front lane change cut into a vehicle, etc., and when the test task is a congested road condition ride test, its associated test scenario categories may include, but are not limited to, performing an appropriate vehicle follow, performing an appropriate lane change, and identifying and responding to an adjacent stop vehicle, etc. The category duty cycle may be a percentage of the target test scenario category among all test scenario categories associated with all test tasks.
In practical application, when performance test is required to be performed on a certain function of a vehicle, a corresponding test task can be determined according to the vehicle function to be tested, and then, the test scene category associated with each test task can be determined. Optionally, acquiring at least one test scenario category associated with at least one test task includes determining each test scenario category associated with each test task according to a pre-established correspondence between each test task and the test scenario category.
Specifically, when determining the test scenario category associated with the test task, a correspondence table between each test task and each test scenario category may be pre-established, so as to determine each test scenario category associated with each test task according to the correspondence table.
Further, in order to determine the importance degree of each test scene category, statistical analysis may be performed on the determined test scene categories to determine the number of occurrences of each test scene category, and further, the category duty ratio of each test scene category may be determined according to the occurrence frequency, so as to analyze the importance degree of each test scene category based on the category duty ratio. Optionally, determining the category duty ratio of each test scene category includes performing superposition processing on each test scene category of each test task, determining frequency information of each test scene, and determining the category duty ratio of each test scene category based on the frequency information.
The frequency information may be an occurrence frequency or an occurrence number of each test scene category.
In a specific implementation, after determining all the test scene categories associated with each test task, all the test scene categories of the test task may be subjected to superposition processing to obtain a total test scene category library corresponding to the vehicle function to be tested, and further, the number of occurrences of each test scene category in the total test scene category library is statistically analyzed to determine the category ratio based on the number of occurrences of each test scene category. For example, when the automatic driving function of the vehicle needs to be tested, the number of corresponding test tasks may be 27, each test task corresponds to a plurality of test scene categories, and after all test scene categories of the 27 test tasks are subjected to superposition processing, a total test scene category library including 500 test scene categories is obtained, where the number of times of occurrence of the test scene categories in the total test scene category library when the proper vehicle start is executed is 50, the corresponding category ratio is 10%, and the number of times of occurrence of the test scene categories in the total test scene category library when the proper line running is executed is 20, the corresponding category ratio is 4%.
S120, acquiring the number of test scenes corresponding to the test tasks for each test task, and determining a recommended test set corresponding to the test tasks based on the number of the test scenes and the category duty ratio.
The number of test scenes may be the number of test scenes required by the current test task. By way of example, the number of test scenes may be 500, 1000, 1500, etc. The recommended test set may be a set containing preferred test scenario categories. The preferred test scenario categories may be test scenario categories that have an explicit test meaning for testing vehicle functions.
Optionally, for each test task, acquiring the number of test scenes corresponding to the test task, and determining a recommended test set corresponding to the test task based on the number of test scenes and the category duty ratio, wherein the recommended test set corresponding to the test task is constructed based on the current test requirement of each test task, determining the number of scenes of each test scene category based on the number of test scenes and the category duty ratio of the test scene category, and constructing the recommended test set corresponding to the test task according to a preset effective scene library and the scene number.
The current test requirement can be a test requirement of a test developer on the vehicle function to be tested at the current moment. For example, the number of the corresponding test scenes may be 500 cases, 1000 cases, 1500 cases, or the like according to the current test requirements. The number of scenes is the number of test scene categories. The effective scene library may be a scene library which is pre-established and is used for storing effective scenes obtained by analyzing the scene effectiveness based on the vehicle function test requirements. The effective scene may be a scene having an actual test meaning in the vehicle function test, i.e., a scene useful for the vehicle function test process.
In a specific implementation, when determining the recommended test set of each test task, the current test requirement of each test task can be obtained to obtain the number of test scenes corresponding to each test task, further, according to the number of test scenes of each test task and the analog ratio of each test scene category in each test task, determining the number of each test scene category under the current number of test scenes, and based on the determined number of scenes of each test scene category, retrieving the test scene category of the target number of scenes from a pre-established effective scene library, and based on the retrieved test scene category, constructing the recommended test set corresponding to each test task.
It should be noted that, the construction of the recommended test set has the advantage that the target vehicle function can be tested based on the recommended test set in the early vehicle function development process, so that the vehicle function can be debugged according to the test result.
S130, constructing at least one scene library based on the recommended test set corresponding to each test task, and testing each scene library based on each test task to determine a target scene library based on a test result.
Wherein the scene library may be a collection of all test scenes required for testing the vehicle functions. Test results may include test pass, test fail, and test exception.
In practical application, when the scene libraries of different orders of magnitude are subjected to simulation tests of different test tasks, the obtained test effects are different, so that the scene libraries containing a proper number of test scenes need to be determined so as to realize the optimal test effect based on the scene libraries. Optionally, constructing at least one scene library based on the recommended test set corresponding to each test task includes determining at least one preset proportion for each test task, expanding the recommended test set based on the preset proportion to obtain at least one functional test set, and superposing the functional test sets of each test task to obtain at least one scene library.
In this embodiment, the preset ratio may be an expansion ratio of a preset test set. Illustratively, the preset ratio may be 1:10, 1:20, 1:50, or the like. For example, the preset ratio may be set to 1:20, the number of test scene categories in the recommended test set is 500, and the number of test scene categories in the obtained functional test set is 10000 after the recommended test set is expanded based on the preset ratio.
In a specific implementation, after determining the recommended test set corresponding to each test task, in order to determine the test effects of the scene libraries of different orders of magnitude, a plurality of preset proportions may be determined, and the recommended test set of each test task is expanded according to the preset proportions, so as to obtain a plurality of functional test sets corresponding to each test task, and further, the functional test sets of each test task are respectively subjected to superposition processing, so as to obtain a plurality of scene libraries, where each scene library corresponds to each preset proportion.
Further, the determined scene libraries are tested based on the test tasks respectively, so that test results are obtained, and a target scene library meeting the requirements can be determined based on the test results of each scene library.
Optionally, determining the target scene library based on the test result comprises determining the test passing rate, the test failure information and the test abnormality reason of each scene library according to the test result, and determining the target scene library in each scene library based on the test passing rate, the test failure information and the test abnormality reason.
In this embodiment, the test passing rate may be a ratio of the number of test scenario categories passing the test in each test task to the total number of test scenario categories. The test failure information may be a specific case of a test scenario class that fails the test in each test task. The reason for the abnormal test can be the reason for the abnormal test of the class of the test scene in each test task. Exemplary causes of test anomalies may include, but are not limited to, problems with the scene file, missing key parameters, and so forth.
In a specific implementation, after the test result of each scene library is obtained, the ratio of the number of test scene categories to the number of total scene test categories when each scene library is processed for the same test task can be determined according to the test result, the specific condition of the test scene category which fails the test is analyzed, and the error reporting reason of the abnormal test scene category is analyzed, so that the test passing rate, the test failure information and the test abnormal reason of each scene library can be analyzed to determine the target scene library with reasonable scene number and test result meeting the requirement.
It should be noted that, after determining the target scene library, the target scene library corresponds to the vehicle function to be tested, and when testing other testing tasks of the vehicle function, the target scene library can directly retrieve the testing scene.
It should be noted that, as time changes, the test scenario in the target scenario library may not meet the current actual situation, or the test scenario in the target scenario library may not meet the requirement of the test task due to the change of the newly added test task, based on which, after the target scenario library is determined, it is further required to dynamically update the target scenario library, so that the target scenario library always meets the requirement of the test task and the requirement of the actual application scenario.
Based on the technical scheme, the method further comprises the steps of updating the target scene library based on the newly added test task when the newly added test task is detected, and acquiring scene library management rules to update the target scene library based on the scene library management rules.
In practical application, when testing the same function of the vehicle, test developers may develop other test tasks different from the existing test tasks with the increase of time, and the newly developed test tasks can be used as newly added test tasks.
In this embodiment, the scene library management rule may be a rule according to which subsequent maintenance of the constructed scene library is required. By way of example, the context library management rules may include, but are not limited to, memory space, update frequency, context date requirements, context utilization statistics, and the like. For example, for a storage space, the target scene library has a fixed storage space, the storage space of the target scene library is required to be kept unchanged all the time when the test scenes are added or removed later, for the update frequency, the update period can be preset so that the target scene library can be updated periodically based on the preset update period, and for the scene date requirement, the test scenes which are far away from the current time in the target scene library can not conform to the current actual situation with the increase of the time, so that the test scenes can be removed, and the test scenes with the latest time can be supplemented in the vacated storage space.
According to the technical scheme, at least one test scene category associated with at least one test task is firstly obtained, the category proportion of each test scene category is determined, further, the number of test scenes corresponding to the test tasks is obtained for each test task, a recommended test set corresponding to the test tasks is determined based on the number of the test scenes and the category proportion, finally, at least one scene library is constructed based on the recommended test set corresponding to each test task, and each scene library is tested based on each test task to determine a target scene library based on test results, so that the problems that the test scenes in the scene library are excessively stacked, the coverage degree of the test scene category does not meet test requirements in the prior art are solved, and the technical effects of improving the test scene coverage rate, the effectiveness of the test scenes and the accuracy of subsequent test results are achieved by analyzing the category distribution of the test scene category and the optimal scale of the scene library.
Example two
Fig. 2 is a schematic structural diagram of a scene library construction device according to a second embodiment of the present invention. As shown in fig. 2, the apparatus includes a test scenario category acquisition module 210, a recommended test set determination module 220, and a target scenario library determination module 230.
The test scenario category acquiring module 210 is configured to acquire at least one test scenario category associated with at least one test task, and determine a category duty ratio of each test scenario category;
The recommended test set determining module 220 is configured to obtain, for each test task, a number of test scenes corresponding to the test task, and determine a recommended test set corresponding to the test task based on the number of test scenes and the category duty ratio;
the target scenario library determining module 230 is configured to construct at least one scenario library based on the recommended test set corresponding to each test task, and test each scenario library based on each test task, so as to determine a target scenario library based on the test result.
According to the technical scheme, at least one test scene category associated with at least one test task is firstly obtained, the category proportion of each test scene category is determined, further, the number of test scenes corresponding to the test tasks is obtained for each test task, a recommended test set corresponding to the test tasks is determined based on the number of the test scenes and the category proportion, finally, at least one scene library is constructed based on the recommended test set corresponding to each test task, and each scene library is tested based on each test task to determine a target scene library based on test results, so that the problems that the test scenes in the scene library are excessively stacked, the coverage degree of the test scene category does not meet test requirements in the prior art are solved, and the technical effects of improving the test scene coverage rate, the effectiveness of the test scenes and the accuracy of subsequent test results are achieved by analyzing the category distribution of the test scene category and the optimal scale of the scene library.
Optionally, the test scenario category obtaining module 210 includes a test scenario category determining unit, configured to determine each test scenario category associated with each test task according to a pre-established correspondence between each test task and the test scenario category.
Optionally, the test scene category obtaining module 210 further includes a category duty ratio determining unit, configured to perform superposition processing on each test scene category of each test task, determine frequency information of each test scene, and determine a category duty ratio of each test scene category based on the frequency information.
Optionally, the recommended test set determining module 220 includes a test scenario number determining unit, a scenario number determining unit, and a recommended test set constructing unit.
The test scene number determining unit is used for determining the number of the test scenes corresponding to the test tasks based on the current test requirements of the test tasks;
the scene number determining unit is used for determining the scene number of each test scene category based on the test scene number and the category occupation ratio of the test scene category;
the recommended test set construction unit is used for constructing a recommended test set corresponding to the test task according to the preset effective scene library and scene number.
Optionally, the target scenario library determining module 230 includes a scenario library constructing unit, configured to determine at least one preset proportion for each test task, to perform expansion processing on the recommended test set based on the preset proportion to obtain at least one functional test set, and to perform superposition processing on the functional test set of each test task to obtain at least one scenario library.
Optionally, the target scene library determining module 230 further includes a target scene library determining unit, configured to determine, according to the test result, a test passing rate, test failure information, and a test abnormality cause of each scene library, and determine the target scene library in each scene library based on the test passing rate, the test failure information, and the test abnormality cause.
Optionally, the device further comprises a target scene library updating module, wherein the target scene library updating module is used for updating the target scene library based on the newly added test task when the newly added test task is detected, and acquiring scene library management rules so as to update the target scene library based on the scene library management rules.
The scene library construction device provided by the embodiment of the invention can execute the scene library construction method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example III
Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including an input unit 16, such as a keyboard, mouse, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a magnetic disk, optical disk, etc., and a communication unit 19, such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the scene library construction method.
In some embodiments, the scene library construction method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the scenario library construction method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the scene library construction method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be a special or general purpose programmable processor, operable to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user, for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), a blockchain network, and the Internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.