Embedded kernel engine algorithm for testing measurement system
Technical Field
The invention relates to the technical field of embedded testing, in particular to an embedded kernel engine algorithm for testing a measurement system.
Background
An embedded system is a "device that controls, monitors, or assists the operation of devices, machines, and equipment" (devices that use to control, monitor, or assist the operation of the devices, machines, and equipment) as defined by the 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 encompass mechanical and other accessories. At present, a commonly accepted definition in China is as follows: the computer system is a special computer system which takes application as a center, takes computer technology as a basis, can cut software and hardware, and is suitable for strict requirements of multiple functions, reliability, cost, volume and power consumption of an application system. Failure of the security of the embedded system may have catastrophic consequences, even if it is a non-secure system, resulting in severe economic losses due to mass production. This requires rigorous testing, validation and verification of the embedded system, including the embedded software. With the increasing use of software and microprocessors in more and more fields to control various embedded devices, it is increasingly important to quickly and effectively test increasingly complex embedded software. The current test measurement system needs to independently build and compile test cases for different embedded software and hardware, different embedded software and hardware cannot realize different logic applications, and the universality is poor.
Disclosure of Invention
The invention aims to provide an embedded kernel engine algorithm of a test measurement system to solve the problems in the background technology.
In order to achieve the purpose, the invention provides the following technical scheme: the embedded kernel engine algorithm of the test measurement system comprises an equipment data acquisition module, a data packet transceiving 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) interface of equipment communication, and then sending key data to the execution module through the data packet transceiving 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 for a user to make test plan parameters, after the user makes a detailed test plan comprising information such as duration, times 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, various preset test scripts and embedded test cases are stored in the embedded test case storage module, the embedded test case classification module searches for a proper test case 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 test case data and software and hardware data, calls the corresponding preset test engines and executes the test scripts to obtain test results;
the data processing module comprises a reporting module and a human-computer interaction interface, and after the reporting module receives the test result, the data processing module classifies and arranges all the data of the test result to generate a report and displays the report through the human-computer interaction interface.
Preferably, the test environment further comprises an environment setting module, the environment setting module is provided with a user interaction interface, and a user views or changes the parameters configured in the test environment through the user interaction interface.
Preferably, the configuration parameters in the test environment include an IP address and a port number of the test instrument, and an IP address and a port number of the device to be tested.
Preferably, the system further comprises a session module, the execution module is connected with the device data acquisition module through the session module, a user can change environmental parameters or send an operation instruction through a user interaction interface, the environment setting module sends the parameter configuration instruction and the operation instruction to the device data acquisition module through the session module, and interaction with the device is completed according to a communication interface packaged by the device data acquisition module.
Preferably, the step of searching the script from 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 out corresponding test case data according to the file path and the file name, and then extracts required test scripts and test cases from the test case data according to the script type and the test case identification.
Preferably, the execution module includes an interpreter, after receiving a data packet transmitted by the device data acquisition module, allocates a dedicated memory area for the test in the interpreter, establishes a lookup table of the memory area, subsequently updates the lookup table correspondingly after receiving test case data, writes the data into the dedicated memory area, solves the problem by using a path search algorithm and constraints, and generates a test case set through repeated iteration.
Preferably, the data processing module further comprises an abnormal information recording module, and when the system generates error information such as abnormal data feedback in the test process, the abnormal data feedback is recorded in time, and the human-computer interaction interface prompts workers.
Preferably, the data processing module further includes a log module, and the log module is configured to track interaction records between the system and the device, record execution results of each test command, and store the execution results according to specific dates and times.
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 large amount of time for manually compiling 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 principle of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "vertical", "upper", "lower", "horizontal", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of describing the present invention and simplifying the description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, 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 otherwise explicitly specified or limited, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly and may, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
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 transceiving 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) interface of equipment communication, and then sending key data to the execution module through the data packet transceiving 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 for a user to make test plan parameters, after the user makes a detailed test plan comprising information such as duration, times 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, various preset test scripts and embedded test cases are stored in the embedded test case storage module, the embedded test case classification module searches for a proper test case 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 test case data and software and hardware data, calls the corresponding preset test engines and executes the test scripts to obtain test results;
the data processing module comprises a reporting module and a human-computer interaction interface, and after the reporting module receives the test result, the data processing module classifies and arranges all the data of the test result to generate a report and displays the report through the human-computer interaction interface.
The test environment monitoring system further comprises an environment setting module, the environment setting module is provided with a user interaction interface, and a user checks or changes parameters configured in the test environment through the user interaction interface.
The configuration parameters in the test environment comprise IP addresses and port numbers of the test instruments, and IP addresses and port number information of the equipment to be tested.
The environment setting module sends the parameter configuration instruction and the operation instruction to the equipment data acquisition module through the session module, and interaction with equipment is completed according to a communication interface packaged by the equipment data acquisition module.
The embedded test case classification module searches the script from the embedded test case storage module specifically comprises the following steps: the embedded test case classification module firstly extracts various information in the request instruction, searches out corresponding test case data according to the file path and the file name, and then extracts required test scripts and test cases from the test case data according to the script type and the test case identification.
The execution module comprises an interpreter, a special memory area is distributed for the test in the interpreter after a data packet transmitted by the equipment data acquisition module is received, a query table of the memory area is established, the query table is correspondingly updated after test case data is received, 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 also comprises an abnormal information recording module which is used for recording in time when the system generates error information such as abnormal data feedback and the like in the test process and prompting the working personnel through a human-computer interaction interface.
The data processing module also comprises a log module which is used for tracking the interaction record of the system and the equipment, recording the execution result of each test command and storing the execution result according to the specific date and time.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.