Simulation starting test method and device of embedded equipment, equipment and medium
Through the simulated startup testing method of embedded devices and using test samples to simulate startup testing, the problems of embedded device daemon program detection stability and low effectiveness testing efficiency are solved, automated monitoring and remediation are realized, and detection efficiency is improved.
Patent Information
- Application Number
- CN202410908018.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When an embedded device is started, the stability and validity detection efficiency of the daemon program is low, requiring manual troubleshooting of abnormal situations, resulting in low testing efficiency.
Provide a simulated startup test method for embedded devices. By obtaining multiple test samples, simulate the startup test to determine whether the startup control program can be started normally. If it is normal, the test will be ended. Otherwise, the loop will be looped until the process ends normally, and a test log and test log will be generated. Prompt information to improve detection efficiency.
There is no need to manually check the validity and stability of the daemon program, which improves testing efficiency and ensures that the daemon can accurately and timely monitor and remedy the startup process of the main program.
Smart Images

Figure CN118747154A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and medium for simulating startup testing of an embedded device. Background Art
[0002] With the rapid development of embedded systems, embedded systems have been widely used in many fields, such as medical equipment, smart home and industrial automation. When embedded devices are updated and iterated, it is crucial to ensure the stable operation of embedded devices. At present, when an embedded device is started, the ifconfig command is generally used in the startup script rc.local to configure network parameters such as IP address and gateway information, and the program is started by executing the executable file. However, due to abnormal startup or shutdown operations by non-technical personnel or customers, it is easy to cause abnormalities in embedded devices, resulting in the failure of embedded devices to start normally.
[0003] In the prior art, in order to ensure that the embedded device can start normally, it is necessary to use a daemon program to detect various abnormal situations in the main program startup process in real time and take timely remedial measures. However, whether the daemon program can accurately detect various abnormal situations and take remedial measures needs to be checked manually, resulting in low test efficiency when detecting the stability and effectiveness of the daemon program. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a simulation startup test method, device, equipment and medium for an embedded device to solve the problem of low test efficiency when detecting the stability and effectiveness of a daemon program.
[0005] In a first aspect, an embodiment of the present application provides a simulation startup test method for an embedded device, comprising:
[0006] Acquire multiple test samples corresponding to the startup control program to be tested, each test sample is used to test a file abnormality under a file type;
[0007] Selecting a target test sample used in this round of simulated startup test from multiple test samples, and determining whether the startup control program can be started normally under the target test sample;
[0008] If the startup control program can be started normally, the current round of simulated startup test is ended, and the next test sample of the target test sample is used as the latest target test sample to perform the next round of simulated startup test using the latest target test sample.
[0009] Optionally, determining whether the startup control program can be started normally under the target test sample includes: modifying a program file stored in the embedded device according to the target test sample, and starting the startup control program using the modified program file to determine whether the startup control program can be started normally under the target test sample.
[0010] Optionally, after determining whether the startup control program can be started normally under the target test sample, it also includes: obtaining a startup process identifier corresponding to the startup control program; and executing an end instruction on the process corresponding to the startup process identifier to end this round of simulated startup test.
[0011] Optionally, after completing this round of simulation startup test, it also includes: determining whether the process corresponding to this round of simulation startup test ends normally; if the process does not end normally, returning to execute the step of obtaining the startup process identifier corresponding to the startup control program until the process ends normally.
[0012] Optionally, before taking the next test sample of the target test sample as the latest target test sample, it also includes: determining whether the simulation startup test for all test samples is completed; if the simulation startup test for all test samples is not completed, selecting the next test sample as the latest target test sample; if the simulation startup test for all test samples is completed, generating a startup test log corresponding to all simulated startup tests, and generating a test prompt message based on the startup test log.
[0013] Optionally, the multiple test samples include test samples for different file types and different test types; the different file types include configuration file type, default program file type, upgrade program file type, backup program file type, default program compressed file type, upgrade program compressed file type and backup program compressed file type; the different test types include file size test type and file integrity test type.
[0014] Optionally, obtaining a plurality of test samples corresponding to the startup control program to be tested includes: obtaining a program identifier to be tested corresponding to the embedded device; and selecting a test sample corresponding to the program identifier to be tested from a database.
[0015] In a second aspect, an embodiment of the present application further provides a simulation startup test device for an embedded device, the device comprising:
[0016] A test sample acquisition module, used to acquire multiple test samples corresponding to the startup control program to be tested, each test sample is used to test a file abnormality under a file type;
[0017] The program startup test module is used to select a target test sample used in this round of simulation startup test from multiple test samples, and determine whether the startup control program can be started normally under the target test sample;
[0018] The loop test module is used to end the current round of simulated startup test if the startup control program can be started normally, and use the next test sample of the target test sample as the latest target test sample to perform the next round of simulated startup test using the latest target test sample.
[0019] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the simulation startup test method of the embedded device as described above are performed.
[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the simulation startup test method for an embedded device as described above are executed.
[0021] The embodiments of the present application bring the following beneficial effects:
[0022] The embodiments of the present application provide a simulation startup test method, apparatus, device and medium for an embedded device, which can obtain test samples corresponding to the startup control program, and determine whether the startup control program of the embedded device can be started normally through the simulation startup test under each test sample. If it is determined that the startup control program can be started normally under all test samples, it means that the daemon program can accurately and timely monitor and remedy the startup process of the main program, and there is no need to manually test the effectiveness and stability of the daemon program, thereby improving the test efficiency. Compared with the simulation startup test method for embedded devices in the prior art, the problem of low test efficiency when detecting the stability and effectiveness of the daemon program is solved.
[0023] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A flowchart of a simulation startup test method for an embedded device provided in an embodiment of the present application is shown;
[0026] Figure 2 A schematic diagram of the structure of a simulation startup test device for an embedded device provided in an embodiment of the present application is shown;
[0027] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0029] It is worth noting that before the present application was proposed, with the rapid development of embedded systems, embedded systems have been widely used in many fields, for example, in the fields of medical equipment, smart home and industrial automation, etc., showing broad application prospects. When embedded devices are updated and iterated in technology, how to ensure the stable operation of embedded devices is crucial. At present, when an embedded device is started, the ifconfig command is generally used in the startup script rc.local to configure network parameters such as IP address and gateway information, and the program startup is completed by executing the executable file. However, due to abnormal startup or shutdown operations by non-technical personnel or customers, it is easy to cause abnormal embedded devices, resulting in the inability of embedded devices to start normally. In the prior art, in order to ensure that the embedded device can start normally, it is necessary to use a daemon program to detect various abnormal situations in the startup process of the main program in real time, and use backup files for timely remediation, but whether the daemon program can accurately detect various abnormal situations and remedy them needs to be checked manually, resulting in low test efficiency when detecting the stability and effectiveness of the daemon program.
[0030] Based on this, an embodiment of the present application provides a simulation startup test method for an embedded device to improve the test efficiency when detecting the stability and effectiveness of a daemon program.
[0031] The simulation startup test method for an embedded device provided in the present application can be implemented through simulation startup test software, and the simulation startup test software is installed in the file system of the embedded device.
[0032] See also Figure 1 , Figure 1 This is a flow chart of a simulation startup test method for an embedded device provided in an embodiment of the present application. Figure 1 As shown, the simulation startup test method of the embedded device provided in the embodiment of the present application includes:
[0033] Step S101, obtaining a plurality of test samples corresponding to the startup control program to be tested.
[0034] In this step, the startup control program may refer to a main program (default program) and a daemon program that implement business functions in the embedded device.
[0035] The test sample is used to characterize possible normal or abnormal file conditions. Each test sample is used to test a normal or abnormal file condition under a file type. Exemplarily, the test sample is a piece of code used to simulate abnormal file conditions of a configuration file.
[0036] The multiple test samples include test samples for different file types and different test types. Different file types include configuration file types, default program file types, upgrade program file types, backup program file types, default program compressed file types, upgrade program compressed file types, and backup program compressed file types; different test types include file basic test types, file size test types, and file integrity test types. Among them, the default program file type is also called the main program file type, the default program compressed file type is also called the main program compressed file type, and the main program may refer to a program used to implement business functions in an embedded device.
[0037] The file basic test type is used to test whether the daemon program can detect whether the file is normal or does not exist. The file size test type is used to test whether the daemon program can detect whether the file size is abnormal. The file integrity test type is used to test whether the daemon program can detect whether the file is incomplete. The test samples under the file size test type include test samples with a file size of 0, a file size of 1, and a file size less than the preset security threshold. The test samples under the file integrity test type include: test samples with abnormal file integrity verification data and test samples with abnormal compressed package integrity verification.
[0038] In an embodiment of the present application, an identification of a program to be tested corresponding to an embedded device is obtained, and a test sample corresponding to the identification of the program to be tested is selected from a database, wherein the identification of the program to be tested may be the device name of an embedded device. The user inputs the identification of the program to be tested into the simulation startup test software, and the simulation startup test software obtains a test sample matching the identification of the program to be tested from the database. Since test samples corresponding to different embedded devices are stored in the database, assuming that a total of 38 test samples are set for the current embedded device, the 38 test samples matching the device name of the current embedded device are used as the obtained multiple test samples corresponding to the startup control program to be tested. If a matching test sample is not obtained, an error prompt message is issued to indicate that the input name is abnormal.
[0039] Among them, the 38 test samples include multiple test samples under each file type.
[0040] The test samples for the configuration file include: normal file test sample, non-existent file test sample, file size 0 test sample, file size 1 test sample, and file size less than the safety threshold test sample.
[0041] The test samples for the default program files include: normal file test samples, file non-existence test samples, file size 0 test samples, file size 1 test samples, file size less than the security threshold test samples, and file integrity check data abnormal test samples. Among them, the normal file test case is used to test whether the daemon can detect the normal situation of the file; the non-existence test sample is used to test whether the daemon can detect the abnormal situation of the non-existence of the file; the file size 0 test sample is used to test whether the daemon can detect the abnormal situation of file read and write errors. The read and write errors are caused by abnormal power failure of the embedded device. This error will cause the size of the executable file or configuration file to become 0; the file size 1 test sample is used to test whether the daemon can detect the abnormal situation of the file size of 1 byte. The abnormal situation of the file size of 1 byte is caused by misoperation, for example: after opening a file, manually delete all the contents, then save and exit, the file size will become 1 byte; the test sample of the file size less than the preset security threshold is used to test whether the daemon can detect the abnormal situation of the file being changed; the test sample of the abnormal file integrity check data is used to test whether the daemon can detect the abnormal situation of the failure of the file integrity check.
[0042] Similar to the default program file, the upgrade program file and the backup program file also include six identical test samples, which will not be described in detail here.
[0043] The test samples for the default program compressed files include: first, a test sample in which the files are normal and the integrity check values of the five default program compressed files are consistent; second, a test sample in which the integrity check values of four compressed files in the five default program compressed files are consistent and the consistent integrity check value is inconsistent with the integrity check value of another compressed file; third, a test sample in which the integrity check values of three compressed files in the five default program compressed files are consistent and the consistent integrity check value is inconsistent with the integrity check values of the other two compressed files; fourth, a test sample in which the integrity check values of two compressed files in the five default program compressed files are consistent and the consistent integrity check value is inconsistent with the integrity check values of the other three compressed files; fifth, a test sample in which the integrity check values of the five default program compressed files are inconsistent.
[0044] Similar to the default program compressed file, the upgrade program compressed file and the backup program compressed file also include five identical test samples, which will not be described in detail here.
[0045] The integrity check value may be a CRC code or an MD5 code. Taking the test example in which the integrity check values of five default program compressed files are inconsistent as an example, five default program compressed files are configured in the file system, and the CRC check values of the five default program compressed files are made unequal to generate the fifth test example for the default program compressed files.
[0046] Step S102 : selecting a target test sample used in this round of simulated startup test from a plurality of test samples, and determining whether the startup control program can be started normally under the target test sample.
[0047] In this step, in order to accurately determine whether the daemon program can detect different abnormal situations of the main program in time and make timely remedies, it is necessary to test the startup of the main program and the daemon program under each test sample.
[0048] In an embodiment of the present application, the target test samples in this round of simulated startup test can be selected from multiple test samples in sequence according to a preset order. For example, first select the test sample numbered 1 as the target test sample to determine whether the startup control program can be started normally under the test sample numbered 1.
[0049] Specifically, the program file stored in the embedded device may be modified according to the target test sample, and the startup control program may be started using the modified program file to determine whether the startup control program can be started normally under the target test sample.
[0050] Take the test sample numbered 1 as an example, which is a test sample with a normal configuration file. In this test sample, there is no need to change the program file. Since the startup of the file under normal conditions is simulated at this time, the daemon program does not need to perform remedial work under abnormal conditions. At this time, the startup control program can be started directly, and it is determined whether the startup control program can be started normally. If it can be started normally, the startup result corresponding to the test sample numbered 1 is recorded as normal, and the first round of simulated startup test is ended; if it cannot be started normally, the startup result of the test sample numbered 1 is recorded as abnormal, and the specific abnormal information is recorded, and the first round of simulated startup test is also ended. Of course, if it cannot be started normally, the startup result of the test sample numbered 1 can also be recorded as abnormal, and all simulated startup tests can be ended, so as to restart the first round of simulated startup test after repairing the abnormality.
[0051] Take the test sample No. 2 as an example, which is a test sample in which the configuration file does not exist. At this time, the configuration file can be deleted through the test sample to simulate the abnormal situation that the configuration file does not exist. Since the abnormal situation that the configuration file does not exist is simulated, the daemon program should detect the abnormal situation in time and take remedial measures. For example, the daemon program obtains the configuration file that does not exist currently from the backup program file, and copies the obtained configuration file to the corresponding configuration file storage path to achieve the repair of the abnormal situation. Then, the startup control program is started, and it is determined whether the startup control program can be started normally. If it can be started normally, it means that the daemon program can detect the abnormal situation that the configuration file does not exist in time, and perform remedial treatment in time, record the startup result corresponding to the test sample No. 2 as normal, and end the second round of simulated startup test; if it cannot be started normally, it means that the daemon program cannot detect the abnormal situation that the configuration file does not exist in time or does not perform remedial treatment, record the startup result of the test sample No. 2 as abnormal, and record the specific abnormal information, and also end the second round of simulated startup test. Of course, if the startup cannot be normal, the startup result of the test sample numbered 2 can be recorded as abnormal, and all simulated startup tests can be terminated, so as to restart the second round of simulated startup tests after the abnormality is repaired.
[0052] The simulation startup test process under other test samples is the same as the above method. Each test sample processes the program file accordingly according to the abnormal situation it simulates, and this application will not go into details here.
[0053] Before determining whether the startup control program can be started normally under the target test sample, it is necessary to determine whether the simulated startup test for all test samples has been completed. If the simulated startup test for all test samples has not been completed, the next test sample is selected as the latest target test sample; if the simulated startup test for all test samples is completed, it means that the entire simulated startup test process has ended. At this time, according to the startup results and abnormal information recorded in each round of simulated startup test, the startup test log corresponding to all simulated startup tests can be generated, and the test prompt information can be generated according to the startup test log, and the generated prompt information can be sent to the staff so that the staff can perform corresponding processing according to the prompt information.
[0054] In addition, after determining whether the startup control program can be started normally under the target test sample, it is necessary to end this round of simulated startup test to start the next round of simulated startup test. Here, the startup process identifier corresponding to the startup control program can be obtained, where the startup process identifier can be the process number, and the end instruction is executed on the process corresponding to the startup process identifier, for example: calling the kill command to end the process to end this round of simulated startup test. Among them, the process number can be obtained by executing the following instruction: pid = $(pgrep-fa.out).
[0055] After the current round of simulated startup test is finished, it is also necessary to determine whether the process corresponding to the current round of simulated startup test is terminated normally. The following instruction can be executed to determine whether the process is terminated normally: if pgrep-x a.out> / dev / null. If the process is not terminated normally, the process returns to the step of obtaining the startup process ID corresponding to the startup control program, so as to loop the process of obtaining the startup process ID and executing the termination instruction on the process corresponding to the startup process ID until the process corresponding to the startup process ID is terminated normally.
[0056] Step S103, if the startup control program can be started normally, then end the current round of simulated startup test, and use the next test sample of the target test sample as the latest target test sample to perform the next round of simulated startup test using the latest target test sample.
[0057] In this step, if the startup control program can be started normally under the current round of target test samples, the first round of simulated startup test is terminated, and the next test sample of the target test sample used in the current round of simulated startup test is used as the target test sample used in the second round of simulated startup test. For example, if this round is the first round, the test sample numbered 2 is used as the target test sample of the second round of simulated startup test, so as to perform the second round of simulated startup test using the test sample numbered 2. This process is repeated until thirty-eight rounds of simulated startup tests corresponding to all 38 test samples are completed, and the entire simulated startup test process is terminated.
[0058] It should be noted that in each round of simulation startup test, it is necessary to enable the target test samples used in this round of simulation startup test through settings after blocking the test samples used in the previous round. For example: the current round is the Nth round of simulation startup test. If the startup result of the N-1th round of simulation startup test is abnormal, it is necessary to first restore the program files in the file system to the normal state before the N-1th round of simulation startup test, and then enable the target test samples of the Nth round of simulation startup test through settings. After the settings are completed, start the Nth round of simulation startup test. In addition, the setting process of the target test samples and the file recovery process of the previous round of simulation startup test are automatically completed by the software, without the need for human intervention, so as to improve the efficiency of the simulation startup test.
[0059] Compared with the simulated startup test method for embedded devices in the prior art, the present application can obtain test samples corresponding to the startup control program, and determine whether the startup control program of the embedded device can be started normally through the simulated startup test under each test sample in turn. If it is determined that the startup control program can be started normally under all test samples, it means that the daemon program can accurately and timely monitor and remedy the startup process of the main program, and there is no need to manually test the effectiveness and stability of the daemon program, which improves the test efficiency. Compared with the simulated startup test method for embedded devices in the prior art, the present application solves the problem of low test efficiency when detecting the stability and effectiveness of the daemon program.
[0060] Based on the same inventive concept, the embodiment of the present application also provides a simulation startup test device for an embedded device corresponding to the simulation startup test method for an embedded device. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the simulation startup test method for the embedded device in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0061] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a simulated startup test device for an embedded device provided in an embodiment of the present application. Figure 2 As shown in , the simulation startup test device 200 of the embedded device includes:
[0062] The test sample acquisition module 201 is used to acquire multiple test samples corresponding to the startup control program to be tested, each test sample is used to test a file abnormality under a file type;
[0063] The program startup test module 202 is used to select a target test sample used in this round of simulated startup test from multiple test samples, and determine whether the startup control program can be started normally under the target test sample;
[0064] The loop test module 203 is used to end the current round of simulated startup test if the startup control program can be started normally, and use the next test sample of the target test sample as the latest target test sample to perform the next round of simulated startup test using the latest target test sample.
[0065] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 3 As shown in , the electronic device 300 includes a processor 310 , a memory 320 and a bus 330 .
[0066] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 communicates with the memory 320 via the bus 330. When the machine-readable instructions are executed by the processor 310, the above-mentioned Figure 1 The steps of the simulated startup test method for an embedded device in the method embodiment shown in the figure, and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.
[0067] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the simulated startup test method for an embedded device in the method embodiment shown in the figure, and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.
[0068] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0069] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0070] 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.
[0071] 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.
[0072] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0073] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A simulation startup test method for an embedded device, characterized in that: include: Acquire multiple test samples corresponding to the startup control program to be tested, each test sample is used to test a file abnormality under a file type; Selecting a target test sample used in this round of simulated startup test from the multiple test samples, and determining whether the startup control program can be started normally under the target test sample; If the startup control program can be started normally, the current round of simulated startup test is ended, and the next test sample of the target test sample is used as the latest target test sample to perform the next round of simulated startup test using the latest target test sample.
2. The method according to claim 1, characterized in that: The determining whether the startup control program can be started normally under the target test sample includes: The program file stored in the embedded device is modified according to the target test sample, and the startup control program is started using the modified program file to determine whether the startup control program can be started normally under the target test sample.
3. The method according to claim 2, characterized in that After determining whether the startup control program can be started normally under the target test sample, the method further includes: Obtaining a startup process identifier corresponding to the startup control program; An end instruction is executed on the process corresponding to the startup process identifier to end this round of simulation startup test.
4. The method according to claim 3, characterized in that After completing this round of simulation startup testing, it also includes: Determine whether the process corresponding to this round of simulation startup test ends normally; If the process does not end normally, the process returns to the step of obtaining the startup process identifier corresponding to the startup control program until the process ends normally.
5. The method according to claim 1, characterized in that Before taking the next test sample of the target test sample as the latest target test sample, the method further includes: Determine whether the simulation startup test for all test samples is completed; If the simulation startup test for all test samples has not been completed, the next test sample is selected as the latest target test sample; If the simulated startup tests for all test samples are completed, startup test logs corresponding to all simulated startup tests are generated, and test prompt information is generated according to the startup test logs.
6. The method according to claim 1, characterized in that The multiple test samples include test samples for different file types and different test types; The different file types include configuration file type, default program file type, upgrade program file type, backup program file type, default program compressed file type, upgrade program compressed file type and backup program compressed file type; The different test types include a file size test type and a file integrity test type.
7. The method according to claim 1, characterized in that The obtaining of a plurality of test samples corresponding to the startup control program to be tested includes: Obtain the program identifier to be tested corresponding to the embedded device; A test sample corresponding to the identification of the program to be tested is selected from the database.
8. A simulated startup test device for an embedded device, characterized in that: include: A test sample acquisition module, used to acquire multiple test samples corresponding to the startup control program to be tested, each test sample is used to test a file abnormality under a file type; A program startup test module, used to select a target test sample used in this round of simulated startup test from the multiple test samples, and determine whether the startup control program can be started normally under the target test sample; The cyclic test module is used to end the current round of simulated startup test if the startup control program can be started normally, and use the next test sample of the target test sample as the latest target test sample to perform the next round of simulated startup test using the latest target test sample.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the simulation startup test method for an embedded device as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the simulation startup test method for an embedded device as described in any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
File testing method and device, electronic equipment and computer readable medium
CN117909221A
