Interrupt event transmission method, system and equipment for multiple virtual systems and medium

By introducing a thread pool mechanism into the in-vehicle multi-virtual system, the problem of screen lag caused by frequent user touches is solved, ensuring timely transmission of interrupt signals and timely acquisition of touch data, thereby improving the system's response efficiency and stability.

CN121879897APending Publication Date: 2026-04-17FIBOCOM AUTO SOFTWARE INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FIBOCOM AUTO SOFTWARE INC
Filing Date
2025-11-17
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In in-vehicle multi-virtual systems, when users frequently touch the display screen, the underlying virtual system fails to send interrupt signals and acquire touch data in a timely manner, causing the input subsystem to be unable to acquire touch data immediately, resulting in screen stuttering.

Method used

By introducing a first thread pool in the external interrupt driver and a second thread pool in the communication module, which are used to send interrupt signals and acquire touch data respectively, the interrupt signals are delivered in a timely manner and the touch data is acquired in a timely manner, avoiding stuttering caused by single-threaded processing.

Benefits of technology

It enables timely transmission of interrupt signals and timely acquisition of touch data, avoiding screen lag and improving the system's response efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121879897A_ABST
    Figure CN121879897A_ABST
Patent Text Reader

Abstract

The invention relates to an interrupt event transmission method, system and device of a multi-virtual system and a medium. The method comprises the steps that an interrupt signal sent by a touch chip is received, and the touch chip generates the interrupt signal when sensing that a touch screen is touched; calling a first thread from a first thread pool of an external interrupt driver, and sending an interrupt signal to an upper-layer virtual system, so that a touch screen driver in the upper-layer virtual system triggers an interrupt callback function; when a callback signal of the upper-layer virtual system is received, calling a second thread from a second thread pool of the communication module of the bottom-layer virtual system, and collecting touch data from the touch chip; and sending the touch data to the upper virtual system, so that the upper virtual system controls the touch screen according to the touch data. According to the method and the device, the technical problem of picture lagging caused by frequent touch of a display screen by a user under a vehicle-mounted multi-virtual system is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multi-virtual system interaction, and in particular to a method, system, device and medium for transmitting interruption events in multi-virtual systems. Background Technology

[0002] For in-vehicle systems, there are generally multiple virtual systems, such as a bottom-level virtual system and an upper-level virtual system. The bottom-level virtual system interacts directly with the hardware on the vehicle to obtain hardware data, while the upper-level virtual system interacts with the user to provide the user with the functions of various software and the functions of the front-end display.

[0003] In a multi-virtual system scenario, when a user touches the touchscreen, the touch chip first senses an interrupt signal and sends it to the underlying virtual system. Then, the underlying virtual system sends an interrupt signal to the upper-level virtual system. The upper-level system triggers an interrupt callback function, obtains the user's touch data from the touch chip through the underlying virtual system, and sends the touch data to the input subsystem to perform corresponding control based on the touch data, such as controlling the software or the display screen.

[0004] However, in the above process, the underlying virtual system sends interrupt signals and obtains touch data in a single thread. If the user touches the screen frequently in a short period of time, the underlying virtual system will not send interrupt signals and obtain touch data in a timely manner. The input subsystem will not be able to obtain touch data in time, causing the front-end display screen of the upper virtual system to lag. Summary of the Invention

[0005] This application provides a method, system, device, and medium for transmitting interrupt events in a multi-virtual system to solve the technical problem of screen stuttering caused by frequent touches of the display screen by users in an in-vehicle multi-virtual system.

[0006] In a first aspect, this application provides a method for transmitting interrupt events in a multi-virtual system, comprising: receiving an interrupt signal sent by a touch chip, wherein the touch chip generates the interrupt signal when it senses that the touchscreen is being touched; calling a first thread from a first thread pool of an external interrupt driver to send the interrupt signal to an upper-layer virtual system, so that the touchscreen driver in the upper-layer virtual system triggers an interrupt callback function; upon receiving the callback signal from the upper-layer virtual system, calling a second thread from a second thread pool of a communication module of the lower-layer virtual system to collect touch data from the touch chip; and sending the touch data to the upper-layer virtual system, so that the upper-layer virtual system controls the touchscreen according to the touch data.

[0007] For example, the above-mentioned invocation of a first thread from an externally interrupt-driven first thread pool to send the interrupt signal to the upper-level virtual system includes: multiple threads from the first thread pool sequentially polling the state of a shared variable; when the state of the shared variable meets a preset condition, the currently polling thread is determined as the first thread, and the interrupt signal is sent to the upper-level virtual system through the first thread, wherein the determined first thread no longer participates in the polling, but re-participates in the polling after the first thread sends the interrupt signal.

[0008] In this embodiment, multiple threads in the first thread pool poll the state of shared variables, thereby sending an interrupt signal to the upper-layer virtual system as soon as the state changes, improving signal transmission efficiency and further avoiding screen stuttering caused by the input subsystem not acquiring touch data in a timely manner.

[0009] For example, the above method further includes: after the first thread is determined, other threads among the plurality of threads continue to poll the state of the shared variable, and after receiving the interrupt signal from the touch chip again, determining one of the other threads to send the new interrupt signal to the upper-level virtual system.

[0010] Through the method of this embodiment, all threads in the first thread pool poll the value of the shared variable. When any interrupt signal is generated, a first thread will send the interrupt signal to the upper virtual system immediately. This achieves the effect of the upper virtual system calling the touch data immediately, and further avoids the problem of screen lag caused by the input subsystem not obtaining touch data in time.

[0011] For example, the above method further includes: dynamically increasing the number of threads in the first thread pool when the number of threads participating in polling in the first thread pool is less than a preset value.

[0012] In this embodiment, the number of threads in the first thread pool is determined by the time required for the threads in the first thread pool to send an interrupt signal to the upper-level virtual system and the time required for the threads in the first thread pool to determine a shared variable. The number of threads in the first thread pool is dynamically adjusted based on the number of threads participating in the polling process. This ensures that the number of threads in the first thread pool is sufficient while reducing the system resource consumption.

[0013] For example, before calling the second thread from the second thread pool of the communication module of the underlying virtual system, the method further includes: creating a thread in the second thread pool each time an interrupt signal sent by the touch chip is received; and numbering the threads in the second thread pool, wherein the number corresponds to the interrupt signal.

[0014] In this embodiment, each time an interrupt signal is received from the touch chip, a thread is created in the second thread pool and the thread is numbered. This allows the corresponding thread to be selected as the second thread to retrieve touch data and return it to the upper virtual system when a callback signal is received from the upper virtual system. This ensures that the touch data is returned to the upper virtual system in a timely manner and further avoids the problem of screen stuttering caused by the input subsystem not retrieving touch data in a timely manner.

[0015] For example, when the callback signal of the upper-level virtual system is received, calling the second thread from the second thread pool of the communication module of the lower-level virtual system includes: when the callback signal is received, selecting the thread with the corresponding number in the second thread pool as the second thread according to the number of the callback signal.

[0016] In this example, since the number of threads in the second thread pool is the same as the number of interrupt signals received, even if all interrupt signals simultaneously call back touch data through the callback function, all callback functions can be processed in parallel, and touch data can be obtained and sent to the upper virtual system in parallel.

[0017] For example, the priority of the external interrupt thread in the aforementioned upper-level virtual system is adjusted from the first priority to a higher second priority.

[0018] In this embodiment, the priority of the thread is increased, so that the thread can transmit signals to the touch screen driver in the upper virtual system as soon as possible.

[0019] Secondly, this application provides an interrupt event transmission system, comprising: a receiving module for receiving an interrupt signal sent by a touch chip, wherein the touch chip generates the interrupt signal when it senses that the touchscreen is touched; a first calling module for calling a first thread from a first thread pool of an external interrupt driver to send the interrupt signal to an upper-layer virtual system, so that the touchscreen driver in the upper-layer virtual system triggers an interrupt callback function; a second calling module for calling a second thread from a second thread pool of a communication module of the lower-layer virtual system when receiving the callback signal from the upper-layer virtual system, to collect touch data from the touch chip; and a sending module for sending the touch data to the upper-layer virtual system, so that the upper-layer virtual system controls the touchscreen according to the touch data.

[0020] Thirdly, this application provides an interrupt event transmission device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement the interrupt event transmission method of any of the above-described multi-virtual systems when executing the computer program.

[0021] Fourthly, this application also provides a computer storage medium storing computer-executable instructions, which are used to execute the interrupt event transmission method of the multi-virtual system described in any of the above claims of this application.

[0022] Compared with the prior art, the technical solution provided in this application has the following advantages: The solution provided in this application receives an interrupt signal sent by a touch chip, wherein the touch chip generates the interrupt signal when it senses that the touchscreen is being touched; a first thread is called from the first thread pool of the external interrupt driver to send the interrupt signal to the upper-layer virtual system, so that the touchscreen driver in the upper-layer virtual system triggers an interrupt callback function; upon receiving the callback signal from the upper-layer virtual system, a second thread is called from the second thread pool of the communication module of the lower-layer virtual system to collect touch data from the touch chip; the touch data is sent to the upper-layer virtual system so that the upper-layer virtual system controls the touchscreen according to the touch data. Thus, the lower-layer virtual system can send interrupt signals and acquire touch data through threads in the thread pool, enabling the input subsystem to acquire the user's touch data immediately, ensuring immediate processing of the user's touch data and avoiding screen lag. Attached Figure Description

[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0026] Figure 1 A flowchart illustrating an interrupt event transmission method for a multi-virtual system provided in this application embodiment; Figure 2 A flowchart illustrating another interrupt event transmission method for a multi-virtual system provided in this application embodiment; Figure 3 A flowchart illustrating another interrupt event transmission method for a multi-virtual system provided in this application embodiment; Figure 4 A flowchart illustrating another interrupt event transmission method for a multi-virtual system provided in this application embodiment; Figure 5 A flowchart illustrating another interrupt event transmission method for a multi-virtual system provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of an interrupt event transmission system provided in an embodiment of this application; Figure 7 This is a schematic diagram of an interrupt event transmission device provided in an embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0029] To address the technical problem of screen stuttering caused by frequent user touches on the display screen in existing in-vehicle multi-virtual systems, this application provides an interrupt event transmission method for multi-virtual systems, which can avoid screen stuttering caused by frequent user touches on the display screen in in-vehicle systems.

[0030] Figure 1 This is a flowchart illustrating an interrupt event transmission method for a multi-virtual system provided in an embodiment of this application. Figure 1 As shown, the interrupt event transmission method for the above-mentioned multi-virtual system includes: S102, receive the interrupt signal sent by the touch chip, wherein the touch chip generates the interrupt signal when it senses that the touch screen is being touched; S104: Call the first thread from the first thread pool of the external interrupt driver and send the interrupt signal to the upper virtual system so that the touch screen driver in the upper virtual system can trigger the interrupt callback function. S106, when receiving a callback signal from the upper virtual system, calls the second thread from the second thread pool of the communication module of the lower virtual system to collect touch data from the touch chip; S108 sends touch data to the upper-level virtual system so that the upper-level virtual system can control the touch screen according to the touch data.

[0031] The interrupt event transmission method for multi-virtual systems in this example can be applied in scenarios involving multiple virtual systems, such as in-vehicle multi-virtual systems or remotely controlled multi-virtual systems.

[0032] In multi-virtual-system scenarios, a single processor device can virtualize multiple virtual systems. For example, in an automotive multi-virtual-system scenario, multiple systems are virtualized using in-vehicle hardware, including at least a lower-level virtual system and an upper-level virtual system. The lower-level virtual system serves as the framework of the in-vehicle system, directly interacting with in-vehicle sensors, such as acquiring data from in-vehicle cameras and radar. The upper-level virtual system is primarily responsible for user interaction, providing a front-end display screen that can display multiple applications and facilitate user interaction.

[0033] In this scenario, if a user performs a touch operation on the display screen, the upper-level virtual system needs to transmit the user's touch data to the input subsystem within the upper-level virtual system. The input subsystem then identifies and processes the data to display the corresponding content on the screen. Timely acquisition of touch data and its delivery to the input subsystem is crucial to its ability to respond promptly and avoid screen lag.

[0034] Figure 2 This is a method for acquiring touch data. In this example, a Virtual Machine Monitor (VMM) runs on the chip. A VMM is a software or hardware system that can create and manage multiple virtual machines on the chip's physical hardware, enabling virtualized resource allocation and isolation. The VMM runs both a lower-level virtual system and an upper-level virtual system. The lower-level virtual system, SOS, can be Yocto, an open-source collaborative project designed to help developers create customized Linux systems for embedded and IoT devices. The upper-level virtual system, UOS, can be a domestically developed operating system or Android, providing foreground interaction and software execution.

[0035] On the hardware (HW) side, the touch panel (TP) chip senses the touch signal by detecting changes in hardware voltage levels when the user touches the display screen. At this time, the touch chip generates an interrupt and sends it to the underlying virtual system's Generic Interrupt Controller (GIC). The GIC sends the interrupt to Yocto's External Interrupt (Eint). The Eint wakes up an Eint worker thread of the Vhost framework and sends the interrupt to Android's Eint. Vhost is a virtualization framework in the Linux kernel, mainly used to optimize the data communication efficiency between the virtual machine and the host machine. Android's Eint wakes up an Eint worker thread, triggering the interrupt callback function of the TP driver. In the interrupt callback function of the TP driver, the i2c_transfer of the two-wire serial communication protocol bus (Inter-Integrated Circuit, I2C) is called to read the touch data of the TP chip. Android's abstraction layer Virtio kicks (in general terms, notifies) Yocto's Vhost I2C through Virtio I2C. Vhost I2C obtains the touch data of the TP chip through I2C communication and returns the touch data to the TP driver. Finally, the TP driver reports the touch event to the input subsystem.

[0036] In the aforementioned method, the underlying virtual system's sending of interrupt signals and acquisition of touch data are single-threaded. If the user frequently touches the screen in a short period, the underlying virtual system's sending of interrupt signals and acquisition of touch data will be delayed, and the input subsystem will not be able to obtain the touch data immediately. Therefore, in this example, a first thread pool is allocated to the external interrupt driver, and a second thread pool is allocated to the communication module. Both the first and second thread pools contain multiple threads. After the underlying virtual system receives the interrupt signal sent by the touch chip, it can call the first thread from the first thread pool of the external interrupt driver. When it receives the callback signal from the upper-layer virtual system, it calls the second thread from the second thread pool of the communication module of the underlying virtual system. This avoids single-threaded processing and allows the touch data to be transmitted to the input subsystem immediately.

[0037] Continue to combine Figure 2 Examples, such as Figure 3As shown, a first thread pool is introduced in the Eint driver, and its size can be set according to actual needs. Upon receiving an interrupt, an atomic polling operation is used in `eint_event_send` to select a worker thread, waking it up to act as the first thread to handle the interrupt event. For example... Figure 4 As shown, a worker thread pool is introduced in the Vhost I2C driver to handle front-end requests. During initialization, a second thread pool is created, and a thread is created for each Virt Queue. When an event is triggered, the Guest writes to the Virtio protocol's VQ queue and kicks it, waking up the corresponding worker thread as a second thread to obtain touch data and realize parallel processing of I2C.

[0038] like Figure 5 As shown, after a user touches the screen, the GIC sends an interrupt to Yocto's Eint. Eint wakes up the corresponding first thread in the first thread pool for the interrupt event and sends the interrupt to Android's Eint. Android's Eint wakes up an Eint worker to trigger the interrupt callback function of the TP driver. In the TP interrupt callback function, i2c_transfer is called to read the touch data of the TP chip. Android's Virtio I2C kicks Yocto's Vhost I2C. Vhost I2C wakes up the second thread of the corresponding channel in the second thread pool, obtains the touch data of the TP chip through I2C communication, and returns the touch data to the TP driver. Finally, the TP driver reports the touch event to the input subsystem.

[0039] The solution provided in this application embodiment receives an interrupt signal sent by the touch chip, wherein the touch chip generates an interrupt signal when it senses that the touch screen is being touched; a first thread is called from the first thread pool of the external interrupt driver to send the interrupt signal to the upper-layer virtual system, so that the touch screen driver in the upper-layer virtual system triggers the interrupt callback function; upon receiving the callback signal from the upper-layer virtual system, a second thread is called from the second thread pool of the communication module of the lower-layer virtual system to collect touch data from the touch chip; the touch data is sent to the upper-layer virtual system so that the upper-layer virtual system controls the touch screen according to the touch data. Thus, the lower-layer virtual system can send interrupt signals and obtain touch data through threads in the thread pool, enabling the input subsystem to obtain the user's touch data in a timely manner, ensuring that the user's touch data is processed in a timely manner, and avoiding screen lag.

[0040] For example, calling the first thread from the first thread pool driven by an external interrupt to send an interrupt signal to the upper virtual system includes: multiple threads in the first thread pool sequentially polling the state of a shared variable; when the state of the shared variable meets a preset condition, the currently polling thread is determined as the first thread, and the interrupt signal is sent to the upper virtual system through the first thread. The determined first thread does not participate in the polling again, but re-participates in the polling after the first thread sends the interrupt signal.

[0041] In this example, when the first thread is called from the first thread pool driven by an external interrupt, since the first thread pool includes multiple threads, it is necessary to first determine the first thread and then have the first thread send the interrupt signal.

[0042] When determining the first thread, all threads in the first thread pool can be polled in a specific order to check the status of a shared variable. This order can be either the order in which the threads were created or a randomly determined order. The shared variable is shared by all threads in the first thread pool and indicates whether an interrupt signal needs to be sent. Different values ​​of the shared variable represent different states. For example, 1 indicates that an interrupt signal needs to be sent, and 0 indicates that no interrupt signal needs to be sent.

[0043] The polling process involves all threads in the first thread pool determining the value of the shared variable in the order specified above. Taking three threads as an example, the first thread determines the value of the shared variable, which is currently zero, indicating no interrupt signal. Then, the second thread determines the value, which is also zero, indicating no interrupt signal. The third thread then determines the value, which is also zero, indicating no interrupt signal. This process continues, looping through all threads and starting again from the first thread, until a thread encounters a value of 1 in the shared variable, indicating an interrupt signal to be sent. This current thread then becomes the first thread to send the interrupt signal.

[0044] The current thread, having encountered a shared variable with a value of 1, sets itself as the first thread, sends an interrupt signal, and resets the shared variable to zero. Because the current thread virtually sends an interrupt signal, it will temporarily not participate in subsequent polling, while other threads continue polling. The current thread will rejoin the polling process after sending its interrupt signal.

[0045] In this embodiment, multiple threads in the first thread pool poll the state of shared variables, thereby sending an interrupt signal to the upper-layer virtual system as soon as the state changes, improving signal transmission efficiency and further avoiding screen stuttering caused by the input subsystem not acquiring touch data in a timely manner.

[0046] For example, the above method further includes: after the first thread is determined, other threads among the multiple threads continue to poll the state of the shared variable, and after receiving the interrupt signal from the touch chip again, a thread is determined from the other threads to send the new interrupt signal to the upper virtual system.

[0047] In this example, since the first thread pool includes multiple threads, even if the user performs multiple touch operations on the display screen in a short period of time, the external interrupt driver can use a separate thread to send an interrupt signal to the upper-layer virtual system for each touch operation.

[0048] For example, continuing with the three-thread scenario above, the first thread determines the value of the shared variable, which is currently zero, indicating no interrupt signal. Then, the second thread determines the value of the shared variable, which is also zero, indicating no interrupt signal. At this point, the user touches the display screen, triggering an interrupt signal from the touch chip. The shared variable's value changes from zero to 1. The third thread then determines the value of the shared variable, which is now 1, indicating an interrupt signal. This third thread then acts as the first thread, sending an interrupt signal to the upper-level virtual system and setting the shared variable's value back to 0. During this interrupt signal sending process, the third thread does not poll the shared variable; the other two threads continue polling. The first thread determines the value of the shared variable, which is currently zero, indicating no interrupt signal. Then, the user touches the display screen again, triggering an interrupt signal from the touch chip. The shared variable's value changes from zero to 1. The second thread determines the value of the shared variable, which is now 1, indicating an interrupt signal. This second thread then acts as the first thread, sending an interrupt signal to the upper-level virtual system and setting the shared variable's value back to 0. At this point, only the first thread remains, and the first thread continues to poll for the value of the shared variable.

[0049] After each thread sends a completion interrupt signal, it will rejoin the queue and start polling the value of the shared variable.

[0050] Through the method of this embodiment, all threads in the first thread pool poll the value of the shared variable. When any interrupt signal is generated, a first thread will send the interrupt signal to the upper virtual system immediately. This achieves the effect of the upper virtual system calling the touch data immediately, and further avoids the problem of screen lag caused by the input subsystem not obtaining touch data in time.

[0051] For example, the above method further includes: dynamically increasing the number of threads in the first thread pool when the number of threads participating in polling in the first thread pool is less than a preset value.

[0052] In this example, the number of threads in the first thread pool can be determined empirically and dynamically adjusted according to parameters. For example, based on experience, the number of threads in the first thread pool can be determined to be 5, so 5 threads are allocated to the first thread pool. Then, the real-time number of threads participating in the polling in the first thread pool is monitored. If the real-time number of threads participating in the polling is low, it indicates that the display screen has received multiple touch operations in a short period of time, and the touch chip has generated multiple interrupt signals, causing multiple threads in the first thread pool to need to send interrupt signals. In this case, more threads should be added to the first thread pool to send interrupt signals in a timely manner.

[0053] In another example, the number of threads in the first thread pool can be determined by comparing the time it takes for a thread in the first thread pool to send an interrupt signal to the upper-level virtual system with the time it takes for a thread in the first thread pool to determine a shared variable. If the time it takes for a thread in the first thread pool to send an interrupt signal to the upper-level virtual system is Y, and the time to determine a shared variable is X, then Y / X can be calculated to obtain a value. This value, rounded up or down, can be used as the initial number of threads in the first thread pool.

[0054] In this embodiment, the number of threads in the first thread pool is determined by the time required for the threads in the first thread pool to send an interrupt signal to the upper-level virtual system and the time required for the threads in the first thread pool to determine a shared variable. The number of threads in the first thread pool is dynamically adjusted based on the number of threads participating in the polling process. This ensures that the number of threads in the first thread pool is sufficient while reducing the system resource consumption.

[0055] For example, before calling the second thread from the second thread pool of the communication module of the underlying virtual system, the above method further includes: creating a thread in the second thread pool each time an interrupt signal sent by the touch chip is received; and numbering the threads in the second thread pool, wherein the number corresponds to the interrupt signal.

[0056] In this example, the second thread pool is the same as the first thread pool, both containing multiple threads. The difference lies in that the threads in the second thread pool are created when an interrupt signal from the touch chip is received. Each time the underlying virtual system receives an interrupt signal from the touch chip, it adds a thread to the second thread pool and can assign a number to each thread, thus associating it with the interrupt signal. For example, the reception time of the interrupt signal can be used to uniquely determine a number, thereby mapping the thread to the interrupt signal.

[0057] When the first thread is invoked from the first thread pool driven by an external interrupt, and an interrupt signal is sent to the upper-layer virtual system, the touchscreen driver of the upper-layer virtual system triggers the interrupt callback function. When the touch data is retrieved through the callback function, the communication module of the lower-layer virtual system invokes the second thread from the second thread pool to collect the touch data. The second thread used by the communication module of the lower-layer virtual system at this time is the thread determined according to the above-mentioned correspondence between threads and interrupt signals.

[0058] This embodiment creates a thread in the second thread pool each time an interrupt signal is received from the touch chip, and assigns a number to the thread. This allows the corresponding thread to be selected as the second thread to retrieve touch data and return it to the upper virtual system when a callback signal is received from the upper virtual system. This ensures that the touch data is returned to the upper virtual system in a timely manner, and further avoids the problem of screen stuttering caused by the input subsystem not retrieving touch data in a timely manner.

[0059] For example, when a callback signal is received from the upper-layer virtual system, calling the second thread from the second thread pool of the communication module of the lower-layer virtual system includes: when the callback signal is received, selecting the thread with the corresponding number as the second thread from the second thread pool according to the number of the callback signal.

[0060] In this embodiment, upon receiving a callback signal, a thread with the corresponding number can be selected as the second thread from the second thread pool. Alternatively, threads can be unnumbered; a new thread can be created in the second thread pool upon receiving an interrupt signal from the touch chip, ensuring that the number of threads in the second thread pool matches the number of received interrupt signals. Then, when the communication module of the underlying virtual system calls the second thread from the second thread pool, it can use any unoccupied thread from the second thread pool as the second thread.

[0061] Threads in the second thread pool, once occupied, can be used to retrieve touch data from the touch chip; unoccupied threads wait to be called. Since the number of threads in the second thread pool is the same as the number of received interrupt signals, even if all interrupt signals simultaneously call back touch data through callback functions, all callback functions can be processed in parallel, and touch data can be retrieved and sent to the upper-layer virtual system in parallel.

[0062] For example, the priority of an external interrupt thread in the upper-level virtual system is adjusted from the first priority to a higher second priority.

[0063] In this embodiment, in addition to the settings of the first thread pool and the second thread pool described above, the priority of the external interrupt thread in the upper-layer virtual system can also be adjusted. The external interrupt thread is the worker thread corresponding to the external interrupt driver in the upper-layer virtual system and the lower-layer virtual system; its priority is generally low. In this embodiment, the priority of this thread is increased, allowing it to transmit signals to the touchscreen driver in the upper-layer virtual system as quickly as possible.

[0064] Figure 6 This is a schematic diagram of an interrupt event transmission system provided in an embodiment of this application. Figure 6 As shown, it includes: The receiving module 601 is used to receive the interrupt signal sent by the touch chip, wherein the touch chip generates the interrupt signal when it senses that the touch screen is being touched; The first calling module 602 is used to call the first thread from the first thread pool of the external interrupt driver and send the interrupt signal to the upper virtual system so that the touch screen driver in the upper virtual system triggers the interrupt callback function. The second calling module 603 is used to call the second thread from the second thread pool of the communication module of the underlying virtual system when a callback signal is received from the upper virtual system, and to collect touch data from the touch chip. The sending module 604 is used to send touch data to the upper-layer virtual system so that the upper-layer virtual system can control the touch screen according to the touch data.

[0065] This example can be applied to scenarios with multiple virtual systems, such as in-vehicle multiple virtual systems or remote control multiple virtual systems.

[0066] In multi-virtual-system scenarios, a single processor device can virtualize multiple virtual systems. For example, in an automotive multi-virtual-system scenario, multiple systems are virtualized using in-vehicle hardware, including at least a lower-level virtual system and an upper-level virtual system. The lower-level virtual system serves as the framework of the in-vehicle system, directly interacting with in-vehicle sensors, such as acquiring data from in-vehicle cameras and radar. The upper-level virtual system is primarily responsible for user interaction, providing a front-end display screen that can display multiple applications and facilitate user interaction.

[0067] In this scenario, if a user performs a touch operation on the display screen, the upper-level virtual system needs to transmit the user's touch data to the input subsystem within the upper-level virtual system. The input subsystem then identifies and processes the data to display the corresponding content on the screen. Timely acquisition of touch data and its delivery to the input subsystem is crucial to its ability to respond promptly and avoid screen lag.

[0068] Figure 2This is a method for acquiring touch data. In this example, a Virtual Machine Monitor (VMM) runs on the chip. A VMM is a software or hardware system that can create and manage multiple virtual machines on the chip's physical hardware, enabling virtualized resource allocation and isolation. The VMM runs both a lower-level virtual system and an upper-level virtual system. The lower-level virtual system, SOS, can be Yocto, an open-source collaborative project designed to help developers create customized Linux systems for embedded and IoT devices. The upper-level virtual system, UOS, can be a domestically developed operating system or Android, providing foreground interaction and software execution.

[0069] On the hardware (HW) side, the touch panel (TP) chip senses the touch signal by detecting changes in hardware voltage levels when the user touches the display screen. At this time, the touch chip generates an interrupt and sends it to the underlying virtual system's Generic Interrupt Controller (GIC). The GIC sends the interrupt to Yocto's External Interrupt (Eint). The Eint wakes up an Eint worker thread of the Vhost framework and sends the interrupt to Android's Eint. Vhost is a virtualization framework in the Linux kernel, mainly used to optimize the data communication efficiency between the virtual machine and the host machine. Android's Eint wakes up an Eint worker thread, triggering the interrupt callback function of the TP driver. In the interrupt callback function of the TP driver, the i2c_transfer of the two-wire serial communication protocol bus (Inter-Integrated Circuit, I2C) is called to read the touch data of the TP chip. Android's abstraction layer Virtio kicks (in general terms, notifies) Yocto's Vhost I2C through Virtio I2C. Vhost I2C obtains the touch data of the TP chip through I2C communication and returns the touch data to the TP driver. Finally, the TP driver reports the touch event to the input subsystem.

[0070] In the aforementioned method, the underlying virtual system's sending of interrupt signals and acquisition of touch data are single-threaded. If the user frequently touches the screen in a short period, the underlying virtual system's sending of interrupt signals and acquisition of touch data will be delayed, and the input subsystem will not be able to obtain the touch data immediately. Therefore, in this example, a first thread pool is allocated to the external interrupt driver, and a second thread pool is allocated to the communication module. Both the first and second thread pools contain multiple threads. After the underlying virtual system receives the interrupt signal sent by the touch chip, it can call the first thread from the first thread pool of the external interrupt driver. When it receives the callback signal from the upper-layer virtual system, it calls the second thread from the second thread pool of the communication module of the underlying virtual system. This avoids single-threaded processing and allows the touch data to be transmitted to the input subsystem immediately.

[0071] Continue to combine Figure 2 Examples, such as Figure 3 As shown, a first thread pool is introduced in the Eint driver, and its size can be set according to actual needs. Upon receiving an interrupt, an atomic polling operation is used in `eint_event_send` to select a worker thread, waking it up to act as the first thread to handle the interrupt event. For example... Figure 4 As shown, a worker thread pool is introduced in the Vhost I2C driver to handle front-end requests. During initialization, a second thread pool is created, and a thread is created for each Virt Queue. When an event is triggered, the Guest writes to the Virtio protocol's VQ queue and kicks it, waking up the corresponding worker thread as a second thread to obtain touch data and realize parallel processing of I2C.

[0072] like Figure 5 As shown, after a user touches the screen, the GIC sends an interrupt to Yocto's Eint. Eint wakes up the corresponding first thread in the first thread pool for the interrupt event and sends the interrupt to Android's Eint. Android's Eint wakes up an Eint worker to trigger the interrupt callback function of the TP driver. In the TP interrupt callback function, i2c_transfer is called to read the touch data of the TP chip. Android's Virtio I2C kicks Yocto's Vhost I2C. Vhost I2C wakes up the second thread of the corresponding channel in the second thread pool, obtains the touch data of the TP chip through I2C communication, and returns the touch data to the TP driver. Finally, the TP driver reports the touch event to the input subsystem.

[0073] The solution provided in this application embodiment receives an interrupt signal sent by the touch chip, wherein the touch chip generates an interrupt signal when it senses that the touch screen is being touched; a first thread is called from the first thread pool of the external interrupt driver to send the interrupt signal to the upper-layer virtual system, so that the touch screen driver in the upper-layer virtual system triggers the interrupt callback function; upon receiving the callback signal from the upper-layer virtual system, a second thread is called from the second thread pool of the communication module of the lower-layer virtual system to collect touch data from the touch chip; the touch data is sent to the upper-layer virtual system so that the upper-layer virtual system controls the touch screen according to the touch data. Thus, the lower-layer virtual system can send interrupt signals and obtain touch data through threads in the thread pool, enabling the input subsystem to obtain the user's touch data in a timely manner, ensuring that the user's touch data is processed in a timely manner, and avoiding screen lag.

[0074] For example, the first calling module includes: a first calling unit, used to have multiple threads of the first thread pool sequentially poll the state of a shared variable; when the state of the shared variable meets a preset condition, the currently polling thread is determined as the first thread, and an interrupt signal is sent to the upper-layer virtual system through the first thread, wherein the determined first thread no longer participates in the polling, and re-participates in the polling after the first thread sends the interrupt signal.

[0075] For example, the above system further includes: a determination module, which, after the first thread is determined, allows other threads among the multiple threads to continue polling the state of the shared variable, and upon receiving another interrupt signal from the touch chip, determines one of the other threads to send a new interrupt signal to the upper-layer virtual system.

[0076] For example, the system further includes an adjustment module, used to dynamically increase the number of threads in the first thread pool when the number of threads participating in polling in the first thread pool is less than a preset value.

[0077] For example, the system further includes: a creation module, configured to create a thread in the second thread pool each time an interrupt signal sent by the touch chip is received before calling the second thread from the second thread pool of the communication module of the underlying virtual system; and to number the threads in the second thread pool, wherein the number corresponds to the interrupt signal.

[0078] For example, the second calling module mentioned above includes: a second calling unit, used to select a thread with the corresponding number as the second thread from the second thread pool when a callback signal is received, according to the number of the callback signal.

[0079] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.

[0080] like Figure 7As shown in the figure, this application provides an interrupt event transmission device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114. Memory 113 is used to store computer programs; In one embodiment of this application, when the processor 111 executes the program stored in the memory 113, it implements the interrupt event transmission method for a multi-virtual system provided in any of the foregoing method embodiments.

[0081] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the interrupt event transmission method for a multi-virtual system as provided in any of the foregoing method embodiments.

[0082] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general-purpose hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0084] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0085] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for transmitting interrupt events in a multi-virtual system, applied in a low-level virtual system, characterized in that, include: The system receives an interrupt signal sent by a touch chip, wherein the touch chip generates the interrupt signal when it senses that the touch screen is being touched. The first thread is called from the first thread pool driven by the external interrupt, and the interrupt signal is sent to the upper virtual system so that the touch screen driver in the upper virtual system triggers the interrupt callback function. Upon receiving a callback signal from the upper-layer virtual system, the second thread is invoked from the second thread pool of the communication module of the lower-layer virtual system to collect touch data from the touch chip. The touch data is sent to the upper-level virtual system so that the upper-level virtual system can control the touch screen based on the touch data.

2. The method according to claim 1, characterized in that, The step of calling the first thread from the first thread pool driven by an external interrupt and sending the interrupt signal to the upper-layer virtual system includes: Multiple threads from the first thread pool sequentially poll the state of the shared variable. When the state of the shared variable meets the preset conditions, the thread currently polling is determined to be the first thread, and the first thread sends the interrupt signal to the upper-level virtual system. The determined first thread no longer participates in the polling, but rejoins the polling after the first thread sends the interrupt signal.

3. The method according to claim 2, characterized in that, The method further includes: After the first thread is identified, the other threads among the plurality of threads continue to poll the state of the shared variable, and upon receiving the interrupt signal from the touch chip again, they identify one of the other threads to send a new interrupt signal to the upper-layer virtual system.

4. The method according to claim 3, characterized in that, The method further includes: When the number of threads participating in polling in the first thread pool is less than a preset value, the number of threads in the first thread pool is dynamically increased.

5. The method according to claim 1, characterized in that, Before invoking the second thread from the second thread pool of the communication module of the underlying virtual system, the method further includes: Each time an interrupt signal is received from the touch chip, a thread is created in the second thread pool; The threads in the second thread pool are numbered, and the number corresponds to the interrupt signal.

6. The method according to claim 5, characterized in that, The step of calling the second thread from the second thread pool of the communication module of the underlying virtual system when receiving the callback signal from the upper-layer virtual system includes: Upon receiving the callback signal, the thread with the corresponding number in the second thread pool is selected as the second thread according to the number of the callback signal.

7. The method according to claim 1, characterized in that, The priority of the external interrupt thread in the upper-level virtual system is adjusted from the first priority to the higher second priority.

8. An interrupt event transmission system, characterized in that, include: A receiving module is used to receive an interrupt signal sent by a touch chip, wherein the touch chip generates the interrupt signal when it senses that the touch screen is being touched; The first calling module is used to call the first thread from the first thread pool driven by the external interrupt, and send the interrupt signal to the upper virtual system so that the touch screen driver in the upper virtual system triggers the interrupt callback function. The second calling module is used to call the second thread from the second thread pool of the communication module of the underlying virtual system when it receives the callback signal of the upper virtual system, and to collect touch data from the touch chip. A sending module is used to send the touch data to the upper-layer virtual system so that the upper-layer virtual system can control the touch screen according to the touch data.

9. An interrupt event transmission device, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; At least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor executes the computer program to implement the interrupt event transmission method for a multi-virtual system as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The storage medium stores computer-executable instructions for executing the interrupt event transmission method for a multi-virtual system as described in any one of claims 1 to 7 of this application.