File verification method and related device

By performing XML and XSD syntax validation on the traffic environment description files, the problem of simulation scenario failure caused by file errors was solved. The simulation scenario was built after ensuring that the files were error-free, thus avoiding resource waste and improving the simulation success rate and efficiency.

CN120832880APending Publication Date: 2025-10-24TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410452084.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-15
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

In existing technologies, traffic environment description files contain errors during simulation, which prevents the successful construction of simulated traffic scenarios, resulting in wasted processing resources and a lack of effective verification mechanisms.

Method used

A comprehensive check of traffic environment description documents is performed using XML syntax validation and XSD syntax validation to determine whether the documents contain syntax errors. This includes identifying the documents to be validated, performing XML syntax validation and XSD syntax validation based on the reference XSD documents, and generating validation results to determine whether the documents pass the validation.

Benefits of technology

Effective verification of traffic environment description files was implemented, ensuring that the files are error-free before they can be used to build simulated traffic scenarios, thus avoiding resource waste and improving the success rate and efficiency of the simulation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120832880A_ABST
    Figure CN120832880A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a file verification method in the field of maps and a related device. The method comprises the following steps: determining a traffic environment description file to be verified; performing extensible markup language (XML) grammar verification on the traffic environment description file to obtain a first verification result corresponding to the traffic environment description file; according to the type version information of the traffic environment description file, determining a reference extensible markup language architecture (XSD) file; performing XSD grammar verification on the traffic environment description file based on the reference XSD file to obtain a second verification result corresponding to the traffic environment description file; and determining whether the traffic environment description file passes the verification according to the first verification result and the second verification result. According to the method, a verification mechanism for the traffic environment description file is provided, and whether the traffic environment description file has problems or not can be effectively verified.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a file checking method and related device. BACKGROUND

[0002] In recent years, automatic driving technology and assisted driving technology develop rapidly. Simulation test, as a necessary link required for optimizing related algorithms, is crucial to promote the development of automatic driving technology and assisted driving technology. In order to realize the unification of simulation field standards, the Association for Standardization of Automation and Measuring Systems (ASAM) proposes OpenX series standards. In OpenX, OpenDRIVE file used for describing static traffic network and OpenSCENARIO file used for describing dynamic traffic scene are specified.

[0003] In actual application, a simulator reads at least one traffic environment description file in the OpenDRIVE file and the OpenSCENARIO file, and constructs a simulation traffic scene according to the traffic environment description file. However, in many cases, the traffic environment description file itself may have errors, and accordingly, the simulation traffic scene required will not be successfully constructed based on the traffic environment description file, and the process will cause waste of processing resources. In order to avoid the above situation, the required traffic environment description file can be checked before simulation, but the industry currently does not propose an effective checking mechanism for the above traffic environment description file. SUMMARY

[0004] Embodiments of the present application provide a file checking method and related device, and propose a checking mechanism for traffic environment description file, which can effectively check whether the traffic environment description file has problems.

[0005] A first aspect of the present application provides a file checking method, and the method comprises:

[0006] determining a traffic environment description file to be checked;

[0007] performing extensible markup language (XML) syntax checking on the traffic environment description file to obtain a first checking result corresponding to the traffic environment description file;

[0008] determining a reference XML schema (XSD) file according to type version information of the traffic environment description file, performing XSD syntax checking on the traffic environment description file based on the reference XSD file to obtain a second checking result corresponding to the traffic environment description file;

[0009] According to the first check result and the second check result, it is determined whether the traffic environment description file passes the check.

[0010] The second aspect of the present application provides a file check device, the device comprises:

[0011] A file determination module is configured to determine a traffic environment description file to be checked.

[0012] A first check module is configured to perform XML syntax check on the traffic environment description file to obtain a first check result corresponding to the traffic environment description file.

[0013] A second check module is configured to determine a reference XSD file according to type version information of the traffic environment description file, and perform XSD syntax check on the traffic environment description file based on the reference XSD file to obtain a second check result corresponding to the traffic environment description file.

[0014] A result determination module is configured to determine whether the traffic environment description file passes the check according to the first check result and the second check result.

[0015] The third aspect of the present application provides a computer device, the device comprises a processor and a memory:

[0016] The memory is configured to store a computer program.

[0017] The processor is configured to execute the steps of the file check method according to the computer program.

[0018] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium is used to store a computer program, the computer program is used to execute the steps of the file check method in the first aspect.

[0019] The fifth aspect of the present application provides a computer program product or a computer program, the computer program product or the computer program comprises computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of the file check method in the first aspect.

[0020] From the above technical solutions, it can be seen that the embodiments of the present application have the following advantages:

[0021] The embodiment of the present application provides a file checking method, which proposes a systematic mechanism for checking a traffic environment description file. Specifically, in the method, first, the traffic environment description file to be checked is determined, that is, the OpenDRINE file and / or the OpenSCENARIO file to be detected is determined. Then, the traffic environment description file to be checked can be subjected to XML syntax checking to obtain a first checking result corresponding to the traffic environment description file; and the type version information of the traffic environment description file to be checked can be determined to determine a reference XSD file, and the traffic environment description file is subjected to XSD syntax checking based on the reference XSD file to obtain a second checking result corresponding to the traffic environment description file. Finally, based on the first checking result and the second checking result, it is determined whether the traffic environment description file passes the checking, that is, whether the traffic environment description file has a syntax error. Therefore, through the XML syntax checking and the XSD syntax checking, the OpenDRINE file and / or the OpenSCENARIO file can be comprehensively checked and detected from two different dimensions, so that it can be accurately determined whether the traffic environment description file has a syntax error, and effective checking of the traffic environment description file is realized. Before a corresponding simulation traffic scene is constructed based on the traffic environment description file, the file checking mechanism is applied to check the traffic environment description file to be used, so that it can be detected in time whether the traffic environment description file has a problem, the traffic environment description file with a problem is modified and adjusted, and the traffic environment description file without a problem is continuously used to construct a simulation traffic scene, so that it can be ensured that the corresponding simulation traffic scene is successfully constructed based on the traffic environment description file, and waste of processing resources is avoided. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 An application scenario diagram of the file checking method provided by the embodiment of the present application is shown.

[0023] Figure 2 A flowchart of the file checking method provided by the embodiment of the present application is shown.

[0024] Figure 3 A schematic diagram of a command line process after a target checking program is run is shown.

[0025] Figure 4 A schematic diagram of an exemplary checking result report is shown.

[0026] Figure 5 A schematic diagram of a visual structure diagram of an exemplary checking result report is shown.

[0027] Figure 6A structural schematic diagram of a file verification system provided by an embodiment of the present application;

[0028] Figure 7 An interaction diagram of a file verification method provided by an embodiment of the present application;

[0029] Figure 8 A schematic diagram of an exemplary folder to be verified provided by an embodiment of the present application;

[0030] Figure 9 A structural schematic diagram of a file verification device provided by an embodiment of the present application;

[0031] Figure 10 A structural schematic diagram of a terminal device provided by an embodiment of the present application;

[0032] Figure 11 A structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the personnel in the technical field without creative labor fall within the scope of protection of the present application.

[0034] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to include only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0035] The file verification method provided in the embodiments of the present application can be executed by a computer device, which can be a terminal device or a server. Among them, terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, autonomous driving, etc.

[0036] It should be noted that the information, data, and signals involved in the embodiments of this application are authorized by the relevant objects or fully authorized by all parties, and the collection, use, and processing of relevant data comply with the relevant laws, regulations, and standards of relevant countries and regions.

[0037] In order to facilitate understanding of the file verification method provided in the embodiment of the present application, the application scenario of the file verification method is exemplarily introduced below, taking the execution subject of the file verification method as a terminal device as an example.

[0038] See also Figure 1 , Figure 1 Schematic diagram of the application scenario of the file verification method provided in the embodiment of the present application. Figure 1 As shown, the application scenario includes a terminal device 110, which includes a storage area, such as a memory and a disk. The traffic environment description file to be verified can be pre-stored in the storage area of ​​the terminal device 110.

[0039] A target verification program is running in the terminal device 110, which implements the file verification method provided in the embodiment of the present application through the target verification program, performs XML syntax verification and XSD syntax verification on the traffic environment description file to be verified, and determines whether the traffic environment description file passes the verification.

[0040] In actual application, before starting the target verification program, the storage path of the traffic environment description file to be verified in the terminal device 110 can be pre-specified. After determining the storage path of the traffic environment description file to be verified, the target verification program can be started by entering a run command, and verification can be performed based on the traffic environment description file corresponding to the storage path.

[0041] Then, the target verification program running on the terminal device 110 can perform an XML syntax check on the traffic environment description file to obtain a first verification result corresponding to the traffic environment description file. Alternatively, a reference XSD file can be determined based on the type and version information of the traffic environment description file, and an XSD syntax check can be performed on the traffic environment description file based on the reference XSD file to obtain a second verification result corresponding to the traffic environment description file.

[0042] Finally, the target verification program running in the terminal device 110 can determine whether the traffic environment description file passes the verification based on the first verification result and the second verification result. Thus, through the XML syntax verification and the XSD syntax verification, the OpenDRIVE file and / or the OpenSCENARIO file can be comprehensively verified and detected from two different dimensions, so that it can be accurately determined whether the traffic environment description file has a syntax error, and effective verification of the traffic environment description file is realized. Before a corresponding simulation traffic scene is constructed based on the traffic environment description file, the above file verification mechanism is applied to verify the traffic environment description file to be used, so that it can be detected in time whether the traffic environment description file has a problem, the traffic environment description file with a problem is modified and adjusted, and the traffic environment description file without a problem is continuously used to construct a simulation traffic scene, so that it can be ensured that the corresponding simulation traffic scene can be successfully constructed based on the traffic environment description file, and waste of processing resources is avoided.

[0043] It should be understood that Figure 1 The application scenarios shown are only examples, and in actual applications, the file verification method provided by the embodiments of the present application can also be applied to other scenarios, and the application scenarios of the file verification method provided by the embodiments of the present application are not limited herein.

[0044] The file verification method provided by the present application will be described in detail below through method embodiments.

[0045] Referring to Figure 2 , Figure 2 a flowchart of the file verification method provided by the embodiments of the present application. For ease of description, the following describes the file verification method by taking a terminal device as an example. As Figure 2 shown, the file verification method includes the following steps:

[0046] S201: Determine a traffic environment description file to be verified.

[0047] The traffic environment description file is the verification object of the file verification method provided by the embodiments of the present application; it is a file for describing a simulation traffic scene, and specifically can be used to describe static elements (such as roads, intersections, infrastructure, etc.) in the simulation traffic scene, or can be used to describe dynamic elements (such as vehicles, pedestrians, etc. on the road) in the simulation traffic scene.

[0048] Specifically, the traffic environment description file can be an OpenDRIVE file or an OpenSCENARIO file, or the traffic environment description file can also include both the OpenDRIVE file and the OpenSCENARIO file. The OpenDRIVE file refers to a part of the ASAM simulation standard, and the OpenDRIVE file defines a storage format for describing a static traffic network and enables the road environment in the simulation test to be described, and the format complies with the XML syntax. The OpenSCENARIO file contains instructions and file composition patterns for dynamic traffic scenarios in the simulation application process, and is mainly used to describe complex operating conditions of multiple vehicles, and is used in the field of virtual development, testing and verification of assisted driving and automatic driving functions. At the same time, the OpenSCENARIO file can be used in combination with the static traffic network information about driving simulation in ASAM OpenDRIVE and ASAM OpenCRG, which is an open continuous road data representation format, to be applied to simulation testing.

[0049] The suffix of the OpenDRIVE file can be an extensible open driving route exchange format (xodr), and the suffix of the OpenSCENARIO file can be an open scenario description format xosc. The xosc aims to provide a general and extensible scenario description language to facilitate interoperability between different automatic driving simulators and sensor simulators, and mainly describes various elements in the map scenario, such as vehicles, roads, and sensor data, by defining a series of XML tags and attributes, so as to simulate and test in the simulation environment.

[0050] The traffic environment description file can be pre-stored in the storage area of the terminal device. Before starting the target verification program by running a command, the storage path of the traffic environment description file to be verified in the terminal device can be pre-specified, for example, the root directory where the traffic environment description file to be verified is located can be directly input in the command line interface of the target verification program, such as D: / datafiles, so as to perform file verification based on the storage path of the traffic environment description file to be verified. The command line refers to a way of interacting with the computer operating system by typing commands and parameters, and the user can input commands in the command line interface and execute the commands by pressing the enter key.

[0051] In a possible implementation, the above-mentioned "determining the traffic environment description file to be verified" can include:

[0052] When the processing path of the target verification program is the root directory of the folder to be verified, the target verification program is run, and the target verification program is deployed in a container environment and is used for verifying the traffic environment description file.

[0053] Through the target verification program, for each file in the to-be-verified folder, it is detected whether the suffix of the file is the target suffix; if yes, it is determined that the file is the traffic environment description file to be verified; if no, the file is skipped.

[0054] The target verification program refers to an application program for executing the file verification method provided by the embodiments of the present application, and the target verification program is deployed in a container environment and is used for verifying the traffic environment description file. The container environment refers to a form of virtualization of an operating system, and an application program can be packaged into a movable computing environment. Therefore, after the container environment is installed and deployed in a terminal device, the overhead during startup can be reduced, and the containerized application program does not need to set a separate guest operating system for each application program, because they share an operating system kernel. Therefore, the container environment helps to more quickly and safely create and deploy the target verification program.

[0055] As an example, the container environment Docker can be installed and deployed in a terminal device, and the target verification program and its dependencies (database, system tools, etc.) can be packaged into a standardized unit called a container in the Docker environment. Then, the container can be run in any Docker-supported environment, thereby improving the running flexibility and portability of the verification process and improving the work efficiency of the operation and maintenance personnel.

[0056] After the Docker environment is deployed, the traffic environment description file to be verified can be determined in the storage area of the terminal device. For example, the traffic environment description file to be verified can be prepared in the storage area of the terminal device in advance (such as importing the traffic environment description file to be verified into the storage area of the terminal device, or creating and editing the traffic environment description file to be verified in the storage area of the terminal device), and then the traffic environment description file to be verified can be stored in a folder, i.e., a to-be-verified folder.

[0057] In the to-be-verified folder, different traffic environment description files can be stored in different sub-folders according to the types of the traffic environment description files. For example, xodr files and xosc files can be stored in different sub-folders under the to-be-verified folder. For example, the root directory of the to-be-verified folder is “D: / datafiles”, the sub-folders under the to-be-verified folder are “D: / datafiles / xosc” and “D: / datafiles / xodr”, and the sub-folders contain corresponding traffic environment description files, such as “a.xosc” and “b.xosc” in “D: / datafiles / xosc” and “a.xodr” and “b.xodr” in “D: / datafiles / xodr”. Of course, various sub-folders can also be customized in the to-be-verified folder, and other related files can also be stored. The present application does not limit the specific content and storage form of the to-be-verified folder.

[0058] When the processing path of the target verification program is the root directory of the to-be-verified folder, that is, when the command line indicates the root directory of the to-be-verified folder, a run command can be input to run the target verification program. The run command refers to an instruction for starting the target verification program, for example, “docker run”.

[0059] After starting the target verification program, the suffix of each file in the to-be-verified folder can be detected. The target suffix refers to the file suffix that the verification object of the file verification method provided by the present application should contain, for example, xodr or xosc. As an example, the target verification program detects each file in the to-be-verified folder. By obtaining the storage path of the file, it can be detected whether the suffix of the file in the to-be-verified folder is the target suffix, that is, xodr or xosc. If yes, it is determined that the file is a to-be-verified traffic environment description file. If not, the file is skipped and the file can also be recorded in a log file for subsequent backtracking and timely understanding of the verification process.

[0060] Thus, when the processing path of the target verification program deployed in the docker environment is the root directory of the to-be-verified folder, the target verification program can be started by running a command line, so that the target verification program can detect the file suffix of each file in the to-be-verified folder, detect whether it is a target suffix, and determine whether the file is a traffic environment description file to be verified according to the detection result. It can be seen that after running the target verification program, the traffic environment description file in the to-be-verified folder can be filtered in advance according to the target suffix, thereby reducing the workload of subsequent syntax verification. At the same time, the target verification program is deployed in the docker environment, realizing containerized deployment, making the installation and use process of the operating system to which the target verification program belongs more simple and convenient, and improving the portability and compatibility of the operating system.

[0061] S202: Perform XML syntax verification on the traffic environment description file to obtain a first verification result corresponding to the traffic environment description file.

[0062] XML syntax verification refers to checking the structure and syntax of an XML document to detect whether it conforms to XML specifications. For example, in an XML document, tags must be nested and closed according to strict syntax rules, attributes must be enclosed in quotes, and special characters must be escaped. XML syntax verification can help developers discover and correct errors in XML documents in a timely manner, ensuring that they can be properly processed during parsing and processing.

[0063] XML syntax verification can be performed on the to-be-verified traffic environment description file to obtain a first verification result corresponding to the traffic environment description file. The first verification result indicates whether the to-be-verified traffic environment description file passes XML syntax verification. If it passes, the first verification result can be XML verification qualified, and if it does not pass, the first verification result can be XML verification unqualified. In addition, when the first verification result is XML verification unqualified, corresponding error or warning information can be output to facilitate timely correction of the error.

[0064] In one possible implementation, the above "performing XML syntax verification on the traffic environment description file to obtain a first verification result corresponding to the traffic environment description file" can include:

[0065] By the target verification program, the traffic environment description file is parsed based on the preset XML syntax verification rule to detect whether the traffic environment description file conforms to the XML syntax specification indicated by the XML syntax verification rule to obtain the first verification result.

[0066] The preset XML syntax checking rule refers to a rule referred to when performing XML syntax checking on the traffic environment description file. The preset XML syntax checking rule can be formulated by a standardization organization of XML, or can also be adjusted as appropriate for OpenDRIVE files and / or OpenSCENARIO files. For example, the preset XML syntax checking rule can include the nesting of tags, each tag must be nested in the correct hierarchy, for example, each start tag must have a corresponding end tag, and the tags cannot be crossed or improperly nested; the attribute values in the XML document must be enclosed in quotes, and the quotes must appear in pairs; special characters in the XML document, such as "&", "<", ">", etc., must be replaced with corresponding escape sequences or entity references, and cannot be used directly.

[0067] It should be noted that the target checking program includes an XML parser, and the XML parser is configured to parse the traffic environment description file based on the preset XML syntax checking rule. For example, the XML parser can be a parsing tool DOM parser, SAX parser or other parser in a programming language, and the present application does not limit the specific XML parser.

[0068] As an example, through the XML parser in the target checking program, the traffic environment description file can be parsed based on the preset XML syntax checking rule, and it is detected whether the syntax in the traffic environment description file conforms to the XML syntax specification indicated by the XML syntax checking rule, thereby obtaining a first checking result for indicating whether the syntax in the traffic environment description file conforms to the XML syntax specification.

[0069] Therefore, in the above manner, by the target checking program, the traffic environment description file is subjected to XML syntax checking based on the preset XML syntax checking rule, so that a first checking result for indicating whether the traffic environment description file passes the XML syntax checking can be quickly and accurately obtained.

[0070] S203: According to the type version information of the traffic environment description file, determine to refer to an extensible markup language schema XSD file; perform XSD syntax checking on the traffic environment description file based on the referred XSD file, and obtain a second checking result corresponding to the traffic environment description file.

[0071] The XSD file refers to a file used to define the structure, content and data type of an XML document, and is usually used to describe the structural constraints of an XML document. Through the XSD file, it can be determined that the XML document conforms to a specific type version and constraint condition. The reference XSD file refers to the standard XSD file that is used as the basis for XSD syntax checking of the traffic environment description file. The standard XSD file has a one-to-one correspondence relationship with the type version information. The standard XSD file is used to specify the characteristics that the XML file of the corresponding type version information should have, i.e., the constraint conditions, XML document structure, etc. in the standard XSD file. The standard XSD file is formulated by a standard committee and can be pre-stored in the built-in storage area of the terminal device or in the container environment. The application does not specifically limit the storage location of the standard XSD file.

[0072] The type version information refers to the type and version number of the traffic environment description file, for example, revMajor can be used to represent the major version number of the traffic environment description file, revMinor can be used to represent the minor version number of the traffic environment description file, and the file suffix can be used to distinguish the type of the traffic environment description file.

[0073] After the reference XSD file is determined, the traffic environment description file can be subjected to XSD syntax checking based on the reference XSD file to obtain a second checking result corresponding to the traffic environment description file.

[0074] XSD syntax checking refers to syntax checking of an XML file based on an XSD file to ensure that it conforms to the structure and rules of the XML document specified in the reference XSD file. For example, the reference XSD file can specify the use of basic data types (such as strings, numbers, Boolean values, etc.) and derived data types (such as dates, times, durations, etc.) to define the data format and value range of elements and attributes, and can use constraint conditions to limit the value range and format of elements and attributes. XSD syntax checking can be based on the reference XSD file to help developers discover and correct structural errors and rule errors in XML documents in a timely manner, ensuring that they can be correctly processed during parsing and processing.

[0075] The target checking program is used to perform XSD syntax checking on the traffic environment description file to be checked, and a second checking result corresponding to the traffic environment description file can be obtained. The second checking result is used to indicate whether the traffic environment description file to be checked passes the XSD syntax checking. If it passes, the second checking result can be XSD checking qualified, and if it does not pass, the second checking result can be XSD checking unqualified.

[0076] In one possible implementation, after the target checking program is run, the application embodiment further includes:

[0077] Load the XSD file library in the container environment; the XSD file library stores the standard XSD files corresponding to various type version information in the form of a dictionary of key-value pairs, and the standard XSD files are used to specify the characteristics that the XML files corresponding to the type version information should have.

[0078] The XSD file library includes standard XSD files corresponding to various type version information stored in the form of a dictionary of key-value pairs. Among them, the key can be composed of the type and version number corresponding to the standard XSD file, and the value can indicate the storage path of the standard XSD file, for example, the key is OpenSCENARIO_revMajor_revMinor or OpenDRIVE_revMajor_revMinor, and the value can be the storage path of the corresponding standard XSD file. For example, the XSD file library can include: {key1: "xodr1.4", value1: "D: / XSD / a.xsd", key2: "xodr1.5", value2: "D: / XSD / b.xsd"…}. The application does not specifically limit the content of the XSD file library.

[0079] As an example, after running the target verification program, the pre-acquired XSD file library can be loaded in the container environment, thereby facilitating subsequent XSD syntax verification based on the standard XSD files in the XSD file library.

[0080] Therefore, by the above-mentioned manner, the XSD file library composed of standard XSD files stored in the form of a dictionary of key-value pairs is loaded in the container environment, and the reference XSD file used for verifying the traffic environment description file can be accurately and quickly found based on the key-value pair information in the XSD file library.

[0081] In a possible implementation, "determining a reference extensible markup language schema XSD file according to type version information of the traffic environment description file" can include:

[0082] Determining the type version information as the reference key according to the suffix and version number of the traffic environment description file through the target verification program;

[0083] Finding the standard XSD file corresponding to the type version information as the reference XSD file based on the reference key in the XSD file library through the target verification program.

[0084] As an example, through the target verification program, the type of the reference key can be determined according to the suffix of the traffic environment description file, for example, when the suffix is "xodr", it can be determined that the traffic environment description file is an OpenDRIVE file; when the suffix is "xosc", it can be determined that the traffic environment description file is an OpenSCENARIO file, and then according to the version number information recorded in the traffic environment description file, the version number of the reference key can be determined, for example, according to the attribute values corresponding to the major version number revMajor and the minor version number revMinor in the traffic environment description file, the major version number and the minor version number of the traffic environment description file can be determined. Finally, the type of the reference key and the version number of the reference key determined are combined, that is, the type version information of the reference key can be determined. The reference key refers to a mark used to find the corresponding standard XSD file in the XSD file library. For example, the type version information of the reference key is "OpenSCENARIO_revMajor_revMinor" or "OpenDRIVE_revMajor_revMinor", corresponding to specific attribute values, and the type version information of the reference key can be "xosc1.2" or "xodr1.4", etc. The application does not specifically limit the type version information of the reference key.

[0085] After determining the type version information of the reference key, the target verification program can find the standard XSD file corresponding to the type version information in the XSD file library based on the reference key, that is, find the value information corresponding to the reference key in the XSD file library, and the XSD file indicated by the value information is the standard XSD file corresponding to the type version information of the traffic environment description file to be verified, that is, the reference XSD file.

[0086] Therefore, based on the file suffix and version number of the traffic environment description file, the type version information of the reference key can be determined, and then the corresponding standard XSD file can be found in the XSD file library based on the determined reference key, so that the reference XSD file can be accurately determined, and the accuracy of XSD syntax verification is improved.

[0087] In a possible implementation, the above "performing XSD syntax verification on the traffic environment description file based on the reference XSD file to obtain a second verification result corresponding to the traffic environment description file" can include:

[0088] Through the target verification program, whether the traffic environment description file has the feature is detected based on the feature specified in the reference XSD file to obtain the second verification result.

[0089] As an example, the features specified in the reference XSD file include that a namespace should be declared in the XSD file, and the structure of the XML file needs to be defined; each element and attribute in the XML document should specify a name and a data type and other necessary constraints, such as the minimum length of different data corresponding to different XSD files, etc.; when defining a complex type, the structure, order, data type, etc. of the element need to be defined; the naming of the element and attribute should comply with the naming specification of XML, etc.

[0090] By the target verification program, based on the features specified in the reference XSD file, it can be detected whether the traffic environment description file has the features specified in the reference XSD file. If it has, it means that the traffic environment description file passes the XSD syntax verification, and the second verification result is XSD verification qualified. If it does not have, it means that the traffic environment description file does not pass the XSD syntax verification, and the second verification result is XSD verification unqualified.

[0091] Therefore, by the target verification program, based on the features specified in the reference XSD file, it is detected whether the traffic environment description file has the features specified in the reference XSD file. The XSD syntax verification is automatically performed, and the second verification result indicating whether the traffic environment description file passes the XSD syntax verification can be quickly and accurately obtained, and the complexity and error rate of manual verification are reduced.

[0092] S204: Determine whether the traffic environment description file passes the verification according to the first verification result and the second verification result.

[0093] Finally, based on the results of the XML syntax verification indicated by the first verification result and the results of the XSD syntax verification indicated by the second verification result, the target verification program can determine whether the traffic environment description file passes the verification. As an example, when any one of the first verification result and the second verification result contains unqualified verification, it is considered that the traffic environment description file does not pass the verification; when the first verification result and the second verification result are both qualified verification, it is considered that the traffic environment description file passes the verification. For example, refer to Figure 3 , Figure 3 A schematic diagram of a command line process after the target verification program provided by an embodiment of the present application is run, Figure 3 The number of traffic environment description files (failed) that do not pass the verification, the number of warning information (warnings) of the operating system to which the target verification program belongs, the number of files that pass the verification (passed), and the time consumed by the target verification program for file verification.

[0094] In a possible implementation, the traffic environment description file to be verified can be verified by the multi-thread concurrent verification of the embodiment of the present application, which can specifically include:

[0095] The target verification program assigns corresponding file verification tasks to multiple threads based on the to-be-verified folder, so that the multiple threads concurrently execute their respective file verification tasks; wherein the file verification task is used to indicate the files in the to-be-verified folder that a thread needs to process, and instruct the thread to perform XML syntax verification and XSD syntax verification on the traffic environment description file therein, so as to determine whether the traffic environment description file passes the verification.

[0096] A thread refers to the smallest unit that can be independently scheduled in an operating system, and in this application, the thread is used to execute the assigned file verification task, so that the multiple threads can concurrently execute their respective file verification tasks to determine whether the traffic environment description file in the to-be-verified folder passes the verification.

[0097] The file verification task refers to the task that a thread needs to process in the to-be-verified folder, so that each thread can perform XML syntax verification and XSD syntax verification based on the traffic environment description file in the to-be-verified folder, so as to determine whether the corresponding traffic environment description file passes the verification based on the first verification result and the second verification result corresponding to each traffic environment description file.

[0098] As an example, when the root directory of the to-be-verified folder is determined, the target verification program can call the maximum Central Processing Unit (CPU) resources of the operating system to assign corresponding file verification tasks to multiple threads based on the to-be-verified folder. For example, assuming that the to-be-verified folder includes 60 files, and at this time, 3 threads (thread a, thread b and thread c) can be called to execute the file verification task. Accordingly, thread a can be assigned a file verification task indicating that it processes the first 20 files (first filter the to-be-verified traffic environment description file from the first 20 files according to the target suffix, and then perform file verification on the to-be-verified traffic environment description file), thread b can be assigned a file verification task indicating that it processes the 21st-40th files (first filter the to-be-verified traffic environment description file from the 21st-40th files according to the target suffix, and then perform file verification on the to-be-verified traffic environment description file), and thread c can be assigned a file verification task indicating that it processes the 41st-60th files (first filter the to-be-verified traffic environment description file from the 41st-60th files according to the target suffix, and then perform file verification on the to-be-verified traffic environment description file).

[0099] Of course, in actual applications, other ways other than equal division can be used to assign corresponding file verification tasks to multiple threads, and the embodiments of the present application do not make any limitation in this regard.

[0100] When the file verification tasks required to be performed by the plurality of threads are determined, the plurality of threads can perform the corresponding file verification tasks in parallel, so that the plurality of threads can perform XML syntax verification and XSD syntax verification on the traffic environment description files respectively processed by the plurality of threads based on the file verification method provided in the embodiments of the present application, to determine the first verification result and the second verification result of each traffic environment description file, so as to determine whether each traffic environment description file passes the verification according to the corresponding first verification result and second verification result.

[0101] Therefore, based on the plurality of threads, it can be determined in parallel whether the traffic environment description files to be verified in the to-be-verified folder pass the verification, and the file verification is performed in a concurrent processing manner, which not only efficiently utilizes the computing resources in the operating system to which the target verification program belongs, saves manpower and time resources, but also improves the verification efficiency and the concurrent processing capability of the operating system.

[0102] The file verification method provided in the embodiments of the present application proposes a systematic verification mechanism for traffic environment description files. Specifically, in the method, the traffic environment description files to be verified are first determined, that is, the OpenDRINE files and / or OpenSCENARIO files to be detected are first determined. Then, the traffic environment description files to be verified can be subjected to XML syntax verification to obtain the first verification result corresponding to the traffic environment description files, and the type version information of the traffic environment description files to be verified can be used to determine the reference XSD file, and the traffic environment description files can be subjected to XSD syntax verification based on the reference XSD file to obtain the second verification result corresponding to the traffic environment description files. Finally, based on the first verification result and the second verification result, it is determined whether the traffic environment description files pass the verification, that is, whether the traffic environment description files have syntax errors. Therefore, through XML syntax verification and XSD syntax verification, the OpenDRINE files and / or OpenSCENARIO files can be comprehensively verified and detected from two different dimensions, so that it can be accurately determined whether the traffic environment description files have syntax errors, and effective verification of the traffic environment description files can be achieved. Before a corresponding simulation traffic scene is constructed based on the traffic environment description files, the file verification mechanism is applied to verify the traffic environment description files to be used, so that it can be detected in time whether the traffic environment description files have problems, the traffic environment description files having problems are modified and adjusted, and the traffic environment description files not having problems are continuously used to construct the simulation traffic scene, so that it can be ensured that the corresponding simulation traffic scene can be successfully constructed based on the traffic environment description files, and waste of processing resources can be avoided.

[0103] In a possible implementation, the embodiments of the present application can also generate and save a verification result report according to the information generated in the above verification process, which can specifically include:

[0104] Through the target verification program, a verification result report corresponding to the to-be-verified folder is generated, and the verification result report is saved to the root directory of the to-be-verified folder.

[0105] The verification result report is used to indicate the result of verifying the files in the to-be-verified folder, and the verification result report can include the files of the non-traffic environment description file, the traffic environment description files that pass the verification, and the verification details of the traffic environment description files that do not pass the verification.

[0106] As an example, in order to facilitate the user to intuitively understand the verification result report, the format of the verification result report can be the HyperText Markup Language (HTML) format, which can not only use various tags and styles to create rich visual effects, but also can embed hyperlinks, buttons and other elements in the HTML format, which can one-click jump to the error position, and facilitate the user to modify and adjust in time according to the verification result report. Of course, the verification result report in the present application can also adopt other formats, for example, the Portable Document Format (PDF) format, the document WORD format and the electronic spreadsheet EXCEL format, etc., and the present application does not specifically limit the format of the verification result report.

[0107] After completing the file verification of all the traffic environment description files in the to-be-verified folder, the target verification program can generate a corresponding verification result report based on the verification results generated in the verification process for each file in the to-be-verified folder, and the verification result report can be saved to the root directory of the to-be-verified folder.

[0108] As an example, the naming format of the verification result report can be determined based on the generation time of the verification result report, for example, “YYYY-MM-DD_HH-mm-ss” is the generation time of the verification result report, and the naming of the verification result report can be “OpenSCENARIO_OpenDRIVE_Syntax_Check_Report_YYYY-MM-DD_HH-mm-ss.html”, and the present application does not specifically limit the naming of the verification result report.

[0109] Thus, the target verification program can generate a verification result report corresponding to the traffic environment description file in the to-be-verified folder, and through the verification result report corresponding to the traffic environment description file, the traffic environment description file that passes the file verification and the traffic environment description file that fails the file verification can be explicitly indicated, and the corresponding verification details information of each traffic environment description file can be obtained, so that the user can view the verification result and find potential problems in time, and thus the traffic environment description file can be modified and adjusted according to the detailed verification result report, which is helpful for the user to optimize and improve the simulation traffic scene.

[0110] In a possible implementation, the verification result report can include a report name, test environment information, report result summary information, and error detail information.

[0111] The report result summary information is used to indicate the files that pass the verification, the files that fail the verification, and the files that skip the verification in the to-be-verified folder, and the error detail information is used to indicate the error details of the files that fail the verification.

[0112] For reference Figure 4 , Figure 4 An exemplary verification result report provided by the embodiments of the present application is shown in the schematic diagram. As an example, the report name is “OpenSCENARIO_OpenDRIVE_Syntax_Check_Report_2024-02-07_03-38-41.html”, the test environment information is Environment, the report result summary information is Summary, and the error detail information is Failed. The test environment information refers to the environment information of the target verification program in the operating system, for example, the version number of the programming language used, the version information of the test platform, the plug-in information, and the installation package information, etc. The present application does not specifically limit the content in the test environment information.

[0113] As an example, the report result summary information includes the names and quantities of the traffic environment description files that pass the verification, the names and quantities of the traffic environment description files that fail the verification, and the names and quantities of the files that skip the verification (the files that are not traffic environment description files to be verified screened out by the target suffix) in the to-be-verified folder.

[0114] The error information of the traffic environment description file that fails to pass the verification, i.e., error detail information, can also be displayed in the verification result report. The error detail information includes information of a syntax error in the traffic environment description file that fails to pass the verification, for example, a storage path of the traffic environment description file that fails to pass the verification, a reason for the syntax error in the traffic environment description file that fails to pass the verification, and a position of the syntax error in the traffic environment description file that fails to pass the verification. The reason for the syntax error in the traffic environment description file that fails to pass the verification can be marked by an error code, for example, the reason for the syntax error in the traffic environment description file that fails to pass the verification can be marked by a syntax error SyntaxError, and then the position of the syntax error in the traffic environment description file that fails to pass the verification can be jumped to by a hyperlink, and the syntax error at the position can be modified. The content of the error detail information is not specifically limited in the present application.

[0115] Therefore, based on the information recorded in the verification result report, a detailed verification result report can be provided for the user, which helps the user to view the verification result and the error detail of the traffic environment file that fails to pass the verification, so that the user can timely modify and adjust based on the error detail information recorded in the verification result report, and potential problems and risks can be found and solved in advance, and the safety of simulation testing is improved.

[0116] In a possible implementation, the embodiments of the present application can further include:

[0117] The verification result report corresponds to a visual structure diagram, the visual structure diagram includes nodes corresponding to each file in the to-be-verified folder, the display forms of the nodes corresponding to the files that pass the verification, the files that fail to pass the verification, and the files that skip the verification are different, and the nodes support triggering the viewing of the verification detail information of the corresponding files.

[0118] The visual structure diagram refers to displaying the verification result report in a visual manner, for example, a tree diagram or a mind map can be used to display the verification result report. The visual structure diagram can include nodes corresponding to each file in the to-be-verified folder, i.e., nodes corresponding to the traffic environment description files that pass the verification, nodes corresponding to the traffic environment description files that fail to pass the verification, and nodes corresponding to the files that skip the verification.

[0119] At the same time, in the visual structure diagram, the nodes corresponding to the traffic environment description files that have passed the verification, the nodes corresponding to the traffic environment description files that have not passed the verification, and the nodes corresponding to the files that have skipped the verification can be displayed in different forms. For example, the nodes corresponding to different files can be distinguished by color, such as the nodes corresponding to the traffic environment description files that have passed the verification can be displayed in a first color, the nodes corresponding to the traffic environment description files that have not passed the verification can be displayed in a second color, and the nodes corresponding to the files that have skipped the verification can be displayed in a third color.

[0120] In addition, the nodes corresponding to the above files also support responding to the user's trigger operation and displaying the verification details information of the corresponding files. The verification details information of the file refers to the display of the file verification status of the corresponding node. For example, the verification details information of the traffic environment description file that passed the verification may include the name and storage path of the traffic environment description file that passed the verification, and the verification details information of the traffic environment description file that failed the verification may include the storage path of the traffic environment description file that failed the verification and the location of the grammatical error in the traffic environment description file that failed the verification, etc. The verification details of the file that skipped the verification may include the name and storage path of the file that skipped the verification. In this regard, the present application does not specifically limit the display form of each node in the visual structure diagram and the verification details corresponding to each node.

[0121] As an example, see Figure 5 , Figure 5 A schematic diagram of a visual structure diagram of an exemplary verification result report provided in an embodiment of the present application is shown in FIG. Figure 5 In the mind map shown, the "Unverified Folder" is the root node. It contains three branch nodes: traffic environment description files that passed verification, traffic environment description files that failed verification, and files that skipped verification. Each of these three branch nodes further contains leaf nodes corresponding to the files, each containing verification details for the corresponding file. Clicking on a branch node displays the corresponding leaf node.

[0122] For example, assuming that the leaf nodes corresponding to the traffic environment description files that pass the verification can be xodr1, xodr2 and xodr3, and clicking each leaf node can trigger viewing of the file and viewing of the verification details corresponding to the file, such as that the 20th-40th paragraph of code in the file is subjected to XML syntax verification, the 60th-99th paragraph of code in the file is subjected to XSD syntax verification, and the above contents all meet the verification requirements of XML syntax verification and XSD syntax verification; assuming that the leaf nodes corresponding to the traffic environment description files that fail the verification can be xosc1, xosc2 and xosc3, and clicking each leaf node can trigger viewing of the file and viewing of the verification details corresponding to the file, such as that the 12th-45th paragraph of code in the file is subjected to XML syntax verification, the 34th-45th paragraph of code does not meet the verification requirements of XML syntax verification, the 65th-128th paragraph of code is subjected to XSD syntax verification, and the 78th-98th paragraph of code does not meet the verification requirements of XSD syntax verification; and assuming that the leaf nodes corresponding to the files that are skipped from the verification are aeds1, aeds2 and aeds3, and clicking each leaf node can trigger viewing of the file and viewing of the verification details corresponding to the file, such as that the file suffix of the file is not the target suffix, and the file is skipped. The application does not specifically limit the content in the visual structure diagram.

[0123] Thus, the verification report is displayed in the form of a visual structure diagram, the display of the verification result report is optimized, the user can intuitively understand the file verification situation in the to-be-verified folder, and the user can quickly locate the syntax error in the verification result report, the visual structure diagram provides an interactive function for the user, the user can expand or fold the nodes according to needs to view detailed verification detail information, and the user experience and operation efficiency are improved.

[0124] In a possible implementation, the embodiments of the application can further include:

[0125] In the case that the traffic environment description file fails the verification, the traffic environment description file is modified based on a file modification mechanism, and the file modification mechanism is provided with a plurality of modification manners corresponding to respective error forms.

[0126] The file modification mechanism refers to the mechanism followed when modifying the traffic environment description file that fails the verification. The file modification mechanism includes multiple modification methods corresponding to various error forms. For example, if the error form is that the tags are not properly closed, the corresponding modification method is to match the tags one by one, and when an unclosed tag is found, the corresponding tag is added to ensure that all tags are properly closed. If the error form is that the characters in the XML are not escaped, the corresponding modification method is to repair the character to the corresponding character reference. If the error form is that the XML attribute value is not enclosed by quotation marks, the corresponding modification method is to add quotation marks to the XML attribute value. The present application does not specifically limit the content of the file modification mechanism.

[0127] After determining the traffic environment description file that fails the verification, the syntax error in the traffic environment description file that fails the verification can be modified according to the modification method recorded in the file modification mechanism. It should be noted that the syntax error in the traffic environment description file that fails the verification can be automatically modified by the operating system to which the target verification program belongs according to the file modification mechanism, or the syntax error in the traffic environment description file that fails the verification can be manually modified by the staff according to the modification method recorded in the file modification mechanism.

[0128] Therefore, based on the file modification mechanism, the modification of the traffic environment description file that fails the verification can be automatically and efficiently completed, the file verification process becomes more complete, and potential problems in the traffic environment description file can be solved in a timely manner, thereby ensuring the safety of the simulation test process.

[0129] In a possible implementation, the present application provides a file verification system, i.e., an operating system to which a target verification program belongs, which can refer to Figure 6 , Figure 6 The present application provides a structural schematic diagram of a file verification system. The file verification system is a system for determining whether the traffic environment description file to be verified passes the file verification through the target verification program and the file verification method provided by the present application. The file verification system includes a basic layer, a data processing layer, a business logic layer, and a product layer.

[0130] It should be noted that the file verification system is deployed in a docker environment, and before the file verification system performs file verification, the user needs to store the traffic environment description file to be verified in the folder to be verified.

[0131] The data processing layer includes a data loading layer and a data verification layer. The data loading layer is configured to search all files in a subfolder in a verification folder based on a root directory of the verification folder provided by a user, and load an XSD file library based on a storage path of the XSD file library in a container environment. For example, the storage path of the XSD file library is "work / xsds".

[0132] The data verification layer is configured to detect a file suffix of each file in the verification folder based on a target suffix, and determine whether the file suffix is the target suffix. For example, a global search function code rglob can be used to detect each file in the verification folder based on the target suffix, and determine whether the file suffix is xosc or xodr. If the file suffix is the target suffix, the file can be determined as a traffic environment description file to be verified. If the file suffix is not the target suffix, the file is skipped. The data verification layer is further configured to perform XSD syntax verification based on a standard XSD file in the XSD file library.

[0133] The basic layer mainly includes a general module, an XML and XSD syntax verification operation module, and a concurrent running framework. The general module includes settings and an exception. The settings are configured to read a global configuration file (a toml file) in a file verification system, so that subsequent configuration information in the configuration file can be adjusted in a timely manner to adapt to different verification requirements. The exception is configured to locate abnormal information in the file verification system, for example, the file verification system cannot normally read a file in a verification folder, so that abnormal conditions at a system level can be quickly located and analyzed, or the abnormal conditions at the system level are recorded in a log. The abnormal conditions in the file verification system can be recorded in a timely manner, and the abnormal conditions in the file verification system can be modified in a timely manner, thereby ensuring the safety of the file verification system.

[0134] The XML and XSD syntax verification operation module is configured to provide an XML syntax verification function for a business logic layer based on an XML tree element library xml.etree.ElemenTree, and provide an XSD syntax verification function for the business logic layer based on an XML mode function xmlschema.

[0135] The concurrent running framework mainly uses a test framework pytest, a distributed test framework pytest-xdist, and a hypertext markup language test framework pytest-html. Based on the concurrent running framework of the basic layer, the business logic layer can verify the traffic environment description file to be verified through multi-threading concurrency.

[0136] The business logic layer is configured to call various basic functions provided by the basic layer, and run a target verification program to perform file verification on the traffic environment description file to be verified in the folder to be verified. Specifically, the traffic environment description file to be verified is subjected to XML syntax verification, and the traffic environment description file to be verified is subjected to XSD syntax verification based on a reference XSD file.

[0137] The business logic layer mainly includes structure well-formedness verification, selection of a reference XSD file, and structure well-formedness verification. The structure well-formedness verification is configured to perform XML syntax verification on the traffic environment description file to be verified in the folder to be verified.

[0138] The selection of the reference XSD file is configured to obtain the suffix and the version number in the traffic environment description file to be verified. For example, the attribute values corresponding to the major version number revMajor and the minor version number revMinor are obtained from the xodr file and the xosc file, respectively. The selection of the reference XSD file is also configured to select a standard XSD file from an XSD file library based on the suffix and the version number in the traffic environment description file to be verified. For example, the xodr file and the corresponding version number can be combined, and the combined type version information can be used as the type version information of the reference key, so that the corresponding standard XSD file can be found from the XSD file library based on the reference key. The structure well-formedness verification is configured to perform XSD syntax verification on the traffic environment description file to be verified based on the standard XSD file.

[0139] The product layer includes a verification result report generation module configured to generate an html format verification result report. The verification result report generation module is mainly based on the framework capability provided by pytest-html in the basic layer, and the style of the verification result report configured in the configuration test function conftest.py, to generate the html format verification result report, so that the user can intuitively understand the verification result of the file verification.

[0140] Therefore, the file verification system provided by the embodiments of the present application realizes automatic file verification. The traffic environment description file to be verified can be automatically selected from the folder to be verified, and the traffic environment description file to be verified can be subjected to XML syntax verification and XSD syntax verification. The file verification process is efficiently completed, and the complexity and error rate of manual verification are reduced.

[0141] In a possible implementation, the reference can be made to Figure 7 , Figure 7An interaction diagram of a file verification method provided in an embodiment of the present application mainly includes a simulation engineer, a disk and a target verification program. The simulation engineer can install and deploy a docker environment on a terminal device, and then determine a to-be-verified folder on the disk, which includes a to-be-verified traffic environment description file. For details, refer to Figure 8 , Figure 8 An exemplary schematic diagram of a to-be-verified folder provided in an embodiment of the present application. The to-be-verified folder includes various subfolders, and each subfolder includes a to-be-verified traffic environment description file.

[0142] When the processing path of the target verification program is the root directory of the to-be-verified folder, the target verification program can be started by running a command. For example, the running command line can be "docker run-rm-v$(pwd) : / work test_xsd". If the processing path included in the above command line is incorrect, the $(pwd) can be replaced with the actual root directory of the to-be-verified folder.

[0143] After starting the target verification program, the XSD file library can be loaded in advance. Then, the target verification program can automatically call the maximum CPU resource of the file verification system, assign corresponding file verification tasks to multiple threads based on the to-be-verified folder, make the multiple threads concurrently execute their respective file verification tasks, and finally obtain a verification result report corresponding to the to-be-verified folder. The file verification task includes determining the to-be-verified traffic environment description file from the to-be-verified folder, performing XML syntax verification on the to-be-verified traffic environment description file, and performing XSD syntax verification on the to-be-verified traffic environment description file.

[0144] Finally, the verification result report corresponding to the to-be-verified folder can be stored in the root directory of the to-be-verified folder on the disk.

[0145] Therefore, by using the file verification method and the file verification system provided in the embodiments of the present application, the efficiency of file verification can be improved by means of concurrent running, and the traffic environment description file can be accurately checked for syntax errors by means of XML syntax verification and XSD syntax verification, thereby ensuring that the traffic environment description file that passes the verification can meet the requirements of the simulation scene.

[0146] Based on the file verification method provided in the foregoing embodiments, a file verification device is also provided in the present application. The following will be described in combination with Figure 9 . Figure 9 A structural schematic diagram of a file verification device 900 provided in an embodiment of the present application. The device includes:

[0147] A file determination module 901 configured to determine a to-be-verified traffic environment description file.

[0148] The first checking module 902 is configured to perform XML syntax checking on the traffic environment description file, to obtain a first checking result corresponding to the traffic environment description file.

[0149] The second checking module 903 is configured to determine a reference XSD file according to type version information of the traffic environment description file, and perform XSD syntax checking on the traffic environment description file based on the reference XSD file, to obtain a second checking result corresponding to the traffic environment description file.

[0150] The result determining module 904 is configured to determine whether the traffic environment description file passes the checking according to the first checking result and the second checking result.

[0151] Optionally, the file determining module 901 comprises:

[0152] The running unit is configured to run a target checking program when a processing path of the target checking program is a root directory of the to-be-checked folder, and the target checking program is deployed in a container environment and is configured to check the traffic environment description file.

[0153] The first detecting unit is configured to detect, by the target checking program, whether a suffix of each file in the to-be-checked folder is a target suffix, and if yes, determine that the file is the to-be-checked traffic environment description file, and if not, skip checking the file.

[0154] Optionally, the first checking module 902 comprises:

[0155] The parsing unit is configured to parse, by the target checking program, the traffic environment description file based on a preset XML syntax checking rule, to detect whether the traffic environment description file conforms to an XML syntax specification indicated by the XML syntax checking rule, to obtain the first checking result.

[0156] Optionally, after the target checking program is run, the apparatus further comprises:

[0157] The loading unit is configured to load an XSD file library in the container environment, and the XSD file library stores, in the form of a dictionary of key-value pairs, a plurality of type version information each corresponding to a standard XSD file, and the standard XSD file is configured to specify features that an XML file of the corresponding type version information should have.

[0158] Optionally, the second checking module 903 comprises:

[0159] A determining unit is configured to determine, by the target verification program, the type version information as a reference key according to a suffix and a version number of the traffic environment description file.

[0160] A searching unit is configured to search, by the target verification program, a standard XSD file corresponding to the type version information as the reference XSD file in the XSD file library based on the reference key.

[0161] Optionally, the second verification module 903 comprises:

[0162] A second detecting unit is configured to detect, by the target verification program, whether the traffic environment description file has a feature specified by the reference XSD file based on the feature to obtain the second verification result.

[0163] Optionally, the apparatus further comprises:

[0164] A concurrent executing unit is configured to assign, by the target verification program, a corresponding file verification task to each thread based on the to-be-verified folder, so that the multiple threads concurrently execute the respective corresponding file verification tasks; wherein the file verification task is used to indicate a file to be processed by the thread in the to-be-verified folder, and indicate that the thread performs the XML syntax verification and the XSD syntax verification on the traffic environment description file in the file to determine whether the traffic environment description file passes the verification.

[0165] Optionally, the apparatus further comprises:

[0166] A report generating unit is configured to generate, by the target verification program, a verification result report corresponding to the to-be-verified folder, and save the verification result report to a root directory of the to-be-verified folder.

[0167] Optionally, the verification result report comprises a report name, test environment information, report result summary information, and error detail information; the report result summary information is used to indicate a file passing the verification, a file failing the verification, and a file skipping the verification in the to-be-verified folder; and the error detail information is used to indicate error details of the file failing the verification.

[0168] Optionally, the apparatus further comprises:

[0169] A display unit is configured to display a visual structure diagram corresponding to the verification result report; the visual structure diagram comprises respective nodes corresponding to each file in the to-be-verified folder, the display forms of respective nodes corresponding to the file passing the verification, the file failing the verification, and the file skipping the verification are different, and the nodes support triggering checking of verification detail information of the corresponding file.

[0170] Optionally, the apparatus further comprises:

[0171] a modification unit configured to modify the traffic environment description file based on a file modification mechanism if the traffic environment description file fails to pass the verification, wherein the file modification mechanism is configured to set a plurality of modification manners corresponding to a plurality of error forms respectively.

[0172] The file verification apparatus provided by the embodiments of the present application proposes a systematic verification mechanism for the traffic environment description file. By means of XML syntax verification and XSD syntax verification, the OpenDRIVE file and / or the OpenSCENARIO file can be comprehensively verified and detected from two different dimensions, so that whether the traffic environment description file has syntax errors can be accurately determined, and effective verification of the traffic environment description file can be realized. Before a corresponding simulation traffic scene is constructed based on the traffic environment description file, the file verification mechanism provided by the embodiments of the present application is applied to verify the traffic environment description file to be used, so that whether the traffic environment description file has problems can be detected in time, the traffic environment description file having problems is modified and adjusted, and the traffic environment description file not having problems is continuously used to construct a simulation traffic scene, so that it can be ensured that the corresponding simulation traffic scene can be successfully constructed based on the traffic environment description file, and waste of processing resources can be avoided.

[0173] The embodiments of the present application further provide a computer device, which can be a terminal device or a server. The terminal device and the server provided by the embodiments of the present application will be introduced from the perspective of hardware realization.

[0174] Referring to Figure 10 , Figure 10 is a structural schematic diagram of the terminal device provided by the embodiments of the present application. As Figure 10 indicated, only parts related to the embodiments of the present application are shown for the convenience of description, and specific technical details not disclosed are referred to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a vehicle-mounted computer, etc. Take a computer as an example:

[0175] Figure 10 shown is a block diagram of part of the structure of the computer related to the terminal provided by the embodiments of the present application. Referring to Figure 10The computer includes a Radio Frequency (RF) circuit 1210, a memory 1220, an input unit 1230 (including a touch panel 1231 and other input devices 1232), a display unit 1240 (including a display panel 1241), a sensor 1250, an audio circuit 1260 (connected with a speaker 1261 and a microphone 1262), a wireless fidelity (WiFi) module 1270, a processor 1280, and a power supply 1290, etc. Those skilled in the art can understand that the computer structure shown in the figure is not a limitation to the computer, which can include more or less components, or combine some components, or different component arrangement. Figure 10 The computer structure shown in the figure is not a limitation to the computer, which can include more or less components, or combine some components, or different component arrangement.

[0176] The memory 1220 can be used to store software programs and modules, and the processor 1280 executes various functions and data processing of the computer by running the software programs and modules stored in the memory 1220. The memory 1220 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the computer (such as audio data, a phone book, etc.), etc. In addition, the memory 1220 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0177] The processor 1280 is the control center of the computer, which connects all parts of the computer through various interfaces and lines, executes various functions and processes data of the computer by running or executing software programs and / or modules stored in the memory 1220, and calling data stored in the memory 1220. Optionally, the processor 1280 can include one or more processing units; preferably, the processor 1280 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and an application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1280.

[0178] In the embodiments of the present application, the processor 1280 included in the terminal is used to execute the steps in the file checking method described in the above various embodiments.

[0179] Referring to Figure 11 , Figure 11A structural schematic diagram of a server 1300 is provided in the embodiments of the present application. The server 1300 can have great differences due to different configurations or performances, and can include one or more central processing units (CPUs) 1322 (for example, one or more processors) and a memory 1332, one or more storage media 1330 (for example, one or more mass storage devices) storing application programs 1342 or data 1344. The memory 1332 and the storage media 1330 can be temporary storage or persistent storage. The programs stored in the storage media 1330 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the server. Further, the central processing unit 1322 can be configured to communicate with the storage media 1330 and execute the series of instruction operations in the storage media 1330 on the server 1300.

[0180] The server 1300 can also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1358, and / or one or more operating systems, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , and the like.

[0181] The steps performed by the server in the above embodiments can be based on the server structure shown in the above embodiments. Figure 11

[0182] The CPU 1322 is configured to execute the steps in the file verification method described in the above embodiments.

[0183] The embodiments of the present application also provide a computer readable storage medium for storing a computer program, and the computer program is used to execute the steps in the file verification method described in the above embodiments.

[0184] The embodiments of the present application also provide a computer program product or a computer program, and the computer program product or the computer program includes computer instructions stored in a computer readable storage medium. The processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the steps in the file verification method described in the above embodiments.

[0185] ​Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

[0186] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the described device embodiments are merely schematic, and the division of the units is merely a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0187] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.

[0188] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of software functional units.

[0189] When the integrated unit is realized in the form of software functional units and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially or the part that makes a contribution to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various computer program storage media.

[0190] It should be understood that in the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, "A and / or B" can represent: only A, only B and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0191] The above-described and above-embodied examples are only used to illustrate the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that the technical solutions recorded in the foregoing examples can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A file verification method, characterized by, The method comprises: determining a traffic environment description file to be checked; performing extensible markup language (XML) syntax checking on the traffic environment description file to obtain a first checking result corresponding to the traffic environment description file; determining a reference XML schema (XSD) file according to type version information of the traffic environment description file; performing XSD syntax checking on the traffic environment description file based on the reference XSD file to obtain a second checking result corresponding to the traffic environment description file; determining whether the traffic environment description file passes the checking according to the first checking result and the second checking result.

2. The method of claim 1, wherein, The determination of the traffic environment description file to be checked comprises: running a target checking program when a processing path of the target checking program is a root directory of a folder to be checked; the target checking program is deployed in a container environment and is used for checking traffic environment description files; detecting, by the target checking program, whether the suffix of each file in the folder to be checked is a target suffix; if yes, determining that the file is the traffic environment description file to be checked; if no, skipping the checking of the file.

3. The method of claim 2, wherein, The XML syntax checking on the traffic environment description file to obtain the first checking result corresponding to the traffic environment description file comprises: parsing, by the target checking program, the traffic environment description file based on a preset XML syntax checking rule, detecting whether the traffic environment description file conforms to an XML syntax specification indicated by the XML syntax checking rule, and obtaining the first checking result.

4. The method according to claim 2 or 3, characterized in that, After the running of the target checking program, the method further comprises: loading an XSD file library in the container environment; the XSD file library stores standard XSD files corresponding to various type version information in the form of a dictionary of key-value pairs; the standard XSD files are used to specify features that an XML file of the corresponding type version information should have.

5. The method of claim 4, wherein, The determination of the reference XSD file according to the type version information of the traffic environment description file comprises: determining, by the target checking program, the type version information as a reference key according to the suffix and the version number of the traffic environment description file; finding, by the target checking program, a standard XSD file corresponding to the type version information in the XSD file library based on the reference key as the reference XSD file.

6. The method according to claim 4 or 5, characterized in that, The XSD syntax checking on the traffic environment description file based on the reference XSD file to obtain the second checking result corresponding to the traffic environment description file comprises: detecting, by the target checking program, whether the traffic environment description file has features specified by the reference XSD file based on the features to obtain the second checking result.

7. The method according to any one of claims 2 to 6, characterized in that, The method further comprises: allocating, by the target checking program, corresponding file checking tasks to a plurality of threads based on the folder to be checked, so that the plurality of threads concurrently execute the corresponding file checking tasks. The file verification task is used to indicate the files in the thread to be processed in the to-be-verified folder, and indicate the thread to perform the XML syntax verification and the XSD syntax verification on the traffic environment description file, so as to determine whether the traffic environment description file passes the verification.

8. The method according to any one of claims 2 to 7, characterized in that, The method further comprises: The target verification program generates a verification result report corresponding to the to-be-verified folder, and saves the verification result report to the root directory of the to-be-verified folder.

9. The method of claim 8, wherein, The verification result report includes a report name, test environment information, report result summary information, and error detail information; the report result summary information is used to indicate the files that pass the verification, the files that do not pass the verification, and the files that skip the verification in the to-be-verified folder; and the error detail information is used to indicate the error details of the files that do not pass the verification.

10. The method according to claim 8 or 9, characterized in that, The method further comprises: A visual structure diagram corresponding to the verification result report is displayed; the visual structure diagram includes nodes corresponding to each file in the to-be-verified folder, the display forms of the nodes corresponding to the files that pass the verification, the files that do not pass the verification, and the files that skip the verification are different, and the nodes support triggering the verification details of the corresponding files.

11. The method according to any one of claims 1 to 10, characterized in that, The method further comprises: In the case that the traffic environment description file does not pass the verification, the traffic environment description file is modified based on a file modification mechanism; the file modification mechanism sets a modification method corresponding to each error form.

12. A file verification apparatus, characterized by comprising: The device comprises: A file determination module is configured to determine a traffic environment description file to be verified. A first verification module is configured to perform an extensible markup language (XML) syntax verification on the traffic environment description file, to obtain a first verification result corresponding to the traffic environment description file. A second verification module is configured to determine a reference extensible markup language schema (XSD) file according to type version information of the traffic environment description file, perform an XSD syntax verification on the traffic environment description file based on the reference XSD file, and obtain a second verification result corresponding to the traffic environment description file. A result determination module is configured to determine whether the traffic environment description file passes the verification according to the first verification result and the second verification result.

13. A computer device, comprising: The device comprises a processor and a memory; The memory is configured to store a computer program; The processor is configured to execute the file verification method according to any one of claims 1 to 11 based on the computer program.

14. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store a computer program, and the computer program is executed by an electronic device to implement the file verification method according to any one of claims 1 to 11.

15. A computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to implement the file verification method according to any one of claims 1 to 11.