CN114153560B - Virtual interrupt processing method, device, equipment and medium - Google Patents

Virtual interrupt processing method, device, equipment and medium Download PDF

Info

Publication number
CN114153560B
CN114153560B CN202111371770.3A CN202111371770A CN114153560B CN 114153560 B CN114153560 B CN 114153560B CN 202111371770 A CN202111371770 A CN 202111371770A CN 114153560 B CN114153560 B CN 114153560B
Authority
CN
China
Prior art keywords
virtual interrupt
interrupt request
target
processed
replaced
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111371770.3A
Other languages
Chinese (zh)
Other versions
CN114153560A (en
Inventor
秦民
王天亮
尚祚彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Automotive Innovation Corp
Original Assignee
China Automotive Innovation Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Automotive Innovation Corp filed Critical China Automotive Innovation Corp
Priority to CN202111371770.3A priority Critical patent/CN114153560B/en
Publication of CN114153560A publication Critical patent/CN114153560A/en
Application granted granted Critical
Publication of CN114153560B publication Critical patent/CN114153560B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)

Abstract

The application relates to a virtual interrupt processing method, a device, equipment and a medium, which are used for determining a first virtual interrupt request to be replaced with the lowest priority in a plurality of virtual interrupt requests to be processed when a waiting state list does not contain the virtual interrupt requests to be processed in an inactive state, and replacing the first virtual interrupt request to be replaced by using a target virtual interrupt request when the priority of the target virtual interrupt request is higher than that of the first virtual interrupt request to be replaced, so that the target virtual interrupt request with higher priority is prevented from waiting for a long time outside the waiting state list, the delay of high-priority virtual interrupt can be shortened, the response efficiency of the high-priority virtual interrupt can be improved, and the real-time performance and the reliability of the whole system can be improved.

Description

Virtual interrupt processing method, device, equipment and medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, a device, and a medium for processing virtual interrupt.
Background
Virtual interrupt is an interrupt mechanism, and uses time-division data bus to implement interrupt, i.e. uses data bus to process interrupt signal by means of message transmission mode on the basis of time sharing. For product functions implemented using virtual interrupt technology, virtual interrupt mechanisms need to be utilized to support the handling of virtual interrupt requests. In the related art, a waiting state list may be set, when a new virtual interrupt request is received, the new virtual interrupt request is stored in a storable position of the waiting state list, if the waiting state list is full, the new virtual interrupt request is queued, after one virtual interrupt request in the waiting state list is processed, the queued virtual interrupt request is stored in the waiting state list, which results in processing delay of virtual interrupt requests outside the waiting state list, so that real-time performance and reliability of the whole system are affected.
Disclosure of Invention
In order to solve the technical problems, the invention provides a virtual interrupt processing method, a device, equipment and a medium, which can reduce the processing delay of partial virtual interrupt requests and greatly improve the real-time performance and reliability of the whole system.
In order to achieve the above object, the present application provides a virtual interrupt processing method, which includes:
Responding to a target virtual interrupt request, and acquiring a waiting state list and states of a plurality of to-be-processed virtual interrupt requests in the waiting state list;
When the waiting state list does not contain the to-be-processed virtual interrupt request in the inactive state, determining a first to-be-replaced virtual interrupt request with the lowest priority in the plurality of to-be-processed virtual interrupt requests;
And replacing the first virtual interrupt request to be replaced by the target virtual interrupt request when the priority of the target virtual interrupt request is higher than that of the first virtual interrupt request to be replaced.
In one possible implementation manner, when the priority of the target virtual interrupt request is higher than the priority of the first to-be-replaced virtual interrupt request, before replacing the first to-be-replaced virtual interrupt request with the target virtual interrupt request, the method further includes:
Acquiring a target identity and a target service scene of the target virtual interrupt request, and a first interrupt mapping table, wherein the first interrupt mapping table represents the corresponding relation between the identity of the virtual interrupt request and the priority under different service scenes;
and determining the priority corresponding to the target virtual interrupt request from the first interrupt mapping table according to the target identity and the target service scene.
In one possible implementation manner, when the priority of the target virtual interrupt request is higher than the priority of the first to-be-replaced virtual interrupt request, before replacing the first to-be-replaced virtual interrupt request with the target virtual interrupt request, the method further includes:
acquiring a target identity of the target virtual interrupt request and a second interrupt mapping table, wherein the second interrupt mapping table characterizes the corresponding relation between the identity of the virtual interrupt request and the priority;
And determining the priority of the corresponding target virtual interrupt request from the second interrupt mapping table according to the target identity.
In one possible implementation, the method further includes:
Processing the virtual interrupt request to be processed in the waiting state list;
And changing the state of the processed virtual interrupt request to be processed in the waiting state list into an inactive state.
In one possible implementation, the method further includes:
When the waiting state list contains a to-be-processed virtual interrupt request in an unactivated state, determining a second to-be-replaced virtual interrupt request based on the to-be-processed virtual interrupt request in the unactivated state;
and replacing the second virtual interrupt request to be replaced by the target virtual interrupt request.
In one possible implementation manner, the determining the first to-be-replaced virtual interrupt request with the lowest priority in the plurality of to-be-processed virtual interrupt requests includes:
Determining the virtual interrupt request to be processed with the lowest priority according to the priority of the virtual interrupt request to be processed in the waiting state list;
and when the number of the to-be-processed virtual interrupt requests with the lowest priority is at least two, selecting one to-be-processed virtual interrupt request from at least two to-be-processed virtual interrupt requests with the lowest priority as the first to-be-replaced virtual interrupt request.
In one possible implementation, the replacing the first virtual interrupt request to be replaced with the target virtual interrupt request includes:
Determining a target position of the first to-be-replaced virtual interrupt request in the waiting state list;
deleting the first virtual interrupt request to be replaced in the waiting state list;
Writing the target virtual interrupt request to the target location in the wait state list.
In one possible implementation manner, before the replacing the first virtual interrupt request to be replaced with the target virtual interrupt request, the method further includes:
And storing the first virtual interrupt request to be replaced into a memory.
In one possible implementation, the method further includes:
And when the priority of the target virtual interrupt request is lower than that of the first virtual interrupt request to be replaced, storing the target virtual interrupt request into a memory.
In another aspect, the present application also provides a virtual interrupt processing apparatus, including:
the waiting state list acquisition module is used for responding to the target virtual interrupt request and acquiring a waiting state list and states of a plurality of to-be-processed virtual interrupt requests in the waiting state list;
The to-be-replaced virtual interrupt request determining module is used for determining to-be-replaced virtual interrupt requests with lowest priority in the plurality of to-be-processed virtual interrupt requests when the to-be-processed virtual interrupt requests in an inactive state are not contained in the waiting state list;
and the replacing module is used for replacing the virtual interrupt request to be replaced by the target virtual interrupt request when the priority of the target virtual interrupt request is higher than that of the virtual interrupt request to be replaced.
In another aspect, the present application also provides an electronic device, including:
A processor;
a memory for storing the processor-executable instructions;
Wherein the processor is configured to execute the instructions to implement the virtual interrupt handling method described above.
Another aspect of the present application also provides a computer-readable storage medium, which when executed by a processor of an electronic device, enables the electronic device to perform the above-described virtual interrupt handling method.
The implementation of the application has the following beneficial effects:
When the waiting state list does not contain the to-be-processed virtual interrupt request in the unactivated state, the first to-be-replaced virtual interrupt request with the lowest priority in the plurality of to-be-processed virtual interrupt requests is determined, and when the priority of the target virtual interrupt request is higher than that of the first to-be-replaced virtual interrupt request, the target virtual interrupt request is utilized to replace the first to-be-replaced virtual interrupt request, so that the target virtual interrupt request with higher priority is prevented from waiting for a long time outside the waiting state list, the delay of the high-priority virtual interrupt can be shortened, the response efficiency of the high-priority virtual interrupt can be improved, and the instantaneity of the whole system can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a virtual interrupt processing application scenario provided in an embodiment of the present application;
FIG. 2 is a flowchart of a virtual interrupt handling method according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for determining a priority corresponding to a target virtual interrupt request according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for determining a priority corresponding to a target virtual interrupt request according to another embodiment of the present application;
FIG. 5 is a flowchart of a virtual interrupt handling method according to another embodiment of the present application;
FIG. 6 is a flowchart of a method for handling virtual interrupt according to another embodiment of the present application;
FIG. 7 is a flowchart of a method for determining a first virtual interrupt request to be replaced according to an embodiment of the present application;
FIG. 8 is a flowchart of a method for replacing a first virtual interrupt request to be replaced according to an embodiment of the present application;
FIG. 9 is a flowchart of a method for handling virtual interrupt according to another embodiment of the present application;
FIG. 10 is a flowchart of a method for handling virtual interrupt according to another embodiment of the present application;
FIG. 11 is a schematic diagram of a virtual interrupt handling device according to an embodiment of the present application;
Fig. 12 is a block diagram of an electronic device for virtual interrupt handling according to an embodiment of the present application.
Detailed Description
In order to make the technical solution of the present application better understood by those skilled in the art, the technical solution of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, shall fall within the scope of the application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to implement the technical scheme of the application, more engineering technicians can easily understand and apply the application, and the working principle of the application is further explained by combining specific embodiments.
The application can be applied to the field of data processing. Referring to fig. 1, fig. 1 is an application scenario diagram of a virtual interrupt handling method according to an embodiment of the present application, where, as shown in fig. 1, the application scenario may at least include GIC (Generic Interrupt Controller, universal interrupt controller) 1, virtual machine monitor 2, vPE (virtual Processing Element, virtual arithmetic unit) 3, IAR (InstructionAccess Register ) 4, LR (LIST REGISTER, list register) 5, and virtual machine system 6.GIC1 may include a physical CPU interface 11, a virtual control module 12, and a virtual CPU interface 13. The physical CPU interface 11 receives an external physical interrupt request, and sends the physical interrupt request to the virtual machine monitor 2. The virtual machine monitor 2 obtains the identity and the priority of the physical interrupt request from the IAR4 and forwards the physical interrupt request to the vPE3 currently running. The virtual CPU interface 13 of GIC1 is connected to LR 5. The virtual machine monitor 2 can write the virtual interrupt request associated with the physical interrupt request into the corresponding memory space of LR5 using the virtual interrupt handling method in the present application. Specifically, after the virtual machine monitor 2 writes the virtual interrupt request associated with the physical interrupt request into the corresponding storage space of the LR5, the vPE3 determines, through the virtual CPU interface 13, the virtual interrupt request that needs to be processed currently from the LR5, and the virtual control module 12 sends the virtual interrupt request to the virtual machine system 6 through the virtual CPU interface 13. And the virtual interrupt request in LR5 is processed by virtual machine system 6.
In addition, it should be noted that, fig. 1 is only one application scenario provided by the present disclosure, and in practical application, other application scenarios may also be included, for example, more virtual machine systems may be included.
It should be noted that, a possible sequence of steps is shown in the following figures, and is not limited to the strict order of the sequence. Some steps may be performed in parallel without mutual dependency. User information (including but not limited to user device information, user personal information, user behavior information, etc.) and data (including but not limited to data for presentation, training, etc.) referred to by this disclosure are both information and data that is authorized by the user or sufficiently authorized by the parties.
FIG. 2 is a flowchart illustrating a virtual interrupt handling method, as shown in FIG. 2, that may be applied to a virtual machine monitor, according to an exemplary embodiment, including the steps of:
in step S201, in response to the target virtual interrupt request, a waiting state list and states of a plurality of pending virtual interrupt requests in the waiting state list are acquired.
In this embodiment of the present disclosure, the target virtual interrupt request may refer to a virtual interrupt request corresponding to a physical interrupt request received by a physical CPU interface. The wait state list includes a plurality of pending virtual interrupt requests, and the wait state list is stored in the LR. The state of the to-be-processed virtual interrupt request comprises an activated state and an inactivated state, the state of the to-be-processed virtual interrupt request which is not processed by the virtual machine system is the activated state, and the state of the processed to-be-processed virtual interrupt request is the inactivated state.
In step S202, when the waiting state list does not include the pending virtual interrupt request in the inactive state, a first pending virtual interrupt request with the lowest priority among the plurality of pending virtual interrupt requests is determined.
In the embodiment of the present disclosure, the multiple pending virtual interrupt requests may be prioritized according to the importance level, where the more important the priority of the pending virtual interrupt requests is higher. For example, when driving automatically, the priority of the pending virtual interrupt request for autopilot control is higher than the priority of the pending virtual interrupt request for entertainment control. When the waiting state list does not contain the waiting virtual interrupt request in the inactive state, the waiting state list indicates that the total amount of the waiting virtual interrupt requests in the waiting state list are all the waiting virtual interrupts which are not processed by the virtual machine system. And acquiring the priority of each to-be-processed virtual interrupt request in the waiting state list, and determining a first to-be-replaced virtual interrupt request with the lowest priority based on the priority of each to-be-processed virtual interrupt request.
In step S203, when the priority of the target virtual interrupt request is higher than the priority of the first virtual interrupt request to be replaced, the first virtual interrupt request to be replaced is replaced with the target virtual interrupt request.
In the embodiment of the present disclosure, the priority of the target virtual interrupt request may be acquired first, and the priority of the target virtual interrupt request may be compared with the priority of the first virtual interrupt request to be replaced. And if the comparison result shows that the priority of the target virtual interrupt request is higher than that of the first virtual interrupt request to be replaced, replacing the first virtual interrupt request to be replaced by the target virtual interrupt request.
The state of the waiting state list and the states of a plurality of to-be-processed virtual interrupt requests in the waiting state list are obtained through responding to the target virtual interrupt request, when the waiting state list does not contain to-be-processed virtual interrupt in an unactivated state, a first to-be-replaced virtual interrupt request with the lowest priority in the plurality of to-be-processed virtual interrupt requests is determined, when the priority of the target virtual interrupt request is higher than that of the first to-be-replaced virtual interrupt request, the first to-be-replaced virtual interrupt request is replaced by the target virtual interrupt request, and replacement of the virtual interrupt request with the lowest priority in the waiting state list by the virtual interrupt request with the highest priority outside the waiting state list is achieved, so that delay of the virtual interrupt request with the highest priority outside the waiting state list can be shortened, and response rate of the high-priority virtual interrupt request is improved, and real-time performance of the whole system is improved.
In an exemplary embodiment, considering the effect of different traffic scenarios on the same virtual interrupt request, as shown in fig. 3, when the priority of the target virtual interrupt request is higher than the priority of the first virtual interrupt request to be replaced, before replacing the first virtual interrupt request to be replaced with the target virtual interrupt request, the method may further include:
In step S301, a target identity and a target service scenario of a target virtual interrupt request and a first interrupt map are acquired.
In this embodiment of the present disclosure, the first interrupt mapping table characterizes a correspondence between the identity of the virtual interrupt request and the priority in different service scenarios. For example, the identity of the virtual interrupt request related to player control in the vehicle is 111, the identity of the virtual interrupt request related to sunroof control is 222, the service scenario 1 is a reverse scenario, the service scenario 2 is a scenario of a vehicle braking state, and the structure of the first interrupt map table may be as shown in table 1:
TABLE 1
The priority in table 1 becomes higher in order from 3 to 1. In the service scene 1, responding to a virtual interrupt request with the identity of 111, and the player can carry out reversing anti-collision alarm; in the service scenario 2, in response to a virtual interrupt request with the identity of 111, the player can play music; in service scenarios 1 and 2, the sunroof may be opened and closed in response to a virtual interrupt request identified as 222. According to different service scenes, the corresponding relation between the identity mark and the priority of the virtual interrupt request is established, the priority of the virtual interrupt request can be reasonably set, and the overall safety of the system is improved.
In step S302, according to the target identity and the target service scenario, a priority corresponding to the target virtual interrupt request is determined from the first interrupt mapping table.
The target identity and the target service scene of the target virtual interrupt request and the first interrupt mapping table are acquired, and the priority corresponding to the target virtual interrupt request is determined from the first interrupt mapping table according to the target identity and the target service scene, so that the accuracy of determining the priority can be improved for the target virtual interrupt request, and the overall safety of the system is improved.
In an exemplary embodiment, for the virtual interrupt request with the priority that is not greatly different in different traffic scenarios, in consideration of processing efficiency, as shown in fig. 4, before replacing the first virtual interrupt request to be replaced with the target virtual interrupt request when the priority of the target virtual interrupt request is higher than the priority of the first virtual interrupt request to be replaced, the method may further include:
in step S401, a target identity of the target virtual interrupt request and a second interrupt map are obtained.
In this embodiment of the present disclosure, the second interrupt map characterizes a correspondence between an identifier of the virtual interrupt request and a priority. The structure of the second interrupt map may be as shown in table 2:
TABLE 2
Virtual interrupt request identity Priority level
111 1
222 2
333 3
444 4
The priorities in table 2 become higher in order from 4 to 1, that is, the priorities of the virtual interrupt request 444, the virtual interrupt request 333, the virtual interrupt request 222, and the virtual interrupt request 111 become higher in order.
In step S402, the priority of the corresponding target virtual interrupt request is determined from the second interrupt map according to the target identity.
In this embodiment of the present disclosure, a correspondence exists between an identity identifier of a virtual interrupt request and a priority in the second interrupt mapping table, and according to a target identity identifier, the priority of the target virtual interrupt request may be determined.
The priority of the target virtual interrupt request can be rapidly determined by acquiring the target identity of the target virtual interrupt request and the second interrupt mapping table and determining the priority of the corresponding target virtual interrupt request from the second interrupt mapping table according to the target identity, so that the processing efficiency of priority determination is improved, and the response speed of the whole system is improved.
In an exemplary embodiment, as shown in fig. 5, the method may further include:
in step S501, a pending virtual interrupt request in the pending status list is processed.
In the embodiment of the present specification, the processing order of the pending virtual interrupt requests in the waiting state list may be determined by the virtual machine system. In practical application, the virtual machine system can process the to-be-processed virtual interrupt request with higher priority.
In step S502, the state of the pending virtual interrupt request processed in the waiting state list is changed to the inactive state.
In the embodiment of the present disclosure, for a processed virtual interrupt request to be processed, the state may be changed to an inactive state.
By processing the to-be-processed virtual interrupt request in the waiting state list, the state of the to-be-processed virtual interrupt request processed in the waiting state list is changed into an inactive state, and whether the to-be-processed virtual interrupt request is processed or not can be reflected in time.
In an exemplary embodiment, as shown in fig. 6, the method may further include:
in step S601, when the waiting state list contains a pending virtual interrupt request in an inactive state, a second pending replacement virtual interrupt request is determined based on the pending virtual interrupt request in the inactive state.
In the embodiment of the present disclosure, the pending virtual interrupt request in the inactive state in the waiting state list may be at least one. And when the inactive state of the virtual interrupt request to be processed is one, taking the inactive state of the virtual interrupt request to be processed as a second virtual interrupt request to be replaced. When the number of the virtual interrupt requests to be processed in the inactive state is at least two, randomly determining one as a second virtual interrupt request to be replaced from the at least two virtual interrupt requests to be processed in the inactive state, or determining the virtual interrupt request with the lowest priority as the second virtual interrupt request to be replaced from the at least two virtual interrupt requests to be processed in the inactive state.
In step S602, the second virtual interrupt request to be replaced is replaced with the target virtual interrupt request.
In this embodiment of the present disclosure, the second virtual interrupt request to be replaced may be deleted from the waiting state list, and then the target virtual interrupt request is written into a corresponding position of the second virtual interrupt request to be replaced in the waiting state list.
When the waiting state list contains the waiting virtual interrupt request in the inactive state, the target virtual interrupt request is used for replacing the waiting virtual interrupt request in the inactive state, so that the response speed of the whole system can be improved.
In an exemplary embodiment, as shown in fig. 7, determining a first pending virtual interrupt request with a lowest priority among the plurality of pending virtual interrupt requests may include:
in step S701, the pending virtual interrupt request with the lowest priority is determined according to the priority of the pending virtual interrupt request in the waiting state list.
In this embodiment of the present disclosure, the priorities of the pending virtual interrupt requests in the pending status list may be ordered, and the lowest priority of the pending virtual interrupt requests in the pending status list may be determined according to the ordering, and the corresponding pending virtual interrupt request of the lowest priority in the pending status list may be determined.
In step S702, when there are at least two pending virtual interrupt requests with the lowest priority, one pending virtual interrupt request is selected from the at least two pending virtual interrupt requests with the lowest priority as the first pending virtual interrupt request.
In this embodiment of the present disclosure, when at least two pending virtual interrupt requests with the lowest priority are provided, one pending virtual interrupt request may be randomly selected from the at least two pending virtual interrupt requests with the lowest priority as a first pending virtual interrupt request, or one pending virtual interrupt request may be selected from the at least two pending virtual interrupt requests with the lowest priority as the first pending virtual interrupt request according to the time when the pending virtual interrupt request joins the waiting state list. Specifically, when selecting according to the time when the to-be-processed virtual interrupt request joins the waiting state list, the joining time may be ordered, and the to-be-processed virtual interrupt request with the lowest priority of the joining time is used as the first to-be-replaced virtual interrupt request.
By determining the virtual interrupt request with the lowest priority according to the priority of the virtual interrupt requests to be processed in the waiting state list, when the virtual interrupt requests with the lowest priority are at least two, selecting one virtual interrupt request to be processed from the at least two virtual interrupt requests with the lowest priority as a first virtual interrupt request to be replaced, and determining the first virtual interrupt request to be replaced when the number of the virtual interrupt requests with the lowest priority is not the same can be realized.
In an exemplary embodiment, as shown in fig. 8, replacing the first virtual interrupt request to be replaced with the target virtual interrupt request may include:
In step S801, a target position of the first virtual interrupt request to be replaced in the wait state list is determined.
In the embodiment of the present disclosure, the target position in the waiting state list refers to a position from the data head to the data tail of the data corresponding to the first to-be-replaced virtual interrupt request. In practical applications, the target position of the first to-be-replaced virtual interrupt request in the waiting state list may be determined by a specific address of the first to-be-replaced virtual interrupt in the register.
In step S802, the first virtual interrupt request to be replaced in the wait state list is deleted.
In the embodiment of the present specification, after determining the target position of the first to-be-replaced virtual interrupt request in the waiting state list, the data of the target position may be deleted, so that the first to-be-replaced virtual interrupt request in the waiting state list is deleted.
In step S803, the target virtual interrupt request is written to the target position in the waiting state list.
In the embodiment of the present disclosure, the starting address of the first virtual interrupt to be replaced in the register may be determined, and the target virtual interrupt request is written from the starting address, so as to implement writing the target virtual interrupt request to the target location in the waiting state list.
By determining the target position of the first virtual interrupt request to be replaced in the waiting state list, deleting the first virtual interrupt request to be replaced in the waiting state list, and writing the target virtual interrupt request to the target position in the waiting state list, insertion of the target virtual interrupt request in the waiting state list can be completed quickly.
In an exemplary embodiment, as shown in fig. 9, before replacing the first to-be-replaced virtual interrupt request with the target virtual interrupt request, the method may further include:
in step S901, a first virtual interrupt request to be replaced is stored in a memory.
After the first virtual interrupt request to be replaced is determined, the first virtual interrupt request to be replaced is stored in the memory, and then the target virtual interrupt request is utilized to replace the first virtual interrupt request to be replaced, so that the execution sequence of the first virtual interrupt request to be replaced can be arranged behind the virtual interrupt request to be processed in the waiting state list, and the effectiveness of the first virtual interrupt request to be replaced is ensured.
In an exemplary embodiment, as shown in fig. 10, the method may further include:
in step S1001, when the priority of the target virtual interrupt request is lower than the priority of the first virtual interrupt request to be replaced, the target virtual interrupt request is stored in the memory.
By storing the target virtual interrupt request with the priority lower than that of the first replacement virtual interrupt request into the memory, the target virtual interrupt request with the lower priority can be queued outside the waiting state list, the response speed of the to-be-processed virtual interrupt request with the high priority is ensured, and the overall real-time performance of the system is improved.
In another aspect, the present application also provides an embodiment of a virtual interrupt handling apparatus, as shown in fig. 11, the apparatus 1100 may include:
a waiting state list obtaining module 1101, configured to obtain a waiting state list and states of a plurality of pending virtual interrupt requests in the waiting state list in response to a target virtual interrupt request;
the to-be-replaced virtual interrupt request determining module 1102 is configured to determine, when the to-be-processed virtual interrupt request in the inactive state is not included in the waiting state list, a first to-be-replaced virtual interrupt request with a lowest priority among the plurality of to-be-processed virtual interrupt requests;
the replacing module 1103 is configured to replace the virtual interrupt request to be replaced with the target virtual interrupt request when the priority of the target virtual interrupt request is higher than the priority of the virtual interrupt request to be replaced.
In an exemplary embodiment, the apparatus may further include:
The first data acquisition module is used for acquiring a target identity of a target virtual interrupt request, a target service scene and a first interrupt mapping table, wherein the first interrupt mapping table characterizes the corresponding relation between the identity of the virtual interrupt request and the priority under different service scenes;
And the first priority determining module is used for determining the priority corresponding to the target virtual interrupt request from the first interrupt mapping table according to the target identity and the target service scene.
In an exemplary embodiment, the apparatus may further include:
The second data acquisition module is used for acquiring a target identity of the target virtual interrupt request and a second interrupt mapping table, and the second interrupt mapping table represents the corresponding relation between the identity of the virtual interrupt request and the priority;
and the second priority determining module is used for determining the priority of the corresponding target virtual interrupt request from the second interrupt mapping table according to the target identity.
In an exemplary embodiment, the apparatus may further include:
And the request processing module is used for processing the waiting virtual middle-short period in the waiting state list.
And the state changing module is used for changing the state of the processed virtual interrupt request to be processed in the waiting state list into an inactive state.
In an exemplary embodiment, the apparatus may further include:
And the second to-be-replaced virtual interrupt request determining module is used for determining the second to-be-replaced virtual interrupt request based on the to-be-processed virtual interrupt request in the unactivated state when the to-be-replaced virtual interrupt request in the unactivated state is contained in the waiting state list.
And the second replacing module is used for replacing the second virtual interrupt request to be replaced by the target virtual interrupt request.
In an exemplary embodiment, the virtual interrupt request to be replaced determination module may include:
The to-be-replaced virtual interrupt request determining unit is used for determining the to-be-processed virtual interrupt request with the lowest priority according to the priority of the to-be-processed virtual interrupt request in the waiting state list;
And the first to-be-replaced virtual interrupt request determining unit is used for selecting one to-be-processed virtual interrupt request from at least two to-be-processed virtual interrupt requests with the lowest priority as the first to-be-replaced virtual interrupt request when the to-be-processed virtual interrupt requests with the lowest priority are at least two.
In an exemplary embodiment, the replacement module may include:
A target position determining unit, configured to determine a target position of the first virtual interrupt request to be replaced in the waiting state list;
a deleting unit configured to delete a first virtual interrupt request to be replaced in the waiting state list;
and the writing unit is used for writing the target virtual interrupt request to a target position in the waiting state list.
In an exemplary embodiment, the apparatus may further include:
The first storage module is used for storing the first virtual interrupt to be replaced in the memory.
In an exemplary embodiment, the apparatus may further include:
And the second storage module is used for storing the target virtual interrupt request into the memory when the priority of the target virtual interrupt request is lower than that of the first virtual interrupt request to be replaced.
Fig. 12 is a block diagram illustrating an electronic device for virtual interrupt handling, which may be a terminal, according to an exemplary embodiment, and an internal structure diagram thereof may be as shown in fig. 12. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile 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 computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of virtual interrupt handling. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of a portion of the structure associated with the disclosed aspects and is not limiting of the electronic device to which the disclosed aspects apply, and that a particular electronic device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
Fig. 12 is a block diagram illustrating an electronic device for virtual interrupt handling, which may be a server, and an internal structure diagram thereof may be as shown in fig. 12, according to an exemplary embodiment. The electronic device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile 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 computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of virtual interrupt handling.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of a portion of the structure associated with the disclosed aspects and is not limiting of the electronic device to which the disclosed aspects apply, and that a particular electronic device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an exemplary embodiment, a computer readable storage medium is also provided, which when executed by a processor of an electronic device, enables the electronic device to perform the virtual interrupt handling method in the embodiments of the present disclosure. The computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, a computer program product containing instructions that, when run on a computer, cause the computer to perform the virtual interrupt handling method in the embodiments of the present disclosure is also provided.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while the embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims of the present invention, any of the claimed embodiments may be used in any combination.
The present invention may also be embodied as a device or system program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments 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 a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order, and the words may be interpreted as names.

Claims (10)

1.A method of virtual interrupt handling, the method comprising:
Responding to a target virtual interrupt request, and acquiring a waiting state list and states of a plurality of to-be-processed virtual interrupt requests in the waiting state list; the state of the to-be-processed virtual interrupt request comprises an activated state and an inactivated state, wherein the activated state is a state of the to-be-processed virtual interrupt request which is not processed by the virtual machine system, and the inactivated state is a state of the to-be-processed virtual interrupt request which is processed by the virtual machine system;
When the waiting state list does not contain the to-be-processed virtual interrupt request in the inactive state, determining a first to-be-replaced virtual interrupt request with the lowest priority in the plurality of to-be-processed virtual interrupt requests;
Acquiring a target identity and a target service scene of the target virtual interrupt request, and a first interrupt mapping table, wherein the first interrupt mapping table represents the corresponding relation between the identity of the virtual interrupt request and the priority under different service scenes;
Determining the priority corresponding to the target virtual interrupt request from the first interrupt mapping table according to the target identity and the target service scenario;
When the priority of the target virtual interrupt request is higher than that of the first virtual interrupt request to be replaced, replacing the first virtual interrupt request to be replaced by the target virtual interrupt request;
When the waiting state list contains a to-be-processed virtual interrupt request in an unactivated state, determining a second to-be-replaced virtual interrupt request based on the to-be-processed virtual interrupt request in the unactivated state;
and replacing the second virtual interrupt request to be replaced by the target virtual interrupt request.
2. The method of claim 1, wherein the method further comprises, prior to replacing the first virtual interrupt request to be replaced with the target virtual interrupt request when the priority of the target virtual interrupt request is higher than the priority of the first virtual interrupt request to be replaced:
acquiring a target identity of the target virtual interrupt request and a second interrupt mapping table, wherein the second interrupt mapping table characterizes the corresponding relation between the identity of the virtual interrupt request and the priority;
And determining the priority of the corresponding target virtual interrupt request from the second interrupt mapping table according to the target identity.
3. The method according to claim 1, wherein the method further comprises:
Processing the virtual interrupt request to be processed in the waiting state list;
And changing the state of the processed virtual interrupt request to be processed in the waiting state list into an inactive state.
4. The method of claim 1, wherein the determining a first pending virtual interrupt request of the plurality of pending virtual interrupt requests having a lowest priority comprises:
Determining the virtual interrupt request to be processed with the lowest priority according to the priority of the virtual interrupt request to be processed in the waiting state list;
and when the number of the to-be-processed virtual interrupt requests with the lowest priority is at least two, selecting one to-be-processed virtual interrupt request from at least two to-be-processed virtual interrupt requests with the lowest priority as the first to-be-replaced virtual interrupt request.
5. The method of claim 1, wherein replacing the first virtual interrupt request to be replaced with the target virtual interrupt request comprises:
determining a target position of the first to-be-replaced virtual interrupt request in the waiting state list; deleting the first virtual interrupt request to be replaced in the waiting state list;
Writing the target virtual interrupt request to the target location in the wait state list.
6. The method of claim 1, wherein prior to replacing the first virtual interrupt request to be replaced with the target virtual interrupt request, the method further comprises:
And storing the first virtual interrupt request to be replaced into a memory.
7. The method according to claim 1, wherein the method further comprises:
And when the priority of the target virtual interrupt request is lower than that of the first virtual interrupt request to be replaced, storing the target virtual interrupt request into a memory.
8. A virtual interrupt handling apparatus, the apparatus comprising:
The waiting state list acquisition module is used for responding to the target virtual interrupt request and acquiring a waiting state list and states of a plurality of to-be-processed virtual interrupt requests in the waiting state list; the state of the to-be-processed virtual interrupt request comprises an activated state and an inactivated state, wherein the activated state is a state of the to-be-processed virtual interrupt request which is not processed by the virtual machine system, and the inactivated state is a state of the to-be-processed virtual interrupt request which is processed by the virtual machine system;
The to-be-replaced virtual interrupt request determining module is used for determining a first to-be-replaced virtual interrupt request with the lowest priority in the plurality of to-be-processed virtual interrupt requests when the to-be-processed virtual interrupt requests in an inactive state are not contained in the waiting state list;
the system comprises a target virtual interrupt request determining module, a first interrupt mapping table and a second interrupt mapping table, wherein the target virtual interrupt request determining module is used for acquiring a target identity of the target virtual interrupt request, a target service scene and the first interrupt mapping table, and the first interrupt mapping table represents the corresponding relation between the identity of the virtual interrupt request and the priority under different service scenes;
The target virtual interrupt priority determining module is used for determining the priority corresponding to the target virtual interrupt request from the first interrupt mapping table according to the target identity and the target service scene;
a replacing module, configured to replace the first to-be-replaced virtual interrupt request with the target virtual interrupt request when the priority of the target virtual interrupt request is higher than the priority of the first to-be-replaced virtual interrupt request;
The second to-be-replaced virtual interrupt request determining module is used for determining a second to-be-replaced virtual interrupt request based on the to-be-processed virtual interrupt request in the unactivated state when the waiting state list contains the to-be-processed virtual interrupt request in the unactivated state;
And the second replacing module is used for replacing the second virtual interrupt request to be replaced by the target virtual interrupt request.
9. An electronic device, comprising:
A processor;
a memory for storing the processor-executable instructions;
Wherein the processor is configured to execute the instructions to implement the virtual interrupt handling method of any of claims 1 to 7.
10. A computer readable storage medium, wherein instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the virtual interrupt handling method of any one of claims 1 to 7.
CN202111371770.3A 2021-11-18 2021-11-18 Virtual interrupt processing method, device, equipment and medium Active CN114153560B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111371770.3A CN114153560B (en) 2021-11-18 2021-11-18 Virtual interrupt processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111371770.3A CN114153560B (en) 2021-11-18 2021-11-18 Virtual interrupt processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114153560A CN114153560A (en) 2022-03-08
CN114153560B true CN114153560B (en) 2024-07-05

Family

ID=80456943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111371770.3A Active CN114153560B (en) 2021-11-18 2021-11-18 Virtual interrupt processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114153560B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115344374A (en) * 2022-10-19 2022-11-15 成都菁蓉联创科技有限公司 Interrupt response method and system thereof

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10062996B4 (en) * 2000-12-16 2005-09-29 Micronas Gmbh Breaker controller with priority setting
CN100365580C (en) * 2005-06-09 2008-01-30 华东师范大学 Real time task dispatching method based on interrupt
GB2462258B (en) * 2008-07-28 2012-02-08 Advanced Risc Mach Ltd Interrupt control for virtual processing apparatus
CN101771983B (en) * 2009-12-14 2014-05-21 中国联合网络通信集团有限公司 Control method and system applied to emergency communication scene
CN105893142A (en) * 2015-12-31 2016-08-24 乐视移动智能信息技术(北京)有限公司 Resource distribution method and device

Also Published As

Publication number Publication date
CN114153560A (en) 2022-03-08

Similar Documents

Publication Publication Date Title
US9547535B1 (en) Method and system for providing shared memory access to graphics processing unit processes
US8395631B1 (en) Method and system for sharing memory between multiple graphics processing units in a computer system
CN113625973B (en) Data writing method, device, electronic equipment and computer readable storage medium
CN114153560B (en) Virtual interrupt processing method, device, equipment and medium
JP2019133662A (en) System and method for machine learning including key value access
CN112925606B (en) Memory management method, device and equipment
US20180157605A1 (en) Configuration of a memory controller for copy-on-write
US10901914B2 (en) Method for writing multiple copies into storage device, and storage device
US8726101B2 (en) Apparatus and method for tracing memory access information
US9934100B2 (en) Method of controlling memory swap operation and data processing system using same
JP2005209206A (en) Data transfer method for multiprocessor system, multiprocessor system, and processor for executing the method
KR101103619B1 (en) Multi-port memory system and access control method thereof
US20200201691A1 (en) Enhanced message control banks
CN107368431B (en) Memory access method, cross switch and computer system
CN116225314A (en) Data writing method, device, computer equipment and storage medium
JP2008523485A5 (en)
CN110096355B (en) Shared resource allocation method, device and equipment
CN110231988B (en) Video memory access method and device and storage medium
US10051087B2 (en) Dynamic cache-efficient event suppression for network function virtualization
US11442668B2 (en) Prioritizing volume accesses in multi-volume storage device based on execution path of a service
CN117555599B (en) Chip design method, system and related equipment for accelerating key data access speed
CN115103020B (en) Data migration processing method and device
CN117806709B (en) Performance optimization method, device, equipment and storage medium of system-level chip
CN117692416B (en) Network message processing method, device, computer equipment and storage medium
TW201317781A (en) Method for sharing memory of virtual machine and computer system using the same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant