Method for Implementing Embedded Software Algorithm Testing Based on Labview

By packaging algorithm code and simulating noise in the Labview environment, the simulation verification of embedded software algorithms is solved, and the applicability and cost of embedded software testing is improved, and the development efficiency and verification effect are improved.

CN115587039BActive Publication Date: 2025-07-04BEIJING INST OF COMP TECH & APPL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211291969.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-07-04
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

The existing embedded software testing methods have poor applicability, no technology can be popularized, and the maintenance and rectification costs are high. Especially in military embedded software, it is impossible to effectively verify the operating requirements of the target machine on the host.

Method used

Using the Labview development environment, the simulation verification of embedded software algorithm algorithms is achieved by packaging the algorithm code segments into DLL files, establishing input and output controls, simulating noise and performing Fourier changes, and analyzing the time and frequency domain characteristics in real time.

Benefits of technology

Without a real operating environment, the verification algorithm can be effectively simulated, saving time and resource costs for waiting for real environment verification, improving software development efficiency, and reducing later rework and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115587039B_ABST
    Figure CN115587039B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for implementing embedded software algorithm testing based on Labview, belonging to the field of embedded software testing. In the present invention, the algorithm code segments of developers are packaged into dll files, and the packaged dll files are called by using the Labview development environment. Input and output controls are established with Labview to simulate noise, and the input data and output data are subjected to two Fourier transforms by Labview to analyze the time-domain and frequency-domain characteristics in real time. The present invention saves the time and resource costs of waiting for verification in a real operating environment, can discover problems existing in the algorithm at the initial stage of code development, improves the software development efficiency, and saves the costs of later rework and maintenance. The present invention is simple and efficient to implement, meeting the requirements of military embedded software testing applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of embedded software testing, and particularly relates to a method for implementing embedded software algorithm testing based on Labview. Background Art

[0002] As is well known, the development of embedded software is carried out on a host computer, but it runs on a target machine. This characteristic determines the complexity of embedded software configuration item testing. Military embedded software is an even more special case. It often only has a running environment when the product is delivered. Therefore, the previous software debugging and testing work can only be carried out on the host computer. How to ensure that the test results on the host computer can meet the running requirements in the target machine application environment and operating system is the core goal of embedded software testing. Therefore, for military embedded software configuration item testing, we often need to build various simulation environments to effectively complete the testing.

[0003] Taking the digital filtering algorithm as an example, most of the time, testers do not perform any test verification work. On the one hand, it is considered that the algorithm is mature and the model is fixed, so there is no need to test and verify anymore. On the other hand, the environment is limited and there are no verification conditions. Wait until there is a running environment to verify with the whole product. However, there are also a few testers who will carry out some verification work within their capabilities. The main verification techniques are as follows:

[0004] One: Simulate and test in the host computer development environment or other development environments. Set a group or several data within a reasonable range as the input of the algorithm, simulate and run to view the output, and compare the characteristics of the input and output data. The verification result of this test method is single. Simple data analysis is okay, but it cannot verify the time domain and frequency domain effects after the filtering algorithm. Therefore, the applicability is poor and the technology has no scalability.

[0005] Two: Verify the algorithm model when there is a running environment. This verification method is indeed effective. However, for military embedded software, testing when there is a running environment often seriously lags behind the test verification stage in the software development cycle model. Moreover, once a problem is found at this time, the cost of maintenance and rectification will also increase exponentially. Therefore, this method is also not ideal for military embedded software testing. Summary of the Invention

[0006] (1) Technical Problems to be Solved

[0007] The technical problem to be solved by the present invention is how to provide a method for implementing embedded software algorithm testing based on Labview to solve the problems of poor applicability of existing embedded software testing methods, lack of scalability of technology, and high cost of maintenance and rectification.

[0008] (2) Technical Solutions

[0009] To solve the above technical problems, the present invention proposes a method for testing an embedded software algorithm based on Labview, and the method includes the following steps:

[0010] S11. Package the algorithm code segment of the developer into a dll file: Take the original data to be calculated and the algorithm model compensation parameters as the input variables Data_in1 and Data_in2 of the function, and take the final calculation result as the output variable Data_out of the function, and then package it into a dynamic link library file.dll;

[0011] S12. Use the Labview development environment to call the packaged dll file, create two double-type input controls, one float-type input control and one double-type output control with Labview. The double-type input controls are respectively linked to Data_in1 and Data_in2. The float-type input control simulates the environmental noise to affect the data Data_in3. After superimposing Data_in3 on Data_out, it is linked to the double-type output control;

[0012] S13. Then use Labview to call the digital signal generator to inject any change rate value Data_in1 that may appear in the real environment into the function in the dynamic link library file in real time through the input control, and input the compensation parameters Data_in2 given by the algorithm model; at the same time, in combination with other performance requirements or environmental impacts of the product, use Labview to call the random number generator and adjust the range to form the environmental noise to affect the data Data_in3. Finally, output the Data_out value after superimposing Data_in3 through the output control;

[0013] S14. Perform two Fourier transforms on the input data Data_in1 value and the Data_out value after the final noise superposition through Labview, and analyze the time domain and frequency domain characteristics in real time.

[0014] Further, the algorithm is an accelerometer digital filtering algorithm.

[0015] Further, in the step S11, the function name in the dynamic link library file is IIR_Filter_Acce(), and the function prototype is double IIR_Filter_Acce(double*Data_in1,double Data_in2,double*Data_out).

[0016] Further, in the step S14, the analysis of the time domain and frequency domain characteristics is presented in a visual interface.

[0017] A method for implementing embedded software algorithm testing based on Labview, the method comprising the following steps:

[0018] S21. Package the algorithm code segment of the developer into a dll file: Take the original data to be calculated and the algorithm model compensation parameters as the input variables Data_in1 and Data_in2 of the function; Take the final calculation result as the output variable Data_out; Then package it into a dynamic link library file.dll;

[0019] S22. Develop parameter input sub VIs, Data_in1.VI, Data_in2.VI, Data_in3.VI with Labview:

[0020] Data_in1.VI: Implement arbitrary data output with controllable output duration, configurable period, adjustable amplitude, and configurable input parameter form, and output variable Data_out_in1;

[0021] Data_in2.VI: Manually input parameter values and numbers, or directly import the compensation parameter file for quick matching, and output variable Data_out_in2;

[0022] Data_in3.VI: According to the possible noise requirements, output random numbers with configurable noise range and configurable noise quantity, and output variable Data_out_in3;

[0023] S23. Develop the algorithm verification main program Main.VI environment with Labview, call the packaged dll file, and two sub VIs, Data_in1.VI and Data_in2.VI, and link the output variables Data_out_in1 and Data_out_in2 of the two sub VIs with the input variables Data_in1 and Data_in2 of the dynamic link library.dll file respectively;

[0024] S24. Use the Labview main program Main.VI to call the noise source Data_in3.VI sub VI, configure the number and range of noises according to actual requirements, and superimpose the noise output Data_out_in3 on Data_in1 or Data_in2 or Data_out;

[0025] S25. Finally, compare the initial input data Data_in1 with the final output data Data_out to obtain the result to be tested, and present the result in a visual interface.

[0026] Further, the algorithm is an accelerometer digital filtering algorithm.

[0027] Further, the function name in the dynamic link library file is IIR_Filter_Acce(), and the function prototype is double IIR_Filter_Acce(double* Data_in1, double Data_in2, double* Data_out).

[0028] Further, the input parameter forms of Data_in1.VI include: sine wave, triangular wave, and Gaussian signal wave.

[0029] Further, Data_in3.VI outputs several groups of random numbers, and different groups of random numbers represent different noise sources.

[0030] Further, the specific steps of step S25 include: for the digital filter algorithm test, through two-time Fourier transforms in Labview, the time-domain and frequency-domain characteristics are analyzed in real time; for the error or precision compensation algorithm test, through difference comparison, error analysis is performed; for the clipping algorithm test, a threshold range is given by Labview, and through range determination, the clipping situation is analyzed.

[0031] (III) Beneficial effects

[0032] The present invention proposes a method for implementing embedded software algorithm testing based on Labview. Compared with the prior art, the technical solution proposed in the present invention establishes a simulation verification environment for military embedded software algorithms, and all algorithms can be dynamically simulated by the same principle, basically meeting the requirements of algorithm simulation verification.

[0033] The present invention saves the time and resource costs of waiting for verification in the real operating environment, can discover problems existing in the algorithm at the initial stage of code development, improves the software development efficiency, and saves the costs of later rework and maintenance. The present invention is simple and efficient, meeting the requirements of military embedded software testing applications. Description of the drawings

[0034] Figure 1 It is a flowchart of the method for verifying the digital filter algorithm of the present invention;

[0035] Figure 2 It is a flowchart of the preferred embodiment of the algorithm verification process of the present invention. Specific implementation manners

[0036] To make the purpose, content, and advantages of the present invention clearer, the following further describes in detail the specific implementation manners of the present invention with reference to the drawings and embodiments.

[0037] The objective of the present invention is to be able to conduct algorithm testing without the target environment for running military embedded software, and at the same time ensure that the test results are fully valid. It should be able to single-step simulate the algorithm results and effectively and real-time feedback the time-domain and frequency-domain characteristics of the data before and after the algorithm.

[0038] The main process of the technical solution of the present invention is as Figure 1 shown. The method for implementing embedded software algorithm testing based on Labview proposed by the present invention, taking the acceleration digital filtering algorithm testing as an example, includes the following steps:

[0039] S11. Package the algorithm code segment of the developer into a dll file: Take the original data to be calculated and the algorithm model compensation parameters as the input variables Data_in1 and Data_in2 of the function, and take the final calculation result as the output variable Data_out of the function, and then package it into a dynamic link library file.dll. The function name in the dynamic link library file is IIR_Filter_Acce(), and the function prototype is double IIR_Filter_Acce(double*Data_in1,doubleData_in2,double*Data_out);

[0040] S12. Use the Labview development environment to call the packaged dll file. Use Labview to create two double-type input controls, one float-type input control, and one double-type output control. The double-type input controls are respectively linked to Data_in1 and Data_in2. The float-type input control simulates the environmental noise to affect the data Data_in3. After superimposing Data_in3 on Data_out, it is linked to the double-type output control;

[0041] S13. Then use Labview to call the digital signal generator (this is a Labview development library function), and inject any change rate value Data_in1 that may appear in the real environment into the function IIR_Filter_Acce() in the dynamic link library file in real time through the input control, and input the compensation parameter Data_in2 given by the algorithm model; at the same time, in combination with other performance requirements or environmental impacts of the product, use Labview to call the random number generator and adjust the range to form the environmental noise to affect the data Data_in3. Finally, output the Data_out value after superimposing Data_in3 through the output control; the above can basically ensure that the simulation environment is zero-different from the real environment;

[0042] S14. Finally, the value of the input data Data_in1 and the Data_out value after the final noise superposition are subjected to two Fourier transforms by Labview to analyze the time-domain and frequency-domain characteristics in real time;

[0043] The analysis of the time-domain and frequency-domain characteristics is presented in a visual interface, and the lag situation of the phase and the attenuation situation of the amplitude frequency can be seen. Therefore, it is obvious whether this set of algorithms meets the requirements.

[0044] To better implement the above scheme, improve the test efficiency, and realize the general design of the simulation verification environment, combined with the actual application, the present design is further optimized. The optimization process is as Figure 2 shown, and the specific implementation steps are as follows:

[0045] S21. Package the algorithm code segment of the developer into a dll file: Take the original data to be calculated and the algorithm model compensation parameters as the input variables Data_in1 and Data_in2 of the function. Take the final calculation result as the output variable Data_out. Then package it into a dynamic link library file.dll, where the function name in the dynamic link library file is IIR_Filter_Acce(), and the function prototype is double IIR_Filter_Acce(double*Data_in1,double Data_in2,double*Data_out);

[0046] S22. Develop parameter input sub-VIs with Labview, Data_in1.VI, Data_in2.VI, Data_in3.VI:

[0047] a) Data_in1.VI: Realize the output of arbitrary data with controllable output duration, configurable period, adjustable amplitude, and configurable input parameter form (such as sine wave, triangular wave, Gaussian signal wave, etc.), and the output variable is Data_out_in1;

[0048] b) Data_in2.VI: The parameter values and the number can be manually input, or the compensation parameter file can be directly imported for quick matching, and the output variable is Data_out_in2;

[0049] c) Data_in3.VI: According to the possible noise requirements, generate random numbers Data_in31, Data_in32, Data_in33... with configurable output noise range and configurable number of noises. Different groups of random numbers represent different noise sources, and several groups of data represent several noise sources. The output variable is Data_out_in3.

[0050] S23. Use Labview to develop the algorithm verification main program Main.VI environment, call the packaged dll file, and two sub-VIs, Data_in1.VI and Data_in2.VI. Link the output variables Data_out_in1 and Data_out_in2 of the two sub-VIs to the input variables Data_in1 and Data_in2 of the dynamic link library.dll file respectively;

[0051] S24. Use the Labview main program Main.VI to call the noise source Data_in3.VI sub-VI, configure the number and range of noises according to actual needs, and superimpose the noise output Data_out_in3 on Data_in1 or Data_in2 or Data_out. Since the position points affected by the external environmental noise of different batches of products will be different, the position of noise superposition is designed to be adjustable and configurable here, and the superposition method is numerical addition;

[0052] The above can basically ensure that the simulation environment is zero-different from the real environment;

[0053] S25. Finally, compare the initial input data Data_in1 with the final output data Data_out to obtain the desired test results. For example: for the digital filter algorithm test, the time-domain and frequency-domain characteristics can be analyzed in real time through two Fourier transforms in Labview; for the error or precision compensation algorithm test, error analysis can be performed through difference comparison; for the clipping algorithm test, the threshold range can be given by Labview, and the clipping situation can be analyzed through range determination, etc.

[0054] S26. All operations and analyses are presented in a visual interface, which is easy to operate and the analysis results can be seen intuitively.

[0055] After the entire environment is set up, for different algorithm verifications, only the dynamic link library.dll file needs to be replaced.

[0056] Compared with the existing technology, in the technical solution proposed by the present invention, a simulation verification environment for military embedded software algorithms is established. The same principle can realize the dynamic simulation of all algorithms, basically meeting the requirements of algorithm simulation verification.

[0057] The present invention saves the time and resource costs of waiting for verification in the real operating environment, can discover problems existing in the algorithm at the initial stage of code development, improves the software development efficiency, and saves the cost of later rework and maintenance. The present invention is simple and efficient to implement, meeting the requirements of military embedded software testing applications.

[0058] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.

Claims

1. A method for implementing embedded software algorithm testing based on Labview, characterized in that, The method includes the following steps: S11. Package the algorithm code segment of the developer into a.dll file: Use the original data to be calculated and the algorithm model compensation parameters as the input variables Data_in1 and Data_in2 of the function, and use the final calculation result as the output variable Data_out of the function, and then package it into a dynamic link library file.dll; S12. Use the Labview development environment to call the packaged.dll file. Use Labview to create two double-type input controls, one float-type input control and one double-type output control. The double-type input controls are respectively linked to Data_in1 and Data_in2. The float-type input control simulates the environmental noise influence data Data_in3. After superimposing Data_in3 on Data_out, it is linked to the double-type output control; S13. Then use Labview to call the digital signal generator to inject any change rate value Data_in1 that may appear in the real environment into the function in the dynamic link library file in real time through the input control, and input the compensation parameters Data_in2 given by the algorithm model; at the same time, in combination with other performance requirements or environmental impacts of the product, use Labview to call the random number generator and adjust the range to form the environmental noise influence data Data_in3. Finally, output the Data_out value after superimposing Data_in3 through the output control; S14. Perform two Fourier transforms on the input data Data_in1 value and the Data_out value after final noise superposition through Labview, and analyze the time-domain and frequency-domain characteristics in real time.

2. The method for testing an embedded software algorithm based on Labview as described in claim 1, wherein The algorithm is an accelerometer digital filtering algorithm.

3. The method for implementing the embedded software algorithm test based on Labview according to claim 2, wherein In step S11, the function name in the dynamic link library file is IIR_Filter_Acce(), and the function prototype is double IIR_Filter_Acce(double* Data_in1, double Data_in2, double* Data_out).

4. The method for testing an embedded software algorithm based on Labview as described in any one of claims 1-3, characterized in that, In step S14, the analysis of the time-domain and frequency-domain characteristics is presented in a visual interface.

5. A method for implementing the test of embedded software algorithms based on Labview, characterized in that, The method includes the following steps: S21. Package the algorithm code segment of the developer into a.dll file: Use the original data to be calculated and the algorithm model compensation parameters as the input variables Data_in1 and Data_in2 of the function; use the final calculation result as the output variable Data_out of the function; and then package it into a dynamic link library file.dll; S22. Use Labview to develop parameter input sub-VIs, Data_in1.VI, Data_in2.VI, Data_in3.VI: Data_in1.VI: Realize the output of any data with controllable output duration, configurable period, adjustable amplitude, and configurable input parameter form, and output variable Data_out_in1; Data_in2.VI: The parameter values and quantities are manually input, or the compensation parameter file is directly imported for quick matching, and the output variable Data_out_in2 is output; Data_in3.VI: According to the possible noise requirements, random numbers with a configurable noise range and quantity are output, and the output variable Data_out_in3 is output; S23. Use Labview to develop an algorithm to verify the Main.VI environment, call the packaged dll file, and two sub-VIs, Data_in1.VI and Data_in2.VI. Link the output variables Data_out_in1 and Data_out_in2 of the two sub-VIs to the input variables Data_in1 and Data_in2 of the dynamic link library.dll file respectively; S24. Use the Labview main program Main.VI to call the noise source Data_in3.VI sub-VI, configure the number and range of noises according to actual requirements, and superimpose the noise output Data_out_in3 on Data_in1 or Data_in2 or Data_out; S25. Finally, compare the initial input data Data_in1 with the final output data Data_out to obtain the desired test results, and the results are presented in a visual interface.

6. The method for implementing the embedded software algorithm test based on Labview according to claim 5, characterized in that The algorithm is an accelerometer digital filtering algorithm.

7. The method for implementing the embedded software algorithm test based on Labview as claimed in claim 6, wherein The function name in the dynamic link library file is IIR_Filter_Acce(), and the function prototype is double IIR_Filter_Acce(double*Data_in1,double Data_in2,double*Data_out).

8. The method for implementing the embedded software algorithm test based on Labview according to claim 5, characterized in that The input parameter forms of the Data_in1.VI include: sine wave, triangular wave, and Gaussian signal wave.

9. The method for implementing the embedded software algorithm test based on Labview according to claim 5, characterized in that, The Data_in3.VI outputs several groups of random numbers, and different groups of random numbers represent different noise sources.

10. The method for testing an embedded software algorithm based on Labview according to claim 5, wherein, The specific steps of S25 include: For the digital filter algorithm test, through two Fourier transforms in Labview, the time-domain and frequency-domain characteristics are analyzed in real time; for the error or precision compensation algorithm test, through difference comparison, error analysis is performed; for the clipping algorithm test, a threshold range is given by Labview, and the clipping situation is analyzed through range determination.

Citation Information

Patent Citations

  • Development of Realtime, Embedded S / W Component Testing and Realtime Analysis Methods and Systems

    KR1020040087767A

  • Method for managing test measurements

    US6542841B1