Process scheduling test method for embedded operating system and related device

By establishing a process scheduling algorithm library and executing test cases in simulated and actual embedded operating systems, recording process switching and system performance, and generating detailed test reports, the problem of low efficiency in embedded operating system process scheduling testing is solved, and efficient fault tracing and scheduling algorithm optimization are achieved.

CN116149982BActive Publication Date: 2026-01-13STATE GRID CORPORATION OF CHINA +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211009919.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-22
Publication Date
2026-01-13
Estimated Expiration
2042-08-22

AI Technical Summary

Technical Problem

In the existing technology, the process scheduling algorithm testing methods for embedded operating systems are inefficient, the test results are simple, they are not helpful to system developers, they lack error classification and recommendations for test results, and the test methods are not adaptable to devices.

Method used

Establish a process scheduling algorithm library, execute test cases through simulation and actual embedded operating systems, record process switching information and system performance, generate detailed test reports, provide optimal process scheduling algorithms and error classification, and improve the speed of fault tracing.

Benefits of technology

It improves the efficiency and accuracy of process scheduling tests, provides detailed error reports, enhances the adaptability of the testing method to devices, recommends more efficient scheduling algorithms, and shortens the system development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116149982B_ABST
    Figure CN116149982B_ABST
Patent Text Reader

Abstract

The application discloses a process scheduling test method of an embedded operating system and a related device. The method comprises the following steps: obtaining a process scheduling algorithm to be tested of an embedded operating system to be tested, and writing the process scheduling algorithm to be tested into a pre-set process scheduling algorithm library; determining a corresponding typical test case set and a random test case set according to the process scheduling algorithm to be tested, and executing the typical test case set and the random test case set in a simulated embedded operating system by using the process scheduling algorithm in the process scheduling algorithm library to determine an average turnaround time set; taking the scheduling process algorithm with the minimum average turnaround time in the average turnaround time set as an optimal process scheduling algorithm, and recording first process scheduling information of the optimal process scheduling algorithm; executing the optimal process scheduling algorithm in the embedded operating system to be tested, recording second process scheduling information of the optimal process scheduling algorithm, and determining a test report according to the first process scheduling information and the second process scheduling information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power measurement equipment technology, and more specifically, to a process scheduling test method and related apparatus for an embedded operating system. Background Technology

[0002] Intelligent power measurement equipment is a crucial component of the physical layer of the power Internet of Things (IoT), capable of collecting, calculating, and transmitting power data. The embedded operating system mounted on this equipment is the foundation for its functionality. While much smaller than desktop and smartphone operating systems, the complexity of software development and testing, along with the hardware and software compatibility requirements with the intelligent power measurement equipment terminals, presents significant challenges for the functional testing of embedded operating systems for these devices. Different types of terminal devices operating at different times have varying functional requirements for the intelligent power measurement equipment's operating system. The response speed to these diverse needs determines the quality of services provided by the intelligent power measurement equipment, which is closely related to the economic benefits of power companies. As a key link between hardware and software, intelligent power measurement equipment allows multiple software applications to access the system in a time-sharing manner. During this access process, the operating system faces situations where multiple processes of the same type simultaneously request resources. The appropriate use of concurrency control semaphores and the selection of suitable scheduling algorithms to ensure the rapid and orderly execution of each process are significant challenges for power companies developing embedded operating systems.

[0003] In addition to considering the correctness and efficiency of process scheduling algorithms for embedded operating systems used in intelligent power measurement equipment, it is also necessary to consider the characteristics and application requirements of the equipment. Furthermore, the diversity of equipment types and application scenarios leads to a wide variety of process scheduling algorithms for embedded systems. Developers often need to conduct multiple tests and modifications to obtain the optimal process scheduling algorithm, resulting in slow system development. Currently, the testing of process scheduling algorithms for embedded operating systems mainly adopts a result-oriented approach, where testers only focus on whether the execution result of the process scheduling algorithm is correct or incorrect, and then feed the test results back to system developers. System developers find it difficult to directly identify bugs in the scheduling algorithm from such test results, affecting the system development schedule. Moreover, due to the large variety of process scheduling algorithms for embedded systems, testers need to design test cases for each process scheduling algorithm test, which also affects the testing schedule.

[0004] In summary, the current testing of process scheduling algorithms for embedded operating systems mainly suffers from the following problems: First, the test results are simplistic and offer little help to system developers; second, the testing methods lack adaptability to the system and interrupt devices, resulting in poor testing efficiency; and third, there is a lack of error classification and recommendations for the test results. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a process scheduling testing method and related apparatus for embedded operating systems.

[0006] According to one aspect of the present invention, a method for testing process scheduling in an embedded operating system is provided, comprising:

[0007] Obtain the process scheduling algorithm of the embedded operating system under test, and write the process scheduling algorithm under test into the pre-set process scheduling algorithm library;

[0008] Based on the process scheduling algorithm under test, determine the typical test case set and the random test case set corresponding to the process scheduling algorithm under test, and execute the typical test case set and the random test case set respectively using the process scheduling algorithm library in the simulated embedded operating system to determine the average turnaround time set.

[0009] The process scheduling algorithm with the minimum average turnaround time in the average turnaround time set is taken as the optimal process scheduling algorithm, and the first process switching information and the first operating system performance information of the optimal process scheduling algorithm are recorded.

[0010] The optimal process scheduling algorithm is executed in the embedded operating system under test. The second process switching information of the optimal process scheduling algorithm and the performance information of the second operating system are recorded. The test report is determined based on the first process switching information, the first operating system performance information, the second process switching information, and the second operating system performance information.

[0011] Optionally, the operation of obtaining the process scheduling algorithm of the embedded operating system under test and writing the process scheduling algorithm under test into a pre-set process scheduling algorithm library includes:

[0012] If the process scheduling algorithm under test is not in the process scheduling algorithm library, write the process scheduling algorithm under test into the process scheduling algorithm library.

[0013] Optionally, the process scheduling algorithm from the process scheduling algorithm library is used in the simulated embedded operating system to execute typical test case sets and random test case sets respectively to determine the average turnaround time set, including:

[0014] Randomly select a process scheduling algorithm from the process scheduling algorithm library, execute typical test cases in a simulated embedded operating system, and determine the first average turnaround time of the selected process scheduling algorithm;

[0015] Execute random test cases in a simulated embedded operating system to determine the second average turnaround time of the selected process scheduling algorithm;

[0016] The average turnaround time of the selected process scheduling algorithm is determined based on the first average turnaround time and the second average turnaround time.

[0017] The average turnaround time set is determined based on the average turnaround time of each process scheduling algorithm in the process scheduling algorithm library.

[0018] Optionally, based on the first process switching information, the first operating system performance information, the second process switching information, and the second operating system performance information, the operation of the test report is determined, including:

[0019] In the case where the first process switching information and the second process switching information do not match, Euclidean distance is calculated on the column vectors of the first operating system performance information and the second operating system performance information to determine the error value sequence;

[0020] Classify the error value sequence to determine the test report.

[0021] Optionally, the method further includes:

[0022] Collect process scheduling algorithm data of embedded operating systems, and build a process scheduling algorithm library based on the process scheduling algorithm data. The process scheduling algorithm data includes process scheduling algorithms and basic information about the process scheduling algorithms.

[0023] The process scheduling algorithm library is updated based on the scheduling algorithm of the process under test.

[0024] According to another aspect of the present invention, a process scheduling testing device for an embedded operating system is provided, comprising: an acquisition module, configured to acquire a process scheduling algorithm of the embedded operating system under test and write the process scheduling algorithm under test into a pre-set process scheduling algorithm library; a first determination module, configured to determine a typical test case set and a random test case set corresponding to the process scheduling algorithm under test, and execute the typical test case set and the random test case set respectively using process scheduling algorithms in the process scheduling algorithm library in a simulated embedded operating system to determine an average turnaround time set; a recording module, configured to select the scheduling process algorithm with the smallest average turnaround time in the average turnaround time set as the optimal process scheduling algorithm, and record the first process scheduling information of the optimal process scheduling algorithm; and a second determination module, configured to execute the optimal process scheduling algorithm in the embedded operating system under test, record the second process scheduling information of the optimal process scheduling algorithm, and determine a test report based on the first process scheduling information and the second process scheduling information.

[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the methods described in any of the above aspects of the present invention.

[0026] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the method described in any of the preceding aspects of the present invention.

[0027] Therefore, this invention, based on a library of commonly used process scheduling algorithms, expands upon these algorithms, selects the most suitable process scheduling algorithm for the current test case, executes the selected algorithm, and collects process switching context information and embedded operating system functional information during algorithm execution. Next, the most suitable process scheduling algorithm is executed in the actual embedded operating system, and process switching context information and embedded operating system functional information are collected again during algorithm execution. A test report is generated based on the first and second sets of collected process scheduling information. Thus, the test report generated from the two sets of collected data can improve the speed of fault tracing and accelerate fault handling efficiency. Attached Figure Description

[0028] Exemplary embodiments of the present invention can be more fully understood by referring to the following figures:

[0029] Figure 1 This is a flowchart illustrating an exemplary embodiment of the process scheduling test method for an embedded operating system provided by the present invention.

[0030] Figure 2 This is another flowchart illustrating the process scheduling test method for an embedded operating system provided in an exemplary embodiment of the present invention;

[0031] Figure 3 This is a schematic diagram illustrating the execution and error detection process of the test case scheduling algorithm provided in an exemplary embodiment of the present invention;

[0032] Figure 4 This is a schematic diagram of the object architecture for process scheduling testing of an embedded operating system provided in an exemplary embodiment of the present invention;

[0033] Figure 5 This is a schematic diagram of the structure of an embedded operating system process scheduling test device provided in an exemplary embodiment of the present invention;

[0034] Figure 6 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. Detailed Implementation

[0035] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.

[0036] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention.

[0037] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of the present invention are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.

[0038] It should also be understood that in the embodiments of the present invention, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.

[0039] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more unless explicitly defined or given contrary instructions in the context.

[0040] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.

[0041] It should also be understood that the description of the various embodiments in this invention emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.

[0042] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0043] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.

[0044] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.

[0045] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0046] The embodiments of this invention can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Well-known examples of terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.

[0047] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.

[0048] Exemplary methods

[0049] Figure 1 This is a flowchart illustrating a process scheduling test method for an embedded operating system provided in an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as… Figure 1 As shown, the process scheduling test method 100 for embedded operating systems includes the following steps:

[0050] Step 101: Obtain the process scheduling algorithm of the embedded operating system under test and write the process scheduling algorithm under test into the pre-set process scheduling algorithm library;

[0051] Step 102: Based on the process scheduling algorithm under test, determine the typical test case set and the random test case set corresponding to the process scheduling algorithm under test, and execute the typical test case set and the random test case set respectively using the process scheduling algorithm library in the simulated embedded operating system to determine the average turnaround time set;

[0052] Step 103: Select the scheduling process algorithm with the minimum average turnaround time in the average turnaround time set as the optimal process scheduling algorithm, and record the first process switching information and the first operating system performance information of the optimal process scheduling algorithm.

[0053] Step 104: Execute the optimal process scheduling algorithm in the embedded operating system under test, record the second process switching information of the optimal process scheduling algorithm and the performance information of the second operating system, and determine the test report based on the first process switching information, the first operating system performance information, the second process switching information and the second operating system performance information.

[0054] Specifically, refer to Figure 1 and Figure 2 As shown, functional testing of embedded operating systems for intelligent power measurement equipment is mainly conducted manually, relying entirely on the tester's experience to select test cases. Analysis and experiments have revealed that this manual selection method is often insufficient to eliminate process scheduling errors in embedded systems. This application proposes a process scheduling testing method for the functional testing of embedded operating systems for intelligent power measurement equipment, as follows: Figure 2 As shown. This invention, based on a library of commonly used process scheduling algorithms, expands upon these algorithms, selects the most suitable process scheduling algorithm for the current test case, executes the selected algorithm, and collects process switching context information and embedded operating system functional information during algorithm execution. Next, the most suitable process scheduling algorithm is executed in an actual embedded operating system, and process switching context information and embedded operating system functional information are collected again during algorithm execution. A test report is generated based on the first and second sets of collected process scheduling information. Therefore, the test report generated from the two sets of collected data can improve the speed of fault tracing and accelerate fault handling efficiency.

[0055] In addition, the information collected from the two times is compared to check whether the process context information is consistent. If they are inconsistent, the system performs classification calculations based on the functions of the embedded operating system to trace the source of the fault and assign corresponding tags. If the comparison is consistent, the process ends.

[0056] Therefore, the embedded operating system process scheduling test method provided by this invention integrates multiple scheduling algorithms, records key information such as process switching and resource usage during the test process, classifies the test results into corresponding errors, and provides recommendations for better scheduling algorithms, which facilitates system developers to modify and optimize scheduling algorithms and improve system development progress.

[0057] Furthermore, the specific steps of the present invention are as follows:

[0058] (1) Establishment of embedded operating system process scheduling algorithm platform: maintain and update the commonly used process scheduling algorithm library, and generate the expected results of typical test cases;

[0059] (2) Obtaining the process scheduling algorithm of the process under test: Obtain the process scheduling algorithm used by the embedded operating system under test, determine whether the scheduling algorithm is included in the common process scheduling algorithm library, add it if not, and mark the algorithm as recently called if it is.

[0060] (3) Simulated execution of test cases: Simulated tests were conducted on each algorithm in the common process scheduling algorithm library using typical test cases and random test cases, and the average turnaround time of the process scheduling algorithm under test for all test cases was calculated.

[0061] (4) Test case execution and analysis: Execute typical test case sets and random test case sets in the embedded operating system under test, test the process scheduling algorithm, record the process switching situation during the execution of each test case, collect the process switching sequence, compare the collected process switching sequence to trace the source of the fault and classify it, and return the test results to the system developer in the form of a test report.

[0062] Optionally, the operation of obtaining the process scheduling algorithm of the embedded operating system under test and writing the process scheduling algorithm under test into a pre-set process scheduling algorithm library includes:

[0063] If the process scheduling algorithm under test is not in the process scheduling algorithm library, write the process scheduling algorithm under test into the process scheduling algorithm library.

[0064] Optionally, the process scheduling algorithm from the process scheduling algorithm library is used in the simulated embedded operating system to execute typical test case sets and random test case sets respectively to determine the average turnaround time set, including:

[0065] Randomly select a process scheduling algorithm from the process scheduling algorithm library, execute typical test cases in a simulated embedded operating system, and determine the first average turnaround time of the selected process scheduling algorithm;

[0066] Execute random test cases in a simulated embedded operating system to determine the second average turnaround time of the selected process scheduling algorithm;

[0067] The average turnaround time of the selected process scheduling algorithm is determined based on the first average turnaround time and the second average turnaround time.

[0068] The average turnaround time set is determined based on the average turnaround time of each process scheduling algorithm in the process scheduling algorithm library.

[0069] Optionally, based on the first process switching information, the first operating system performance information, the second process switching information, and the second operating system performance information, the operation of the test report is determined, including:

[0070] In the case where the first process switching information and the second process switching information do not match, Euclidean distance is calculated on the column vectors of the first operating system performance information and the second operating system performance information to determine the error value sequence;

[0071] Classify the error value sequence to determine the test report.

[0072] Optionally, the method further includes:

[0073] Collect process scheduling algorithm data of embedded operating systems, and build a process scheduling algorithm library based on the process scheduling algorithm data. The process scheduling algorithm data includes process scheduling algorithms and basic information about the process scheduling algorithms.

[0074] The process scheduling algorithm library is updated based on the scheduling algorithm of the process under test.

[0075] Specifically, the process of process scheduling testing in the functional testing of the embedded operating system of intelligent power measurement equipment includes the following four steps:

[0076] 1) Establishment of an embedded operating system process scheduling algorithm platform:

[0077] ① Maintenance of commonly used process scheduling algorithms: Collect commonly used process scheduling algorithms SA={SA1,SA2,…,SA n The document contains basic information about each scheduling algorithm (SAi), including algorithm name, version, function, applicable process types, algorithm code, and typical test cases, where n represents the number of process scheduling algorithms; commonly used process types TP = {TP1, TP2, ..., TP...}. m Each scheduling algorithm SA i It may be applicable to one or more process types, where m represents the number of process types in the embedded operating system; each process scheduling algorithm SA i Functional point F to be tested i ={f1,f2,…,f S The typical test case set is T. i ={tc1,tc2,…,tc N}, where S and N represent the number of functional points to be tested and the number of test cases for the process scheduling algorithm SAi, respectively; process scheduling algorithm SAi i Each test case tc j It can be used to test SA i If one or more function points, then SA i The coverage matrix MC represents the coverage of S functional points by N test cases. i The matrix has a size of S rows and N columns, and the number of elements in the matrix is ​​mc. j,k =1 indicates test case tc jIt can be used to test function point f k ,mc j,k =0 indicates that the test case tc j Cannot be used to test function point f k Where 1≤j≤N, 1≤k≤S; the commonly used process scheduling algorithm library SA includes First-Come, First-Served (FCFS), Round Robin (RR), Shortest Process First (SCF), etc.

[0078] ② Update the commonly used process scheduling algorithm library: When encountering a new process scheduling algorithm SA j When it is necessary to add it to the commonly used process scheduling algorithm library, that is, if Then SA=SA∪{SA j}; Set an unused frequency (ut) for each scheduling algorithm in the commonly used process scheduling algorithm library. i =0 indicates the number of times the scheduling algorithm has not been used recently. If a process scheduling algorithm SA i ut i ≥T tre At that time, SA i Removed from the library of commonly used process scheduling algorithms, i.e., SA = SA - {SA} i}, where 1≤i≤n, T tre This is the threshold for the longest unused frequency of the scheduling algorithm set by the embedded operating system tester.

[0079] ③ Generate expected results for typical test cases: Based on the collected basic information of commonly used process scheduling algorithms, generate SA for each scheduling algorithm. i Simulated scheduler SP i , will SA i Each typical test case tc j As a simulated scheduler SP i Input, record the correct scheduling result SR j And join SA i In the basic information, 1≤i≤n, 1≤j≤N.

[0080] 2) Obtaining the scheduling algorithm for the process under test:

[0081] ① Obtain the process scheduling algorithm SA used by the embedded operating system under test. i This includes the scheduling algorithm name, algorithm version, algorithm function, applicable process types, algorithm code, etc.

[0082] ②If the scheduling algorithm for the process under test is SA i It is not included in the commonly used process scheduling algorithm library SA, that is Then increment the unused frequency of all process scheduling algorithms in the SA by 1, that is, for any SAj ∈SA execute ut j =ut j +1, and set the scheduling algorithm SA to be tested. i The information is added to the commonly used process scheduling algorithm library SA, that is, SA = SA∪{SA} i The process scheduling algorithm SA under test i Unused frequency ut i =0, generating a typical test case set T for the process scheduling algorithm. i Generate a test case coverage matrix (MC) for the functional points. i Generate a simulated scheduler SP corresponding to the process scheduling algorithm SAi under test. i where 1≤j≤n;

[0083] ③ If the scheduling algorithm for the test program is SA i It is included in the commonly used process scheduling algorithm library SA, i.e., SA i ∈SA, then SA i Unused frequency ut i =0, for other process scheduling algorithms in the commonly used process scheduling algorithm library SA j ∈SA and SA j ≠SA i Execute ut j =ut j +1, where 1≤j≤n.

[0084] 3) Simulated execution of test cases:

[0085] ① Simulation testing of typical test cases: For the process scheduling algorithm SA under test i Obtain the corresponding typical test case set T from the commonly used process scheduling algorithm library SA. i ={tc1,tc2,…,tc N Functional point F to be tested i ={f1,f2,…,f S} and the test case coverage matrix MC for functional points i , where 1≤i≤n; each test case tc j Contains h processes {p1, p2, ..., p h}, each process p k Information includes process arrival time rt k Service time st k Each process p k Record the completion time ft after the processing is completed. k And calculate the turnaround time. k =ft k -rt kCalculate the average turnaround time after all processes have finished executing. After all test cases are completed, the scheduling algorithm SA under test is calculated. i For typical test case set T i Average turnaround time Where 1≤i≤n, 1≤j≤N, 1≤k≤h; record the process scheduling algorithm SA. i Process switching occurs during the execution of each typical test case tcj. TSP = [tp1, tp2, ..., tp x Each time a process switches tp a This represents the blocking or completion of one process and the execution of another process, where x is the test case tc. j The process includes h process schedulers and the number of process switches that occur during the process, where x ≥ h and 1 ≤ a ≤ x; record the time point (tp) for each process switch. a Generate the resource usage vector A of the embedded operating system at any given time. a =[A a,1 A a,2 ,…,A a,r The resource usage information vectors of all process switches constitute the resource usage matrix A = [A1, A2, ..., A...]. x ], where 1≤a≤x, r represents the number of resource types, which is specified by the embedded system developer and serves as the basis for process scheduling, such as CPU utilization, available memory capacity, etc.;

[0086] ② Simulated testing with random test cases: The testers are the process scheduling algorithm SA for the process under test. i Randomly generate a set of test cases RT i ={rtc1,rtc2,…,rtc M}, where each random test case is rtc j Used for testing function point F under test i ={f1,f2,…,f S One or more functional points in} generate a coverage matrix RMC of all random test cases for the functional point under test. i Where 1≤i≤n, 1≤j≤M, and M represents the number of random test cases; each test case has an rtc j Contains g processes {p1, p2, ..., p g}, each process p k Information includes process arrival time rt k Service time st k Each process p k Record the completion time ft after the processing is completed. k And calculate the turnaround time. k =ft k -rtk Calculate the average turnaround time after all processes have finished executing. After all test cases are completed, the scheduling algorithm SA under test is calculated. i For the random test case set RT i Average turnaround time Where 1≤i≤n, 1≤j≤M, 1≤k≤g; record the process scheduling algorithm SA. i RTC is executed for each random test case. j The process switching information that occurs during the process is RSP = [rp1, rp2, ..., rp y Each time a process switches tp a This represents the blocking or completion of one process and the execution of another process, where y is a randomized test case (RTC). j The process includes g process schedulers and the number of process switches that occur during the process, where y ≥ g, 1 ≤ a ≤ y; record the time point (tp) for each process switch. a Generate the resource usage vector RA of the embedded operating system at any time. a =[RA a,1 ,RA a,2 ,…,RA a,r The resource usage information vectors of all process switches constitute the resource usage matrix RA = [RA1, RA2, ..., RA]. y ], where 1≤a≤x, and r represents the number of resource types;

[0087] ③ Calculate the scheduling algorithm SA for the process under test i Average turnaround time (AvgT) for all test cases i =(Aturnt) j +RAturnt j ) / 2;

[0088] ④ In addition to testing the process scheduling algorithm (SA) submitted by the developers, testers also need to review the algorithm submitted by the developers. i In addition, the same typical test case set T is used. i and random test case set RT i For each other process scheduling algorithm in the commonly used process scheduling algorithm library SA j All tests should be conducted according to steps ① to ③ (in addition, tests can also be performed using...) Figure 2 The described steps involve first adding the process scheduling algorithm to be tested to the process scheduling algorithm library, and then calculating the average turnaround time (SA) of each process scheduling algorithm in the library. j Average turnaround time AvgT j Find the scheduling algorithm with the minimum average turnaround time in the SA (Scheduling Algorithm). min , if SA i ≠SA minThe test report then recommends SA as a better process scheduling algorithm for embedded operating system developers. min And attached SA min Basic information, including 1≤i,j,k,min≤x.

[0089] 4) Test Case Execution and Analysis: Execute test cases in the embedded operating system under test, collect process context information and embedded system information, and perform fault tracing and classification.

[0090] ① Execute the typical test case set T in the embedded operating system under test. i and random test case set RT i For the process scheduling algorithm SA i Perform tests and record the process switching during the execution of each test case to obtain the tc for each typical test case. j and random test cases RTC k The process switching sequence during execution is TSP′=[tp1,tp2,…,tp x′ ] and RSP′=[rp1,rp2,…,rp y′ ], where x' and y' represent the test cases tc executed on the embedded operating system under test, respectively. j and RTC k The number of process switches, 1≤i≤n, 1≤j≤N, 1≤k≤M;

[0091] ② Collection process switching sequence TSP′=[tp1,tp2,…,tp x′ ] and RSP′=[rp1,rp2,…,rp y′ [In each process switch tp] a and rp b Resource usage vector A of the embedded operating system a ′ and RA b ′, and the resource usage matrices A' and RA' corresponding to the entire process switching sequence, where 1≤a≤x', 1≤b≤y';

[0092] ③ Compare the collected process switching sequences TSP = [tp1, tp2, ..., tp] respectively. x ] and TSP′=[tp1,tp2,…,tp x′ And RSP = [rp1, rp2, ..., rp] y ] and RSP′=[rp1,rp2,…,rp y′ When a process is detected switching TP... a or rp b When the context information does not match, based on the collected embedded operating system information Aa and A a ′ or RA b and RA b The comparison is performed, and the Euclidean distance is calculated on the column vectors to obtain the sequence D = [d1, d2, ... d] corresponding to different values. x Sort the data in the sequence in descending order, and select the top-ranked d. i The corresponding function is the location of the fault; it is tagged at the current moment of process switching, indicating that it is d. i The function malfunctioned at this moment, and there are three types of label classifications, namely p during the execution of the scheduling algorithm. ij A priority preemption error (err1) occurs when a process attempts to preempt resources that do not belong to it; a process p encounters an equal condition during the execution of the scheduling algorithm. ij The deadlock error err2 occurs when it is difficult to make a decision, and the malicious process failure err3 occurs when process pij occupies too many resources and times out during the execution of the scheduling algorithm.

[0093] ④ The test results are compiled into a test report and returned to the system developers, including the test case set used in the test, the process switching sequence and corresponding resource usage matrix of the simulated test results, the process switching sequence and corresponding resource usage matrix of the actual test results, the fault prediction results, and the process scheduling algorithm recommendation results, etc.

[0094] Furthermore, the test case scheduling algorithm execution and fault detection process in this embodiment can be found in [reference needed]. Figure 3 The specific process is as follows: System developer P1 designed and developed the embedded operating system EOS for a certain intelligent power measurement equipment system; system tester P2 was responsible for testing EOS; troubleshooting personnel P3 were responsible for troubleshooting faults in the intelligent power measurement equipment; and application developer P4 was responsible for the functional requirements needed for the application to run. The specific order of operations is as follows:

[0095] ① The system developers, department P1, provided the functionality of the embedded operating system to be tested, F = {fc1, fc2, ..., fc8}. Based on the application software designed by A3, five processes p = {A, B, C, D, E} were generated. First, the types of processes were distinguished, where A, B, C, and D are user processes, while E is a system process. The user processes use the Shortest Process First (SCF) scheduling algorithm. The time information for these four user processes includes arrival time rt = {0, 1, 2, 3} and service time st = {5, 2, 9, 8}. The embedded operating system was simulated and executed using the SCF scheduling algorithm, resulting in the process scheduling sequence SP1 = [A1, B1, A2, A3, D1, C1]. The turnaround time was derived as turnt1 = {7, 2, 21, 9}, and the average turnaround time a_turnt1 = 9.7. The embedded system information during the process scheduling process was recorded as AS1 = [Apc1, Apc2, ..., Apc6].

[0096] ② The same four processes are executed using the shortest process first (SFP) scheduling algorithm in the actual embedded operating system. When the process scheduling sequence SP2 = [A1, B1, A2, D3, A3, C1] is detected, the turnaround time is derived as turnt2 = {15, 2, 21, 8}, and the average turnaround time a_turnt2 = 11.5. The embedded system information during the process scheduling is recorded, AS2 = [Apc 1’ ,Apc 2’ …Apc 6’ At this point, it can be observed that the average turnaround time has increased. By comparing SP1 = [A1, B1, A2, A3, D1, C1] and SP2 = [A1, B1, A2, D3, A3, C1], it can be seen that a problem occurred during process switching after A2, namely a priority preemption error. By comparing the functional information AS1 and AS2 recorded during process scheduling, and calculating the distance between the column vectors corresponding to the two matrices using Euclidean distance, the function corresponding to the column with the largest value is the location of the fault. Therefore, the fault source was successfully traced, and the fault type was identified as a priority preemption error.

[0097] ③ The same four processes are executed using the shortest process first (SFL) scheduling algorithm in the actual embedded operating system. When the process scheduling sequence SP3 = [A1, A2, D1—] is detected, the processes cease execution, and the recorded embedded system information is AS3 = [Apc...]. 1’ ,Apc 2’ ,Apc 3’—], the execution sequence shows that after D1, two shortest processes of the same length, A3=2 and B1=2, appeared. It can be inferred that a deadlock occurred during process execution. Comparing AS1 and AS3 reveals the location of the fault. Therefore, fault tracing was successful, and the fault type was identified as a deadlock.

[0098] ④ The same four processes are executed using the shortest process first (SFL) scheduling algorithm in the actual embedded operating system. When the process scheduling sequence SP4 = [A1, B1, A2, A3, D1, C1] is detected, the turnaround time is derived as turnt4 = {7, 2, 29, 9}, and the average turnaround time a_turnt4 = 11.75. The embedded system information during the process scheduling process is recorded, AS4 = [Apc 1’ ,Apc 2’ …Apc 6’ At this point, the derivation revealed that C1 had exceeded its normal execution time. If this time was significantly prolonged, it could be inferred that a malicious process might have entered this area. By comparing AS1 and AS4, the location of the fault was identified. Therefore, the fault source was successfully traced, and the fault type was determined to be a malicious process that had entered the process execution phase.

[0099] Department P2 can provide feedback on this result to departments P1 and P3, which will help in updating and fixing the system.

[0100] Furthermore, this invention provides a process scheduling testing method for embedded operating systems of intelligent power measurement equipment. It aims to establish a scalable platform for process scheduling algorithms within the embedded operating system of intelligent power measurement equipment. Test cases are generated using different methods to test the algorithms on the platform, and testing is performed based on these test cases. When the used process scheduling algorithm is not included in the scalable process scheduling algorithm platform, it is added to the platform; if it is already on the platform, its identifier is updated to indicate that it has been recently called. Different types of processes are tested in a simulated embedded system, and test cases are generated using different methods for the same type of process to test the functionality of the scheduling algorithm. Context information of process switching during test cases and relevant information on the embedded system's functional usage at the corresponding moments are collected. Context information of process switching during actual embedded operating system execution and relevant information on the embedded system's functional usage at the corresponding moments are also collected. By comparing the process context switching information of the simulated and actual embedded operating system functions, the test ends if there are no problems; otherwise, fault tracing is performed, and the fault type is classified based on the embedded system functional information at the time of the error. This improves the speed of fault tracing in the functional testing of embedded operating systems on intelligent power measurement equipment.

[0101] The purpose of this invention is:

[0102] (1) Current testing methods usually only give the result of whether the process scheduling algorithm is correct or incorrect. It is difficult for developers to quickly find the error of the scheduling algorithm from these results. However, this invention collects the system resource usage during each process switch and process switch during the testing process, and classifies the algorithm test errors to provide developers with accurate and detailed error reports, thereby improving the development progress of the system.

[0103] (2) Traditional process scheduling test algorithms are designed for specific systems and schedule scheduling algorithms, and have poor adaptability to scheduling algorithms and terminal devices. The test method of this invention enhances the adaptability to process scheduling algorithms and terminal devices by setting up a schedule scheduling algorithm library and customizing system resources, and can also improve the reusability of test cases.

[0104] (3) Traditional test results only apply to the scheduling algorithm used by the developer. The test method of this invention can recommend a higher-performance process scheduling method for the developer, making it easier for the developer to optimize the scheduling algorithm and speed up the system development process.

[0105] Furthermore, the testing framework proposed in this invention is primarily used for intelligent power measurement equipment. It tests the functionality of the operating system built into the equipment. On a platform capable of integrating process scheduling algorithms, a suitable scheduling algorithm is selected based on the process type. Functional testing is conducted on both simulated and actual embedded devices. Processes that malfunction during execution are categorized for rapid troubleshooting, laying the groundwork for the subsequent sale and use of terminal equipment. Because the types of terminal devices connected to intelligent power measurement equipment are diverse, and their requirements for the embedded operating system installed on these devices vary—for example, some terminal devices have strict requirements on the response time of the embedded operating system—excessive use of the embedded operating system's functions can lead to reversed process response order, prolonged execution time, and deadlocks, hindering the provision of high-quality service to users. Therefore, it is necessary to effectively classify and detect faults. When errors occur during the process scheduling process of the embedded operating system, the error category can be quickly identified so that troubleshooting personnel can resolve the problem quickly.

[0106] In addition, refer to Figure 4 As shown, the objects involved in the entire system include embedded system developers, embedded system testers, application software designers and developers, and troubleshooters, etc. The object architecture is shown in [reference needed]. Figure 4 Embedded system designers and developers provide a complete list of features; embedded system testers provide test cases and perform system testing; application developers provide information on how terminal application software uses the embedded operating system's functions; and embedded system testers provide the test results to embedded system developers and troubleshooting personnel.

[0107] The beneficial effects of this invention are as follows:

[0108] (1) The test results of the process scheduling algorithm are accurate to each process switch in the process scheduling process and the system resource usage when a process switch occurs, and the algorithm test errors are classified, so the test results are accurate;

[0109] (2) By maintaining the library of common process scheduling algorithms and customizing system resources, we ensure that the process scheduling test algorithm is applicable to the testing of different process scheduling algorithms. We set the frequency threshold of process unused to adjust the computing resource limit on terminal devices, which is applicable to different terminal devices.

[0110] (3) The test report includes detailed actual test results, which helps embedded operating system developers quickly find bugs in the process scheduling algorithm. It can also recommend better process scheduling algorithms to help system developers optimize the process scheduling algorithm and speed up the system development process.

[0111] Exemplary device

[0112] Figure 5 This is a schematic diagram of the structure of an embedded operating system process scheduling testing device provided in an exemplary embodiment of the present invention. Figure 5 As shown, the device 500 includes:

[0113] The acquisition module 510 is used to acquire the process scheduling algorithm of the embedded operating system under test and write the process scheduling algorithm under test into a pre-set process scheduling algorithm library.

[0114] The first determining module 520 is used to determine the typical test case set and the random test case set corresponding to the process scheduling algorithm under test, and to execute the typical test case set and the random test case set respectively using the process scheduling algorithm in the process scheduling algorithm library in the simulated embedded operating system to determine the average turnaround time set.

[0115] The recording module 530 is used to select the scheduling process algorithm with the minimum average turnaround time in the average turnaround time set as the optimal process scheduling algorithm, and record the first process scheduling information of the optimal process scheduling algorithm.

[0116] The second determining module 540 is used to execute the optimal process scheduling algorithm in the embedded operating system under test, record the second process scheduling information of the optimal process scheduling algorithm, and determine the test report based on the first process scheduling information and the second process scheduling information.

[0117] Optionally, module 510 includes:

[0118] The write submodule is used to write the process scheduling algorithm under test into the process scheduling algorithm library when the algorithm under test is not in the process scheduling algorithm library.

[0119] Optionally, the first determining module 520 includes:

[0120] The first determination submodule is used to randomly select a selected process scheduling algorithm from the process scheduling algorithm library, execute typical test cases in a simulated embedded operating system, and determine the first average turnaround time of the selected process scheduling algorithm.

[0121] The second determination submodule is used to execute random test cases in a simulated embedded operating system to determine the second average turnaround time of the selected process scheduling algorithm;

[0122] The third determining submodule is used to determine the average turnaround time of the selected process scheduling algorithm based on the first average turnaround time and the second average turnaround time.

[0123] The fourth determination submodule is used to determine the average turnaround time set based on the average turnaround time of each process scheduling algorithm in the process scheduling algorithm library.

[0124] Optionally, the first process scheduling information includes first process switching information and first operating system performance information, and the second process scheduling information includes second process switching information and second operating system performance information.

[0125] The second determining module 540 includes:

[0126] The fifth determination submodule is used to determine the test report based on the first process switching information, the first operating system performance information, the second process switching information, and the second operating system performance information.

[0127] Optionally, the fifth determining submodule includes:

[0128] The sixth determination submodule is used to perform Euclidean distance calculation on the column vectors of the first operating system performance information and the second operating system performance information to determine the error value sequence when the first process switching information and the second process switching information do not match.

[0129] The seventh module is used to classify the error value sequence and determine the test report.

[0130] Optionally, the device 500 also includes:

[0131] The module is used to collect process scheduling algorithm data of embedded operating systems and build a process scheduling algorithm library based on the process scheduling algorithm data. The process scheduling algorithm data includes process scheduling algorithms and basic information about the process scheduling algorithms.

[0132] The update module is used to update the process scheduling algorithm library according to the scheduling algorithm of the process under test.

[0133] Exemplary electronic devices

[0134] Figure 6 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. The electronic device may be either or both of a first device and a second device, or a standalone device independent of them, which may communicate with the first device and the second device to receive acquired input signals from them. Figure 6 A block diagram of an electronic device according to an embodiment of the present invention is illustrated. Figure 6 As shown, the electronic device 60 includes one or more processors 61 and a memory 62.

[0135] The processor 61 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0136] The memory 62 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 61 may execute the program instructions to implement the methods for information mining of historical change records and / or other desired functions of the software programs of the various embodiments of the present invention described above. In one example, the electronic device may also include an input device 63 and an output device 64, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0137] In addition, the input device 63 may also include, for example, a keyboard, a mouse, etc.

[0138] The output device 64 can output various information to the outside. The output device 64 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0139] Of course, for the sake of simplicity, Figure 6 Only some of the components of the electronic device relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.

[0140] Exemplary computer program products and computer-readable storage media

[0141] In addition to the methods and devices described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods for information mining of historical change records according to various embodiments of the present invention as described in the "Exemplary Methods" section of this specification.

[0142] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of the present invention. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0143] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the methods for information mining of historical change records according to various embodiments of the present invention as described in the "Exemplary Methods" section above.

[0144] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0145] The basic principles of the present invention have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in the present invention are merely examples and not limitations, and should not be considered as essential features of each embodiment of the present invention. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the present invention to the necessity of employing the aforementioned specific details.

[0146] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0147] The block diagrams of devices, systems, devices, and systems involved in this invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, systems, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0148] The methods and systems of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers recording media storing programs for performing the methods according to the present invention.

[0149] It should also be noted that in the systems, apparatus, and methods of the present invention, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered equivalents of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the invention. Therefore, the invention is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0150] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the invention to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A process scheduling test method for an embedded operating system, characterized in that, include: Obtain the process scheduling algorithm of the embedded operating system under test, and write the process scheduling algorithm under test into a pre-set process scheduling algorithm library; Based on the process scheduling algorithm under test, a typical test case set and a random test case set corresponding to the process scheduling algorithm under test are determined, and the process scheduling algorithm in the process scheduling algorithm library in the simulated embedded operating system are used to execute the typical test case set and the random test case set respectively to determine the average turnaround time set. The scheduling algorithm with the minimum average turnaround time in the set of average turnaround times is taken as the optimal process scheduling algorithm, and the first process scheduling information of the optimal process scheduling algorithm is recorded. The optimal process scheduling algorithm is executed in the embedded operating system under test, the second process scheduling information of the optimal process scheduling algorithm is recorded, and a test report is determined based on the first process scheduling information and the second process scheduling information. The operation of using the process scheduling algorithm from the aforementioned process scheduling algorithm library to execute typical test case sets and the aforementioned random test case sets in a simulated embedded operating system to determine the average turnaround time set includes: Randomly select a process scheduling algorithm from the process scheduling algorithm library, execute typical test cases in the simulated embedded operating system, and determine the first average turnaround time of the selected process scheduling algorithm. The random test cases are executed in the simulated embedded operating system to determine the second average turnaround time of the selected process scheduling algorithm. The average turnaround time of the selected process scheduling algorithm is determined based on the first average turnaround time and the second average turnaround time. The average turnaround time set is determined based on the average turnaround time of each process scheduling algorithm in the process scheduling algorithm library.

2. The method according to claim 1, characterized in that, The operation of obtaining the process scheduling algorithm of the embedded operating system under test and writing the process scheduling algorithm under test into a pre-set process scheduling algorithm library includes: If the process scheduling algorithm to be tested is not in the process scheduling algorithm library, the process scheduling algorithm to be tested shall be written into the process scheduling algorithm library.

3. The method according to claim 1, characterized in that, The first process scheduling information includes first process switching information and first operating system performance information; the second process scheduling information includes second process switching information and second operating system performance information. Based on the first process scheduling information and the second process scheduling information, determine the operation of the test report, including: The test report is determined based on the first process switching information, the first operating system performance information, the second process switching information, and the second operating system performance information.

4. The method according to claim 3, characterized in that, Based on the first process switching information, the first operating system performance information, the second process switching information, and the second operating system performance information, the operation for determining the test report includes: If the first process switching information and the second process switching information do not match, Euclidean distance is calculated on the column vectors of the first operating system performance information and the second operating system performance information to determine the error value sequence. The error value sequence is classified to determine the test report.

5. The method according to claim 1, characterized in that, Also includes: Collect process scheduling algorithm data of the embedded operating system, and construct the process scheduling algorithm library based on the process scheduling algorithm data. The process scheduling algorithm data includes process scheduling algorithms and basic information of the process scheduling algorithms. The process scheduling algorithm library is updated according to the process scheduling algorithm under test.

6. A process scheduling testing device for an embedded operating system, characterized in that, include: The acquisition module is used to acquire the process scheduling algorithm of the embedded operating system under test and write the process scheduling algorithm under test into a pre-set process scheduling algorithm library. The first determining module is used to determine a typical test case set and a random test case set corresponding to the process scheduling algorithm under test, and to execute the typical test case set and the random test case set respectively using the process scheduling algorithm in the process scheduling algorithm library in a simulated embedded operating system to determine the average turnaround time set. The recording module is used to select the scheduling process algorithm with the minimum average turnaround time in the average turnaround time set as the optimal process scheduling algorithm, and record the first process scheduling information of the optimal process scheduling algorithm. The second determining module is used to execute the optimal process scheduling algorithm in the embedded operating system under test, record the second process scheduling information of the optimal process scheduling algorithm, and determine the test report based on the first process scheduling information and the second process scheduling information. The first determining module includes: The first determining submodule is used to randomly select a selected process scheduling algorithm from the process scheduling algorithm library, execute typical test cases in the simulated embedded operating system, and determine the first average turnaround time of the selected process scheduling algorithm. The second determining submodule is used to execute the random test cases in the simulated embedded operating system and determine the second average turnaround time of the selected process scheduling algorithm. The third determining submodule is used to determine the average turnaround time of the selected process scheduling algorithm based on the first average turnaround time and the second average turnaround time. The fourth determining submodule is used to determine the average turnaround time set based on the average turnaround time of each process scheduling algorithm in the process scheduling algorithm library.

7. The apparatus according to claim 6, characterized in that, The acquisition module includes: The write submodule is used to write the process scheduling algorithm under test into the process scheduling algorithm library when the process scheduling algorithm under test is not in the process scheduling algorithm library.

8. The apparatus according to claim 6, characterized in that, The first process scheduling information includes first process switching information and first operating system performance information; the second process scheduling information includes second process switching information and second operating system performance information. The second determining module includes: The fifth determining submodule is used to determine the test report based on the first process switching information, the first operating system performance information, the second process switching information, and the second operating system performance information.

9. The apparatus according to claim 8, characterized in that, The fifth determination submodule includes: The sixth determination submodule is used to perform Euclidean distance calculation on the column vectors of the first operating system performance information and the second operating system performance information to determine the error value sequence when the first process switching information and the second process switching information do not match. The seventh determination submodule is used to classify the error value sequence and determine the test report.

10. The apparatus according to claim 6, characterized in that, Also includes: A construction module is used to collect process scheduling algorithm data of the embedded operating system and construct the process scheduling algorithm library based on the process scheduling algorithm data. The process scheduling algorithm data includes process scheduling algorithms and basic information of the process scheduling algorithms. The update module is used to update the process scheduling algorithm library according to the process scheduling algorithm under test.

11. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for performing the method described in any one of claims 1-5.

12. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Performance test method and tool aiming at Linux process scheduling

    CN102722434A

  • Operating system virtual experiment method based on Windows platform

    CN111915961A