Test resource management methods, devices, equipment, media and program products
By managing test files on a cloud server and storing them in a structured data format, the problem of low efficiency in test file management is solved, resource sharing and fast querying are achieved, and the overall testing efficiency is improved.
Patent Information
- Application Number
- CN202411533049.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In existing technologies, the management of test files is time-consuming and labor-intensive, resulting in low overall testing efficiency and difficulty in achieving resource sharing and quick retrieval of specific data.
Test files are managed uniformly through a cloud server. Different parsing methods are used to parse different file types and store them in a structured data format, enabling resource sharing and fast querying of test files.
It improves the efficiency of querying and using test files, saves testing manpower costs, enhances the overall efficiency of testing, and supports online editing and remote distribution of test files.
Smart Images

Figure CN119484506B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated testing technology, specifically to a test resource management method, apparatus, equipment, media, and program product. Background Technology
[0002] With the rapid advancement of vehicle technology, the functional boundaries of vehicle electronic control units (ECUs) are constantly expanding, and their complexity and integration are significantly increasing. Comprehensive testing of ECUs has become an indispensable and crucial part of the vehicle development process. This testing process often involves a large number of test files of various types, including model files generated using MATLAB (a high-level programming language and interactive environment), Controller Area Network (CAN) bus files from different vehicles, mapping files and constant files generated by test automation software, and Python scripts written by testers themselves.
[0003] Currently, testers typically manage and maintain test files on local devices, including establishing standardized file naming conventions and planning reasonable file storage paths to facilitate quick retrieval of required test files in subsequent work. However, managing test files in this way is often time-consuming and labor-intensive, impacting overall testing efficiency. Summary of the Invention
[0004] The purpose of this invention is to provide a test resource management method, apparatus, equipment, medium, and program product to solve the problem of affecting the overall efficiency of testing caused by the current method of managing test files.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A test resource management method is applied to a cloud server. The test resource management method includes: receiving a test file to be stored sent by a client; determining the target file type of the test file to be stored, wherein the file type includes at least one of model file, Extensible Markup Language (XML) file, and Controller Area Network (CAN) bus file; parsing the test file to be stored using a parsing method corresponding to the target file type to obtain test data items corresponding to the test file to be stored; and storing the test data items, wherein the data format of the test data items is structured data format.
[0007] Based on the aforementioned technical means, unified management of test files through a cloud server enables resource sharing of test files, facilitating rapid reuse of test files by different testers. By using different parsing methods to process test files of different file types, testers no longer need to focus on the specific storage location of test files, allowing for convenient management. Furthermore, using a structured data format to store test data items effectively improves the efficiency of data retrieval and utilization within test files, thereby saving manpower costs and enhancing overall testing efficiency.
[0008] Furthermore, the target file type includes model files. The parsing method corresponding to the target file type is used to parse the test file to be stored, and the test data items corresponding to the test file to be stored are obtained. This includes: decompressing the test file to be stored to obtain the system description file corresponding to the sub-model contained in the test file to be stored; parsing the system description file to obtain a list of variable description file names; obtaining the variable description file according to the name list; parsing the variable description file line by line according to the first preset key field to obtain the variable attributes and attribute values; grouping the attributes and attribute values according to the first preset key field, and using the first preset keyword as an index to obtain the test data items.
[0009] Furthermore, the target file type includes XML files. The parsing method corresponding to the target file type is used to parse the test file to be stored, and the test data items corresponding to the test file to be stored are obtained, including: according to the second preset key field, the test file to be stored is parsed using a preset parsing template to obtain the node data of the test file to be stored; and the test data items are obtained according to the second preset key field and the node data.
[0010] Furthermore, the target file type includes CAN bus files. The parsing method corresponding to the target file type is used to parse the test file to be stored, and the test data items corresponding to the test file to be stored are obtained. This includes: initializing multiple preset regular expressions; for each line of data in the test file to be stored, determining whether there is a target regular expression that matches the data among the multiple preset regular expressions; if so, extracting the target data from the test file to be stored using the capture group corresponding to the target regular expression, encapsulating the target data according to the CAN bus signal identifier, and obtaining the test data item using the CAN bus signal identifier as an index.
[0011] Furthermore, the test resource management method also includes: receiving configuration information sent by the client, the configuration information including the target device identifier of the target test bench and the target file identifier of the test file to be downloaded; generating a configuration file based on the configuration information, the configuration file containing the target device identifier and the target file identifier; establishing a connection with the host computer running on the target test bench based on the configuration file; sending the configuration file to the host computer; responding to receiving a download request for the test file to be downloaded sent by the host computer based on the configuration file, generating a test file containing target test data items based on the target file identifier; and sending the test file to be downloaded to the host computer.
[0012] Furthermore, based on the target file identifier, a test file to be downloaded containing target test data items is generated, including: determining the file type of the test file to be downloaded based on the target file identifier; determining the target file template based on the file type of the test file to be downloaded; obtaining the target test data items based on the target file identifier; and filling the target test data items into the target file template to generate a test file to be downloaded containing the target test data items.
[0013] Furthermore, the process of sending the test file to be downloaded to the host computer includes: encrypting the test file to be downloaded to obtain the encrypted test file; and sending the encrypted test file to the host computer.
[0014] Furthermore, the test resource management method also includes: receiving a viewing request sent by the client, wherein the viewing request carries the file identifier of the target test file; obtaining the test data item corresponding to the target test file according to the file identifier of the target test file; and sending the test data item corresponding to the target test file to the client.
[0015] Furthermore, the test resource management method also includes: receiving an edit request sent by the client, the edit request carrying the file identifier of the target test file and the modified test data items corresponding to the target test file; and saving the modified test data items according to the file identifier of the target test file.
[0016] Furthermore, the test resource management method also includes: receiving a permission configuration request sent by the client, the permission configuration request carrying the file identifier of the test file to be stored and the access permissions for the test file to be stored; and saving the access permissions for the test file to be stored based on the file identifier of the test file to be stored.
[0017] A test resource management method is applied to a client. The test resource management method includes: in response to an upload command for a test file to be stored, obtaining the test file to be stored; sending the test file to be stored to a cloud server, so that the cloud server parses the test file to be stored, obtains the test data items corresponding to the test file to be stored, and stores the test data items.
[0018] Furthermore, the test resource management method also includes: in response to a configuration operation for a test file to be downloaded on a target test bench device, obtaining configuration information, the configuration information including the target device identifier of the target test bench device and the target file identifier of the test file to be downloaded; and sending the configuration information to a cloud server so that the cloud server sends the test file to be downloaded to a host computer running on the target test bench device according to the configuration information.
[0019] Furthermore, the test resource management method also includes: in response to a viewing operation on a target test file, sending a viewing request to a cloud server, the viewing request carrying the file identifier of the target test file; receiving the test data items corresponding to the target test file sent by the cloud server; and displaying the test data items corresponding to the target test file.
[0020] Furthermore, the test resource management method also includes: in response to an editing operation on a target test file, sending an editing request to a cloud server, the editing request carrying the file identifier of the target test file and the modified test data items corresponding to the target test file, so that the cloud server saves the modified test data items.
[0021] Furthermore, the test resource management method also includes: in response to a permission configuration operation for a test file to be stored, sending a permission configuration request to a cloud server, the permission configuration request carrying the file identifier of the test file to be stored and the access permissions for the test file to be stored, so that the cloud server saves the access permissions for the test file to be stored.
[0022] A test resource management device is applied to a cloud server. The test resource management device includes: a receiving module for receiving test files to be stored sent by a client; a determining module for determining the target file type of the test files to be stored, wherein the file type includes at least one of model files, Extensible Markup Language (XML) files, and Controller Area Network (CAN) bus files; a parsing module for parsing the test files to be stored using a parsing method corresponding to the target file type to obtain test data items corresponding to the test files to be stored; and a storage module for storing the test data items, wherein the data format of the test data items is a structured data format.
[0023] Furthermore, the target file type includes model files. The parsing module is specifically used for: decompressing the test file to be stored to obtain the system description file corresponding to the sub-model contained in the test file; parsing the system description file to obtain a list of variable description file names; obtaining the variable description file based on the name list; parsing the variable description file line by line according to the first preset key field to obtain the variable attributes and attribute values; grouping the attributes and attribute values according to the first preset key field and using the first preset keyword as an index to obtain the test data items.
[0024] Furthermore, the target file type includes XML files, and the parsing module is specifically used to: parse the test file to be stored using a preset parsing template based on the second preset key field to obtain the node data of the test file to be stored; and obtain the test data items based on the second preset key field and the node data.
[0025] Furthermore, the target file type includes CAN bus files. The parsing module is specifically used to: initialize multiple preset regular expressions; for each line of data in the test file to be stored, determine whether there is a target regular expression that matches the data among the multiple preset regular expressions; if so, extract the target data from the test file to be stored using the capture group corresponding to the target regular expression, encapsulate the target data according to the CAN bus signal identifier, and obtain the test data item using the CAN bus signal identifier as an index.
[0026] Furthermore, the test resource management device also includes a processing module, configured to: receive configuration information sent by the client, the configuration information including the target device identifier of the target test bench and the target file identifier of the test file to be downloaded; generate a configuration file based on the configuration information, the configuration file containing the target device identifier and the target file identifier; establish a connection with the host computer running on the target test bench based on the configuration file; send the configuration file to the host computer; and in response to receiving a download request for the test file to be downloaded sent by the host computer based on the configuration file, generate a test file containing target test data items based on the target file identifier; and send the test file to be downloaded to the host computer.
[0027] Furthermore, when the processing module generates a test file to be downloaded containing target test data items based on the target file identifier, it specifically performs the following steps: determining the file type of the test file to be downloaded based on the target file identifier; determining the target file template based on the file type of the test file to be downloaded; obtaining the target test data items based on the target file identifier; and filling the target test data items into the target file template to generate a test file to be downloaded containing the target test data items.
[0028] Furthermore, when the processing module is used to send the test file to be downloaded to the host computer, it is specifically used to: encrypt the test file to be downloaded to obtain the encrypted test file; and send the encrypted test file to the host computer.
[0029] Furthermore, the test resource management device also includes a viewing module, used for: receiving a viewing request sent by a client, the viewing request carrying a file identifier of the target test file; obtaining the test data item corresponding to the target test file based on the file identifier of the target test file; and sending the test data item corresponding to the target test file to the client.
[0030] Furthermore, the test resource management device also includes an editing module, used to: receive an editing request sent by the client, the editing request carrying the file identifier of the target test file and the modified test data items corresponding to the target test file; and save the modified test data items according to the file identifier of the target test file.
[0031] Furthermore, the test resource management device also includes a permission configuration module, used to: receive a permission configuration request sent by the client, the permission configuration request carrying the file identifier of the test file to be stored and the access permissions for the test file to be stored; and save the access permissions for the test file to be stored according to the file identifier of the test file to be stored.
[0032] A test resource management device is applied to a client. The test resource management device includes: an acquisition module, used to acquire the test file to be stored in response to an upload command for the test file to be stored; and a sending module, used to send the test file to be stored to a cloud server, so that the cloud server parses the test file to be stored, obtains the test data items corresponding to the test file to be stored, and stores the test data items.
[0033] Furthermore, the test resource management device also includes a configuration module, used to: in response to a configuration operation for a test file to be downloaded on a target test bench device, obtain configuration information, the configuration information including the target device identifier of the target test bench device and the target file identifier of the test file to be downloaded; and send the configuration information to a cloud server so that the cloud server sends the test file to be downloaded to a host computer running on the target test bench device according to the configuration information.
[0034] Furthermore, the test resource management device also includes a viewing module, used to: in response to a viewing operation on a target test file, send a viewing request to a cloud server, the viewing request carrying the file identifier of the target test file; receive the test data items corresponding to the target test file sent by the cloud server; and display the test data items corresponding to the target test file.
[0035] Furthermore, the test resource management device also includes an editing module, used to: in response to an editing operation on a target test file, send an editing request to a cloud server, the editing request carrying the file identifier of the target test file and the modified test data items corresponding to the target test file, so that the cloud server saves the modified test data items.
[0036] Furthermore, the test resource management device also includes a permission configuration module, used to: in response to a permission configuration operation for a test file to be stored, send a permission configuration request to the cloud server, the permission configuration request carrying the file identifier of the test file to be stored and the access permissions for the test file to be stored, so that the cloud server saves the access permissions for the test file to be stored.
[0037] A test resource management system includes: a cloud server and a client; the cloud server is used to execute the test resource management method of the cloud server as described above; the client is used to execute the test resource management method of the client as described above.
[0038] An electronic device includes: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the test resource management method described above in this invention.
[0039] A computer-readable storage medium storing computer program instructions, which, when executed, implement the test resource management method described above.
[0040] A computer program product includes a computer program that, when executed, implements the test resource management method described above in this invention.
[0041] The beneficial effects of this invention are as follows: The test resource management method, apparatus, equipment, medium, and program products provided by this invention, through a client responding to an upload command for a test file to be stored, obtain the test file to be stored, and send the test file to the cloud server, can realize resource sharing of test files, facilitating the rapid reuse of test files by different testers. The cloud server receives the test file to be stored sent by the client, determines the target file type of the test file to be stored, and the file type includes at least one of model files, XML files, and CAN bus files. The cloud server uses the parsing method corresponding to the target file type to parse the test file to be stored, obtains the corresponding test data items, and stores the test data items in a structured data format. By using different parsing methods to parse test files of different file types, testers can easily manage test files without having to pay too much attention to the specific storage location of the test files. At the same time, using a structured data format to store test data items can effectively improve the efficiency of data retrieval and use in test files, thereby saving test manpower costs and improving the overall efficiency of testing. Attached Figure Description
[0042] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of the present invention;
[0043] Figure 2 A flowchart illustrating a test resource management method provided in an embodiment of the present invention;
[0044] Figure 3 A flowchart of a model file parsing method provided in an embodiment of the present invention;
[0045] Figure 4 A flowchart illustrating an XML file parsing method provided in an embodiment of the present invention;
[0046] Figure 5 A flowchart of a CAN bus file parsing method provided in an embodiment of the present invention;
[0047] Figure 6 A flowchart illustrating a test file download method provided in an embodiment of the present invention;
[0048] Figure 7 This is a schematic diagram of the structure of a test resource management device provided in an embodiment of the present invention;
[0049] Figure 8 This is a schematic diagram of the structure of a test resource management device provided in another embodiment of the present invention;
[0050] Figure 9 This is a schematic diagram of the structure of a test resource management device provided in another embodiment of the present invention;
[0051] Figure 10 A schematic diagram of a test resource management system provided in an embodiment of the present invention;
[0052] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0053] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.
[0054] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0055] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0056] With the rapid advancement of vehicle technology, especially the in-depth research and development of intelligence, connectivity, and electrification, the functional boundaries of vehicle ECUs are constantly expanding, and their complexity and integration are significantly increasing. This places more stringent requirements on ECU testing, and comprehensive ECU testing has become an indispensable and crucial part of the vehicle R&D process. This testing process often involves a large number of test files of various types, including but not limited to model files generated by MATLAB, CAN bus files from different vehicles, Extensible Markup Language (XML) files (including mapping files and constant files) generated by test automation software, and Python scripts written by testers (also known as third-party test files). Mapping files are used to map the relationships between variables in the model and the test script; constant files are used to define constants.
[0057] Currently, testers typically manage and maintain test files on local devices, including establishing standardized file naming conventions and planning reasonable file storage paths to facilitate quick retrieval of required test files in subsequent work. However, managing test files in this way is often time-consuming and labor-intensive, impacting overall testing efficiency. Furthermore, locally stored test files are difficult to share. When testers want to synchronize files with others, they need to rely on tools that passively, rather than actively, synchronize files to the test bench. When test benches are located in different locations, assistance from testers at other locations is required, which is equally time-consuming and labor-intensive.
[0058] While managing test files through traditional file storage platforms can alleviate file management difficulties to some extent, it also has limitations. For example, when files are modified, testers need to manually synchronize them on each rack device, which is inefficient.
[0059] Furthermore, some test files use XML or custom formats. Their semi-structured nature means that finding specific data requires traversing data nodes layer by layer, significantly reducing data retrieval efficiency. Simultaneously, the numerous tags in XML files not only increase file size but also make the content less intuitive and reduce readability. If testers need to modify the test files, they must first familiarize themselves with the different file formats, understand the function of each tag, and the meaning of each type of data node, significantly increasing the learning curve.
[0060] The aforementioned issues collectively pose a challenge to the work efficiency of testers, which in turn may affect the overall progress and efficiency of ECU testing. Therefore, exploring and implementing a more efficient and automated document management system to reduce the burden on testers, improve the smoothness and efficiency of the overall testing process, and shorten the testing and verification time is particularly urgent and important.
[0061] To address the aforementioned issues, this invention provides a test resource management method. By parsing and storing test files of different file types on a cloud server, it enables online management and maintenance of vehicle ECU test files, improving the online resource sharing capability of test files and the efficiency of data retrieval and utilization within these files. This saves on testing manpower costs and enhances overall testing efficiency. Furthermore, it allows for online editing of test files, improving online editing capabilities, and enables remote distribution of test files to test bench equipment, providing testers with the ability to conduct remote and off-site testing, thereby further improving overall testing efficiency.
[0062] The following section first illustrates the application scenarios of the solution provided by this invention.
[0063] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of the present invention. For example... Figure 1 As shown, in this application scenario, the cloud server connects to the host computers running on test benches in various regions (i.e., regions A, B, and C). According to the test resource management method provided by this invention, testers can upload ECU test files to the cloud server via a client. The cloud server parses the test files and stores the corresponding test data items in a database. A star topology structure enables centralized management and distributed use of test resources. Testers can easily share test files and, through the remote distribution function, distribute test files to the host computers running on test benches in designated regions for ECU testing.
[0064] It should be noted that, Figure 1 This is merely a schematic diagram illustrating one application scenario provided by an embodiment of the present invention. The embodiments of the present invention do not necessarily represent... Figure 1The included equipment is not limited, nor is it restricted. Figure 1 The positional relationships between the devices are defined.
[0065] The technical solution of the present invention will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0066] Figure 2 This is a flowchart illustrating a test resource management method provided in an embodiment of the present invention. Figure 2 As shown, the method of this embodiment of the invention includes:
[0067] S201. The client responds to the upload command for the test file to be stored and obtains the test file to be stored.
[0068] In this embodiment of the invention, testers can select local test files (i.e., test files to be stored) and upload them via a client. Correspondingly, the client responds to the upload command for the test file to be stored and retrieves the test file. The file type of the test file to be stored may be, for example, a model file, an XML file, or a CAN bus file. The test file to be stored can be a single test file or a compressed package of multiple test files. Optionally, when the client receives the test file uploaded by the tester, it first determines whether it supports the file type of the test file to be stored. If not, it prompts the tester to re-upload the test file.
[0069] S202. The client sends the test file to be stored to the cloud server, so that the cloud server parses the test file to obtain the test data items corresponding to the test file and stores the test data items. Correspondingly, the cloud server receives the test file to be stored sent by the client.
[0070] In this step, the client sends the obtained test file to be stored to the cloud server, and the cloud server receives the test file to be stored sent by the client.
[0071] S203. The cloud server determines the target file type of the test file to be stored. The file type includes at least one of the following: model file, XML file, and CAN bus file.
[0072] For example, after receiving the test file to be stored from the client, the cloud server can determine the target file type of the test file, such as a model file, an XML file, or a CAN bus file. A model file might be a file generated by MATLAB; an XML file might be a mapping file and constant file generated by test automation software; and a CAN bus file might be a CAN bus database file used to define and interpret binary frame signals. Optionally, if the test file to be stored is a compressed package of multiple test files, it can be decompressed first to obtain multiple test files. For each test file, the file type-supported test files are processed according to the parsing method for individual test files, and the relative path of the test file is recorded.
[0073] S204. The cloud server uses the parsing method corresponding to the target file type to parse the test file to be stored, and obtains the test data items corresponding to the test file to be stored.
[0074] It's understandable that different file types require different parsing methods. For example, if the target file type is a model file, the cloud server can use the parsing method corresponding to model files to parse the test file to be stored, obtaining the test data items corresponding to the test file. These test data items are data obtained by encapsulating and grouping the attributes and attribute values of the variables parsed from the model file.
[0075] S205. The cloud server stores the test data items, and the data format of the test data items is structured data format.
[0076] In this step, after parsing and obtaining the test data items corresponding to the test file to be stored, the cloud server stores the test data items. For example, the test data items can be saved to a table in the database corresponding to the target file type of the test file to be stored. The data format of the test data items is structured data format. It can be understood that different storage templates can be predefined for test files of different file types, and the parsed test data items can be directly stored in the database.
[0077] The test resource management method provided in this invention involves a client responding to an upload command for a test file to be stored, acquiring the test file, and sending it to a cloud server. This enables resource sharing of test files, facilitating rapid reuse of test files by different testers. The cloud server receives the test file from the client, determines its target file type (including at least one of model files, XML files, and CAN bus files), and parses the test file using a parsing method corresponding to the target file type. The cloud server then obtains and stores the corresponding test data items, which are in a structured data format. By using different parsing methods for different file types, testers can easily manage test files without needing to focus on their specific location. Furthermore, using a structured data format to store test data items effectively improves the efficiency of data retrieval and utilization within the test files, thereby saving manpower costs and enhancing overall testing efficiency.
[0078] Based on the above embodiments, a model file parsing method is introduced through specific embodiments for cases where the target file type includes model files. Figure 3 The flowchart illustrates a model file parsing method provided in an embodiment of the present invention, applied to a cloud server. For example... Figure 3 As shown, the method of this embodiment of the invention includes:
[0079] S301. Decompress the test file to be stored to obtain the system description file corresponding to the sub-model contained in the test file to be stored.
[0080] It is understandable that when the target file type of the test file to be stored is a model file, the test file to be stored is usually a compressed package of the entire experiment, containing one or more sub-models. During ECU testing, the key information is the variables contained in the sub-models; therefore, the variables in the test file to be stored can be parsed. For example, when the target file type of the test file to be stored is determined to be a model file, the test file to be stored is first decompressed to a local relative path, obtaining the System Description File (SDF) corresponding to the sub-models contained in the test file. Each sub-model corresponds to an SDF file, which defines the sub-model's system information, parameters, and measurement variables.
[0081] S302. Parse the system description file to obtain a list of variable description file names.
[0082] For example, after obtaining the system description file, it can be parsed to extract information about trace files, resulting in a list of names for Traceability Record Configuration (TRC) files. The TRC files provide variable information for the real-time application; the trace files record the relative paths of the TRC files; and the list of TRC file names is a list containing the relative paths of different TRC files.
[0083] S303. Obtain the variable description file based on the name list.
[0084] For example, after obtaining a list of TRC file names, the variable description file can be found based on the relative paths of the TRC files in the list of names.
[0085] S304. Parse the variable description file line by line according to the first preset key field to obtain the variable's attributes and attribute values.
[0086] For example, the first preset key field is a key field that is pre-defined as needed. The first preset keyword could be, for example, different group identifiers. After obtaining the TRC file, the TRC file can be opened, each line of data in the TRC file can be read, and the first preset key field can be retrieved. Based on the first preset key field, it can be determined whether it is the starting position of a variable (e.g., the starting position of the variable is the location of the first preset key field). Then, the TRC file is read line by line until the end of the variables, from which the variable attributes and attribute values are parsed. Finally, the variable attributes and attribute values can be encapsulated to obtain encapsulated model variable data. The above parsing process is repeated until the TRC file reading is complete.
[0087] S305. Group the attributes and attribute values according to the first preset key field, and obtain the test data items by using the first preset keyword as the index.
[0088] For example, after obtaining the attributes and values of a variable, these attributes and values can be encapsulated to obtain encapsulated model variable data. Then, the encapsulated data is grouped (categorized) according to a first preset key field, and the test data items are obtained using the first preset keyword as an index. It can be understood that a test file of a model file type can typically be parsed into, for example, tens of thousands of model variables. Grouping these model variables and creating an index allows for faster retrieval and querying.
[0089] The model file parsing method provided in this embodiment of the invention parses the test file to be stored by using the parsing method corresponding to the model file type. It can accurately obtain the test data items corresponding to the test file to be stored, and the data format of the test data items is a structured data format, which can improve the query and usage efficiency of the test data items, thereby helping to improve the overall efficiency of the test.
[0090] Based on the above embodiments, for cases where the target file type includes XML files, a method for parsing XML files is introduced through specific embodiments. Figure 4 This is a flowchart illustrating an XML file parsing method provided in an embodiment of the present invention, applied to a cloud server. For example... Figure 4 As shown, the method of this embodiment of the invention includes:
[0091] S401. Based on the second preset key field, the preset parsing template is used to parse the test file to be stored, and the node data of the test file to be stored is obtained.
[0092] It's understandable that XML files, with their tree structure, while flexible, are not conducive to direct retrieval and editing. To improve data processing efficiency and space utilization, all data in the XML file can be parsed and converted into a structured data format for storage. This conversion process not only simplifies subsequent data retrieval and editing operations but also effectively reduces storage space requirements by removing XML tags, thus achieving a dual improvement in test file processing and storage efficiency. To parse different test files, key fields (i.e., the second preset key fields) need to be predefined in the test files. These key fields are those that play a role in actual vehicle ECU testing. The nodes corresponding to the key fields can be obtained from the XML file, thereby extracting the corresponding node data. Test files of the same type may also have differences. To ensure compatibility with these differences, additional processing is required when defining the parsing template. For example, the test file to be stored might be a mapping file or a constant file. For mapping files or constant files, data can be obtained from the nodes of the XML file according to the preset parsing template. All nodes of the XML are recursively traversed, the node type is determined by the node name, and then the node data is obtained and stored. It can automatically handle missing nodes; for cases where the number of nodes cannot be determined, such as mapping enumeration values, all child node data can be converted into key-value JSON (a data exchange format) strings for processing.
[0093] S402. Based on the second preset key fields and node data, obtain the test data items.
[0094] For example, after obtaining the node data of the test file to be stored, the second preset key field and the node data are associated and stored using the first preset keyword as an index, thereby obtaining the test data item corresponding to the test file to be stored.
[0095] The XML file parsing method provided in this invention parses the test file to be stored using the parsing method corresponding to the XML file type. It can accurately obtain the test data items corresponding to the test file to be stored, and parse the data in the test file to be stored and convert it into a structured data format for storage. This not only simplifies subsequent data retrieval and editing operations, but also effectively reduces the storage space requirement by removing XML tags. This achieves a dual improvement in test file processing efficiency and storage efficiency, thereby helping to improve the overall efficiency of testing.
[0096] Based on the above embodiments, a CAN bus file parsing method is introduced through specific embodiments for cases where the target file type includes CAN bus files. Figure 5 This is a flowchart illustrating a CAN bus file parsing method provided in an embodiment of the present invention, applied to a cloud server. For example... Figure 5 As shown, the method of this embodiment of the invention includes:
[0097] S501. Initialize multiple preset regular expressions.
[0098] In this step, a preset regular expression is used to match key information in the test file to be stored.
[0099] S502. For each line of data in the test file to be stored, determine whether there is a target regular expression that matches the data among multiple preset regular expressions.
[0100] It is understandable that the parsing process of CAN bus files is similar to that of TRC files, both involving directly reading the test file to be stored line by line. For example, the test file to be stored is read line by line, and for each line of data, it is determined whether a target regular expression matching the data exists among multiple preset regular expressions.
[0101] S503. If it exists, the target data is extracted from the test file to be stored by using the capture group corresponding to the target regular expression, the target data is encapsulated according to the CAN bus signal identifier, and the test data item is obtained by using the CAN bus signal identifier as the index.
[0102] In this step, if a target regular expression matching the data is found among multiple preset regular expressions, the meaning of that row of data can be determined. Therefore, the target data can be extracted from the test file to be stored using the capture group corresponding to the target regular expression. The target data includes key data such as signal name, signal identifier, signal start value, signal length, and enumeration value. Steps S502 and S503 are executed for each row of data in the test file to be stored until the test file is completely read. The target data can be encapsulated according to the CAN bus signal identifier, and the test data item can be obtained using the CAN bus signal identifier as an index.
[0103] The CAN bus file parsing method provided in this embodiment of the invention parses the test file to be stored by using the parsing method corresponding to the CAN bus file type. It can accurately obtain the test data items corresponding to the test file to be stored, and the data format of the test data items is a structured data format, which can improve the query and usage efficiency of the test data items, thereby helping to improve the overall efficiency of the test.
[0104] Based on the above embodiments, optionally, the file type may also include third-party test files, which are test files without a defined storage template, such as Python scripts. These third-party test files are directly called when executing ECU testing tasks. After receiving the third-party test file from the client, the cloud server packages the third-party test file and stores it directly on the object storage (BOS) server for easy sharing and downloading later. Additionally, other test files without a defined storage template, such as unparsed data in model files, can also be stored using an object storage server. During storage, if a test file with the same name already exists, the data items of the two test files are compared, and the test data items are modified according to the latest test file.
[0105] Figure 6 This is a flowchart illustrating a test file download method provided in an embodiment of the present invention. Figure 6 As shown, the method in this embodiment of the invention may include:
[0106] S601. The client responds to the configuration operation for the test file to be downloaded for the target test bench device by obtaining configuration information, which includes the target device identifier of the target test bench device and the target file identifier of the test file to be downloaded.
[0107] In this embodiment of the invention, it can be understood that the cloud server controls the test bench via a host computer (not shown in the figure) running on the test bench. The host computer is a Java (a programming language) program in JAR format (a distribution format for Java applications and libraries). It is responsible for collecting device information from the test bench and reporting this information to the cloud server via periodic heartbeats, as well as receiving and executing tasks sent by the cloud server. When the host computer program starts, the tester can select the test bench and test files on the client side. The cloud server will automatically send the test files to the host computer, and the host computer will store the received test files in a designated location.
[0108] In this step, when the tester needs to distribute ECU test files, the client first configures the front-end page by selecting the target test bench and the test files to be downloaded. There can be one or more test files to be downloaded. Correspondingly, the client responds to the configuration operation for the test files to be downloaded on the target test bench by obtaining configuration information, including the target device identifier and the target file identifier.
[0109] S602, the client sends configuration information to the cloud server, so that the cloud server sends the test file to be downloaded to the host computer running on the target test bench device according to the configuration information. Correspondingly, the cloud server receives the configuration information sent by the client.
[0110] In this step, after obtaining the configuration information, the client sends the configuration information to the cloud server, and the cloud server receives the configuration information sent by the client.
[0111] S603 and the cloud server generate a configuration file based on the configuration information. The configuration file contains the target device identifier and the target file identifier.
[0112] In this step, the cloud server receives the configuration information sent by the client, configures the information, generates a configuration file, and creates a test file to send out the task.
[0113] S604, the cloud server establishes a connection with the host computer running on the target rack device according to the configuration file.
[0114] It's understandable that after the host computer on the test bench starts up, it periodically maintains a heartbeat connection with the cloud server. The cloud server uses this heartbeat to send test file distribution tasks to the host computer. Upon receiving the test file distribution task, the host computer actively establishes a socket connection to communicate with the cloud server. In this step, the cloud server can establish a socket connection with the host computer running on the target test bench according to the configuration file.
[0115] S605: The cloud server sends a configuration file to the host computer. Correspondingly, the host computer receives the configuration file sent by the cloud server.
[0116] For example, after a connection is established between the cloud server and the host computer running on the target rack device, the cloud server sends a configuration file to the host computer. Upon receiving the configuration file from the cloud server, the host computer parses the configuration file and sends a download request for the test file to be downloaded to the cloud server via a socket connection.
[0117] S606: Upon receiving a download request from the host computer for a test file to be downloaded, based on the configuration file, the cloud server generates a test file containing the target test data items to be downloaded, according to the target file identifier.
[0118] For example, the target test data items corresponding to the test file to be downloaded are stored in the database. The database can be queried according to the target file identifier to obtain all the target test data items, thereby generating and exporting the test file to be downloaded in a specific format.
[0119] Further, optionally, generating a test file to be downloaded containing target test data items based on the target file identifier may include: determining the file type of the test file to be downloaded based on the target file identifier; determining the target file template based on the file type of the test file to be downloaded; obtaining the target test data items based on the target file identifier; and filling the target test data items into the target file template to generate a test file to be downloaded containing the target test data items.
[0120] For example, the file type of the test file to be downloaded can be determined based on the target file identifier, such as a model file, an XML file, or a CAN bus file. Based on the file type of the test file to be downloaded, a target file template is determined. All target test data items are retrieved from the database based on the target file identifier, and these target test data items are populated into the target file template to generate a test file to be downloaded containing the target test data items.
[0121] Optionally, for test files stored on an object storage server (such as third-party test files), the test files can be downloaded directly from the object storage server and distributed.
[0122] S607: The cloud server sends the test file to be downloaded to the host computer. Correspondingly, the host computer receives the test file to be downloaded from the cloud server.
[0123] In this step, after generating a test file containing the target test data items, the cloud server sends the test file to the host computer. Correspondingly, the host computer receives the test file from the cloud server and stores it in a designated location for ECU testing.
[0124] Optionally, sending the test file to be downloaded to the host computer may include: encrypting the test file to be downloaded to obtain an encrypted test file; and sending the encrypted test file to the host computer.
[0125] For example, the cloud server encrypts the generated test file to be downloaded, obtaining an encrypted test file, and sends the encrypted test file to the host computer via a socket connection. This embodiment of the invention does not limit the encryption method. Correspondingly, the host computer receives the encrypted test file sent by the cloud server and stores it in a designated location for ECU testing.
[0126] The test file download method provided in this invention involves a client responding to a configuration operation for a test file to be downloaded on a target test bench, obtaining configuration information, and sending the configuration information to a cloud server. The cloud server generates a configuration file based on the configuration information, establishes a connection with a host computer running on the target test bench based on the configuration file, sends the configuration file to the host computer, and responds to a download request for the test file to be downloaded sent by the host computer based on the configuration file. Based on the target file identifier, it generates a test file to be downloaded containing target test data items and sends the test file to the host computer. This achieves resource sharing of test files, enabling testers in different locations and on different test benches to quickly reuse test resources. Through the remote test file download function, test files can be synchronized to the target test bench with one click, providing testers with the ability to perform remote and off-site testing. When the test file is modified, manual synchronization by testers is no longer required, thus greatly saving manpower costs and improving overall testing efficiency.
[0127] Based on the above embodiments, optionally, in response to a viewing operation on a target test file, the client sends a viewing request to the cloud server, the viewing request carrying the file identifier of the target test file; the cloud server receives the viewing request sent by the client, obtains the test data item corresponding to the target test file according to the file identifier of the target test file, and sends the test data item corresponding to the target test file to the client; the client receives the test data item corresponding to the target test file sent by the cloud server and displays the test data item corresponding to the target test file.
[0128] For example, testers can select a target test file to view via a client. In response to the tester's viewing action, the client sends a viewing request to the cloud server. Upon receiving the request, the cloud server retrieves the corresponding test data items based on the target test file's file identifier and sends these data items back to the client. The client then displays the test data items to the tester for easy viewing.
[0129] Based on the above embodiments, optionally, in response to an editing operation on the target test file, the client sends an editing request to the cloud server. The editing request carries the file identifier of the target test file and the modified test data items corresponding to the target test file. The cloud server receives the editing request sent by the client and saves the modified test data items according to the file identifier of the target test file.
[0130] For example, testers can edit the test data items corresponding to the target test file, thereby the client sends an edit request to the cloud server, and the cloud server saves the modified test data items after receiving the edit request.
[0131] It's understandable that cloud servers, by categorizing different test files according to file type, allow testers to easily manage test files without needing to focus too much on their specific storage location. Simultaneously, using a structured data format to store test data items effectively improves data search and retrieval efficiency. This allows testers to quickly find and reference variables within test data items while writing test scripts. Furthermore, the structured data format presents test data items in an intuitive way, enabling testers to directly view the attributes of a data item and quickly edit attribute values. This allows for rapid modification of the entire test file without needing to be familiar with the file format, effectively reducing the learning curve for testers.
[0132] Based on the above embodiments, optionally, in response to the permission configuration operation for the test file to be stored, the client sends a permission configuration request to the cloud server. The permission configuration request carries the file identifier of the test file to be stored and the access permissions for the test file to be stored. The cloud server receives the permission configuration request sent by the client and saves the access permissions for the test file to be stored according to the file identifier of the test file to be stored.
[0133] For example, when testers upload test files to the cloud server via a client, they can set access permissions for the test files (i.e., set the visibility scope of the test files), such as whether the test files belong to a team, project, or individual. Correspondingly, in response to the permission configuration operation for the test files, the client sends a permission configuration request to the cloud server. After receiving the permission configuration request from the client, the cloud server marks the test files with access permissions to distinguish the visibility scope of the test files and saves the access permissions. Testers can download test files from the public resources of the cloud server to their personal resources, or upload test files from their personal resources to the public resources of the cloud server, thereby achieving test file sharing.
[0134] The following are embodiments of the apparatus of the present invention, which can be used to execute embodiments of the method of the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, please refer to the embodiments of the method of the present invention.
[0135] Figure 7 This is a schematic diagram of a test resource management device provided in an embodiment of the present invention, applied to a cloud server. Figure 7 As shown, the test resource management device 700 of this embodiment includes: a receiving module 701, used to receive a test file to be stored sent by a client; a determining module 702, used to determine the target file type of the test file to be stored, the file type including at least one of model file, XML file and CAN bus file; a parsing module 703, used to parse the test file to be stored using a parsing method corresponding to the target file type to obtain test data items corresponding to the test file to be stored; and a storage module 704, used to store the test data items, the data format of the test data items being a structured data format.
[0136] Furthermore, the target file type includes model files, and the parsing module 703 can be specifically used to: decompress the test file to be stored to obtain the system description file corresponding to the sub-model contained in the test file to be stored; parse the system description file to obtain a list of variable description file names; obtain the variable description file according to the name list; parse the variable description file line by line according to the first preset key field to obtain the variable attributes and attribute values; group the attributes and attribute values according to the first preset key field, and obtain the test data items using the first preset keyword as an index.
[0137] Furthermore, the target file type includes XML files, and the parsing module 703 can be specifically used to: parse the test file to be stored using a preset parsing template based on the second preset key field to obtain the node data of the test file to be stored; and obtain test data items based on the second preset key field and the node data.
[0138] Furthermore, the target file type includes CAN bus files. The parsing module 703 can be specifically used to: initialize multiple preset regular expressions; for each line of data in the test file to be stored, determine whether there is a target regular expression that matches the data among the multiple preset regular expressions; if so, extract the target data from the test file to be stored using the capture group corresponding to the target regular expression, encapsulate the target data according to the CAN bus signal identifier, and obtain the test data item using the CAN bus signal identifier as an index.
[0139] Furthermore, the test resource management device 700 also includes a processing module (not shown in the figure), used for: receiving configuration information sent by the client, the configuration information including the target device identifier of the target test bench and the target file identifier of the test file to be downloaded; generating a configuration file according to the configuration information, the configuration file containing the target device identifier and the target file identifier; establishing a connection with the host computer running on the target test bench according to the configuration file; sending the configuration file to the host computer; responding to receiving a download request for the test file to be downloaded sent by the host computer according to the configuration file, generating a test file containing target test data items according to the target file identifier; and sending the test file to be downloaded to the host computer.
[0140] Furthermore, when the processing module generates a test file to be downloaded containing target test data items based on the target file identifier, it can specifically be used to: determine the file type of the test file to be downloaded based on the target file identifier; determine the target file template based on the file type of the test file to be downloaded; obtain the target test data items based on the target file identifier; and fill the target test data items into the target file template to generate a test file to be downloaded containing the target test data items.
[0141] Furthermore, when the processing module is used to send the test file to be downloaded to the host computer, it can specifically be used to: encrypt the test file to be downloaded to obtain the encrypted test file; and send the encrypted test file to the host computer.
[0142] Furthermore, the test resource management device 700 also includes a viewing module (not shown in the figure), used to: receive a viewing request sent by a client, the viewing request carrying a file identifier of the target test file; obtain the test data item corresponding to the target test file according to the file identifier of the target test file; and send the test data item corresponding to the target test file to the client.
[0143] Furthermore, the test resource management device 700 also includes an editing module (not shown in the figure), used to: receive an editing request sent by the client, the editing request carrying the file identifier of the target test file and the modified test data items corresponding to the target test file; and save the modified test data items according to the file identifier of the target test file.
[0144] Furthermore, the test resource management device 700 also includes a permission configuration module (not shown in the figure), which is used to: receive a permission configuration request sent by the client, the permission configuration request carrying the file identifier of the test file to be stored and the access permissions of the test file to be stored; and save the access permissions of the test file to be stored according to the file identifier of the test file to be stored.
[0145] The apparatus of this invention can be used to execute the technical solution of the cloud server in any of the above-described method embodiments. Its implementation principle and technical effect are similar, and will not be repeated here.
[0146] Figure 8 This is a schematic diagram of a test resource management device provided in another embodiment of the present invention, applied to a client. For example... Figure 8 As shown, the test resource management device 800 of this embodiment includes: an acquisition module 801, used to acquire the test file to be stored in response to an upload command for the test file to be stored; and a sending module 802, used to send the test file to be stored to a cloud server so that the cloud server can parse the test file to be stored, obtain the test data items corresponding to the test file to be stored, and store the test data items.
[0147] Furthermore, the test resource management device 800 may also include a configuration module (not shown in the figure), used to: in response to a configuration operation for a test file to be downloaded on a target test bench device, obtain configuration information, the configuration information including the target device identifier of the target test bench device and the target file identifier of the test file to be downloaded; and send the configuration information to a cloud server so that the cloud server sends the test file to be downloaded to a host computer running on the target test bench device according to the configuration information.
[0148] Furthermore, the test resource management device 800 may also include a viewing module (not shown in the figure), used for: in response to a viewing operation on a target test file, sending a viewing request to a cloud server, the viewing request carrying the file identifier of the target test file; receiving test data items corresponding to the target test file sent by the cloud server; and displaying the test data items corresponding to the target test file.
[0149] Furthermore, the test resource management device 800 may also include an editing module (not shown in the figure), used to: in response to an editing operation on a target test file, send an editing request to a cloud server, the editing request carrying the file identifier of the target test file and the modified test data items corresponding to the target test file, so that the cloud server saves the modified test data items.
[0150] Furthermore, the test resource management device 800 may also include a permission configuration module (not shown in the figure), used to: in response to a permission configuration operation for a test file to be stored, send a permission configuration request to a cloud server, the permission configuration request carrying the file identifier of the test file to be stored and the access permissions for the test file to be stored, so that the cloud server saves the access permissions for the test file to be stored.
[0151] The apparatus of this invention can be used to execute the technical solution of the client in any of the method embodiments shown above. Its implementation principle and technical effect are similar, and will not be repeated here.
[0152] Based on the above embodiments, Figure 9 This is a schematic diagram of a test resource management device provided in another embodiment of the present invention, applied to a cloud server. For example... Figure 9 As shown, the test resource management device 900 of this embodiment includes: a data parsing module 901, a file storage module 902, a file export module 903, and a file distribution module 904.
[0153] in:
[0154] The data parsing module 901 is used to parse the ECU test files uploaded by the testers to obtain the test data items corresponding to the test files.
[0155] The file storage module 902 is used to classify and store test files of different file types; the storage used includes databases, BOS file storage servers, and ES (a distributed search and analysis engine).
[0156] The file export module 903 is used to generate and export test files in a specific format based on the stored test data items.
[0157] The file distribution module 904 is used to communicate with the host computer (not shown in the figure) running on the test bench device, create a test file distribution task, distribute the test file distribution task to the host computer, and transmit the test file to be distributed to the host computer.
[0158] The apparatus of this invention can be used to execute the technical solution of the cloud server in any of the above-described method embodiments. Its implementation principle and technical effect are similar, and will not be repeated here.
[0159] Figure 10 This is a schematic diagram of a test resource management system provided in an embodiment of the present invention, as shown below. Figure 10 As shown, the test resource management system 1000 includes a cloud server 1001 and a client 1002, which are communicatively connected. The cloud server 1001 can employ... Figure 7or Figure 9 The structure of the device embodiment, correspondingly, can perform... Figure 2 , Figure 3 , Figure 4 , Figure 5 or Figure 6 The technical solution in this embodiment is similar in principle and technical effect, and will not be described again here. Client 1002 can adopt... Figure 8 The structure of the device embodiment, correspondingly, can perform... Figure 2 or Figure 6 The technical solutions in the embodiments are similar in principle and in effect, and will not be described again here.
[0160] Figure 11 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present invention. Figure 11 As shown, the electronic device 1100 may include at least one processor 1101 and a memory 1102.
[0161] The memory 1102 is used to store programs. Specifically, the program may include program code, which includes computer-executable instructions.
[0162] The memory 1102 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0163] The processor 1101 executes computer execution instructions stored in the memory 1102 to implement the test resource management method described in the foregoing method embodiments. The processor 1101 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. Specifically, when implementing the test resource management method described in the foregoing method embodiments, the electronic device may be, for example, a server or other electronic device with processing capabilities.
[0164] Optionally, the electronic device 1100 may also include a communication interface 1103. In specific implementations, if the communication interface 1103, memory 1102, and processor 1101 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.
[0165] Optionally, in a specific implementation, if the communication interface 1103, memory 1102 and processor 1101 are integrated on a single chip, then the communication interface 1103, memory 1102 and processor 1101 can communicate through an internal interface.
[0166] The present invention also provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implements the above-described test resource management method.
[0167] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described test resource management method.
[0168] The aforementioned computer-readable storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0169] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in a test resource management device.
[0170] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0171] Finally, it should be noted that the above embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention.
Claims
1. A method of test resource management, characterized by, The test resource management method is applied to a cloud server and includes the following steps: receiving a to-be-stored test file sent by a client; determining a target file type of the to-be-stored test file, the file type including at least one of a model file, an extensible markup language (XML) file, and a controller area network (CAN) bus file; if the target file type includes the model file, decompressing the to-be-stored test file to obtain a system description file corresponding to a sub-model included in the to-be-stored test file; parsing the system description file to obtain a name list of variable description files; obtaining the variable description files according to the name list; parsing the variable description files row by row according to a first preset key field to obtain attributes and attribute values of variables; grouping the attributes and the attribute values according to the first preset key field, and taking the first preset key as an index to obtain test data items; if the target file type includes the XML file, parsing the to-be-stored test file according to a second preset key field and using a preset parsing template to obtain node data of the to-be-stored test file; and obtaining test data items according to the second preset key field and the node data; if the target file type includes the CAN bus file, initializing a plurality of preset regular expressions; determining, for each row of data of the to-be-stored test file, whether there is a target regular expression matching the data in the plurality of preset regular expressions; if there is, extracting target data from the to-be-stored test file using a capture group corresponding to the target regular expression, encapsulating the target data according to a CAN bus signal identifier, and taking the CAN bus signal identifier as an index to obtain test data items; storing the test data items, the data format of the test data items being a structured data format.
2. The test resource management method of any one of claim 1, wherein, Further including: receiving configuration information sent by a client, the configuration information including a target device identifier of a target test bench device and a target file identifier of a to-be-downloaded test file; generating a configuration file according to the configuration information, the configuration file including the target device identifier and the target file identifier; establishing a connection with an upper computer running on the target test bench device according to the configuration file; sending the configuration file to the upper computer; in response to receiving a download request sent by the upper computer according to the configuration file, the download request being directed to the to-be-downloaded test file, generating a to-be-downloaded test file including target test data items according to the target file identifier; sending the to-be-downloaded test file to the upper computer.
3. The test resource management method of claim 2, wherein, The generating of the to-be-downloaded test file including the target test data items according to the target file identifier includes: determining a file type of the to-be-downloaded test file according to the target file identifier; determining a target file template according to the file type of the to-be-downloaded test file; obtaining the target test data items according to the target file identifier; filling the target test data items into the target file template to generate the to-be-downloaded test file including the target test data items.
4. The test resource management method of claim 2, wherein, The sending of the to-be-downloaded test file to the upper computer includes: Encrypt the test file to be downloaded to obtain an encrypted test file; Send the encrypted test file to the host computer.
5. The test resource management method of any one of claim 1, wherein, Further comprising: Receiving a viewing request sent by a client, the viewing request carrying a file identifier of a target test file; According to the file identifier of the target test file, obtaining the test data item corresponding to the target test file; Sending the test data item corresponding to the target test file to the client.
6. The test resource management method of claim 5, wherein, Further comprising: Receiving an editing request sent by a client, the editing request carrying a file identifier of a target test file and a modified test data item corresponding to the target test file; According to the file identifier of the target test file, saving the modified test data item.
7. The test resource management method of any one of claim 1, wherein, Further comprising: Receiving a permission configuration request sent by a client, the permission configuration request carrying a file identifier of a test file to be stored and an access permission to the test file to be stored; According to the file identifier of the test file to be stored, saving the access permission to the test file to be stored.
8. A test resource management method, characterized by, Applied to a client, the test resource management method comprises: In response to an upload instruction for a test file to be stored, obtaining the test file to be stored; Sending the test file to be stored to a cloud server, so that the cloud server analyzes the test file to be stored to obtain a test data item corresponding to the test file to be stored, and stores the test data item; If the target file type of the test file to be stored is a model file, the test data item is obtained based on the following manner: decompressing the test file to be stored to obtain a system description file corresponding to a sub-model included in the test file to be stored; analyzing the system description file to obtain a name list of variable description files; according to the name list, obtaining a variable description file; according to a first preset key field, analyzing the variable description file line by line to obtain attributes and attribute values of variables; grouping the attributes and the attribute values according to the first preset key field, and taking the first preset key as an index; If the target file type of the test file to be stored is an XML file, the test data item is obtained based on the following manner: according to a second preset key field, using a preset parsing template to parse the test file to be stored to obtain node data of the test file to be stored; according to the second preset key field and the node data, obtaining the test data item; If the target file type of the test file to be stored is a CAN bus file, the test data item is obtained based on the following manner: initializing a plurality of preset regular expressions; for each line of data of the test file to be stored, determining whether there is a target regular expression matching the data in the plurality of preset regular expressions; if there is, extracting target data from the test file to be stored using a capture group corresponding to the target regular expression, encapsulating the target data according to a CAN bus signal identifier, and taking the CAN bus signal identifier as an index.
9. The test resource management method of claim 8, wherein, Further comprising: In response to a configuration operation for a target test file to be downloaded, a viewing request is sent to the cloud server, the viewing request carrying a file identifier of the target test file; In response to a viewing operation for a target test file, a viewing request is sent to the cloud server, the viewing request carrying a file identifier of the target test file; 10. The test resource management method of claim 8, wherein, In response to an editing operation for the target test file, an editing request is sent to the cloud server, the editing request carrying a file identifier of the target test file and modified test data items corresponding to the target test file, so that the cloud server saves the modified test data items. In response to a permission configuration operation for the test file to be stored, a permission configuration request is sent to the cloud server, the permission configuration request carrying a file identifier of the test file to be stored and an access permission for the test file to be stored, so that the cloud server saves the access permission for the test file to be stored. The test resource management device applied to a cloud server comprises: a receiving module configured to receive a test file to be stored sent by a client; 11. The test resource management method of claim 10, wherein, a determining module configured to determine a target file type of the test file to be stored, the file type comprising at least one of a model file, an extensible markup language (XML) file and a controller area network (CAN) bus file; an analyzing module configured to, if the target file type comprises the model file, decompress the test file to be stored to obtain a system description file corresponding to a sub-model included in the test file to be stored, analyze the system description file to obtain a name list of variable description files, acquire the variable description files according to the name list, and analyze the variable description files line by line according to a first preset key field to obtain attributes and attribute values of variables, group the attributes and the attribute values according to the first preset key field, and obtain test data items by taking the first preset key as an index; 12. The test resource management method of claim 8, wherein, if the target file type comprises the XML file, analyze the test file to be stored according to a second preset key field by using a preset analysis template to obtain node data of the test file to be stored, and obtain the test data items according to the second preset key field and the node data; and if the target file type comprises the CAN bus file, analyze the test file to be stored according to a third preset key field to obtain the test data items.
13. A test resource management apparatus, characterized by: If the target file type comprises a CAN bus file, a plurality of preset regular expressions are initialized; for each line of data of the test file to be stored, it is determined whether there is a target regular expression matching the data in the plurality of preset regular expressions; if there is, target data is extracted from the test file to be stored by using a capture group corresponding to the target regular expression, the target data is encapsulated according to a CAN bus signal identifier, and a test data item is obtained by taking the CAN bus signal identifier as an index; A storage module is configured to store the test data item, and the data format of the test data item is a structured data format.
14. A test resource management apparatus, characterized by: The test resource management device applied to a client comprises: An acquisition module is configured to acquire a test file to be stored in response to an upload instruction for the test file to be stored; A sending module is configured to send the test file to be stored to a cloud server, so that the cloud server analyzes the test file to be stored to obtain a test data item corresponding to the test file to be stored, and stores the test data item; If a target file type of the test file to be stored is a model file, the test data item is obtained based on the following manner: the test file to be stored is decompressed to obtain a system description file corresponding to a sub-model included in the test file to be stored; the system description file is parsed to obtain a name list of variable description files; the variable description files are acquired according to the name list; the variable description files are parsed line by line according to a first preset key field to obtain attributes and attribute values of variables; the attributes and the attribute values are grouped according to the first preset key field, and the first preset key is taken as an index; If a target file type of the test file to be stored is an XML file, the test data item is obtained based on the following manner: the test file to be stored is parsed by using a preset parsing template according to a second preset key field to obtain node data of the test file to be stored; the test data item is obtained according to the second preset key field and the node data; If a target file type of the test file to be stored is a CAN bus file, the test data item is obtained based on the following manner: a plurality of preset regular expressions are initialized; for each line of data of the test file to be stored, it is determined whether there is a target regular expression matching the data in the plurality of preset regular expressions; if there is, target data is extracted from the test file to be stored by using a capture group corresponding to the target regular expression, the target data is encapsulated according to a CAN bus signal identifier, and a test data item is obtained by taking the CAN bus signal identifier as an index.
15. A test resource management system, characterized by Comprise: A cloud server and a client; The cloud server is configured to execute the test resource management method in any one of claims 1 to 7; The client is configured to execute the test resource management method in any one of claims 8 to 12.
16. An electronic device, comprising: Comprise: A processor, and a memory connected with the processor in communication; The memory stores computer execution instructions; The processor executes computer-executed instructions stored in the memory to implement the test resource management method according to any one of claims 1-12.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, and the computer program instructions, when executed, implement the test resource management method according to any one of claims 1-12.
18. A computer program product comprising a computer program, characterized in that, The computer program, when executed, implements the test resource management method according to any one of claims 1-12.
Citation Information
Patent Citations
Verification program management method and device, equipment, medium and program product
CN119441005A