Interrupt processing method and device, electronic equipment and storage medium

By directly sending the through interrupt signal to the target virtualizer using interrupt mapping tables in the virtualized environment, the problem of high interrupt delay in the virtualized environment is solved, and the work efficiency and virtualization performance of virtual machines are improved.

CN119536902APending Publication Date: 2025-02-28CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411508566.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In a virtualized environment, the interrupt delay of the pass-through interrupt signal is high, resulting in low interrupt transmission efficiency and virtual machine operation efficiency, thereby reducing virtualization performance.

Method used

By receiving the target interrupt signal and obtaining the interrupt number, the interrupt mapping table is used to determine whether the interrupt signal is a direct interrupt, and send it directly to the target virtualizer for processing, to avoid the interrupt signal passing through the interrupt sending mechanism of the virtualization software.

Benefits of technology

Simplifies interrupt management logic, improves virtual machine work efficiency, reduces interrupt delay, and improves virtualization performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536902A_ABST
    Figure CN119536902A_ABST
Patent Text Reader

Abstract

The invention relates to an interrupt processing method and device, electronic equipment and a storage medium, and the method comprises the steps: receiving a target interrupt signal sent by target equipment, and obtaining a target interrupt number and an interrupt mapping table corresponding to the target interrupt signal; the interrupt mapping table comprises an interrupt flag bit corresponding to each preset interrupt number in the at least one preset interrupt number and a corresponding virtual device identifier, and the interrupt flag bit is used for indicating whether the corresponding preset interrupt signal belongs to a straight-through interrupt signal or not; under the condition that the target interrupt flag bit indicates that the target interrupt signal is a straight-through interrupt signal, obtaining a target virtual device identifier corresponding to the target interrupt number from an interrupt mapping table; and sending the target interrupt signal to a target virtual device corresponding to the target virtual device identifier, so that the target virtual device performs interrupt processing. By utilizing the embodiment of the invention, the efficiency of executing interrupt sending by the direct connection interrupt signal can be improved, the interrupt time delay is reduced, and the working efficiency and the virtualization performance of the virtual machine are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of virtualization technology, and in particular to an interrupt processing method, device, electronic device and storage medium. Background Art

[0002] With the gradual development of automotive operating system virtualization technology, embedded virtualization technology has achieved efficient integration and intelligent control of various devices. How to reduce the high interrupt latency problem caused by direct interrupt sending in a virtualized environment has also become the key to ensuring the normal and efficient operation of virtual machines.

[0003] In the related art, the virtual machines, virtualization software and other physical processors running in the virtualization environment have different resource management permissions, among which the resource management permissions of the virtual machines are lower than those of the virtualization software; when the virtual machine needs to receive a direct interrupt signal (an interrupt signal that needs to be processed by the virtualizer), the direct interrupt signal is often first sent to the virtualization software with higher resource management permissions, and then sent to the virtual machine with lower resource management permissions through the interrupt sending mechanism of the virtualization software. However, in the related art, sending the interrupt signal from the virtualization software to the virtual machine will increase the interrupt response time, and the above steps need to be performed each time an interrupt signal is received, resulting in overhead on the performance of the virtualization system, and bringing about the problem of high interrupt latency caused by the direct interrupt signal when executing interrupt sending, and the interrupt sending efficiency and virtual machine working efficiency are both low, which in turn leads to problems such as reduced virtualization performance. Summary of the invention

[0004] The present disclosure provides an interrupt processing method, device, electronic device and storage medium to at least solve the problems in the related art that the direct interrupt signal has a high interrupt delay when executing interrupt sending, the interrupt sending efficiency and the virtual machine working efficiency are both low, and thus the virtualization performance is reduced. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an interrupt processing method, comprising:

[0006] Receive a target interrupt signal sent by a target device, and obtain a target interrupt number corresponding to the target interrupt signal;

[0007] Obtain an interrupt mapping table; the interrupt mapping table includes an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number and a virtual device identifier corresponding to each preset interrupt number; the interrupt flag is used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal, and the at least one preset interrupt number includes the target interrupt number;

[0008] Based on the interrupt mapping table, determining a target interrupt flag corresponding to the target interrupt number;

[0009] When the target interrupt flag indicates that the target interrupt signal is a pass-through interrupt signal, obtaining a target virtual device identifier corresponding to the target interrupt number from the interrupt mapping table;

[0010] The target interrupt signal is sent to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine performs interrupt processing.

[0011] In an optional embodiment, the method further includes:

[0012] Accessing at least one preset device and receiving an interrupt signal sent by a current device; the current device is any one of the at least one preset device accessed;

[0013] When the interrupt signal sent by the current device is an interrupt signal that needs to be processed by the corresponding virtualizer, a current interrupt flag bit corresponding to the interrupt signal sent by the current device is generated, and the current interrupt flag bit indicates that the interrupt signal sent by the current device is a pass-through interrupt signal;

[0014] Obtaining a current interrupt number corresponding to an interrupt signal sent by the current device, and using the current interrupt flag as an interrupt flag corresponding to the current interrupt number; the current interrupt number is any one of the at least one preset interrupt number;

[0015] Obtaining a current virtual machine identifier of a virtual machine corresponding to the interrupt signal sent by the current device, and using the current virtual machine identifier as the virtual machine identifier corresponding to the current interrupt number;

[0016] Based on the current interrupt number, an interrupt flag corresponding to the current interrupt number and a virtual device identifier corresponding to the current interrupt number are stored in the interrupt mapping table.

[0017] In an optional embodiment, the method further includes:

[0018] The interrupt mapping table is stored in a preset memory, a base address of the interrupt mapping table in the preset memory is recorded, and the base address is stored in an interrupt mapping register.

[0019] In an optional embodiment, the method further includes:

[0020] Obtaining a base address of the interrupt mapping table in the preset memory from the interrupt mapping table register;

[0021] Based on the base address, an interrupt mapping table is obtained from the preset memory.

[0022] In an optional embodiment, sending the target interrupt signal to the target virtual machine corresponding to the target virtual machine identifier so that the target virtual machine performs interrupt processing includes:

[0023] The target interrupt signal is sent to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine executes an interrupt service program corresponding to the target interrupt signal.

[0024] In an optional embodiment, the method further includes:

[0025] In the case where the target interrupt flag indicates that the target interrupt signal is not a pass-through interrupt signal, the target interrupt signal is sent to the virtualization software, so that the virtualization software, based on a preset interrupt priority, adds the target interrupt signal to a virtual interrupt list; the virtual interrupt list includes at least one current interrupt signal; the preset interrupt priority is used to indicate the execution order corresponding to the at least one preset interrupt signal;

[0026] A current interrupt signal is obtained from the virtual interrupt list, and the current interrupt signal is sent to the virtualization software so that the virtualization software performs interrupt processing, wherein the current interrupt signal is an interrupt signal with the highest execution priority in the virtual interrupt list.

[0027] In an optional embodiment, the method further includes:

[0028] An interrupt completion signal is sent to the virtualization software, so that the virtualization software updates the interrupt status of the current interrupt signal and removes the current interrupt signal from the virtual interrupt list.

[0029] According to a second aspect of an embodiment of the present disclosure, there is provided an interrupt processing device, comprising:

[0030] A first acquisition module, configured to receive a target interrupt signal sent by a target device, and acquire a target interrupt number corresponding to the target interrupt signal;

[0031] A second acquisition module is used to acquire an interrupt mapping table; the interrupt mapping table includes an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number and a virtual device identifier corresponding to each preset interrupt number; the interrupt flag is used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal, and the at least one preset interrupt number includes the target interrupt number;

[0032] A target interrupt flag bit determination module, used for determining a target interrupt flag bit corresponding to the target interrupt number based on the interrupt mapping table;

[0033] A third acquisition module is used to acquire a target virtual device identifier corresponding to the target interrupt number from the interrupt mapping table when the target interrupt flag indicates that the target interrupt signal is a pass-through interrupt signal;

[0034] The interrupt processing module is used to send the target interrupt signal to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine performs interrupt processing.

[0035] In an optional embodiment, the device further comprises:

[0036] An interrupt signal receiving module, used to access at least one preset device and receive an interrupt signal sent by a current device; the current device is any one of the at least one preset device that is accessed;

[0037] An interrupt flag generating module, used for generating a current interrupt flag corresponding to the interrupt signal sent by the current device when the interrupt signal sent by the current device is an interrupt signal that needs to be processed by the corresponding virtual device, and the current interrupt flag indicates that the interrupt signal sent by the current device is a pass-through interrupt signal;

[0038] A fourth acquisition module is used to acquire a current interrupt number corresponding to the interrupt signal sent by the current device, and use the current interrupt flag as the interrupt flag corresponding to the current interrupt number; the current interrupt number is any one of the at least one preset interrupt number;

[0039] A fifth acquisition module, configured to acquire a current virtual device identifier of a virtual device corresponding to the interrupt signal sent by the current device, and use the current virtual device identifier as the virtual device identifier corresponding to the current interrupt number;

[0040] The first storage module is used to store the interrupt flag corresponding to the current interrupt number and the virtual device identifier corresponding to the current interrupt number in the interrupt mapping table based on the current interrupt number.

[0041] In an optional embodiment, the device further comprises:

[0042] The second storage module is used to store the interrupt mapping table in a preset memory, record the base address of the interrupt mapping table in the preset memory, and store the base address in an interrupt mapping register.

[0043] In an optional embodiment, the device further comprises:

[0044] A base address acquisition module, used for acquiring a base address of the interrupt mapping table in the preset memory from the interrupt mapping table register;

[0045] The interrupt mapping table acquisition module is used to acquire the interrupt mapping table from the preset memory based on the base address.

[0046] In an optional embodiment, the interrupt processing module includes:

[0047] The interrupt service program execution unit is used to send the target interrupt signal to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine executes the interrupt service program corresponding to the target interrupt signal.

[0048] In an optional embodiment, the device further comprises:

[0049] An adding module, configured to send the target interrupt signal to the virtualization software when the target interrupt flag indicates that the target interrupt signal is not a pass-through interrupt signal, so that the virtualization software adds the target interrupt signal to a virtual interrupt list based on a preset interrupt priority; the virtual interrupt list includes at least one current interrupt signal; the preset interrupt priority is used to indicate an execution order corresponding to the at least one preset interrupt signal;

[0050] The first target interrupt signal sending module is used to obtain the current interrupt signal from the virtual interrupt list and send the current interrupt signal to the virtualization software so that the virtualization software performs interrupt processing. The current interrupt signal is the interrupt signal with the highest execution priority in the virtual interrupt list.

[0051] In an optional embodiment, the device further comprises:

[0052] The second target interrupt signal sending module is used to send an interrupt completion signal to the virtualization software, so that the virtualization software updates the interrupt status of the current interrupt signal and removes the current interrupt signal from the virtual interrupt list.

[0053] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is used to execute the instructions to implement a method as described in any one of the above-mentioned first aspects.

[0054] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method described in the first aspect of the embodiment of the present disclosure.

[0055] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0056] A target interrupt signal sent by a target device is received and a corresponding target interrupt number is obtained, and an interrupt mapping table including an interrupt flag bit corresponding to each preset interrupt number in at least one preset interrupt number and a virtual machine identifier corresponding to each preset interrupt number is obtained, wherein the interrupt flag bit is used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal. Based on the interrupt mapping table, the target interrupt flag bit corresponding to the target interrupt number can be determined, thereby simplifying the interrupt management logic and improving the working efficiency of the virtual machine. When the target interrupt flag bit indicates that the target interrupt signal is a pass-through interrupt signal, the target virtual machine identifier corresponding to the target interrupt number is obtained from the interrupt mapping table, and the target interrupt signal is sent to the target virtual machine corresponding to the target virtual machine identifier for interrupt processing, thereby improving the efficiency of the pass-through interrupt signal in executing interrupt sending, reducing interrupt latency, and greatly improving the working efficiency and virtualization performance of the virtual machine.

[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0059] Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment;

[0060] Figure 2 is a flowchart of an interrupt processing method according to an exemplary embodiment;

[0061] Figure 3 is a schematic diagram of an interrupt mapping representation according to an exemplary embodiment;

[0062] Figure 4 is a flow chart showing a method of generating an interrupt mapping table according to an exemplary embodiment;

[0063] Figure 5 is a block diagram of an interrupt processing device according to an exemplary embodiment;

[0064] Figure 6 The invention is a block diagram of an electronic device for interrupt processing according to an exemplary embodiment. DETAILED DESCRIPTION

[0065] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0066] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar different contents, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.

[0067] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0068] See also Figure 1 , Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment. Figure 1 As shown, the application environment may include a processor 100 and a preset device 200 .

[0069] In an optional embodiment, the processor 100 is responsible for receiving and managing interrupt signals and running virtualization software. Optionally, the processor 100 can generate an interrupt mapping table in advance, and send the direct interrupt signal to the corresponding virtualizer for interrupt processing in combination with the interrupt mapping table. Specifically, the processor 100 includes but is not limited to an embedded processor and an industrial-grade processor.

[0070] In an optional embodiment, the preset device 200 may send an interrupt signal to the processor 100, and perform data transmission and interaction with the processor 100. Specifically, the preset device includes but is not limited to electronic devices such as sensors, touch screens, mice, keyboards, and network interface controllers.

[0071] In addition, it should be noted that Figure 1 What is shown is only one application environment provided by the present disclosure. In actual application, other application environments may also be included.

[0072] In the embodiments of this specification, the processor 100 and the preset device 200 may be directly or indirectly connected via wired or wireless communication, which is not limited in this disclosure.

[0073] Figure 2 is a flowchart of an interrupt processing method according to an exemplary embodiment. Figure 2As shown, the interrupt processing method is used in electronic devices such as processors and preset devices, and includes the following steps.

[0074] In step S201, a target interrupt signal sent by a target device is received, and a target interrupt number corresponding to the target interrupt signal is acquired.

[0075] In a specific embodiment, the target device may correspond to different devices in combination with actual application requirements, for example, the target device may be a camera, a sensor, a radar, etc. The target interrupt signal may be a signal generated by the target device to notify the processor that an event has occurred and needs to be processed. Specifically, in the case where the target device is a keyboard, the target interrupt signal may be an interrupt signal sent by the keyboard to the processor when a key on the keyboard is pressed. Optionally, the target interrupt number may be used to identify the target device that sends the target interrupt signal.

[0076] In step S203, an interrupt mapping table is obtained.

[0077] In a specific embodiment, the interrupt mapping table may include an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number and a virtual machine identifier corresponding to each preset interrupt number. The virtual machine may be a processor of a virtual machine. Specifically, at least one preset interrupt number may include a target interrupt number, and the interrupt flag may be used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal.

[0078] In an optional embodiment, the above method may further include:

[0079] The interrupt mapping table is stored in a preset memory, a base address of the interrupt mapping table in the preset memory is recorded, and the base address is stored in an interrupt mapping register.

[0080] In a specific embodiment, a section of memory may be allocated in the preset memory for storing the interrupt mapping table, the base address may be the starting address of the interrupt mapping table in the preset memory, and the interrupt mapping register may be used to store the base address.

[0081] In the above embodiment, the interrupt mapping table is stored in the memory, and the base address of the interrupt mapping table is stored in the interrupt mapping register. Based on the base address, the interrupt mapping table can be quickly located to achieve a fast interrupt response. Since the base address of the interrupt mapping table is fixed, there is no need to perform multiple memory addressing operations, which reduces the delay of memory access and improves the speed of the entire interrupt processing.

[0082] In an optional embodiment, the above method may further include:

[0083] Get the base address of the interrupt mapping table in the preset memory from the interrupt mapping table register;

[0084] Based on the base address, the interrupt mapping table is obtained from the preset memory.

[0085] In a specific embodiment, assuming that the base address of the interrupt mapping table obtained from the interrupt mapping table register in the preset memory is 0x80000000, based on the base address 0x80000000, the interrupt mapping table can be obtained from the preset memory.

[0086] In the above embodiment, the interrupt mapping table is accessed by acquiring the base address of the interrupt mapping table in the preset memory from the interrupt mapping table register, thereby avoiding unnecessary memory access and calculation overhead, and reducing resource consumption.

[0087] Figure 3 FIG. 1 is a schematic diagram of an interrupt mapping table according to an exemplary embodiment. Figure 3 As shown, the interrupt mapping table includes an interrupt mapping register, an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number, and a virtual device identifier corresponding to each preset interrupt number, wherein the interrupt mapping register can be used to store the base address of the interrupt mapping table in the preset memory. The interrupt flag is composed of 1 bit, and has two states of 1 and 0. 1 can be used to indicate that the corresponding preset interrupt signal is a direct-through interrupt signal, and 0 can be used to indicate that the corresponding preset interrupt signal is not a direct-through interrupt signal. The virtual device identifier is composed of 7 bits, and 7 bits can represent the virtual device identifiers corresponding to 128 virtual devices. At least one preset interrupt number in the interrupt mapping table increases in sequence, and the interrupt flag corresponding to each preset interrupt number and the virtual device identifier corresponding to each preset interrupt number are composed of 8 bits. Specifically, as Figure 3 As shown, the interrupt flag bit corresponding to the preset interrupt number 0 is 1, indicating that the interrupt signal corresponding to the preset interrupt number 0 is a pass-through signal, and the virtual device identifier corresponding to the preset interrupt number 0 is 0000010, indicating that the interrupt signal corresponding to the preset interrupt number 0 is sent to the virtual device with the virtual device identifier 0000010 for interrupt processing. When the interrupt flag bit corresponding to the preset interrupt number is 0, it indicates that the interrupt signal corresponding to the preset interrupt number is not a pass-through signal. At this time, the virtual device identifier corresponding to the preset interrupt number is 0000000, indicating that the interrupt signal corresponding to the preset interrupt number is sent to the virtualization software for interrupt processing.

[0088] In an optional embodiment, the above method may further include: a step of generating an interrupt mapping table, such as Figure 4 As shown, the following steps may be included:

[0089] In step S401, at least one preset device is connected to receive an interrupt signal sent by the current device.

[0090] In a specific embodiment, the preset device may correspond to different devices in combination with actual application requirements, for example, the preset device may be a sensor, a touch screen, a mouse, a keyboard, a network interface controller, etc. Correspondingly, the current device may be any one of the at least one preset device connected.

[0091] In step S403, when the interrupt signal sent by the current device is an interrupt signal that needs to be processed by the corresponding virtualizer, a current interrupt flag corresponding to the interrupt signal sent by the current device is generated, and the current interrupt flag indicates that the interrupt signal sent by the current device is a direct interrupt signal.

[0092] In a specific embodiment, the current interrupt flag may be an interrupt flag corresponding to an interrupt signal sent by the current device. Specifically, when the interrupt signal sent by the current device is an interrupt signal that needs to be processed by a corresponding virtualizer, the generated current interrupt flag is 1, indicating that the interrupt signal sent by the current device is a pass-through interrupt signal.

[0093] In step S405, the current interrupt number corresponding to the interrupt signal sent by the current device is obtained, and the current interrupt flag is used as the interrupt flag corresponding to the current interrupt number.

[0094] In a specific embodiment, the current interrupt number can be used to identify the current device. Specifically, when the current interrupt flag is 1 and the current interrupt number is 10, 1 is filled in the interrupt flag corresponding to the preset interrupt number 10 in the interrupt mapping table.

[0095] In step S407, the current virtual device identifier of the virtual device corresponding to the interrupt signal sent by the current device is obtained, and the current virtual device identifier is used as the virtual device identifier corresponding to the current interrupt number.

[0096] In a specific embodiment, the current virtual machine identifier can be used to identify the processor of the virtual machine corresponding to the interrupt signal sent by the current device, and the virtual machine corresponding to the interrupt signal sent by the current device can be used to perform interrupt processing on the interrupt signal sent by the current device.

[0097] In step S409, based on the current interrupt number, the interrupt flag bit corresponding to the current interrupt number and the virtual device identifier corresponding to the current interrupt number are stored in the interrupt mapping table.

[0098] In a specific embodiment, for example, when the interrupt flag bit corresponding to the current interrupt number is 1, the virtual device identifier corresponding to the current interrupt number is 0000100, and the current interrupt number is 2, based on the current interrupt number, the interrupt flag bit corresponding to the current interrupt number and the virtual device identifier corresponding to the current interrupt number are stored in the interrupt mapping table, such as Figure 3As shown, in the interrupt mapping table, in the entry corresponding to interrupt number 2, the interrupt flag bit is 1 and the virtual device identifier is 0000100.

[0099] In the above embodiment, by judging the interrupt signal sent by the currently connected device, when the interrupt signal sent is an interrupt signal that needs to be processed by the corresponding virtual device, an interrupt mapping table is pre-generated based on the generated interrupt flag and the corresponding virtual device identifier, so that when the interrupt signal is received subsequently, the system can quickly determine the virtual device identifier corresponding to the direct interrupt signal by querying the pre-generated interrupt mapping table, thereby sending the direct interrupt signal to the corresponding virtual device for interrupt processing, which greatly reduces the delay of interrupt processing and improves the efficiency of interrupt processing.

[0100] In step S205, based on the interrupt mapping table, a target interrupt flag bit corresponding to the target interrupt number is determined.

[0101] In a specific embodiment, the target interrupt flag bit can be used to indicate whether the corresponding target interrupt signal is a direct interrupt signal. Specifically, Figure 3 As shown, when the target interrupt number is 3, based on the interrupt mapping table, it can be determined that the target interrupt flag bit corresponding to the target interrupt number is 1.

[0102] In step S207, when the target interrupt flag indicates that the target interrupt signal is a pass-through interrupt signal, the target virtual device identifier corresponding to the target interrupt number is obtained from the interrupt mapping table.

[0103] In a specific embodiment, the target virtual machine identifier can be used to identify the processor of the virtual machine corresponding to the target interrupt signal. Specifically, assuming that the target interrupt number is 3, the corresponding target interrupt flag bit is 1, indicating that the target interrupt signal is a pass-through interrupt signal, such as Figure 3 As shown, based on the interrupt mapping table, the target virtual machine identifier corresponding to the target interrupt number can be obtained as 0000101.

[0104] In step S209, a target interrupt signal is sent to a target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine performs interrupt processing.

[0105] In a specific embodiment, the target virtual machine may be a processor of a virtual machine corresponding to the target interrupt signal. Specifically, when the target virtual machine identifier is 0000010, the target interrupt signal is sent to the target virtual machine with the virtual machine identifier 0000010 so that the target virtual machine performs interrupt processing.

[0106] In an optional embodiment, sending the target interrupt signal to the target virtual machine corresponding to the target virtual machine identifier so that the target virtual machine performs interrupt processing includes:

[0107] The target interrupt signal is sent to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine executes the interrupt service program corresponding to the target interrupt signal.

[0108] In a specific embodiment, the interrupt service routine may be a processing program executed after receiving an interrupt signal, such as an ISR (interrupt service routine). Specifically, when the target virtual machine corresponding to the target virtual machine identifier receives a target interrupt signal, the target virtual machine jumps to the interrupt service routine corresponding to the target interrupt signal and executes it.

[0109] In the above embodiment, by sending the target interrupt signal to the target virtualizer, it is ensured that each virtualizer only processes the interrupt signal related to it, thereby achieving effective isolation of resources and improving resource utilization. The target virtualizer executes the interrupt service program corresponding to the target interrupt signal, and each virtualizer performs interrupt processing independently, thereby improving the availability of the system.

[0110] In an optional embodiment, the above method may further include:

[0111] When the target interrupt flag indicates that the target interrupt signal is not a pass-through interrupt signal, the target interrupt signal is sent to the virtualization software, so that the virtualization software adds the target interrupt signal to the virtual interrupt list based on a preset interrupt priority;

[0112] The current interrupt signal is obtained from the virtual interrupt list, and the current interrupt signal is sent to the virtualization software so that the virtualization software performs interrupt processing.

[0113] In a specific embodiment, the virtualization software may be software that supports the creation and operation of multiple independent virtualization environments, such as VMware. The preset interrupt priority may be used to indicate the execution order corresponding to at least one preset interrupt signal. The virtual interrupt list may be a data structure used to manage and record interrupt information of interrupt signals in the virtualization environment. Specifically, when the target interrupt flag is 0, it indicates that the target interrupt signal is not a pass-through interrupt signal. The target interrupt signal is sent to the virtualization software so that the virtualization software compares the interrupt priority of the target interrupt signal with the interrupt priority of the interrupt signal in the virtual interrupt list based on the preset interrupt priority. For example, assuming that the interrupt priorities of the interrupt signals in the virtual interrupt list are interrupt signal A, interrupt signal B, interrupt signal C, etc. from high to low, based on the preset interrupt priority, the interrupt priority of the target interrupt signal D is lower than interrupt signal A and higher than interrupt signal B, then the target interrupt signal D is added between the interrupt signals of interrupt signal A and interrupt signal B, and the interrupt priorities of the interrupt signals in the virtual interrupt list after the addition are interrupt signal A, interrupt signal D, interrupt signal B, interrupt signal C, etc. from high to low.

[0114] In a specific embodiment, the current interrupt signal may be the interrupt signal with the highest execution priority in the virtual interrupt list. For example, assuming that the interrupt priorities of the interrupt signals in the virtual interrupt list are interrupt signal A, interrupt signal B, interrupt signal C, etc. from high to low, then the current interrupt signal may be interrupt signal A, and interrupt signal A is sent to the virtualization software for interrupt processing.

[0115] In the above embodiment, by presetting the interrupt priority, the virtualization software can ensure that high-priority interrupt signals are processed first, thereby improving the resource utilization of the system. For newly received target interrupt signals, based on the preset interrupt priority, they are added to the virtual interrupt list, which can avoid the confusion caused by disorderly processing of interrupt signals and improve the security and stability of the system.

[0116] In an optional embodiment, the above method may further include:

[0117] An interrupt completion signal is sent to the virtualization software, so that the virtualization software updates the interrupt status of the current interrupt signal and removes the current interrupt signal from the virtual interrupt list.

[0118] In a specific embodiment, the interrupt completion signal can be used to notify the virtualization software that the interrupt signal has been processed, and the interrupt status can be used to record the current status of the interrupt signal, including unprocessed, being processed, processed, etc. Specifically, assuming that the interrupt priorities of the interrupt signals in the virtual interrupt list are interrupt signal A, interrupt signal B, interrupt signal C, etc. from high to low, when the current interrupt signal A has been processed, an interrupt completion signal is sent to the virtualization software so that the virtualization software updates the interrupt status of the current interrupt signal to processed, and removes the current interrupt signal from the virtual interrupt list. At this time, the interrupt priorities of the interrupt signals in the virtual interrupt list are interrupt signal B, interrupt signal C, etc. from high to low.

[0119] In the above embodiment, when the interrupt signal processing is completed, by sending an interrupt completion signal to the virtualization software, the virtualization software can quickly update the interrupt status and remove the current interrupt signal from the virtual interrupt list, thereby avoiding waste caused by long-term occupation of resources, and releasing resources in time, thereby improving the resource utilization and operating efficiency of the system. Once the interrupt signal is removed from the virtual interrupt list by the virtualization software, the virtualization software will no longer repeatedly process the interrupt signal that has been processed, thereby avoiding confusion in interrupt processing and improving the security and reliability of the system.

[0120] It can be seen from the technical solutions provided by the above embodiments of this specification that this specification receives a target interrupt signal sent by a target device and obtains a corresponding target interrupt number, obtains an interrupt mapping table including an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number and a virtual machine identifier corresponding to each preset interrupt number, the interrupt flag is used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal, and the target interrupt flag corresponding to the target interrupt number can be determined based on the interrupt mapping table, thereby simplifying the interrupt management logic and improving the working efficiency of the virtual machine. When the target interrupt flag indicates that the target interrupt signal is a pass-through interrupt signal, the target virtual machine identifier corresponding to the target interrupt number is obtained from the interrupt mapping table, and the target interrupt signal is sent to the target virtual machine corresponding to the target virtual machine identifier for interrupt processing, thereby improving the efficiency of the pass-through interrupt signal in executing interrupt sending, reducing interrupt latency, and greatly improving the working efficiency and virtualization performance of the virtual machine.

[0121] Figure 5 is a block diagram of an interrupt processing device according to an exemplary embodiment. Figure 5 , the device comprises:

[0122] A first acquisition module 510 is used to receive a target interrupt signal sent by a target device and acquire a target interrupt number corresponding to the target interrupt signal;

[0123] The second acquisition module 530 is used to acquire an interrupt mapping table; the interrupt mapping table includes an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number and a virtual device identifier corresponding to each preset interrupt number; the interrupt flag is used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal, and at least one preset interrupt number includes a target interrupt number;

[0124] A target interrupt flag bit determination module 550 is used to determine a target interrupt flag bit corresponding to a target interrupt number based on an interrupt mapping table;

[0125] The third acquisition module 570 is used to acquire the target virtual device identifier corresponding to the target interrupt number from the interrupt mapping table when the target interrupt flag indicates that the target interrupt signal is a pass-through interrupt signal;

[0126] The interrupt processing module 590 is used to send a target interrupt signal to a target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine performs interrupt processing.

[0127] In an optional embodiment, the above device further includes:

[0128] An interrupt signal receiving module, used to access at least one preset device and receive an interrupt signal sent by a current device; the current device is any one of the at least one preset device that is accessed;

[0129] An interrupt flag generating module, used for generating a current interrupt flag corresponding to the interrupt signal sent by the current device when the interrupt signal sent by the current device is an interrupt signal that needs to be processed by the corresponding virtual device, and the current interrupt flag indicates that the interrupt signal sent by the current device is a direct interrupt signal;

[0130] A fourth acquisition module is used to acquire a current interrupt number corresponding to an interrupt signal sent by a current device, and use the current interrupt flag as an interrupt flag corresponding to the current interrupt number; the current interrupt number is any one of at least one preset interrupt number;

[0131] A fifth acquisition module, used to acquire a current virtual device identifier of a virtual device corresponding to an interrupt signal sent by a current device, and use the current virtual device identifier as a virtual device identifier corresponding to a current interrupt number;

[0132] The first storage module is used to store the interrupt flag bit corresponding to the current interrupt number and the virtual machine identifier corresponding to the current interrupt number in the interrupt mapping table based on the current interrupt number.

[0133] In an optional embodiment, the above device further includes:

[0134] The second storage module is used to store the interrupt mapping table in a preset memory, record the base address of the interrupt mapping table in the preset memory, and store the base address in the interrupt mapping register.

[0135] In an optional embodiment, the above device further includes:

[0136] A base address acquisition module is used to obtain the base address of the interrupt mapping table in the preset memory from the interrupt mapping table register;

[0137] The interrupt mapping table acquisition module is used to acquire the interrupt mapping table from the preset memory based on the base address.

[0138] In an optional embodiment, the interrupt processing module 590 includes:

[0139] The interrupt service program execution unit is used to send a target interrupt signal to a target virtual machine corresponding to a target virtual machine identifier, so that the target virtual machine executes an interrupt service program corresponding to the target interrupt signal.

[0140] In an optional embodiment, the above device further includes:

[0141] An adding module is used to send the target interrupt signal to the virtualization software when the target interrupt flag indicates that the target interrupt signal is not a pass-through interrupt signal, so that the virtualization software adds the target interrupt signal to the virtual interrupt list based on the preset interrupt priority; the virtual interrupt list includes at least one current interrupt signal; the preset interrupt priority is used to indicate the execution order corresponding to the at least one preset interrupt signal;

[0142] The first target interrupt signal sending module is used to obtain the current interrupt signal from the virtual interrupt list and send the current interrupt signal to the virtualization software so that the virtualization software performs interrupt processing. The current interrupt signal is the interrupt signal with the highest execution priority in the virtual interrupt list.

[0143] In an optional embodiment, the above device further includes:

[0144] The second target interrupt signal sending module is used to send an interrupt completion signal to the virtualization software, so that the virtualization software updates the interrupt status of the current interrupt signal and removes the current interrupt signal from the virtual interrupt list.

[0145] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0146] Figure 6 is a block diagram of an electronic device for interrupt processing according to an exemplary embodiment. The electronic device may be a preset device, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an interrupt processing method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0147] Those skilled in the art will understand that Figure 6The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0148] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is used to execute the instructions to implement the interrupt processing method in the embodiment of the present disclosure.

[0149] In an exemplary embodiment, a computer-readable storage medium is also provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the interrupt processing method in the embodiment of the present disclosure.

[0150] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0151] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An interrupt processing method, characterized in that: The method comprises: Receive a target interrupt signal sent by a target device, and obtain a target interrupt number corresponding to the target interrupt signal; Obtain an interrupt mapping table; the interrupt mapping table includes an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number and a virtual device identifier corresponding to each preset interrupt number; the interrupt flag is used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal, and the at least one preset interrupt number includes the target interrupt number; Based on the interrupt mapping table, determining a target interrupt flag corresponding to the target interrupt number; When the target interrupt flag indicates that the target interrupt signal is a pass-through interrupt signal, obtaining a target virtual device identifier corresponding to the target interrupt number from the interrupt mapping table; The target interrupt signal is sent to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine performs interrupt processing.

2. The interrupt processing method according to claim 1, characterized in that: The method further comprises: Accessing at least one preset device and receiving an interrupt signal sent by a current device; the current device is any one of the at least one preset device accessed; When the interrupt signal sent by the current device is an interrupt signal that needs to be processed by the corresponding virtualizer, a current interrupt flag bit corresponding to the interrupt signal sent by the current device is generated, and the current interrupt flag bit indicates that the interrupt signal sent by the current device is a pass-through interrupt signal; Obtaining a current interrupt number corresponding to an interrupt signal sent by the current device, and using the current interrupt flag as an interrupt flag corresponding to the current interrupt number; the current interrupt number is any one of the at least one preset interrupt number; Obtaining a current virtual machine identifier of a virtual machine corresponding to the interrupt signal sent by the current device, and using the current virtual machine identifier as the virtual machine identifier corresponding to the current interrupt number; Based on the current interrupt number, an interrupt flag corresponding to the current interrupt number and a virtual device identifier corresponding to the current interrupt number are stored in the interrupt mapping table.

3. The interrupt processing method according to claim 1, characterized in that: The method further comprises: The interrupt mapping table is stored in a preset memory, a base address of the interrupt mapping table in the preset memory is recorded, and the base address is stored in an interrupt mapping register.

4. The interrupt processing method according to claim 3, characterized in that: The method further comprises: Obtaining a base address of the interrupt mapping table in the preset memory from the interrupt mapping table register; Based on the base address, an interrupt mapping table is obtained from the preset memory.

5. The interrupt processing method according to claim 1, characterized in that: The sending the target interrupt signal to the target virtual machine corresponding to the target virtual machine identifier so that the target virtual machine performs interrupt processing includes: The target interrupt signal is sent to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine executes an interrupt service program corresponding to the target interrupt signal.

6. The interrupt processing method according to claim 1, characterized in that: The method further comprises: In the case where the target interrupt flag indicates that the target interrupt signal is not a pass-through interrupt signal, the target interrupt signal is sent to the virtualization software, so that the virtualization software, based on a preset interrupt priority, adds the target interrupt signal to a virtual interrupt list; the virtual interrupt list includes at least one current interrupt signal; the preset interrupt priority is used to indicate the execution order corresponding to the at least one preset interrupt signal; A current interrupt signal is obtained from the virtual interrupt list, and the current interrupt signal is sent to the virtualization software so that the virtualization software performs interrupt processing, wherein the current interrupt signal is an interrupt signal with the highest execution priority in the virtual interrupt list.

7. The interrupt processing method according to claim 6, characterized in that: The method further comprises: An interrupt completion signal is sent to the virtualization software, so that the virtualization software updates the interrupt status of the current interrupt signal and removes the current interrupt signal from the virtual interrupt list.

8. An interrupt processing device, characterized in that: The device comprises: A first acquisition module, configured to receive a target interrupt signal sent by a target device, and acquire a target interrupt number corresponding to the target interrupt signal; A second acquisition module is used to acquire an interrupt mapping table; the interrupt mapping table includes an interrupt flag corresponding to each preset interrupt number in at least one preset interrupt number and a virtual device identifier corresponding to each preset interrupt number; the interrupt flag is used to indicate whether the corresponding preset interrupt signal is a pass-through interrupt signal, and the at least one preset interrupt number includes the target interrupt number; A target interrupt flag bit determination module, used for determining a target interrupt flag bit corresponding to the target interrupt number based on the interrupt mapping table; A third acquisition module is used to acquire a target virtual device identifier corresponding to the target interrupt number from the interrupt mapping table when the target interrupt flag indicates that the target interrupt signal is a pass-through interrupt signal; The interrupt processing module is used to send the target interrupt signal to the target virtual machine corresponding to the target virtual machine identifier, so that the target virtual machine performs interrupt processing.

9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is used to execute the instruction to implement the interrupt processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the interrupt processing method as claimed in any one of claims 1 to 7.