File sequence processing method, device, terminal equipment and storage medium
By determining the action node labels and sequences, and using the preset dynamic link library to call the corresponding functions, the problem that the XML parsing tool cannot run the formal test sequence is solved, and the complete execution of the test sequence is achieved.
Patent Information
- Application Number
- CN202011300137.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-19
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-11-19
AI Technical Summary
Existing XML parsing tools can only simply read the data in the source file, making the formally described test sequence unable to actually run.
By obtaining the source files to be processed, the action node labels and sequences are determined, and the corresponding execution functions are called in sequence using the preset dynamic link library to execute the test sequence. The default dynamic link library is compiled and stored in advance, including various execution functions, used to implement the test actions described by the action node labels.
It realizes the complete and accurate execution of the test sequence in the source file, so that the formally described test sequence can be actually run.
Smart Images

Figure CN112445490B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a file sequence processing method, device, terminal equipment and storage medium. Background Art
[0002] At present, there are often some source files used to formally describe test sequences, such as Open Test Sequence eXchange (OTX) source files. OTX source files are based on the ISO13209 standard and formally describe the standardized test sequence of the vehicle automatic diagnosis process through the Extensible Markup Language (XML), thereby facilitating the unification of the data format of the diagnostic communication process.
[0003] However, existing parsing tools, such as XML parsing tools, can only perform simple data reading on the data in the source file, resulting in the inability to actually run the test sequences in the source file. Summary of the invention
[0004] In view of this, embodiments of the present application provide a file sequence processing method, apparatus, terminal device and storage medium to solve the problem in the prior art of how to enable the test sequence formally described in the source file to actually run.
[0005] A first aspect of an embodiment of the present application provides a file sequence processing method, including:
[0006] Get the source file to be processed;
[0007] Determine each action node label and the order of each action node label contained in the source file to be processed, and obtain action execution order information; the action node label is a node label used to describe the test action;
[0008] According to the action execution sequence information, the execution functions corresponding to the action node labels are called in sequence from the preset dynamic link library to execute the test sequence described by the source file to be processed; wherein the execution function is a computer function created in advance for various action node labels and used to implement the test action described by the action node label; the preset dynamic link library is a dynamic link library obtained by compiling the program files containing each of the execution functions in advance.
[0009] Optionally, determining each action node label and the order of each action node label contained in the source file to be processed to obtain action execution order information includes:
[0010] Record the unique identification information of each action node label in the source file to be processed in sequence;
[0011] According to the unique identification information of each action node label recorded in sequence, the name of the execution function corresponding to each action node label is determined in sequence to obtain action execution sequence information; the action execution sequence information includes the name of the execution function recorded in sequence;
[0012] Correspondingly, calling the execution functions corresponding to the action node labels in sequence from a preset dynamic link library according to the action execution sequence information to execute the test sequence described by the source file to be processed includes:
[0013] According to the action execution sequence information, the execution functions corresponding to the names of the execution functions are called in sequence from the preset dynamic link library to execute the test sequence described in the source file.
[0014] Optionally, determining each action node label and the order of each action node label contained in the source file to be processed to obtain action execution order information includes:
[0015] Sequentially record the unique identification information of each action node label in the source file to be processed to obtain action execution information; the action execution information includes the unique identification information of the action node labels recorded in sequence;
[0016] Correspondingly, calling the execution functions corresponding to the action node labels in sequence from a preset dynamic link library according to the action execution sequence information to execute the test sequence described by the source file to be processed includes:
[0017] According to the action execution sequence information, execution functions corresponding to the unique identification information of each action node label are called in sequence from the preset dynamic link library to execute the test sequence described in the source file.
[0018] Optionally, determining each action node label and the order of each action node label contained in the source file to be processed to obtain action execution order information includes:
[0019] Recording each action node label and the order of each action node label contained in each process node label in the source file to be processed through the first interface to obtain first record information;
[0020] Recording the order of each process node label in the source file to be processed through the second interface to obtain second record information;
[0021] The action execution sequence information is obtained according to the first record information and the second record information.
[0022] Optionally, the action execution sequence information further includes parameter information corresponding to each action node label recorded in sequence. Correspondingly, calling the execution functions corresponding to each action node label in sequence from a preset dynamic link library according to the action execution sequence information to execute the test sequence described by the source file to be processed includes:
[0023] According to the action execution sequence information, while calling the execution functions corresponding to the action node labels in sequence from the preset dynamic link library, the corresponding parameter information is passed to the execution function, and the test sequence described in the source file is executed according to the parameter information.
[0024] Optionally, before obtaining the source file to be processed, the method further includes:
[0025] Get a preset number of source files;
[0026] Parsing each of the source files in turn, creating a corresponding execution function for each action node label contained in the source file in turn, and obtaining a program file containing each of the execution functions;
[0027] Compile the program file, generate a preset dynamic link library and store it.
[0028] Optionally, the file sequence processing method further includes:
[0029] Recording log information of the test sequence execution process;
[0030] The preset dynamic link library is adjusted according to the log information.
[0031] A second aspect of an embodiment of the present application provides a file sequence processing device, including:
[0032] A first acquisition unit, used for acquiring an OTX source file to be processed;
[0033] An action execution sequence information determination unit, used to determine each action node label and the order of each action node label contained in the source file to be processed, and obtain action execution sequence information; the action node label is a node label used to describe the test action;
[0034] An execution unit is used to call the execution functions corresponding to each of the action node labels in sequence from a preset dynamic link library according to the action execution sequence information, and execute the test sequence described by the source file to be processed; wherein the execution function is a computer function created in advance for various action node labels and used to implement the test action described by the action node label; the preset dynamic link library is a dynamic link library obtained by compiling the program files containing each of the execution functions in advance.
[0035] Optionally, the action execution sequence information determination unit is specifically used to record in order the unique identification information of each action node label in the source file to be processed; according to the unique identification information of each action node label recorded in order, determine in turn the name of the execution function corresponding to each action node label to obtain the action execution sequence information; the action execution sequence information includes the names of the execution functions recorded in order;
[0036] Correspondingly, the execution unit is specifically configured to call the execution functions corresponding to the names of the respective execution functions in sequence from the preset dynamic link library according to the action execution sequence information, and execute the test sequence described in the source file.
[0037] Optionally, the action execution sequence information determination unit is specifically used to record the unique identification information of each action node label in the source file to be processed in sequence to obtain action execution information; the action execution information includes the unique identification information of the action node labels recorded in sequence;
[0038] Correspondingly, the execution unit is specifically configured to sequentially call execution functions corresponding to the unique identification information of each action node label from the preset dynamic link library according to the action execution sequence information, and execute the test sequence described in the source file.
[0039] Optionally, the action execution sequence information determination unit includes a first recording module, a second recording module and a sequence integration module:
[0040] A first recording module, used for recording, through a first interface, each action node label and the sequence of each action node label contained in each process node label in the source file to be processed, to obtain first recording information;
[0041] A second recording module, used to record the order of each process node label in the source file to be processed through a second interface to obtain second recording information;
[0042] The sequence integration module is used to obtain the action execution sequence information according to the first record information and the second record information.
[0043] Optionally, the action execution sequence information also includes parameter information corresponding to each action node label recorded in sequence. Correspondingly, the execution unit is specifically used to call the execution functions corresponding to each action node label in sequence from a preset dynamic link library according to the action execution sequence information, pass the corresponding parameter information to the execution function, and execute the test sequence described in the source file according to the parameter information.
[0044] Optionally, the file processing device further includes:
[0045] A second acquisition unit, used to acquire a preset number of source files;
[0046] A program file acquisition unit, used to parse each of the source files in turn, create a corresponding execution function for each action node label contained in the source file in turn, and obtain a program file containing each of the execution functions;
[0047] The compiling unit is used to compile the program file, generate a preset dynamic link library and store it.
[0048] Optionally, the file sequence processing device further includes:
[0049] A log information recording unit, used to record log information of the test sequence execution process;
[0050] The adjustment unit is used to record the log information of the test sequence execution process.
[0051] A third aspect of an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the terminal device implements the steps of the file sequence processing method.
[0052] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, a terminal device implements the steps of the file sequence processing method.
[0053] The fifth aspect of the embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the steps of the file sequence processing method described in any one of the first aspects above.
[0054] Compared with the prior art, the embodiments of the present application have the following beneficial effects: in the embodiments of the present application, since a preset dynamic link library is set in advance, the preset dynamic link library is a dynamic link library obtained by compiling a program file containing various execution functions in advance, and each execution function is a computer function created in advance for respectively implementing the test actions described by each action node label, so that after obtaining the source file to be processed, it is only necessary to determine the various action node labels contained in the source file to be processed and the order of each action node label to obtain the action execution sequence information, and then the execution functions corresponding to the various action node labels in the preset dynamic link library can be directly called in sequence according to the action execution sequence information, and each test action is executed in sequence, and finally the execution of the test sequence of the source file can be completed completely and accurately, so that the test sequence formally described in the source file can be actually run. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0056] Figure 1 It is a schematic diagram of an application scenario corresponding to a file sequence processing method provided in an embodiment of the present application;
[0057] Figure 2 It is a schematic diagram of an implementation flow of a file sequence processing method provided in an embodiment of the present application;
[0058] Figure 3 is a schematic diagram of a file sequence processing device provided in an embodiment of the present application;
[0059] Figure 4 It is a schematic diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0061] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0062] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0063] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0064] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0065] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0066] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0067] Figure 1 A schematic diagram of an application scenario corresponding to a file sequence processing method of an embodiment of the present application is shown, including a vehicle diagnostic test platform 11, a diagnostic test device 12 and a vehicle 13. Among them, the vehicle diagnostic test platform 11 establishes a communication connection with the diagnostic test device 12, and the diagnostic test device 12 is connected to the on-board automatic diagnostic system (On Board Diagnostics, OBD) interface 131 of the vehicle 13. The vehicle diagnostic test platform 11 can obtain the source file to be processed through the file sequence processing method of the embodiment of the present application, determine the various action node labels contained in the source file to be processed and the order of each action node label to obtain the action execution sequence information; according to the action execution sequence information, call the execution functions corresponding to each action node label in sequence from the preset dynamic link library, execute the test sequence described in the source file, and control the diagnostic test device 12 to complete the diagnostic test of the vehicle 13.
[0068] Embodiment 1:
[0069] Figure 2 A flowchart of a file sequence processing method provided by an embodiment of the present application is shown, and the details are as follows:
[0070] In S201, a source file to be processed is obtained.
[0071] In the embodiment of the present application, the source file is a file that formally describes (e.g., describes in XML language) a test sequence, wherein the test sequence is composed of various test actions required to perform certain test tasks (e.g., vehicle diagnostic tests). The source file can only formally describe the test sequence and cannot be directly called by the application to perform the corresponding test actions. Among them, the source file to be processed is a specified source file that describes the test sequence to be executed currently.
[0072] The terminal device can obtain the source file to be processed from its own storage unit, or download the source file to be processed from other devices or the network. Exemplarily, when the source file to be processed is specifically an OTX source file, the source file to be processed can be obtained by reading a readable storage medium provided by the manufacturer of the vehicle to be tested that stores various source files of the vehicle to be tested, or the source file to be processed can be obtained by obtaining the model information of the vehicle to be tested and downloading the source file corresponding to the vehicle to be tested from the website according to the model information.
[0073] In S202, each action node label and the order of each action node label contained in the source file to be processed are determined to obtain action execution order information; the action node label is a node label in the node label used to describe the test action.
[0074] In the embodiment of the present application, the source file may be in XML format, and the data related to each test described in the source file is encapsulated and stored through node tags at various levels. Specifically, the node tags of the source file include at least a node tag for describing the test action, i.e., an action node tag. <action>. The action node label encapsulates the detailed parameters of a single test action, such as the start execution time, conditions, units to be executed, end time and conditions, etc. In the source file, the execution order of each test action is described by arranging each action node label in sequence, thereby completely describing the test sequence. Optionally, the source file is an OTX source file, then the test sequence described in the source file is specifically a vehicle diagnostic test sequence, and the detailed parameters in the action node label may include the name information of the Electronic Control Unit (ECU) to be executed.
[0075] In an embodiment of the present application, after obtaining the source file to be processed, the source file to be processed can be processed by calling a preset dynamic link library for parsing the source file (for the convenience of description, it will be referred to as a parsing dynamic link library), and the source file to be processed can be parsed. During the parsing process, the action node labels contained in the source file and the execution order of each action node label are recorded, thereby obtaining the action execution order information of the source file to be processed.
[0076] In S203, according to the action execution sequence information, the execution functions corresponding to the action node labels are called in sequence from the preset dynamic link library to execute the test sequence described by the source file to be processed; wherein, the execution function is a computer function created in advance for various action node labels and used to implement the test action described by the action node label; the preset dynamic link library is a dynamic link library obtained by compiling the program files containing each of the execution functions in advance.
[0077] In the embodiment of the present application, the preset dynamic link library is a dynamic link library obtained by compiling a preset program file in advance, and the preset program file contains various execution functions, which are computer functions created in advance for various action node labels to implement the test actions described by the action node labels. Exemplarily, the computer function can be a function in the form of C++ code. The preset dynamic link library is stored in advance in a storage unit so that after obtaining the source file to be processed, the compiled execution functions in the preset dynamic function are called in sequence.
[0078] Specifically, after determining the action execution sequence information of the current source file to be processed, the execution functions corresponding to the action node labels contained in the source file to be processed can be called in sequence from the preset dynamic link library according to the recorded execution order of each action node label, and each test action contained in the test sequence can be executed one by one through the execution function, thereby realizing the sequential execution of the test sequence.
[0079] In the embodiment of the present application, since a preset dynamic link library is set in advance, the preset dynamic link library is a dynamic link library obtained by compiling a program file containing various execution functions in advance, and each execution function is a computer function created in advance for implementing the test actions described by each action node label. After obtaining the source file to be processed, it is only necessary to determine the various action node labels and the order of each action node label contained in the source file to be processed to obtain the action execution sequence information. The execution function corresponding to each action node label in the preset dynamic link library can be directly called in sequence according to the action execution sequence information, and each test action is executed in sequence. Finally, the execution of the test sequence of the source file can be completed completely and accurately, so that the test sequence formally described in the source file can be actually run.
[0080] Optionally, the above step S202 includes:
[0081] A1: Record the unique identification information of each action node label in the source file to be processed in sequence;
[0082] A2: According to the unique identification information of each action node label recorded in sequence, the name of the execution function corresponding to each action node label is determined in sequence to obtain action execution sequence information; the action execution sequence information includes the name of the execution function recorded in sequence;
[0083] Correspondingly, the above step S203 includes:
[0084] A3: According to the action execution sequence information, the execution functions corresponding to the names of the execution functions are called in sequence from the preset dynamic link library to execute the test sequence described in the source file.
[0085] In an embodiment of the present application, specifically, by calling the above-mentioned parsing dynamic link library to execute steps A1 to A2, the names of the execution functions recorded in sequence can be obtained as the action execution sequence information. Then, according to the action execution sequence information, the execution functions corresponding to the names of the execution functions are called from the preset dynamic link library in sequence, and the execution of each test action is implemented in sequence, thereby completing the execution of an entire test sequence.
[0086] Specifically, in step A1, when parsing the source file, the parsing dynamic link library can record the unique identification information of each action node label in sequence to achieve the recording of the action node label and its sequence. Specifically, the unique identification information can be the unique identification number ID of the action node label. Optionally, the action execution sequence information can be recorded through an associative container map. The associative container map stores each action node label similar to<key,value> The key-value pair is used to realize the mapping storage of two data. In order to distinguish them, the associated container here is called the first associated container map1. When an action node label is parsed, the current sequence number is used as the key value, and the unique identification information of the current action node label is used as the value value, and they are stored in map1 accordingly. Among them, the sequence number increases one by one with the number of action node labels parsed. For example, when the first node label is parsed, the sequence number is 1, when the second node label is parsed, the sequence number increases to 2, and when the third node label is parsed, the sequence number increases to 3, and so on.
[0087] In the embodiment of the present application, the correspondence between the unique identification information of the action node label and the name of the execution function is also pre-stored in the parsed dynamic link library. Specifically, the second associated container map2 can be used to map and store the unique identification information of the action node label as the key value and the name of the corresponding execution function as the value. In step A2, the names of the execution functions recorded in sequence can be obtained as the action execution sequence information based on the unique identification information of each action node label recorded in sequence (which can be the above-mentioned first associated container map1) and the corresponding relationship stored in the second associated container map2. Specifically, the action execution sequence information can be stored through the third associated container map3, in which the current sequence number is used as the key value, and the name of the execution function corresponding to the sequence number currently determined in combination with map1 and map2 is used as the value value, thereby realizing the sequential recording of the names of each execution function.
[0088] In the embodiment of the present application, the compiled execution function stored in the preset dynamic link library can be called according to the name of the execution function. Specifically, in step A3, the names of the execution functions recorded in sequence according to the above-mentioned action execution sequence information are called in sequence to sequentially call the corresponding compiled execution functions in the preset dynamic link library, thereby sequentially implementing each test action and finally completing the accurate execution of the test sequence.
[0089] Optionally, the above step S202 includes:
[0090] B1: Record the unique identification information of each action node label in the source file to be processed in sequence to obtain action execution information; the action execution information includes the unique identification information of the action node labels recorded in sequence;
[0091] Correspondingly, the above step S203 includes:
[0092] B2: According to the action execution sequence information, the execution functions corresponding to the unique identification information of each action node label are sequentially called from the preset dynamic link library to execute the test sequence described in the source file.
[0093] In the embodiment of the present application, the correspondence between the unique identification information and the execution function is stored in the preset dynamic link library. By calling the above-mentioned parsing dynamic link library to execute step B1, after obtaining the unique identification information of each action node label recorded in sequence as the action execution sequence information, according to the action execution sequence information and the correspondence between the unique identification information and the execution function stored in the preset dynamic link library, the execution function corresponding to the unique identification information of each action node label is called from the preset dynamic link library in sequence, and the execution of each test action is realized in sequence, thereby completing the execution of an entire test sequence.
[0094] Specifically, in step B1, similar to step A1, the parsing dynamic link library can record the unique identification information of each action node label in sequence when parsing the source file to achieve the recording of the action node label and its sequence. And, the unique identification information of the action node label recorded in sequence is used as the action execution sequence information, for example, the information stored in the first association container map is used as the action execution sequence information.
[0095] In step B2, after determining the action execution sequence information, call the preset dynamic link library, pass the action execution sequence information into the preset dynamic link library, and call each execution function in sequence according to the correspondence between the unique identification information stored in the preset dynamic link library and the execution function, so as to implement each test action in sequence, and finally complete the accurate execution of the test sequence. Optionally, the preset dynamic link library can specifically store a fourth associated container map4, in which the key value is the unique identification information of the action node label, and the value value is the name of the corresponding execution function. After obtaining the above-mentioned action execution sequence information containing the unique identification information of the action node label recorded in sequence, the preset dynamic link library, in combination with the map4, determines the name of the corresponding execution function in sequence, and calls the corresponding compiled execution function through the name of the execution function, so as to implement each test action in the test sequence in sequence.
[0096] In an embodiment of the present application, the dynamic node labels and their order contained in the source file to be processed are recorded in sequence by recording the unique identification information of each dynamic node label in the source file to be processed. Since the unique identification information can uniquely identify a dynamic node label, and its data format is usually relatively simple (usually a string type with a small amount of data), it is possible to save storage space while ensuring the accuracy of the recorded action execution sequence information.
[0097] Optionally, the above step S201 includes:
[0098] Recording each action node label and the order of each action node label contained in each process node label in the source file to be processed through the first interface to obtain first record information;
[0099] Recording the order of each process node label in the source file to be processed through the second interface to obtain second record information;
[0100] The action execution sequence information is obtained according to the first record information and the second record information.
[0101] In the embodiment of the present application, a complete test sequence can be specifically divided into various test sub-processes, each of which contains various specific test actions combined in sequence. <procedure>Tag) to encapsulate the information of a test sub-process (that is, encapsulate each action node tag <action>), and then the action node labels contained in the process node labels <action>To describe the information of each specific test action separately.
[0102] In an embodiment of the present application, the first interface can be used to record the various action node labels and the order of the action node labels contained in each process node label to obtain the first record information. The first record information describes the various test actions contained in the sequence of a single sub-process. At the same time, the order between the various process node labels is recorded through the second interface to obtain the second record information. The second record information describes the execution order between the various test sub-processes.
[0103] Afterwards, through the above-mentioned first record information and second record information, all action node labels contained in each process node label can be sequentially combined to obtain action execution sequence information containing the complete execution sequence of all action node labels.
[0104] Exemplarily, the vehicle key self-learning diagnostic process includes test sub-process 1 and test sub-process 2, wherein test sub-process 1 includes test actions a1, a2, and a3, and test sub-process 2 includes test actions b1, b2, and b3. Assuming that the OTX source file corresponding to the key self-learning diagnostic process is the current source file to be processed, the OTX source file contains two process node labels, which can be called procedure1 and procedure2, wherein the action node labels encapsulated in procedure1 can sequentially include action node labels action_a1 for describing test action a1, action node labels action_a2 for describing test action a2, and action node labels action_a3 for describing test action a3; the action node labels encapsulated in procedure2 can sequentially include action node labels action_b1 for describing test action b1, action node labels action_b2 for describing test action b2, and action node labels action_b3 for describing test action b3. Through the first interface, the first record information can be recorded in sequence: procedure1 contains action_a1, action_a2, action_a3 in sequence; procedure2 contains action_b1, action_b2, action_b3 in sequence. Through the second interface, the execution order of procedure1 and procedure2 can be recorded as: procedure1→procedure2. Afterwards, according to the first record information and the second record information, the complete action execution sequence information can be obtained: action_a1→action_a2→action_a3→action_b1→action_b2→action_b3.
[0105] In an embodiment of the present application, considering that action node labels are usually encapsulated through process node labels in source files, a first interface is set to record the execution order of action node labels contained in each process node label, and a second interface is used to record the execution order between each process node label. By combining these two recording information, the action execution sequence information of the source file to be processed can be obtained efficiently and accurately.
[0106] Optionally, the action execution sequence information further includes parameter information respectively included in each action node tag recorded in sequence. Correspondingly, the above step S203 includes:
[0107] According to the action execution sequence information, while calling the execution functions corresponding to the action node labels in sequence from the preset dynamic link library, the corresponding parameter information is passed to the execution function, and the test sequence described in the source file is executed according to the parameter information.
[0108] In the embodiment of the present application, while recording each action node label and its order, the parameter information corresponding to each action node label is also recorded, thereby generating action execution sequence information that not only records each action node label in order, but also records the parameter information corresponding to each action node label. For example, in step A1 or step B1, each time an action node label is parsed, the unique identification information of the action node label and the parameter information encapsulated in the parsed action node label are stored in the value of map1. Correspondingly, in step A2, the key value of map3 is the sequence number, and the value value includes both the name of the execution function and the corresponding parameter information. Therefore, whether the first associated container map1 is used as the action execution sequence information, or the third associated container map3 is used as the action execution sequence information, the action execution sequence information includes the parameter information corresponding to the action node labels in order.
[0109] Afterwards, in step S203, based on the action execution sequence information, while calling the execution function corresponding to the action node label from the preset dynamic link library, the corresponding parameter information can be accurately passed to the execution function, so that the execution function can accurately implement the corresponding test action according to the parameter information, thereby accurately completing the execution of the test sequence.
[0110] In the embodiment of the present application, since it is taken into account that each compiled execution function in the preset dynamic link library is usually a flexibly set execution function that requires the input of parameter information, the parameter information that needs to be input is recorded while recording the order of each action node label, so that when the execution function corresponding to the action node label is called later, the corresponding parameter information can be accurately input, thereby accurately and flexibly executing the test sequence described by the source file to be processed.
[0111] Optionally, before step S201, the method further includes:
[0112] S2001: Obtain a preset number of source files;
[0113] S2002: parsing each of the source files in sequence, and creating corresponding execution functions for each action node label contained in the source file in sequence, to obtain a program file containing each of the execution functions;
[0114] S2003: Compile the program file, generate a preset dynamic link library and store it.
[0115] In the embodiment of the present application, before obtaining the source file to be processed, the preset dynamic link library is compiled and stored in advance through steps S2001 to S2003.
[0116] In step S2001, a preset number of source files are obtained in advance from a storage medium provided by the vehicle manufacturer or from a website, and the preset number of source files includes various possible action node labels. For example, if the file sequence processing method in the embodiment of the present application is specifically applied to the processing of OTX source files, the preset number of source files specifically includes various OTX source files corresponding to different ECUs and different diagnostic process functions that may be used.
[0117] In step S2002, each source file is parsed in turn, and corresponding execution functions are created for the action node tags contained in each source file in turn. The execution function is a specific implementation code segment (for example, C++ code) of the test action described by the action node tag. Specifically, the code information of each created execution function is written into the same program file to obtain a program file containing each execution function.
[0118] In step S2003, the program file including each execution function is compiled, and the obtained dynamic link library is the preset dynamic link library, which is stored for calling in subsequent steps.
[0119] In an embodiment of the present application, the preset dynamic link library is created and stored in advance through steps S2001 to S2003, so that after the source file to be processed is obtained, each test action can be directly implemented by calling the execution function in the preset dynamic link library to complete the execution of the test sequence.
[0120] Optionally, before step S203, the method further includes:
[0121] Load other preset modules;
[0122] Correspondingly, in step S203, it includes:
[0123] According to the action execution sequence information, the execution functions corresponding to the action node labels are called in sequence from the preset dynamic link library, and combined with the other preset modules mentioned above, the execution of the test sequence described by the source file to be processed is completed.
[0124] Specifically, other preset modules may include diagnostic software modules, display program modules, data link protocol data unit (D-PDU) modules, etc. These modules are in the form of dynamic link libraries (DLL) or executable files (EXE). The preset dynamic link library cooperates with these preset modules to achieve complete execution of the test sequence.
[0125] Optionally, the file sequence processing method of the embodiment of the present application further includes:
[0126] Recording log information of the test sequence execution process;
[0127] The preset dynamic link library is adjusted according to the log information.
[0128] In the embodiment of the present application, specifically in the above-mentioned step S203, while the test sequence is being executed, log information of the execution process of the test sequence may be recorded.
[0129] Afterwards, when the test is automatically interrupted or the test is completed, the recorded log information is used to determine whether the execution process of the current test sequence is normal. If there is an exception, the execution function of the preset dynamic link library with the exception information is queried through the log information, and the preset dynamic link library is adjusted by modifying and improving the code segment of the execution function, so that the preset dynamic link library can be successfully called later, thereby improving the success rate of the smooth execution of subsequent test sequences.
[0130] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0131] Embodiment 2:
[0132] Figure 3 A schematic diagram of the structure of a file sequence processing device provided in an embodiment of the present application is shown. For the sake of convenience, only the part related to the embodiment of the present application is shown:
[0133] The file sequence processing device comprises: a first acquisition unit 31, an action execution sequence information determination unit 32, and an execution unit 33. Among them:
[0134] The first acquisition unit 31 is used to acquire a source file to be processed.
[0135] The action execution sequence information determination unit 32 is used to determine the action node labels and the order of the action node labels contained in the source file to be processed to obtain the action execution sequence information; the action node labels are node labels used to describe the test actions.
[0136] The execution unit 33 is used to call the execution functions corresponding to each of the action node labels in sequence from the preset dynamic link library according to the action execution order information, and execute the test sequence described by the source file to be processed; wherein the execution function is a computer function created in advance for various action node labels and used to implement the test action described by the action node label; the preset dynamic link library is a dynamic link library obtained by compiling the program files containing each of the execution functions in advance.
[0137] Optionally, the action execution sequence information determining unit 32 is specifically used to sequentially record the unique identification information of each action node label in the source file to be processed; according to the unique identification information of each action node label recorded in sequence, the name of the execution function corresponding to each action node label is determined in sequence to obtain the action execution sequence information; the action execution sequence information includes the names of the execution functions recorded in sequence;
[0138] Correspondingly, the execution unit 33 is specifically configured to call the execution functions corresponding to the names of the execution functions in sequence from the preset dynamic link library according to the action execution sequence information, and execute the test sequence described in the source file.
[0139] Optionally, the action execution sequence information determining unit 32 is specifically used to record the unique identification information of each action node label in the source file to be processed in sequence to obtain action execution information; the action execution information includes the unique identification information of the action node labels recorded in sequence;
[0140] Correspondingly, the execution unit 33 is specifically configured to call the execution functions corresponding to the unique identification information of each action node label in sequence from the preset dynamic link library according to the action execution sequence information, and execute the test sequence described in the source file.
[0141] Optionally, the action execution sequence information determining unit 32 includes a first recording module, a second recording module and a sequence integration module:
[0142] A first recording module, used for recording, through a first interface, each action node label and the sequence of each action node label contained in each process node label in the source file to be processed, to obtain first recording information;
[0143] A second recording module, used to record the order of each process node label in the source file to be processed through a second interface to obtain second recording information;
[0144] The sequence integration module is used to obtain the action execution sequence information according to the first record information and the second record information.
[0145] Optionally, the action execution sequence information also includes parameter information corresponding to each action node label recorded in sequence. Correspondingly, the execution unit 33 is specifically used to call the execution functions corresponding to each action node label in sequence from a preset dynamic link library according to the action execution sequence information, pass the corresponding parameter information to the execution function, and execute the test sequence described in the source file according to the parameter information.
[0146] Optionally, the file sequence processing device further includes:
[0147] A second acquisition unit, used to acquire a preset number of source files;
[0148] A program file acquisition unit, used to parse each of the source files in turn, create a corresponding execution function for each action node label contained in the source file in turn, and obtain a program file containing each of the execution functions;
[0149] The compiling unit is used to compile the program file, generate a preset dynamic link library and store it.
[0150] Optionally, the file sequence processing device further includes:
[0151] A log information recording unit, used to record log information of the test sequence execution process;
[0152] The adjustment unit is used to record the log information of the test sequence execution process.
[0153] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0154] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0155] Embodiment three:
[0156] Figure 4 Schematic diagram of a terminal device provided by an embodiment of the present application. Figure 4 As shown, the terminal device 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40, such as a file sequence processing program. When the processor 40 executes the computer program 42, the steps in the above-mentioned various file sequence processing method embodiments are implemented, such as Figure 2 Alternatively, when the processor 40 executes the computer program 42, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 3 The functions of the units 31 to 33 are shown.
[0157] Exemplarily, the computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into a first acquisition unit, an action sequence execution information determination unit, and an execution unit, and the specific functions of each unit are as follows:
[0158] A first acquisition unit, used to acquire a source file to be processed;
[0159] An action execution sequence information determination unit, used to determine each action node label and the order of each action node label contained in the source file to be processed, and obtain action execution sequence information; the action node label is a node label used to describe the test action;
[0160] An execution unit is used to call the execution functions corresponding to each of the action node labels in sequence from a preset dynamic link library according to the action execution sequence information, and execute the test sequence described by the source file to be processed; wherein the execution function is a computer function created in advance for various action node labels and used to implement the test action described by the action node label; the preset dynamic link library is a dynamic link library obtained by compiling the program files containing each of the execution functions in advance.
[0161] The terminal device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0162] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0163] The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used to store the computer program and other programs and data required by the terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
[0164] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0165] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0166] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0167] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0168] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0169] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0170] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0171] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.< / action> < / action> < / procedure> < / action>
Claims
1. A file sequence processing method, characterized in that: include: Get a preset number of source files; Parsing each of the preset number of source files in sequence, and creating corresponding execution functions for each action node label contained in the preset number of source files in sequence, to obtain a program file containing each of the execution functions; Compiling the program file, generating a preset dynamic link library and storing it; Obtaining a source file to be processed, wherein the source file to be processed is a file that formally describes a test sequence; According to a preset parsing dynamic link library, the source file to be processed is parsed, each action node label and the order of each action node label contained in the source file to be processed are determined, and action execution order information is obtained; the action node label is a node label used to describe the test action; According to the action execution sequence information, the execution functions corresponding to the action node labels are called in sequence from the preset dynamic link library to execute the test sequence described by the source file to be processed; wherein the execution function is a computer function created in advance for various action node labels and used to implement the test action described by the action node label; the preset dynamic link library is a dynamic link library obtained by compiling the program files containing each of the execution functions in advance.
2. The file sequence processing method according to claim 1, characterized in that: The step of determining each action node label and the order of each action node label contained in the source file to be processed to obtain action execution order information includes: Record the unique identification information of each action node label in the source file to be processed in sequence; According to the unique identification information of each action node label recorded in sequence, the name of the execution function corresponding to each action node label is determined in sequence to obtain action execution sequence information; the action execution sequence information includes the name of the execution function recorded in sequence; Correspondingly, calling the execution functions corresponding to the action node labels in sequence from a preset dynamic link library according to the action execution sequence information to execute the test sequence described by the source file to be processed includes: According to the action execution sequence information, the execution functions corresponding to the names of the execution functions are called in sequence from the preset dynamic link library to execute the test sequence described in the source file.
3. The file sequence processing method according to claim 1, characterized in that: The step of determining each action node label and the order of each action node label contained in the source file to be processed to obtain action execution order information includes: Sequentially record the unique identification information of each action node label in the source file to be processed to obtain action execution information; the action execution information includes the unique identification information of the action node labels recorded in sequence; Correspondingly, calling the execution functions corresponding to the action node labels in sequence from a preset dynamic link library according to the action execution sequence information to execute the test sequence described by the source file to be processed includes: According to the action execution sequence information, execution functions corresponding to the unique identification information of each action node label are called in sequence from the preset dynamic link library to execute the test sequence described in the source file.
4. The file sequence processing method according to claim 1, characterized in that: The step of determining each action node label and the order of each action node label contained in the source file to be processed to obtain action execution order information includes: Recording each action node label and the order of each action node label contained in each process node label in the source file to be processed through the first interface to obtain first record information; Recording the order of each process node label in the source file to be processed through the second interface to obtain second record information; The action execution sequence information is obtained according to the first record information and the second record information.
5. The file sequence processing method according to claim 1, characterized in that: The action execution sequence information also includes parameter information corresponding to each action node label recorded in sequence. Correspondingly, calling the execution functions corresponding to each action node label in sequence from a preset dynamic link library according to the action execution sequence information to execute the test sequence described by the source file to be processed includes: According to the action execution sequence information, while calling the execution functions corresponding to the action node labels in sequence from the preset dynamic link library, the corresponding parameter information is passed to the execution function, and the test sequence described in the source file is executed according to the parameter information.
6. The file sequence processing method according to any one of claims 1 to 5, characterized in that: The file sequence processing method further includes: Recording log information of the test sequence execution process; The preset dynamic link library is adjusted according to the log information.
7. A file sequence processing device, characterized in that: include: A second acquisition unit, used to acquire a preset number of source files; A program file acquisition unit, used to parse each of the preset number of source files in sequence, and create corresponding execution functions for each action node label contained in the preset number of source files in sequence, so as to obtain a program file containing each of the execution functions; A compiling unit, used to compile the program file, generate a preset dynamic link library and store it; A first acquisition unit is used to acquire a source file to be processed, where the source file to be processed is a file that formally describes a test sequence; An action execution sequence information determination unit is used to parse the source file to be processed according to a preset parsing dynamic link library, determine each action node label and the order of each action node label contained in the source file to be processed, and obtain action execution sequence information; the action node label is a node label used to describe the test action; An execution unit is used to call the execution functions corresponding to each of the action node labels in sequence from the preset dynamic link library according to the action execution order information, and execute the test sequence described by the source file to be processed; wherein the execution function is a computer function created in advance for various action node labels and used to implement the test action described by the action node label; the preset dynamic link library is a dynamic link library obtained by compiling the program files containing each of the execution functions in advance.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the terminal device implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the terminal device implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Fight parameter system automation testing method
CN105468811A
Method and device for generating test case, terminal and computer-readable medium
CN108170602A
Method for dynamically configuring instrument parameter interface in automatic testing system software
CN108334365A
Vehicle diagnosis method and device and vehicle diagnosis equipment
CN111552267A
File processing method, file processing device, diagnosis equipment and electronic equipment
CN111813754A
