Method and system for measuring running time of MCU Hypervisor system and computer equipment

By adding monitoring interfaces and recording logs at timing events of the MCU Hypervisor system, the problems of insufficient flexibility and low efficiency of measurement methods in the prior art are solved, and multi-dimensional accurate performance measurement is achieved.

CN120371665APending Publication Date: 2025-07-25SHENZHEN DESAY SV AUTOMOTIVE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510256195.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, the performance measurement method of the MCU Hypervisor system is not flexible enough and has low measurement efficiency. It can only measure a single dimension and cannot meet the measurement needs of complex scenarios.

Method used

Add a timing event monitoring interface at the timing events of the MCU Hypervisor system, record the event log and cache it, and obtain the event period data through the host computer analysis and processing.

Benefits of technology

It realizes flexible and efficient measurement of multi-dimensional timing events, with high accuracy and no additional hardware operation, which is convenient to use and wide application range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371665A_ABST
    Figure CN120371665A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computer communication, and discloses a method and system for measuring the running time of an MCU Hypervisor system and computer equipment, and the method comprises the steps: adding a corresponding time sequence event monitoring interface at a time sequence event needing to be monitored in the MCU Hypervisor system; the MCU Hypervisor system calls a corresponding time sequence event monitoring interface at a position where a time sequence event occurs in a virtual machine scheduling process and a virtual machine communication process, and inputs a corresponding event type parameter; recording a time sequence event log through a time sequence event monitoring interface, and recording the time sequence event log record into the MCU Hypervisor system for caching; and analyzing and processing the time sequence event log record to obtain occurrence cycle data of the event of the corresponding type. According to the method for measuring the running time of the MCU Hypervisor system, time sequence events of all dimensions are measured at a time, then time sequence event measurement results of different dimensions are presented according to actual performance measurement requirements, and the method is very flexible and efficient to use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer communication technologies, and particularly to a method, a system, and a computer device for measuring the running time of an MCU Hypervisor system. Background Art

[0002] MCU Hypervisor refers to the virtualization system of a microcontroller. In the MCU Hypervisor system, the Hypervisor directly interacts with the MCU hardware. This direct hardware operation method bypasses the intermediate software layer, reduces unnecessary overhead, and improves the response speed and real-time performance of the system. The traditional real-time operating system of the MCU running on the Hypervisor provides a stable and reliable operating environment for upper-layer application programs, enabling different application programs to run independently on the same MCU without interference.

[0003] In practical applications, the performance of the MCU Hypervisor system directly affects the stability and reliability of the entire embedded system. Therefore, accurately measuring the performance overhead of the MCU Hypervisor system helps developers optimize the system design and improve the performance and efficiency of the system. At the same time, potential problems in the system can also be discovered by measuring the performance overhead.

[0004] The traditional method of measuring the control pin level output is based on the fixed configuration of hardware pins. Once the hardware design is completed, the functions and quantities of the pins are determined. However, there are various types of timing events in the MCU Hypervisor system, and different events may require different measurement parameters and measurement methods. Due to the fixity of the traditional measurement method, it cannot be flexibly adjusted according to different event types and measurement requirements, resulting in the ability to measure only single-dimensional scenarios and unable to meet complex measurement needs.

[0005] Moreover, in the face of a large number of timing events and complex measurement scenarios, the traditional method of measuring the control pin level output requires manual setting of measurement parameters and reading of measurement results, which is cumbersome and time-consuming. Furthermore, since only single-dimensional data can be obtained in each measurement, multiple measurements and processing are required for multi-dimensional data, further reducing the measurement efficiency. Summary of the Invention

[0006] The embodiments of the present invention provide a method, a system, and a computer device for measuring the running time of an MCU Hypervisor system to solve the problems of insufficient flexibility, too low measurement efficiency, and the ability to measure only single-dimensional measurement scenarios in the existing method of measuring the performance overhead of the MCU Hypervisor system by measuring the control pin level output.

[0007] According to an object of an embodiment of the present invention, there is provided a method for measuring the running time of an MCU Hypervisor system, including the following steps:

[0008] Add corresponding timing event monitoring interfaces at the timing events to be monitored in the MCU Hypervisor system;

[0009] During the virtual machine scheduling process and the virtual machine communication process of the MCU Hypervisor system, call the corresponding timing event monitoring interface at the position where a timing event occurs, and input the corresponding event type parameter;

[0010] Implement timing event logging through the timing event monitoring interface, and record the timing event logging in the MCU Hypervisor system for caching;

[0011] The host computer analyzes and processes the timing event logging to obtain the occurrence cycle data of events of the corresponding type.

[0012] In some optional implementation manners, before the host computer analyzes and processes the timing event logging, it further includes:

[0013] The MCU Hypervisor system exports the cached timing event logging to the host computer.

[0014] In some optional implementation manners, analyzing the timing of event occurrence includes:

[0015] According to the measurement requirements, perform timing analysis on events that filter specified virtual machines and specified event types.

[0016] In some optional implementation manners, it further includes:

[0017] Analyze the occurrence cycle data of the events of the corresponding type to obtain relevant parameters of the occurrence cycle of the events;

[0018] Show the occurrence process of the events through the relevant parameters of the occurrence cycle of the events.

[0019] In some optional implementation manners, the relevant parameters of the occurrence cycle of the events include: the average value, variance or timing diagram of the occurrence cycle of the events.

[0020] In some optional implementation manners, the timing event logging is cached in a specified log circular cache of the MCU Hypervisor system.

[0021] In some alternative implementations, the timing event logging at least includes: event type and real-time timestamp;

[0022] Wherein, the timestamp value is read by a constructed timestamp counter.

[0023] In some alternative implementations, the event type includes: time slice scheduling timer interrupt entry event, priority scheduling interrupt entry event, inter-virtual machine communication signal interrupt event, triggering virtualization service call event, virtualization service execution completion time, or context switching event.

[0024] According to another object of the embodiments of the present invention, there is provided a measurement system for the operating time of an MCU Hypervisor system, including: a configuration module, a timing event trigger module, a generation module, a cache module, and a processing module;

[0025] The configuration module is used to add corresponding timing event monitoring interfaces at the timing events that need to be monitored in the MCU Hypervisor system;

[0026] The timing event trigger module is used to call the corresponding timing event monitoring interface at the position where a timing event occurs during the virtual machine scheduling process and the virtual machine communication process in the MCU Hypervisor system, and input corresponding event type parameters;

[0027] The generation module is used to implement timing event logging through the timing event monitoring interface;

[0028] The cache module is used to cache the timing event logging implemented by the generation module into the log recording circular cache specified by the MCU Hypervisor system;

[0029] The processing module is used to analyze and process the timing event logging to obtain the occurrence period data of events of corresponding types.

[0030] According to yet another object of the embodiments of the present invention, there is provided a computer device, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete mutual communication through the communication bus;

[0031] The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operations of the measurement method for the operating time of the MCU Hypervisor system as described above.

[0032] Compared with the prior art, the present invention has the following advantages:

[0033] The method for measuring the running time of the MCU Hypervisor system provided by the present invention adds corresponding timing event monitoring interfaces at the timing events to be monitored in the MCU Hypervisor system and inputs corresponding event type parameters, so that during the running process of the MCU Hypervisor system, the corresponding timing event monitoring interfaces are called at the positions where timing events occur to implement timing event log recording. Finally, the timing event log recording is analyzed to obtain the occurrence cycle data of events of corresponding types; it realizes the measurement of all dimensions of timing events at one time, and then presents the measurement results of different dimensions of timing events according to actual performance measurement needs, which is very flexible and efficient and more accurate; moreover, the method for measuring the running time of the MCU Hypervisor system of the present invention only collects event types and real-time timestamps during measurement, without the need to operate any other hardware, and only needs to use the existing hardware circuit of the MCU Hypervisor system to complete the acquisition of measurement data, which is very convenient to use and has a wide range of applications.

[0034] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to be able to understand the technical means of the embodiment of the present invention more clearly, it can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and understandable, the following specifically illustrates the embodiments of the present invention. Brief Description of the Drawings

[0035] The drawings are only used to illustrate the embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0036] Figure 1 It shows a schematic flow chart of a method for measuring the running time of an MCU Hypervisor system provided by an embodiment of the present invention;

[0037] Figure 2 It shows a schematic structural diagram of a system for measuring the running time of an MCU Hypervisor system provided by an embodiment of the present invention;

[0038] Figure 3 It shows a schematic structural diagram of a computer device provided by an embodiment of the present invention. Detailed Description of the Embodiments

[0039] The following will describe the exemplary embodiments of the present invention in more detail with reference to the drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein.

[0040] This embodiment provides a method for measuring the running time of an MCU Hypervisor system to solve the problems of insufficient flexibility, too low measurement efficiency, and only being able to measure a single - dimension measurement scenario in the existing control - pin - level - output measurement method for measuring the performance overhead of the MCU Hypervisor system.

[0041] A method for measuring the running time of an MCU Hypervisor system provided by an embodiment of the present invention, as Figure 1 shown, includes the following steps:

[0042] S10. Add corresponding timing - event monitoring interfaces at the timing events to be monitored in the MCU Hypervisor system.

[0043] In this step, optimize the MCU Hypervisor system, and combine the virtual - machine scheduling and communication mechanisms of the MCU Hypervisor system to add corresponding timing - event monitoring interfaces at key positions in the virtual - machine scheduling process and virtual - machine communication process of the MCU Hypervisor system.

[0044] In this embodiment, the timing - event monitoring interface can comprehensively capture various events during the running process of the MCU Hypervisor system, providing a rich data source for in - depth analysis of the performance of the MCU Hypervisor system.

[0045] In addition, in this embodiment, the key positions in the virtual - machine scheduling process and virtual - machine communication process of the MCU Hypervisor system are the timing events to be monitored in the MCU Hypervisor system.

[0046] S20. During the virtual - machine scheduling process and virtual - machine communication process of the MCU Hypervisor system, call the corresponding timing - event monitoring interface at the position where a timing event occurs, and input the corresponding event - type parameter.

[0047] In this step, it can be understood that: during the normal running process of the MCU Hypervisor system, at the key positions in the virtual - machine scheduling process and virtual - machine communication process of the MCU Hypervisor system, that is, at the positions where timing events occur, trigger the timing events. At this time, call the corresponding timing - event monitoring interface and input the corresponding event - type parameter to distinguish and record different types of events.

[0048] S30. Implement timing - event log recording through the timing - event monitoring interface, and record the timing - event log recording in the MCU Hypervisor system for caching.

[0049] In this step, relevant type event information is recorded through the timing event monitoring interface to form a timing event log record. Then, the timing event log record is recorded into the log record circular buffer specified by the MCU Hypervisor system.

[0050] S40. The host computer analyzes and processes the timing event log record to obtain the occurrence cycle data of events of the corresponding type.

[0051] In this step, the host computer grabs the exported timing event log record and analyzes the timing of event occurrence to obtain the occurrence cycle data of events of the corresponding type.

[0052] Specifically, the host computer analyzes the timing event log record to obtain the occurrence cycle data of the specified virtual machine and the specified event type filtered based on different requirements.

[0053] The method for measuring the running time of the MCU Hypervisor system provided in this embodiment adds corresponding timing event monitoring interfaces at the timing events that need to be monitored by the MCU Hypervisor system, so that during the operation of the MCU Hypervisor system, the corresponding timing event monitoring interface is called at the position where the timing event occurs, and the corresponding event type parameter is input to implement the timing event log record. Finally, the timing event log record is analyzed to obtain the occurrence cycle data of events of the corresponding type; it realizes the measurement of all dimensions of timing events at one time, and then presents the measurement results of different dimensions of timing events according to the actual performance measurement needs, which is very flexible and efficient, and more accurate; and the method for measuring the running time of the MCU Hypervisor system in this embodiment only collects the event type and real-time timestamp during measurement, without operating any other hardware, and only needs to use the existing hardware circuit of the MCU Hypervisor system to complete the measurement data acquisition, which is very convenient and has a wide range of applications.

[0054] As a preferred embodiment, before optimizing the software of the MCU Hypervisor system, a timestamp counter is built based on the MCU hardware to calibrate the exact moment when all timing events occur through the count value of the timestamp counter, providing a time reference for subsequent event analysis.

[0055] Preferably, the timestamp counter is a high-precision timestamp counter at the nanosecond level.

[0056] And each timing event log record includes at least: event type and real-time timestamp.

[0057] Among them, the timestamp value is read through the constructed timestamp counter; the event type is determined by the event type parameter input by the event monitoring interface.

[0058] In some alternative implementation manners, each timing event log record may further include: a physical core ID and a virtual machine ID. Among them, the physical core ID and the virtual machine ID are obtained by querying the corresponding registers.

[0059] In this embodiment, the event types include: time slice scheduling timer interrupt entry event, priority scheduling interrupt entry event, inter-virtual machine communication signal interrupt event, triggering virtualization service call event, virtualization service execution completion time or context switching event, etc.

[0060] In addition, the event type further includes other event types newly added according to user requirements to meet different measurement and analysis requirements.

[0061] Therefore, in this embodiment, before the host computer analyzes and processes the timing event log records, it further includes:

[0062] The MCU Hypervisor system exports the cached timing event log records to the host computer.

[0063] In view of the possible compatibility issues between different models of MCUs and host computers. During the development of the MCU Hypervisor system, the characteristics of different hardware platforms and software environments should be fully considered, and a unified data interface and communication protocol should be formulated to ensure the generality and scalability of the MCU Hypervisor system. The export method can be selected according to the existing communication functions supported by the MCU Hypervisor system, such as serial port, Ethernet, etc., to ensure the efficient and stable transmission of data.

[0064] Then the host computer grabs the exported timing event log records and analyzes the timing of the event occurrence to obtain the occurrence cycle data of the event of the corresponding type.

[0065] Specifically, the host computer grabs the exported timing event log records and performs timing analysis on the events of filtering specified virtual machines and specified event types according to the measurement requirements to obtain the occurrence cycle data of the event of the corresponding type.

[0066] Preferably, this embodiment further includes:

[0067] Analyze the occurrence cycle data of the event of the corresponding type to obtain the relevant parameters of the occurrence cycle of the event.

[0068] Display the occurrence process of the event through the relevant parameters of the occurrence cycle of the event.

[0069] Among them, the relevant parameters of the occurrence period of the event include: the average value, variance or time series diagram of the occurrence period of the event.

[0070] Therefore, in this embodiment, by analyzing the time series event log records, the analysis of the time series of event occurrences is realized, enabling the user to screen the events of a specified virtual machine and a specified event type for in-depth analysis according to the measurement requirements. Finally, the host computer can efficiently calculate statistical quantities such as the average value and variance of the occurrence period of a certain type of event or a group of types of event groups, and can also intuitively display the occurrence process of the event or event group through a time series diagram.

[0071] In some alternative embodiments, the embodiment of the present invention also discloses a measurement system for the running time of an MCU Hypervisor system.

[0072] As Figure 2 shown, the measurement system for the running time of the MCU Hypervisor system includes: a configuration module 100, a time series event trigger module 200, a generation module 300, a cache module 400, and a processing module 500.

[0073] In this embodiment, the configuration module 100 is used to add corresponding time series event monitoring interfaces at the time series events that need to be monitored in the MCU Hypervisor system;

[0074] The time series event trigger module 200 is used to call the corresponding time series event monitoring interface at the position where a time series event occurs during the virtual machine scheduling process and the virtual machine communication process in the MCU Hypervisor system, and input the corresponding event type parameters;

[0075] The generation module 300 is used to implement time series event log records through the time series event monitoring interface;

[0076] The cache module 400 is used to cache the time series event log records implemented by the generation module into the log record circular cache specified by the MCU Hypervisor system.

[0077] The processing module 500 is used to analyze and process the time series event log records to obtain the occurrence period data of the events of the corresponding type.

[0078] In this embodiment, for the specific position where the configuration module 100 adds the time series event monitoring interface, refer to step S10 of the embodiment of the measurement method for the running time of the MCU Hypervisor system above, and this embodiment will not be repeated here.

[0079] The timing event trigger module 200 implements the calling process of the timing event monitoring interface. For the specific steps, refer to step S20 in the embodiment of the method for measuring the running time of the MCU Hypervisor system above. This embodiment will not be elaborated repeatedly.

[0080] The generation module 300 implements the process of recording timing event logs. For the specific steps, refer to step S30 in the embodiment of the method for measuring the running time of the MCU Hypervisor system above. This embodiment will not be elaborated repeatedly.

[0081] The processing module 500 implements the process of analyzing and processing the timing event logs. For the specific steps, refer to step S40 in the embodiment of the method for measuring the running time of the MCU Hypervisor system above. This embodiment will not be elaborated repeatedly.

[0082] In some alternative embodiments, the embodiment of the present invention also discloses a computer device.

[0083] Figure 3 The structural schematic diagram of a computer device provided by the embodiment of the present invention is shown.

[0084] As Figure 3 shown, the computer device includes: a processor 610, a memory 620, a communication interface 630, and a communication bus 640. The processor 610, the memory 620, and the communication interface 630 complete communication with each other through the communication bus 640.

[0085] In this embodiment, the memory 620 is used to store at least one executable instruction, and the executable instruction causes the processor 620 to execute the operations of the method for measuring the running time of the MCU Hypervisor system described in any of the above embodiments; the communication interface 630 is used to communicate with network elements of other devices such as clients or other servers, etc. The processor 610 is used to execute the program 650, and specifically can execute the relevant steps in the embodiment of the method for measuring the running time of the MCU Hypervisor system above.

[0086] Specifically, the program 650 may include program code, and the program code includes computer executable instructions.

[0087] The processor 610 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiment of the present invention. One or more processors included in the computer device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.

[0088] The memory 620 is used to store the program 650. The memory 620 may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.

[0089] Specifically, the program 650 can be called by the processor 610 to cause the computer device to execute the operations of the method for measuring the running time of the MCU Hypervisor system described in any of the above embodiments.

[0090] In some alternative embodiments, the embodiments of the present invention also disclose a computer-readable storage medium, in which at least one executable instruction is stored. When the executable instruction runs on a computer device / device, the computer device / device is caused to execute the steps of the method for measuring the running time of the MCU Hypervisor system in any of the above method embodiments.

[0091] For the specific implementation process of the method for measuring the running time of the MCU Hypervisor system described in this embodiment, refer to any of the above method embodiments, and this embodiment will not be repeated here.

[0092] In the specification provided here, a large number of specific details are described. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. Similarly, in order to streamline the present invention and help understand one or more of the various aspects of the invention, in the above description of the exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. Among them, the claims following the specific implementation manners are hereby expressly incorporated into the specific implementation manners, and each claim itself serves as a separate embodiment of the present invention.

[0093] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and arranged in one or more devices different from this embodiment. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive.

[0094] It should be noted that the above embodiments are illustrative of the present invention and not restrictive thereof, and alternative embodiments can be designed by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim listing several devices, several of these devices can be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

Claims

1. A method for measuring the running time of an MCU Hypervisor system, characterized in that It includes the following steps: Add corresponding timing event monitoring interfaces at the timing events to be monitored by the MCU Hypervisor system; During the virtual machine scheduling process and the virtual machine communication process of the MCU Hypervisor system, call the corresponding timing event monitoring interfaces at the positions where timing events occur, and input corresponding event type parameters; Implement timing event logging through the timing event monitoring interfaces, and record the timing event logging in the MCU Hypervisor system for caching; The host computer analyzes and processes the timing event logging to obtain the occurrence cycle data of events of corresponding types.

2. The method for measuring the running time of an MCU Hypervisor system according to claim 1, wherein Before the host computer analyzes and processes the timing event logging, it further includes: The MCU Hypervisor system exports the cached timing event logging to the host computer.

3. A method for measuring the running time of an MCU Hypervisor system according to claim 1, characterized in that Analyzing the timing of event occurrence includes: According to the measurement requirements, perform timing analysis on the events of filtering specified virtual machines and specified event types.

4. The method for measuring the running time of an MCU Hypervisor system according to claim 1, wherein It further includes: Analyze the occurrence cycle data of the events of the corresponding type to obtain relevant parameters of the occurrence cycle of the events; Display the occurrence process of the events through the relevant parameters of the occurrence cycle of the events.

5. A method for measuring the running time of an MCU Hypervisor system according to claim 4, characterized in that The relevant parameters of the occurrence cycle of the events include: the average value, variance or timing diagram of the occurrence cycle of the events.

6. The method for measuring the running time of an MCU Hypervisor system according to claim 1, characterized in that The timing event logging is cached in the specified log circular cache of the MCU Hypervisor system.

7. A method for measuring the running time of an MCU Hypervisor system according to claim 1, characterized in that The timing event logging at least includes: event type and real-time timestamp; Among them, the timestamp value is read through the constructed timestamp counter.

8. A method for measuring the running time of an MCU Hypervisor system according to claim 1, characterized in that The event types include: time slice scheduling timer interrupt entry event, priority scheduling interrupt entry event, virtual machine intercommunication signal interrupt event, trigger virtualization service call event, virtualization service execution completion time or context switching event.

9. A measurement system for the running time of an MCU Hypervisor system, characterized in that, It includes: Configuration module, timing event trigger module, generation module, cache module and processing module; The configuration module is used to add corresponding timing event monitoring interfaces at the timing events to be monitored by the MCU Hypervisor system; The timing event trigger module is used to call the corresponding timing event monitoring interfaces at the positions where timing events occur during the virtual machine scheduling process and the virtual machine communication process of the MCU Hypervisor system, and input corresponding event type parameters; The generation module is used to implement timing event logging through the timing event monitoring interfaces; The cache module is used to cache the timing event logging implemented by the generation module in the specified log circular cache of the MCU Hypervisor system; The processing module is used to analyze and process the timing event logging to obtain the occurrence cycle data of events of corresponding types.

10. A computer device, characterized in that, It includes: Processor, memory, communication interface and communication bus, and the processor, the memory and the communication interface complete mutual communication through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operations of the method for measuring the MCU Hypervisor system running time according to any one of claims 1-8.