Embedded kernel engine algorithm of test measurement system
Technical Field
The invention relates to the technical field of embedded testing, in particular to an embedded kernel engine algorithm of a testing and measuring system.
Background
An embedded system is a "control, monitoring or auxiliary device, machine and equipment operation device" (devices used to control, monitor, or assist the operation of equipment, machinery or plants) according to the definition of IEEE (institute of electrical and electronics engineers). It can be seen that the embedded system is a complex of software and hardware, and may also cover mechanical accessory devices. At present, a commonly accepted definition in China is as follows: application-centric, computer-technology-based, software and hardware-tailorable, application-system-compliant, multi-functional, reliable, cost-effective, volume-effective, power-hungry, special-purpose computer systems. Failure of the security of embedded systems can lead to catastrophic results, even for non-secure systems, with significant economic loss due to mass production. This requires rigorous testing, validation and verification of embedded systems, including embedded software. With the increasing use of software and microprocessors to control various embedded devices in more and more fields, it is increasingly important to quickly and efficiently test increasingly complex embedded software. The existing test measurement system needs to independently build and write test cases aiming at different embedded software and hardware, and different logic applications cannot be realized by different embedded software and hardware, so that the universality is poor.
Disclosure of Invention
The invention aims to provide an embedded kernel engine algorithm of a test measurement system so as to solve the problems in the background technology.
In order to achieve the above purpose, the present invention provides the following technical solutions: the embedded kernel engine algorithm of the test measurement system comprises an equipment data acquisition module, a data packet receiving and transmitting module, an execution module, a test plan making module, an embedded test case storage module, an embedded test case classification module and a data processing module, wherein the equipment data acquisition module is used for acquiring equipment hardware information and driving information, constructing and defining a communication protocol packet, packaging an API (application program interface) of equipment communication, and then sending key data to the execution module through the data packet receiving and transmitting module;
the test plan making module comprises upper PC software, the upper PC software is provided with a user interaction interface and provides a function of making test plan parameters for a user, after the user makes a detailed test plan comprising time length, frequency and the like through the test plan making module, the test plan making module generates a request instruction and sends the request instruction to the embedded test case classification module, the embedded test case storage module stores preset test scripts and embedded test cases, and the embedded test case classification module searches proper test cases from the embedded test case storage module according to the information in the request instruction and sends test case data to the execution module;
the execution module stores various preset test engines, and after receiving the test case data and the software and hardware data, the execution module calls the corresponding preset test engines to execute the test script to obtain a test result;
the data processing module comprises a reporting module and a man-machine interaction interface, wherein after the reporting module receives the test result, the reporting module classifies and sorts each item of data of the test result to generate a report, and the report is displayed through the man-machine interaction interface.
Preferably, the environment setting module is further provided with a user interaction interface, and the user views or changes parameters configured in the test environment through the user interaction interface.
Preferably, the configuration parameters in the test environment include an IP address, a port number, an IP address of the device under test, and port number information of the test instrument.
Preferably, the system further comprises a session module, the execution module is connected with the equipment data acquisition module through the session module, a user can change environmental parameters or send operation instructions through a user interaction interface, the environment setting module sends parameter configuration instructions and operation instructions to the equipment data acquisition module through the session module, and interaction is completed with equipment according to a communication interface packaged by the equipment data acquisition module.
Preferably, the searching script in the embedded test case storage module by the embedded test case classification module specifically includes the following steps: the embedded test case classification module firstly extracts various information in the request instruction, searches corresponding test case data according to the file path and the file name, and then extracts a required test script and test case from the test case data according to the script type and the test case identifier.
Preferably, the execution module comprises an interpreter, after receiving the data packet transmitted by the equipment data acquisition module, a section of special memory area is allocated for the test in the interpreter, a lookup table of the memory area is built, the lookup table is correspondingly updated after receiving the test case data, the data is written into the special memory area, a path search algorithm and constraint solution are utilized, and a test case set is generated through repeated iteration.
Preferably, the data processing module further comprises an abnormal information recording module, when error information such as abnormal data feedback and the like is generated in the testing process of the system, the error information is recorded in time, and workers are prompted through a human-computer interaction interface.
Preferably, the data processing module further comprises a log module, wherein the log module is used for tracking interaction records of the system and the equipment, recording execution results of each test command and storing according to specific date and time.
Compared with the prior art, the invention has the beneficial effects that: the invention provides an embedded software framework capable of deploying different application logics, saves a great amount of time for manually writing test cases and test scripts, has better universality, has good system compatibility for various devices and software, and can meet the requirement of closed-loop real-time industrial test.
Drawings
Fig. 1 is a schematic diagram of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present invention, it should be noted that the azimuth or positional relationship indicated by the terms "vertical", "upper", "lower", "horizontal", etc. are based on the azimuth or positional relationship shown in the drawings, and are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the apparatus or element referred to must have a specific azimuth, be constructed and operated in a specific azimuth, and thus should not be construed as limiting the present invention.
In the description of the present invention, it should also be noted that, unless explicitly specified and limited otherwise, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
Referring to fig. 1, the present invention provides a technical solution: the embedded kernel engine algorithm of the test measurement system comprises an equipment data acquisition module, a data packet receiving and transmitting module, an execution module, a test plan making module, an embedded test case storage module, an embedded test case classification module and a data processing module, wherein the equipment data acquisition module is used for acquiring equipment hardware information and driving information, constructing and defining a communication protocol packet, packaging an API (application program interface) of equipment communication, and then sending key data to the execution module through the data packet receiving and transmitting module;
the test plan making module comprises upper PC software, the upper PC software is provided with a user interaction interface and provides a function of making test plan parameters for a user, after the user makes a detailed test plan comprising time length, frequency and the like through the test plan making module, the test plan making module generates a request instruction and sends the request instruction to the embedded test case classification module, the embedded test case storage module stores preset test scripts and embedded test cases, and the embedded test case classification module searches proper test cases from the embedded test case storage module according to the information in the request instruction and sends test case data to the execution module;
the execution module stores various preset test engines, and after receiving the test case data and the software and hardware data, the execution module calls the corresponding preset test engines to execute the test script to obtain a test result;
the data processing module comprises a reporting module and a man-machine interaction interface, wherein after the reporting module receives the test result, the reporting module classifies and sorts each item of data of the test result to generate a report, and the report is displayed through the man-machine interaction interface.
The environment setting module is provided with a user interaction interface, and a user views or changes parameters configured in the test environment through the user interaction interface.
The configuration parameters in the test environment comprise the IP address and port number of the test instrument, the IP address and port number information of the equipment to be tested.
The system comprises a device data acquisition module, an execution module, a session module, an environment setting module, a parameter configuration module, a communication interface and a device data interaction module, wherein the execution module is connected with the device data acquisition module through the session module, a user can change environment parameters or send operation instructions through a user interaction interface, the environment setting module sends parameter configuration instructions and operation instructions to the device data acquisition module through the session module, and interaction is completed with the device according to the communication interface packaged by the device data acquisition module.
The embedded test case classification module searches scripts from the embedded test case storage module, and specifically comprises the following steps: the embedded test case classification module firstly extracts various information in the request instruction, searches corresponding test case data according to the file path and the file name, and then extracts a required test script and test case from the test case data according to the script type and the test case identifier.
The execution module comprises an interpreter, after receiving the data packet transmitted by the equipment data acquisition module, a section of special memory area is allocated for the test in the interpreter, a lookup table of the memory area is built, the lookup table is correspondingly updated after receiving the test case data, the data is written into the special memory area, a path search algorithm and constraint solution are utilized, and a test case set is generated through repeated iteration.
The data processing module further comprises an abnormal information recording module, when the system generates error information such as abnormal data feedback in the test process, the error information is recorded in time, and workers are prompted through a human-computer interaction interface.
The data processing module also comprises a log module, wherein the log module is used for tracking interaction records of the system and the equipment, recording execution results of each test command and storing according to specific date and time.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.