Real-time operating system testing method and apparatus, and computer device and storage medium

By allocating test tasks to multiple user partitions and merging their kernel resource scheduling logs, the problem of inaccurate test results in the existing technology is solved, and a more accurate and secure real-time operating system performance test is achieved.

WO2024183648A1PCT designated stage expired Publication Date: 2024-09-12CHINA ELECTRONICS RELIABILITY AND ENVIRONMENTAL TESTING INSTITUTE ((THE FIFTH INSTITUTE OF ELECTRONICS MINISTRY OF INDUSTRY AND INFORMATION TECHNOLOGY) (CHINA SAIBAO LABORATORY)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/079641
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-06
Filing Date
2024-03-01
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

Existing real-time operating system performance testing methods are not accurate enough due to the experience and contingency of a single test user, and cannot meet the needs of key areas with higher security.

Method used

By assigning test tasks to multiple user partitions and controlling each user partition to call different memory partitions for testing, the kernel resource scheduling logs of each user partition are obtained and then merged to obtain the kernel resource test results of the real-time operating system and improve test data isolation. effectiveness and accuracy.

Benefits of technology

This method avoids the influence of individual experience through multi-user partition testing, improves the accuracy and data security of test reports, and ensures the reliability of performance test results of real-time operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024079641_12092024_PF_FP_ABST
    Figure CN2024079641_12092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a real-time operating system testing method and apparatus, and a computer device, a storage medium and a computer program product. The method comprises: acquiring test tasks of a real-time operating system; allocating the test tasks to a first preset number of user partitions, according to the allocated test task, controlling each user partition to call a memory partition corresponding to each user partition so as to perform a test, and obtaining a kernel resource scheduling log of each user partition, wherein the memory partitions called by the user partitions are different; and combining the kernel resource scheduling logs of the user partitions, so as to obtain a kernel resource test result of the real-time operating system. In the method, a plurality of users are partitioned, test data of the users is different from each other, such that the effect of individual experience of the test users is avoided, and a final kernel resource test report is obtained by integrating a plurality of user partitions and kernel resource scheduling logs corresponding to the plurality of user partitions, thereby improving the accuracy of the test report.
Need to check novelty before this filing date? Find Prior Art

Description

Real-time operating system testing method, device, computer equipment and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 6, 2023, with application number 202310210695.5, and invention name “Testing method, device, computer equipment and storage medium for real-time operating system”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a testing method, apparatus, computer equipment, storage medium, and computer program product for a real-time operating system. Background Art

[0003] With the advancement of information technology, conventional operating systems, such as Windows, are no longer sufficient for production monitoring tasks in critical areas with high security requirements. Consequently, real-time operating systems (RTOSs) have emerged as highly secure systems that can quickly receive and respond to external events or data. Before using an RTOS, system performance testing is often required.

[0004] Existing real-time operating system performance testing methods often involve a single test user testing the system. Due to the influence of the test user's experience and the randomness of the test task, the test results are not accurate enough.

[0005] Summary of the Invention

[0006] The present application provides a real-time operating system testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product capable of improving testing results.

[0007] In a first aspect, the present application provides a method for testing a real-time operating system, the method comprising:

[0008] Obtaining a test task for the real-time operating system;

[0009] Assigning the test task to a first preset number of user partitions, and controlling each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test task, thereby obtaining a kernel resource scheduling log of each user partition, wherein the memory partition called by each user partition is different;

[0010] The kernel resource scheduling logs of each user partition are merged to obtain the kernel resource test result of the real-time operating system.

[0011] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0013] FIG1 is a diagram illustrating an application environment of a method for testing a real-time operating system according to an embodiment;

[0014] FIG2 is a schematic flow chart of a method for testing a real-time operating system in one embodiment;

[0015] FIG3 is a schematic diagram of a process flow of kernel resource scheduling logs for a user partition in one embodiment;

[0016] FIG4 is a schematic diagram of the calling relationship between user partitions and memory partitions in one embodiment;

[0017] FIG5 is a schematic diagram of a process for creating a memory partition in one embodiment;

[0018] FIG6 is a schematic flow chart of a partition isolation testing method for a real-time operating system according to an embodiment;

[0019] FIG7 is a schematic diagram of the structure of a real-time operating system in one embodiment;

[0020] FIG8 is a block diagram of a test apparatus for a real-time operating system according to an embodiment;

[0021] FIG9 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0023] The real-time operating system testing method provided in the embodiments of the present application can be applied in the application environment shown in Figure 1. In this embodiment, a test terminal 102 communicates with a test monitoring terminal 104 via a network. A data storage system can store monitoring data recorded by the test monitoring terminal 104. The data storage system can be integrated with the test monitoring terminal 104 or placed in the cloud or on other network servers.

[0024] The test terminal 102 obtains a test task for the real-time operating system; the test terminal 102 assigns the test task to a first preset number of user partitions, and controls each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task, and obtains a kernel resource scheduling log of each user partition, wherein the memory partition called by each user partition is different; the test terminal 102 merges the kernel resource scheduling logs of each user partition to obtain a kernel resource test result of the real-time operating system.

[0025] The test terminal 102 may be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. The test monitoring terminal 104 may be implemented using a standalone server or a server cluster consisting of multiple servers.

[0026] In one embodiment, as shown in FIG2 , a method for testing a real-time operating system is provided. The method is described by taking the test terminal in FIG1 as an example, and includes the following steps:

[0027] S202: Acquire a test task for the real-time operating system.

[0028] The operating system is the first layer of software built on computing hardware, serving as a bridge between hardware and other software. It controls the execution of other programs, manages system resources, and provides basic computing functions, such as managing and allocating memory and prioritizing resource supply and demand. It also provides essential service programs, such as the file system unit, memory management unit, host control interface, and time-slicing scheduling unit. Because of its special functions, the operating system's performance must be tested before it is officially deployed.

[0029] Among them, the operating system can include a real-time operating system and a time-sharing operating system. The real-time operating system is able to complete data processing in a relatively short time when external events or data are generated, and return the data response to the user, while the time-sharing operating system is a computer that completes multiple submitted tasks in fixed time segments or different time segments in turn at certain time intervals.

[0030] The test task may be a performance test of a real-time operating system, specifically including: operating system kernel resource management response speed, time slice scheduling accuracy, file system integrity, etc.

[0031] Specifically, the test task of the real-time operating system may be obtained by reading the test task pre-configured by the user in the test terminal.

[0032] At least two users may pre-configure test tasks, and the user-configured test tasks may be the same or different. When the user-configured test tasks are the same, the operating system is tested according to multiple identical test tasks to obtain multiple test results, which are then analyzed to eliminate accidental factors and obtain a final test result. When the user-configured test tasks are different, the operating system is tested according to multiple different test tasks to obtain multiple test results, the different test contents in the test results are summarized, and the identical test contents in the test results are analyzed to obtain a final test result.

[0033] S204, assigning the test task to a first preset number of user partitions, and controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task, and obtaining the kernel resource scheduling log of each user partition, wherein the memory partition called by each user partition is different.

[0034] The user partitions may correspond one-to-one to the test users, and the first preset number is at least one.

[0035] Specifically, the test task is divided into multiple test subtasks, and then the multiple test subtasks are assigned to a first preset number of user partitions. It should be noted that the test subtasks may be identical or different. When the test subtasks are identical, the test results of the real-time operating system are analyzed based on the multiple identical test subtasks to obtain a final test result. When the test subtasks are different, the test results of the real-time operating system are aggregated based on the test subtasks, including: adding the test contents of the non-intersecting portions, analyzing the test contents of the intersecting portions, and aggregating the test results of the two to obtain a final test result.

[0036] The test task may be stored in a user partition, and multiple test subtasks may be stored in each user partition respectively.

[0037] Memory partitioning can be performed by partitioning the computer's memory, which can be volatile storage. Partitioning the computer's memory can be performed at any time. Partitioning can be performed once before testing the computer's real-time operating system, with the memory partitioning results remaining unchanged until all tests are completed. Alternatively, memory partitioning can be performed before each test of the computer's real-time operating system.

[0038] Specifically, the calling relationship between the user partition and the memory partition can be a one-to-one or one-to-many relationship, that is, a test task of a user partition can be executed in at least one memory partition.

[0039] Kernel resource scheduling logs may include memory management test results, time slice scheduling test results, and file system test results. Memory management test results may include memory size, the number of memory partitions, etc. Time slice scheduling test results may include the priority of the test task execution order between user partitions and the test task execution time. File system test results may include the size of the storage space occupied by the test task.

[0040] S206: Merge the kernel resource scheduling logs of each user partition to obtain kernel resource test results of the real-time operating system.

[0041] Among them, different test contents in the kernel resource scheduling log of each user partition can be analyzed, and the same test contents in the kernel resource scheduling log of each user partition can be summarized, and the two can be combined to obtain the kernel resource test result of the real-time operating system.

[0042] Specifically, taking the user partition containing three user partitions as an example, the kernel resource scheduling log corresponding to user partition 1 includes memory management test result 1, time slice scheduling test result 1 and file system test result 1, the kernel resource scheduling log corresponding to user partition 2 includes memory management test result 2 and time slice scheduling test result 2, and the kernel resource scheduling log corresponding to user partition 3 is memory management test result 3. At this time, the memory management test result 1, memory management test result 2 and memory management test result 3 are analyzed to obtain the analyzed memory management test result, the time slice scheduling test result 1 and the time slice scheduling test result 2 are analyzed to obtain the analyzed time slice scheduling test result, and then summarized with the file system test result 1 to obtain the kernel resource test result of the real-time operating system.

[0043] In the above-mentioned real-time operating system testing method, by obtaining the test task of the real-time operating system, the test task is assigned to a first preset number of user partitions, and each user partition is controlled to call the memory partition corresponding to each user partition for testing according to the assigned test task, and the kernel resource scheduling log of each user partition is obtained, wherein the memory partition called by each user partition is different, and the kernel resource scheduling logs of each user partition are merged to obtain the kernel resource test result of the real-time operating system. This method, on the one hand, the real-time operating system includes user partitions and memory partitions, and the partitions called by each user partition are different, which improves the test data isolation effect and ensures data security; on the other hand, by partitioning multiple users, the user's test data are different from each other, avoiding the influence of the individual experience of the test user, and combining multiple user partitions and the kernel resource scheduling logs corresponding to the multiple user partitions to obtain the final kernel resource test report, thereby improving the accuracy of the test report.

[0044] In one embodiment, as shown in FIG3 , a flowchart of kernel resource scheduling logs for user partitions is shown. The steps of obtaining kernel resource scheduling logs for each user partition includes:

[0045] S302: Obtain the priority of each user partition.

[0046] The priority of the user partition may be the running order of the test tasks corresponding to the user partition. The higher the level of the user partition priority, the higher the running order of the test tasks corresponding to the user partition.

[0047] Specifically, the priority of the user partition may include: first priority, second priority, third priority, etc. from high to low priority. When the priority of the user partition is the first priority, the test task corresponding to the user partition is in the running state. When the priority of the user partition is the second priority, the test task corresponding to the user partition is in the ready state. When the priority of the user partition is the third priority, the test task corresponding to the user partition is in the blocked state.

[0048] When the test task corresponding to the user partition is in the running state, it means that the processor is processing the task. For a single-core processor, only one task is in the running state at any time.

[0049] When a test task corresponding to a user partition is in the Ready state, it indicates that the test task is ready to run. That is, the test task is not blocked or suspended and can be run at any time. Specifically, when a test task corresponding to a user partition is in the Ready state, at least one test task corresponding to the user partition is in the Running state. In other words, the user's second-priority test task will not begin until all first-priority test tasks for the user partition have completed execution.

[0050] Among them, when the test task corresponding to the user partition is in a blocked state, it means that the test task is waiting for a specific task to be executed. The specific task can be a test task or other tasks that include calling functions.

[0051] Specifically, when the specific task is completed, the blocked test task is converted to a ready test task. It should be noted that a blocked task can be set with a timeout. If the specific task is not executed or completed within the preset time, the blocked test task is forced to exit the blocked state and enter the ready state.

[0052] S304: Sort by priority of each user partition to obtain a sorting result.

[0053] The priorities of the user partitions may be sorted from high to low to obtain a first sorting result, and the execution order of the user partitions may be limited according to the first sorting result.

[0054] The test subtasks within the test task in the user partition can also be sorted to obtain a sorting result for the test subtasks. Each test subtask can be a different test content within a test task, such as the response speed of operating system kernel resource management, the accuracy of time slice scheduling, and the integrity of the file system. Specifically, each test subtask can be sorted by priority to obtain a second sorting result, and the execution order of each test subtask can be limited based on the second sorting result.

[0055] S306 , controlling each user partition in turn to call the memory partition corresponding to each user partition according to the assigned test task according to the sorting result, and obtaining the kernel resource scheduling log of each user partition.

[0056] Among them, the memory partition of the user partition can be called for testing according to the priority of each user partition in the first sorting result. For example, if the priority of user partition 1 is greater than the priority of user partition 2, the memory partition corresponding to user partition 1 is tested first, and then the memory partition corresponding to user partition 2 is tested.

[0057] Among them, the test sub-task in user partition 1 can also be tested according to the second sorting result. Specifically, if the priority of test sub-task 1 is greater than the priority of test sub-task 2, the memory partition corresponding to user partition 1 is first called for testing according to test sub-task 1, and then the memory partition corresponding to user partition 1 is called for testing according to test sub-task 2.

[0058] In this embodiment, the order in which user partitions call memory partitions is determined according to the priority of each user partition, so that important user partitions, i.e., user partitions with higher priority ranking results, are tested first, and then the test of each user partition is completed to ensure the completeness of the test.

[0059] In one embodiment, the steps of controlling each user partition in turn to call the memory partition corresponding to each user partition for testing according to the assigned test task based on the sorting result, and obtaining the kernel resource scheduling log of each user partition include: controlling each user partition in turn from the highest priority level to call the memory partition corresponding to each user partition for testing according to the assigned test task based on the sorting result, and obtaining the kernel resource scheduling log of each user partition.

[0060] Among them, according to the sorting results, each user partition can be controlled in sequence starting from the highest priority to call the memory partition corresponding to each user partition for testing according to the assigned test task. Specifically, as shown in the schematic diagram of the calling relationship between user partitions and memory partitions in Figure 4, if the priority of user partition 1 is greater than that of user partition 2, the corresponding memory 1 is called for testing according to the test task 1 assigned to user partition 1, and then the corresponding memory 2 is called for testing according to the test task 2 assigned to user partition 2.

[0061] The order of the test subtasks can also be determined based on the priority order of the test subtasks in the test task. Specifically, as shown in Figure 4, if the priority level of test subtask 1 is greater than the priority level of test subtask 2, which is greater than the priority level of test subtask 3, then test subtask 1 assigned to user partition 1 and user partition 2 will be executed first to call memory partition 1 and memory partition 2 for testing, followed by test subtask 2 assigned to user partition 1 to call memory partition 1 for testing, and finally test subtask 3 assigned to user partition 2 to call memory partition 2 for testing.

[0062] The priority of a user partition can be obtained in real time. If the priority of a user partition is higher than that of the current user partition, the process of calling the memory partition for the test task assigned to the current user partition is stopped, and the process of the user partition with the higher priority level is executed. Using a priority preemptive method, the memory partition corresponding to each user partition is called for testing, ensuring the real-time performance of the test process.

[0063] In this embodiment, the order in which user partitions call memory partitions is determined according to the priority of each user partition, so that important user partitions, that is, user partitions with higher priority ranking results, are tested first. Then, the test of each user partition is completed. If a process with a higher priority appears, the process with a higher priority is executed first, which can ensure the real-time performance of the test process.

[0064] In one embodiment, before the step of allocating the test task to a first preset number of user partitions, the step includes: after obtaining the test task, creating a first number of user partitions for the real-time kernel of the real-time operating system; creating a second number of memory partitions for the memory of the real-time operating system, wherein the second number is greater than or equal to the first number; and allocating at least one memory partition to a user partition.

[0065] A real-time operating system (RTOS) typically consists of a real-time kernel and network components. The real-time kernel is typically multitasking, implementing functions such as task management, timer management, memory management, inter-task communication and synchronization, and interrupt management. The network components connect to peripheral devices and monitoring and testing PCs through interfaces, implementing link-layer communication protocols.

[0066] The number of times that user partitions and memory partitions are created is at least once. When the number of times that user partitions and memory partitions are created is once, the user partitions and memory partitions can be created once after obtaining a test task. When the number of times that user partitions and memory partitions are created is multiple, the user partitions and memory partitions can be created once after each test task is obtained, and / or, when a test task is temporarily obtained while the current test task is being tested, the user partitions and memory partitions can be created again.

[0067] It should be noted that there can be associations between test tasks. For example, if multiple test users test a real-time operating system over a period of time, the test tasks corresponding to each test user are associated with each other. In this case, there is no need to repeatedly create user partitions and memory partitions, that is, the original user partitions and memory partitions can be used. There can also be no associations between test tasks. For example, before a real-time operating system fails and after the real-time operating system is repaired, there is no association between the test tasks corresponding to the two test users. In this case, the user partitions and memory partitions need to be recreated.

[0068] At least one memory partition is allocated to a user partition, that is, the relationship between the user partition and the memory partition is one-to-one or one-to-many, which ensures the exclusivity of the user partition to the processor resources.

[0069] In this embodiment, by allocating at least one memory partition to a user partition, the user partition is guaranteed to have exclusive access to processor resources, thereby improving the security during the real-time operating system test.

[0070] In one embodiment, as shown in the flowchart of the method for creating memory partitions in FIG5 , the steps of assigning test tasks to a first preset number of user partitions, controlling each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test tasks, and obtaining kernel resource scheduling logs for each user partition include:

[0071] S502: Allocate a test task to a first preset number of user partitions, determine a correspondence between each user partition and a test subtask, and the test task includes a plurality of test subtasks.

[0072] A test task includes multiple test subtasks. It is understood that each test subtask contains different test content. The number of test subtasks is greater than or equal to the number of user partitions. A user partition corresponds to at least one test subtask. For the purpose of this description, a user partition corresponds to one test subtask.

[0073] Specifically, user partition 1 and user partition 2 correspond to test subtask 1 and test subtask 2 respectively. Test subtask 1 can be at least one of kernel management test, time slice scheduling test, and file system test. Test subtask 2 can also be at least one of kernel management test, time slice scheduling test, and file system test.

[0074] S504, determining the correspondence between each test subtask and each memory partition according to the correspondence between each user partition and the test subtask, and obtaining a mapping table of the logical address-physical address of each test subtask according to the correspondence between each test subtask and each memory partition.

[0075] Among them, according to the correspondence between each user partition and the test subtask, the correspondence between the type of the test subtask and the memory partition is determined. Specifically, the correspondence between the type of the test subtask and the memory partition can be to correspond the memory partition according to the type of the test subtask. For example, when the type of the test subtask is any one of the kernel management test, time slice scheduling test, and file system test, there is a memory partition corresponding to it.

[0076] The logical address-physical address mapping table needs to meet the exclusivity constraints of the user partition.

[0077] Specifically, the test subtask obtains the physical address of the test subtask in the memory partition based on the logical address-physical address mapping table. It should be noted that each test subtask has its own logical address to physical address mapping relationship. The logical address spaces of multiple test subtasks can overlap, but the mapped physical spaces will not overlap, thereby achieving spatial isolation of partitions.

[0078] S506: Control each user partition according to the mapping table to call the corresponding memory partition for testing according to the assigned test task.

[0079] According to the correspondence between the logical address of the test subtask and the physical address of the memory partition in the mapping table, each user partition is controlled to call the corresponding memory partition for testing according to the assigned test task.

[0080] In this embodiment, by establishing a logical address-physical address mapping table, the user partition, test subtask and memory partition are linked together, which can ensure that the physical space after the user partition and the test subtask are mapped will not overlap, thereby achieving spatial isolation of the partitions.

[0081] In one embodiment, in the process of controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task, the resource usage results of the memory partition, storage resources and CPU in the real-time operating system are obtained through peripheral devices; and the test results of the real-time operating system are obtained based on the kernel resource test results and the resource usage results.

[0082] Among them, peripheral devices refer to devices in the computer system other than the host, including: input and output devices, external memory, peripheral processors, etc. Peripheral devices provide devices for the real-time kernel to communicate with the outside world. Specifically, peripheral devices can be peripheral devices of the test terminal, and the peripheral devices of the test terminal are connected to the test terminal.

[0083] Among them, the peripheral devices of the test terminal obtain the resource usage results of memory partition, storage resources and CPU from the test terminal, merge the resource usage results of memory partition, storage resources and CPU to obtain the resource usage results, and the resource usage results also include the identification of abnormal resource usage, etc.

[0084] The test results of the real-time operating system are obtained based on the kernel resource test results and the resource usage results.

[0085] In this embodiment, in the process of controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task, resource usage results are obtained through peripheral testing equipment, which can improve the integrity of the real-time operating system security test.

[0086] In one embodiment, as shown in FIG6 , a partition isolation testing method for a real-time operating system is provided, including:

[0087] S602: Acquire a test task of the real-time operating system.

[0088] The real-time operating system shown in FIG7 includes a software part, a hardware part, a monitoring part, and a peripheral testing part.

[0089] The software part includes time-sharing isolation of users to obtain user partition 1, user partition 2, and user partition 3. The software part also includes a kernel resource management module, which includes a main control interface, a memory management unit, a time slice scheduling unit, and a file system unit.

[0090] The main control interface connects to the monitoring PC and transmits kernel resource test results to the monitoring PC via the main control interface. The memory management unit (MMU) partitions the hardware memory into memory partitions. The time slice scheduling unit partitions each user into user partitions. The file system unit records the storage space usage of each component in the kernel resource management module.

[0091] S604: After obtaining the test task, create a first number of user partitions for the real-time kernel of the real-time operating system.

[0092] S606: Create a second number of memory partitions for the memory of the real-time operating system, where the second number is greater than or equal to the first number.

[0093] S608: Allocate at least one memory partition to a user partition.

[0094] S610: Allocate the test task to a first preset number of user partitions, and obtain the priority of each user partition.

[0095] S612: Sort by priority of each user partition to obtain a sorting result.

[0096] S614 , based on the sorting result, starting from the highest priority, control each user partition in turn to call the memory partition corresponding to each user partition according to the assigned test task to perform a test, and obtain the kernel resource scheduling log of each user partition.

[0097] Among them, the memory partition called by each user partition is different.

[0098] S616: Merge the kernel resource scheduling logs of each user partition to obtain the kernel resource test result of the real-time operating system.

[0099] Among them, the test task is assigned to a first preset number of user partitions, and each user partition is controlled to call the memory partition corresponding to each user partition for testing according to the assigned test task. The step of obtaining the kernel resource scheduling log of each user partition includes: assigning the test task to a first preset number of user partitions, determining the correspondence between each user partition and the test subtask, and the test task includes multiple test subtasks; determining the correspondence between each test subtask and each memory partition according to the correspondence between each user partition and the test subtask, and obtaining a mapping table of the logical address-physical address of each test subtask according to the correspondence between each test subtask and each memory partition; according to the mapping table, controlling each user partition to call the corresponding memory partition for testing according to the assigned test task.

[0100] S618 , in the process of controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task, obtain resource usage results of the memory partition, storage resources and CPU in the real-time operating system through the peripheral device.

[0101] S620: Obtain a test result of the real-time operating system according to the kernel resource test result and the resource usage result.

[0102] In this embodiment, by obtaining a test task of a real-time operating system, the test task is assigned to a first preset number of user partitions, and each user partition is controlled to call a memory partition corresponding to each user partition for testing according to the assigned test task, thereby obtaining a kernel resource scheduling log of each user partition, wherein the memory partition called by each user partition is different, and the kernel resource scheduling logs of each user partition are merged to obtain a kernel resource test result of the real-time operating system. In this method, on the one hand, the real-time operating system includes user partitions and memory partitions, and the partitions called by each user partition are different, thereby improving the test data isolation effect and ensuring data security; on the other hand, by partitioning multiple users, the test data of the users are different from each other, thereby avoiding the influence of the individual experience of the test users, and combining multiple user partitions and the kernel resource scheduling logs corresponding to the multiple user partitions to obtain a final kernel resource test report, thereby improving the accuracy of the test report.

[0103] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0104] Based on the same inventive concept, embodiments of the present application also provide a real-time operating system testing device for implementing the real-time operating system testing method described above. The implementation solution provided by this device is similar to the implementation solution described in the above-mentioned method. Therefore, the specific limitations of one or more real-time operating system testing device embodiments provided below can be found in the limitations of the real-time operating system testing method described above and will not be repeated here.

[0105] In one embodiment, as shown in FIG8 , a testing device for a real-time operating system is provided, including: an acquisition module 802 , a testing module 804 , and a processing module 806 , wherein:

[0106] An acquisition module 802 is used to acquire a test task of a real-time operating system;

[0107] A testing module 804 is configured to assign test tasks to a first preset number of user partitions, and control each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test task, thereby obtaining a kernel resource scheduling log for each user partition, wherein each user partition calls a different memory partition.

[0108] The processing module 806 is used to merge the kernel resource scheduling logs of each user partition to obtain the kernel resource test result of the real-time operating system.

[0109] In one embodiment, the test module 804 is further used to obtain the priority of each user partition; sort the user partitions according to their priorities to obtain sorting results; and control each user partition in turn to call the memory partition corresponding to each user partition according to the assigned test task to perform testing, thereby obtaining the kernel resource scheduling log of each user partition.

[0110] In one embodiment, the test module 804 is further used to control each user partition to call the memory partition corresponding to each user partition according to the assigned test task based on the sorting result, starting from the highest priority level, to perform testing, and obtain the kernel resource scheduling log of each user partition.

[0111] In one embodiment, the testing device for a real-time operating system further includes an allocation module for creating a first number of user partitions for the real-time kernel of the real-time operating system after obtaining a test task; creating a second number of memory partitions for the memory of the real-time operating system, wherein the second number is greater than or equal to the first number; and allocating at least one memory partition to a user partition.

[0112] In one embodiment, the test module 804 is also used to assign the test task to a first preset number of user partitions, determine the correspondence between each user partition and the test subtask, and the test task includes multiple test subtasks; determine the correspondence between each test subtask and each memory partition based on the correspondence between each user partition and the test subtask, and obtain a mapping table of the logical address-physical address of each test subtask based on the correspondence between each test subtask and each memory partition; control each user partition to call the corresponding memory partition for testing according to the assigned test task according to the mapping table.

[0113] In one embodiment, the testing device for the real-time operating system also includes a peripheral testing module 804, which is used to obtain the resource usage results of the memory partition, storage resources and CPU in the real-time operating system through peripheral devices during the process of controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task; and obtain the test results of the real-time operating system based on the kernel resource test results and the resource usage results.

[0114] Each module in the above-mentioned real-time operating system test device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in the form of software in a memory in the computer device, so that the processor can call and execute the corresponding operations of each module.

[0115] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in Figure 9. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store test task data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a test method for a real-time operating system is implemented.

[0116] In one embodiment, a computer device is provided, comprising a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the computer device is used to obtain a test task for a real-time operating system; assign the test task to a first preset number of user partitions, and control each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test task, thereby obtaining a kernel resource scheduling log for each user partition, wherein the memory partition called by each user partition is different; and merge the kernel resource scheduling logs of each user partition to obtain a kernel resource test result for the real-time operating system.

[0117] In one embodiment, when the processor executes a computer program, it is used to obtain the priority of each user partition; sort the user partitions according to their priorities to obtain a sorting result; and control each user partition in turn according to the sorting result to call the memory partition corresponding to each user partition according to the assigned test task to perform a test, thereby obtaining a kernel resource scheduling log of each user partition.

[0118] In one embodiment, when the processor executes the computer program, it is used to control each user partition in sequence from the highest priority level according to the sorting result to call the memory partition corresponding to each user partition according to the assigned test task to perform testing, and obtain the kernel resource scheduling log of each user partition.

[0119] In one embodiment, when the processor executes the computer program, it is used to create a first number of user partitions for the real-time kernel of the real-time operating system after obtaining a test task; create a second number of memory partitions for the memory of the real-time operating system, wherein the second number is greater than or equal to the first number; and allocate at least one memory partition to a user partition.

[0120] In one embodiment, when the processor executes a computer program, it is used to assign a test task to a first preset number of user partitions, determine the correspondence between each user partition and a test subtask, and the test task includes multiple test subtasks; determine the correspondence between each test subtask and each memory partition based on the correspondence between each user partition and the test subtask, and obtain a mapping table of the logical address-physical address of each test subtask based on the correspondence between each test subtask and each memory partition; and control each user partition to call the corresponding memory partition for testing according to the assigned test task according to the mapping table.

[0121] In one embodiment, when the processor executes the computer program, it is used to obtain the resource usage results of the memory partition, storage resources and CPU in the real-time operating system through the peripheral device while controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task; and obtain the test results of the real-time operating system based on the kernel resource test results and the resource usage results.

[0122] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the computer program is used to obtain a test task for a real-time operating system; assign the test task to a first preset number of user partitions, and control each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test task, thereby obtaining a kernel resource scheduling log for each user partition, wherein the memory partition called by each user partition is different; and merge the kernel resource scheduling logs of each user partition to obtain a kernel resource test result for the real-time operating system.

[0123] In one embodiment, a computer program product is provided, comprising a computer program. When executed by a processor, the computer program is configured to obtain a test task for a real-time operating system; assign the test task to a first preset number of user partitions, and control each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test task, thereby obtaining a kernel resource scheduling log for each user partition, wherein the memory partition called by each user partition is different; and merge the kernel resource scheduling logs for each user partition to obtain a kernel resource test result for the real-time operating system.

[0124] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0125] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0126] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A real-time operating system testing method, It is characterized in that The method comprises: Obtaining a test task for the real-time operating system; Allocate the test task to a first preset number of user partitions, and control each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test task, and obtain a kernel resource scheduling log of each user partition, wherein the memory partition called by each user partition is different; The kernel resource scheduling logs of each user partition are merged to obtain the kernel resource test result of the real-time operating system.

2. The method according to claim 1, It is characterized in that The step of controlling each user partition to call the memory partition corresponding to each user partition to perform a test according to the assigned test task, and obtaining the kernel resource scheduling log of each user partition comprises: Get the priority of each user partition; Sort by priority of each user partition to obtain the sorting result; According to the sorting result, each user partition is controlled in turn to call the memory partition corresponding to each user partition for testing according to the assigned test task, so as to obtain the kernel resource scheduling log of each user partition.

3. The method according to claim 2, It is characterized in that The step of sequentially controlling each user partition to call the memory partition corresponding to each user partition according to the assigned test task to perform a test according to the sorting result, and obtaining the kernel resource scheduling log of each user partition includes: According to the sorting result, each user partition is controlled in turn starting from the highest priority level to call the memory partition corresponding to each user partition for testing according to the assigned test task, and the kernel resource scheduling log of each user partition is obtained.

4. The method according to claim 1, It is characterized in that Before the step of allocating the test task to a first preset number of user partitions, the method includes: After obtaining the test task, creating a first number of user partitions for the real-time kernel of the real-time operating system; creating a second number of memory partitions for the memory of the real-time operating system, wherein the second number is greater than or equal to the first number; Assign at least one memory partition to a user partition.

5. The method according to claim 1, It is characterized in that The step of allocating the test task to a first preset number of user partitions, controlling each user partition to call a memory partition corresponding to each user partition for testing according to the allocated test task, and obtaining a kernel resource scheduling log of each user partition comprises: The test task is assigned to a first preset number of user partitions, and the corresponding relationship between each user partition and the test subtask is determined. The test task includes multiple test subtasks; Determine the correspondence between each test subtask and each memory partition according to the correspondence between each user partition and the test subtask, and obtain a mapping table of the logical address-physical address of each test subtask according to the correspondence between each test subtask and each memory partition; According to the mapping table, each user partition is controlled to call the corresponding memory partition for testing according to the assigned test task.

6. The method according to claim 1, It is characterized in that The method further comprises: In the process of controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task, obtaining the resource usage results of the memory partition, storage resources and CPU in the real-time operating system through the peripheral device; The test result of the real-time operating system is obtained according to the kernel resource test result and the resource usage result.

7. The method according to claim 1, It is characterized in that The step of obtaining the test task of the real-time operating system includes: At least one of the operating system kernel resource management response speed of the real-time operating system, the accuracy of the time slice scheduling of the real-time operating system, and the integrity of the file system of the real-time operating system is obtained.

8. The method according to claim 1, It is characterized in that The step of obtaining the test task of the real-time operating system includes: The test task of the real-time operating system is read from the test terminal.

9. The method according to claim 1, It is characterized in that The step of merging the kernel resource scheduling logs of each user partition to obtain the kernel resource test result of the real-time operating system includes: According to the type of the kernel resource scheduling log, the kernel resource scheduling logs of the same type of each user partition are analyzed to obtain analysis results of the kernel resource scheduling logs of the same type; The analysis results of kernel resource scheduling logs of the same type are summarized to obtain the kernel resource test results of the real-time operating system.

10. The method according to claim 6, It is characterized in that The peripheral device includes at least one of an input / output device, an external memory, and a peripheral processor, and the peripheral device is connected to the test terminal.

11. The method according to claim 10, It is characterized in that The step of obtaining the memory partition, storage resources and CPU resource usage results in the real-time operating system through the peripheral device includes: The peripheral device is controlled to obtain at least one of the usage results of memory partition, storage resources and CPU resources from the test terminal in the real-time operating system.

12. A test device for a real-time operating system, It is characterized in that The device comprises: An acquisition module, used for acquiring a test task of the real-time operating system; A test module, used to assign the test task to a first preset number of user partitions, and control each user partition to call a memory partition corresponding to each user partition for testing according to the assigned test task, and obtain a kernel resource scheduling log of each user partition, wherein the memory partition called by each user partition is different; The processing module is used to merge the kernel resource scheduling logs of each user partition to obtain the kernel resource test result of the real-time operating system.

13. The device according to claim 12, It is characterized in that The test module is also used to obtain the priority of each user partition; sort the user partitions according to their priorities to obtain sorting results; and control each user partition in turn to call the memory partition corresponding to each user partition for testing according to the assigned test tasks, thereby obtaining the kernel resource scheduling log of each user partition.

14. The device according to claim 13, It is characterized in that The test module is also used to control each user partition in turn from the highest priority level to call the memory partition corresponding to each user partition according to the assigned test task according to the sorting result, and obtain the kernel resource scheduling log of each user partition.

15. The device according to claim 12, It is characterized in that The device also includes: an allocation module, which is used to create a first number of user partitions for the real-time kernel of the real-time operating system after obtaining the test task; create a second number of memory partitions for the memory of the real-time operating system, wherein the second number is greater than or equal to the first number; and allocate at least one memory partition to a user partition.

16. The device according to claim 12, It is characterized in that The test is further used to assign the test task to a first preset number of user partitions, determine the corresponding relationship between each user partition and the test subtask, and the test task includes a plurality of test subtasks; According to the correspondence between each user partition and the test subtask, the correspondence between each test subtask and each memory partition is determined, and according to the correspondence between each test subtask and each memory partition, a mapping table of the logical address-physical address of each test subtask is obtained; according to the mapping table, each user partition is controlled to call the corresponding memory partition for testing according to the assigned test task.

17. The device according to claim 12, It is characterized in that The device also includes: a peripheral testing module, which is used to obtain the resource usage results of the memory partition, storage resources and CPU in the real-time operating system through peripheral devices during the process of controlling each user partition to call the memory partition corresponding to each user partition for testing according to the assigned test task; and obtain the test result of the real-time operating system according to the kernel resource test result and the resource usage result.

18. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

19. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

20. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Test log processing method, system and terminal

    CN107957940A

  • Secure operating system based on MILS architecture

    CN110968876A

  • Operating system testing method and device, equipment and readable storage medium

    CN111949546A