Task processing method, computing device, task processing system and storage medium

By combining the software architecture of terminal programs and agent programs with virtualization technology and buffered transmission of virtual address space, the problem of limited use of peripheral devices under different processor architectures and operating systems is solved, and efficient peripheral data transmission is achieved.

CN122019049APending Publication Date: 2026-05-12PHYTIUM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PHYTIUM TECH CO LTD
Filing Date
2025-12-30
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing peripheral device drivers are primarily designed for x86-based Windows systems, limiting their use cases on other processor architectures and operating systems. Furthermore, cloud printing functionality cannot be extended by connecting peripheral devices over a network.

Method used

The software architecture employs a terminal program and an agent program. The terminal program runs on the host machine's first operating system, while the agent program runs on the virtual machine's second operating system. Virtualization technology grants the virtual machine control permissions over peripherals and establishes a buffer in the virtual address space to transmit peripheral data, avoiding data copying back and forth between the host machine and the virtual machine.

Benefits of technology

It enables the normal use of peripheral devices under any processor architecture and operating system, improves data transfer speed, avoids inefficient disk I/O and disk I/O simulated by software inside the virtual machine, and achieves zero-copy data transfer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019049A_ABST
    Figure CN122019049A_ABST
Patent Text Reader

Abstract

According to the task processing method provided by the embodiment of the invention, a software architecture comprising a terminal program and an agent program is utilized, and a computing device carrying any first operating system and any architecture can be supported to call and control a target peripheral through interaction of the terminal program and the agent program. Through software architecture of the terminal program and the agent program, the complexity of a bottom layer heterogeneous environment (such as different processor architectures and operating systems) is shielded, so that a user can use the target peripheral on computing equipment of any processor architecture and any first operating system through the agent program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer application technology, and more specifically, to a task processing method, computing device, task processing system, and storage medium. Background Technology

[0002] To enable additional functionality, computing devices often connect to peripherals to extend their capabilities, such as text processing. For example, printers, scanners, or multifunction printers (MFPs) that integrate printing, copying, scanning, and faxing all rely heavily on their drivers for proper operation. Currently, manufacturers of these peripherals primarily develop drivers for Windows systems based on the x86 architecture, severely limiting their usability. Summary of the Invention

[0003] This specification provides a task processing method, a computing device, a task processing system, and a storage medium to enable the use of peripheral devices on computing devices with any processor architecture and any operating system, thereby expanding the application scenarios of peripheral devices.

[0004] To achieve the above technical objectives, the embodiments of this specification provide the following technical solutions: Firstly, one embodiment of this specification provides a task processing method applied to a computing device, the computing device establishing a communication connection with a target peripheral device, the computing device including a first operating system and a virtual machine, the first operating system deploying a terminal program, the virtual machine including a second operating system and an agent program deployed in the second operating system and a driver for the target peripheral device, the virtual machine having control permissions for the target peripheral device, the task processing method including: In response to a task processing request, the agent program invokes the driver program of the target peripheral to execute the target task; The peripheral data corresponding to the target task is transmitted between the agent program and the terminal program through a buffer. The buffer is a storage space established by the agent program in the virtual address space, and the virtual address space is the address space of the virtual machine's virtual machine manager process.

[0005] Secondly, one embodiment of this specification also provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task processing method described above.

[0006] Thirdly, one embodiment of this specification also provides a task processing system, including: a computing device and a target peripheral device, wherein the computing device is any of the computing devices described above.

[0007] Fourthly, one embodiment of this specification also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the task processing method described above.

[0008] Fifthly, embodiments of this specification provide a computer program product or computer program, the computer program product including a computer program stored in a computer-readable storage medium; a processor of a computer device reads the computer program from the computer-readable storage medium, and when the processor executes the computer program, it implements the steps of the task processing method described above. Optionally, the computer program may be stored in a computer-readable storage medium or in the cloud; the processor of the computer device reads the computer program from the readable storage medium or in the cloud.

[0009] As can be seen from the above technical solutions, the task processing method provided in this specification is applied to a computing device that has established a communication connection with a target device. This computing device includes a first operating system and a virtual machine. The first operating system deploys a terminal program, and the virtual machine includes a second operating system, an agent program deployed in the second operating system, and a driver for the target peripheral. The first operating system may be different from the second operating system. The virtual machine has control permissions over the target peripheral. Based on the above hardware and software architecture, when this task processing method is implemented, the agent program responds to the task processing request and calls the driver for the target peripheral to execute the target task. The peripheral data corresponding to the target task is transmitted between the agent program and the terminal program through a buffer. The buffer is a storage space established by the agent program in the virtual address space, and the virtual address space is the address space of the virtual machine's virtual machine manager process. Thus, by utilizing a software architecture including a terminal program and an agent program, computing devices with any first operating system and any architecture can achieve the calling and control of target peripherals through the interaction of the terminal program and the agent program. In essence, by using a software architecture of terminal programs and agent programs, the complexity of the underlying heterogeneous environment (such as different processor architectures and operating systems) is shielded, allowing users to access target peripherals on computing devices with any processor architecture and any primary operating system through the agent program. Furthermore, since the physical memory of a virtual machine is essentially part of the address space of the virtual machine manager process, when transferring peripheral data, the agent program can establish a buffer in the virtual address space. This allows the terminal program on the host machine to directly write data to or access data in this buffer, just like accessing ordinary memory. Therefore, transferring peripheral data corresponding to the target task through a buffer avoids data being copied back and forth between the host machine and the virtual machine, avoiding the large amount of inefficient disk I / O or even disk I / O simulated by the virtual machine's internal software during data transfer. This achieves zero-copy data transfer, significantly improving the speed of peripheral data transfer. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this specification. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of the hardware architecture of a computing device and a target peripheral provided for one embodiment of this specification.

[0012] Figure 2 This is a schematic diagram of the structure of a computing device provided for one embodiment of this specification.

[0013] Figure 3 This is a schematic diagram of a task processing method provided for one embodiment of this specification.

[0014] Figure 4 This is a schematic diagram of the structure of a computing device provided for one embodiment of this specification. Detailed Implementation

[0015] Unless otherwise defined, the technical or scientific terms used in the embodiments of this specification shall have the ordinary meaning understood by one of ordinary skill in the art to which this specification pertains. The terms "first," "second," and similar terms used in the embodiments of this specification do not indicate any order, quantity, or importance, but are merely used to avoid confusion of constituent elements.

[0016] Unless the context otherwise requires, throughout this specification, "a plurality of" means "at least two," and "including" is interpreted as open-ended or encompassing, that is, "including, but not limited to." In the description of this specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this specification. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example.

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

[0018] Overview Peripheral devices that provide various extended functions for computing devices often rely on their accompanying drivers to function properly. Although some manufacturers have begun to provide driver support for operating systems other than Windows (such as Linux, macOS, Android, HarmonyOS, etc.) or other processor architectures (such as ARM architecture), taking peripheral devices with printing and scanning functions as an example, key hardware operations such as printing and scanning are often deeply bound to specific operating systems and underlying hardware architectures. Currently, the drivers available for these peripheral devices still only support running on x86 architecture Windows systems, which greatly limits the usage scenarios of peripheral devices.

[0019] In related technologies, cloud printing has been proposed to address this issue. This function can, to some extent, compensate for the incompatibility between peripheral device drivers and the processor architecture or operating system of computing devices, allowing printing and other operations to be initiated over the network without installing peripheral device drivers on the computing device. However, its drawbacks are also obvious: it can only connect to peripheral devices via the network and cannot do so through other means, and the cloud printing function is fixed and cannot be expanded.

[0020] To enable the normal use of peripheral devices on computing devices with any processor architecture and any operating system, a software architecture comprising a terminal program and an agent program is proposed. The terminal program can run in the host machine's first operating system, while the agent program can run in the virtual machine's second operating system. This second operating system is compatible with the target peripheral device's driver, allowing the driver to be deployed correctly within the virtual machine's second operating system. Based on this architecture, the terminal program can convert task processing requests from the host machine into task processing requests from the virtual machine, thereby enabling the agent program to utilize the virtual machine's capabilities to process the target task on the host machine. Furthermore, since the virtual machine's physical memory is essentially part of the virtual machine manager process's address space, when transferring peripheral data, the agent program can establish a buffer in the virtual address space. This allows the terminal program on the host machine to directly write data to or access data in this buffer, just like accessing ordinary memory. Therefore, by transmitting peripheral data corresponding to the target task through a buffer, the data can be avoided from being copied back and forth between the host machine and the virtual machine. This avoids a large amount of inefficient disk I / O or even disk I / O simulated by the software inside the virtual machine when transmitting data between the host machine and the virtual machine, achieving zero copy in the data transmission process and greatly improving the transmission speed of peripheral data.

[0021] Based on the above concept, the embodiments of this specification provide a task processing method. The task processing method provided by the embodiments of this specification will be described exemplarily below with reference to the accompanying drawings.

[0022] Exemplary methods Figure 1 A schematic diagram of a hardware architecture for a computing device 10 and a target peripheral 20 is shown. The computing device 10 and the target peripheral 20 can establish a communication connection via USB, serial / parallel port, or Ethernet. (Reference) Figure 2The computing device 10 may include a first operating system 10B and a virtual machine 11. The first operating system 10B deploys a terminal program 10A. The virtual machine 11 includes a second operating system 11B, an agent program 11A deployed in the second operating system 11B, and a driver for the target peripheral 20. Through specific virtualization technology, control permissions for a target peripheral 20 (such as a printer or scanner) physically connected to the host machine can be selectively granted to a designated virtual machine 11. This virtualization technology can take various forms, including but not limited to direct hardware mapping, protocol forwarding, or interface emulation, as needed. Common forms include USB pass-through. Through the above virtualization technology, the virtual machine 11 can obtain effective access and control permissions to the target peripheral 20 and load the driver or software stack of the target peripheral 20 for management.

[0023] To be applied to, for example Figure 1 and Figure 2 Taking the computing device 10 shown as an example, this specification provides a task processing method, such as... Figure 3 As shown, it includes: S301: In response to a task processing request, the agent program 11A calls the driver of the target peripheral 20 to execute the target task; The peripheral data corresponding to the target task is transmitted between the agent program 11A and the terminal program 10A through a buffer. The buffer is a storage space established by the agent program 11A in the virtual address space, and the virtual address space is the address space of the virtual machine 11 manager process of the virtual machine 11.

[0024] The target task may include at least one of text processing tasks such as printing or scanning. Correspondingly, the task processing request may include a printing or scanning request triggered by the user on the host machine, or a scanning request triggered by the user via the scan button on the target peripheral 20. This specification does not limit this; it depends on the specific circumstances. Accordingly, the target peripheral 20 includes at least one of printing and scanning functions.

[0025] The computing device 10 can be a physical host with any processor architecture and any operating system. The processor architecture can include x86, x64, ARM, and RISC-V, and the operating system can include at least one of Linux, Windows, macOS, Android, and HarmonyOS. That is, the first operating system 10B and the second operating system 11B can be any one of Linux, Windows, macOS, Android, and HarmonyOS. The second operating system 11B can be compatible with the driver of the target peripheral 20 (i.e., the second operating system 11B can support running the driver of the target peripheral 20), satisfying the need to control the target peripheral 20 by calling the driver of the target peripheral 20.

[0026] Different operating systems can have corresponding technical frameworks for operating the target peripheral 20. Taking printing or scanning devices as examples, the Windows operating system provides the Windows Image Acquisition (WIA) framework for scanning devices and the Windows Printing System for printing devices. On Linux and UNIX-like systems, the open-source CUPS (Common UNIX Printing System) has become the de facto default printing framework. The Android operating system introduces the Printing Framework, and the HarmonyOS operating system's interface SDK (interface software development kit) as technical frameworks for printing devices. These technical frameworks can provide the corresponding control interface (hereinafter referred to as the target interface) for the target peripheral 20 within the operating system.

[0027] Leveraging the compatibility between the second operating system 11B of the virtual machine 11 and the driver of the target peripheral 20, and the fact that the agent program 11A in the virtual machine 11 can communicate with the terminal program 10A in the first operating system 10B, the complexity of the underlying heterogeneous environment (such as processor architecture and operating system) can be shielded by utilizing the agent program 11A in the virtual machine 11 and the terminal program 10A in the host machine. This allows any first operating system 10B and any architecture computing device 10 to invoke the target peripheral 20 based on the framework of the terminal program 10A and the agent program 11A. Specifically, when the terminal program 10A transmits a request to the agent program 11A, it can convert the request into a request adapted to the second operating system 11B in the virtual machine 11. The agent program 11A can then respond to this request by invoking the corresponding driver of the target peripheral 20 to execute the corresponding target task. Correspondingly, the agent program 11A can transmit the status information of the target peripheral 20 (such as printing status, scanning status, whether ink is low, whether paper is low, whether paper is jammed, etc.) back to the terminal program 10A, meeting the requirement for real-time updates of the target peripheral 20's status.

[0028] The peripheral data corresponding to the target task can refer to the data that the task needs to process. In one implementation, this data may not include request, instruction, or other data. Taking a text processing task as an example, the peripheral data corresponding to the target task may include the text, images, characters, and other data that the text processing task needs to transmit. Specifically, taking a printing task as an example, the peripheral data corresponding to the target task may include the text, images, characters, and other information that needs to be printed. Taking a scanning task as an example, the peripheral data corresponding to the target task may include the scanned images and other data that need to be transmitted.

[0029] To improve the efficiency of peripheral data transfer between terminal program 10A and agent program 11A, a mechanism for transferring peripheral data corresponding to the target task based on a buffer is proposed, leveraging the fact that the "physical memory" of virtual machine 11 is essentially part of the virtual address space of the virtual machine 11 manager process on the host machine. Specifically, since the "physical memory" of virtual machine 11 is essentially part of the virtual address space of the virtual machine 11 manager process on the host machine, programs on the host machine can directly access this buffer as if it were ordinary memory, thus achieving zero-copy data transfer during task processing. Furthermore, transferring peripheral data corresponding to the target task through the buffer ensures that this data flows entirely within memory, avoiding the mechanical latency of disk I / O or the latency of flash memory writes. Moreover, peripheral data does not need to be packaged into network packets, avoiding the processing overhead of the TCP / IP protocol stack. Therefore, transferring peripheral data through a buffer created by agent program 11A can significantly improve transmission efficiency.

[0030] In summary, the task processing method provided in this embodiment is applied to a computing device 10 that has established a communication connection with a target device. The computing device 10 includes a first operating system 10B and a virtual machine 11. The first operating system 10B deploys a terminal program 10A. The virtual machine 11 includes a second operating system 11B, an agent program 11A deployed in the second operating system 11B, and a driver for the target peripheral 20. The first operating system 10B may be different from the second operating system 11B. The virtual machine 11 has control permissions over the target peripheral 20. Based on the above hardware and software architecture, when the task processing method is implemented, the agent program 11A responds to the task processing request and calls the driver for the target peripheral 20 to execute the target task. The peripheral data corresponding to the target task is transmitted between the agent program 11A and the terminal program 10A through a buffer. The buffer is a storage space established by the agent program 11A in the virtual address space, and the virtual address space is the address space of the virtual machine manager process of the virtual machine 11. Thus, by utilizing the software architecture including terminal program 10A and agent program 11A, it is possible to support the calling and control of the target peripheral 20 by a computing device 10 equipped with any first operating system 10B and any architecture, through the interaction of terminal program 10A and agent program 11A. That is, through the software architecture of terminal program 10A and agent program 11A, the complexity of the underlying heterogeneous environment (such as different processor architectures and operating systems) is shielded, allowing users to use the target peripheral 20 on a computing device 10 with any processor architecture and any first operating system 10B via agent program 11A. Furthermore, since the physical memory of virtual machine 11 is essentially part of the address space of virtual machine 11 manager process, when transferring peripheral data, agent program 11A can establish a buffer in the virtual address space, allowing terminal program 10A on the host machine to directly write data to this buffer or directly access the data in this buffer, just like accessing ordinary memory. Therefore, by transmitting peripheral data corresponding to the target task through a buffer, the data can be avoided from being copied back and forth between the host machine and the virtual machine 11. This avoids a large amount of inefficient disk I / O or even disk I / O simulated by the software inside the virtual machine 11 when transmitting data between the host machine and the virtual machine 11, achieving zero copy in the data transmission process and greatly improving the transmission speed of peripheral data.

[0031] In one embodiment, a feasible process is provided in which a terminal program 10A and an agent program 11A cooperate to perform a first task. Specifically, the task processing request includes a first task request, and the task processing method further includes: The terminal program 10A detects the first task operation, writes the first peripheral data corresponding to the first task operation into the buffer, and sends the first task request to the agent program 11A. In response to a task processing request, the agent program 11A invokes the driver program of the target peripheral 20 to perform the target task, including: In response to the first task request, the agent program 11A performs a first operation, the first operation including: reading the first peripheral data from the buffer and invoking the driver of the target peripheral 20 to instruct the target peripheral 20 to perform a first task based on the first peripheral data.

[0032] The first task request can refer to a task that requests peripheral data to be transferred from the terminal program 10A to the agent program 11A, and then to the target peripheral 20 through the driver. For example, it can include a print task. The first task request can include a print request, and the first task operation can be the user triggering the print button on the target page. After the terminal program 10A detects this operation, it can directly write the first peripheral data (such as the document, image, etc. to be printed) corresponding to the first task operation into the buffer.

[0033] In response to the first task request sent by the terminal program 10A, the agent program 11A performs the first operation to call the target peripheral 20 to perform the first task.

[0034] In one implementation, in order to achieve efficient transmission of requests, status data, etc. between terminal program 10A and agent program 11A, conventional transmission methods such as traditional network transmission and virtual I / O can be abandoned. A more efficient transmission method is proposed, which can use target registers and target instructions to realize the transmission of requests and status between terminal program 10A and agent program 11A. The target register can be used to store the metadata of the request, and the target instruction can include instructions (such as magic instructions) that do not change the processor state of the computing device 10 after execution.

[0035] Specifically, the computing device 10 further includes: a target register; The terminal program 10A sends the first task request to the agent program 11A, including: The terminal program 10A writes the metadata of the first task request into the target register and requests the virtual machine manager 11 to inject a first target instruction into the agent program 11A. The first target instruction includes an instruction that does not change the processor state of the computing device 10 after execution. In response to the first task request, the agent program 11A performs the first operation, including: The agent program 11A responds to the first target instruction and performs the first operation based on the metadata of the first task request in the target register.

[0036] The metadata for the first task request can refer to descriptive data about the first task request. Unlike content data such as peripheral data, the metadata for the first task request can refer to data that precisely describes the peripheral data and the request type of the first task request. Specifically, the metadata may include information such as the starting address of the peripheral data, the size of the peripheral data, and the request type of the task request (e.g., printing, scanning, etc.).

[0037] Processor states include, but are not limited to, the values ​​of various registers, the value of the program counter, and the state of the memory management unit, including, but not limited to, at least one of general-purpose registers and status registers.

[0038] The target register may include one or more registers of the processor in computing device 10. The first target instruction may include a magic instruction. Taking the x86 architecture as an example, the magic instruction may include: xchg bx,bx. This swap instruction swaps the value of register bx with itself, but nothing actually happens, and it does not change the state of the status register, etc. In related technologies, this magic instruction is widely used in virtualization debugging by emulators / simulators such as Intel Simics / Bochs. However, in this embodiment, the first target instruction is used for notification between agent program 11A and terminal program 10A. In conjunction with the target register, it can realize the transmission of request, status and other information between agent program 11A and terminal program 10A. Specifically, some of the processor's general-purpose registers (such as the base address register EBX and the counter register ECX) can be temporarily used as target registers to store the requested metadata. The first target instruction is inserted into the execution flow of the virtual machine 11. When the virtual machine 11 manager simulates the execution of the first target instruction, once the instruction is detected, it means that the first task request has been received. The agent program 11A can then perform the first operation, complete the process of reading the first peripheral data from the buffer and invoking the driver to execute the first task.

[0039] In this embodiment, inefficient virtualized I / O is not required to implement request transmission, thus avoiding triggering the resource-intensive VM Exit process. The overhead of detecting a specific instruction (i.e., the first target instruction) is much smaller than that of processing a complete I / O port access, which greatly reduces resource overhead. Furthermore, by using the target register to transmit metadata, notification and parameter transmission are combined into one, avoiding additional data reading operations. This greatly improves the efficiency of request transmission between the terminal program 10A and the agent program 11A and reduces transmission overhead.

[0040] Similarly, in one embodiment, a feasible process is provided in which a terminal program 10A and an agent program 11A cooperate to perform a second task. Specifically, the task processing request includes a second task request, and the task processing method further includes: The agent program 11A detects the second task operation and calls the driver program of the target peripheral 20 to receive the second peripheral data corresponding to the second task operation; The agent program 11A writes the second peripheral data into the buffer and sends a second task request to the terminal program 10A through the virtual machine manager 11. In response to the second task request, the terminal program 10A performs a second operation, which includes: reading the second peripheral data from the buffer and obtaining the file corresponding to the second task request based on the second peripheral data.

[0041] The second task request can refer to a task that requests peripheral data to be transferred from the agent program 11A to the terminal program 10A. For example, the second task request may include a scan request, the second task may include a scan task, and the second task operation may be the user's operation of triggering the scan button on the target peripheral 20. After the agent program 11A detects the operation, it can directly write the second peripheral data (such as scanned image data) corresponding to the second task operation into the buffer.

[0042] Accordingly, the agent program 11A sends a second task request to the terminal program 10A through the virtual machine manager 11, including: The agent program 11A writes the metadata of the second task request into the target register and executes the second target instruction; The virtual machine manager detects that the second target instruction has been executed and sends the second task request to the terminal program 10A; In response to the second task request, the terminal program 10A performs the second operation, including: In response to the second task request, the terminal program 10A performs the second operation based on the metadata of the second task request in the target register.

[0043] Similarly, in this embodiment, the second target instruction can be the same as the first target instruction. Through the cooperation of the second target instruction and the target register, the second task request is efficiently transmitted between the terminal program 10A and the agent program 11A, which greatly reduces the communication overhead between the terminal program 10A and the agent program 11A and helps to improve the execution efficiency of the method.

[0044] To enable users to monitor the status of the target peripheral 20 and / or the processing progress of tasks in real time on the target interface, in one embodiment, the task processing method further includes: The agent program 11A receives status information returned by the driver of the target peripheral 20, the status information being used to characterize at least one of the current status of the target peripheral 20 and the execution status information of the target task. The agent program 11A returns the status information to the terminal program 10A through the virtual machine 11 manager; Based on the status information, the terminal program 10A updates the information displayed in the target interface, which includes the human-computer interaction interface provided by the first operating system 10B.

[0045] In this embodiment, the interaction between the agent program 11A and the terminal program 10A enables real-time feedback and updating of status information, allowing users to obtain relevant status information in real time based on the target interface.

[0046] Specifically, in one embodiment, the computing device 10 further includes a target register, wherein the agent program 11A returns the status information to the terminal program 10A through the virtual machine manager 11, including: The agent program 11A writes the metadata of the state update request and the state information into the target register and executes the third target instruction, which includes an instruction that does not change the processor state of the computing device 10 after execution. The virtual machine manager detects that the third target instruction has been executed and notifies the terminal program 10A to execute the status update request. Based on the status information, the terminal program 10A updates the information displayed on the target interface, including: In response to the status update request, the terminal program 10A reads the status information from the target register based on the metadata of the status update request, and updates the information displayed on the target interface according to the status information.

[0047] The third target instruction can be the same as the first target instruction or the second target instruction. Similarly, in this embodiment, by cooperating with the target register, the traditional means such as virtual I / O are avoided in the communication between the terminal program 10A and the agent program 11A, which greatly reduces the communication overhead between the terminal program 10A and the agent program 11A and helps to improve the execution efficiency of the method.

[0048] Exemplary device In one exemplary embodiment of this specification, a task processing apparatus is also provided, applied to a computing device 10, the computing device 10 establishing a communication connection with a target peripheral device 20. The computing device 10 includes a first operating system 10B and a virtual machine 11. A terminal program 10A is deployed in the first operating system 10B. The virtual machine 11 includes a second operating system 11B, an agent program 11A deployed in the second operating system 11B, and a driver for the target peripheral device 20. The virtual machine 11 has control permissions over the target peripheral device 20. The task processing apparatus includes: In the first module, the agent program 11A responds to a task processing request by calling the driver program of the target peripheral 20 to execute the target task; The peripheral data corresponding to the target task is transmitted between the agent program 11A and the terminal program 10A through a buffer. The buffer is a storage space established by the agent program 11A in the virtual address space, and the virtual address space is the address space of the virtual machine 11 manager process of the virtual machine 11.

[0049] For specific limitations regarding the task processing device, please refer to the limitations regarding the task processing method above, which will not be repeated here. Each module in the aforementioned task processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.

[0050] Exemplary computing device 10 Another embodiment of this application also proposes a computing device 10, see [link to relevant documentation] Figure 2 As shown, an exemplary embodiment of this specification also provides a computing device 10, which establishes a communication connection with a target peripheral 20. The computing device 10 includes a first operating system 10B and a virtual machine 11. A terminal program 10A is deployed in the first operating system 10B. The virtual machine 11 includes a second operating system 11B, an agent program 11A deployed in the second operating system 11B, and a driver for the target peripheral 20. The virtual machine 11 has control over the target peripheral 20, wherein: The agent program 11A is configured to: in response to a task processing request, invoke the driver of the target peripheral 20 to execute the target task; The peripheral data corresponding to the target task is transmitted between the agent program 11A and the terminal program 10A through a buffer. The buffer is a storage space established by the agent program 11A in the virtual address space, and the virtual address space is the address space of the virtual machine 11 manager process of the virtual machine 11.

[0051] Accordingly, another embodiment of this application also proposes a computing device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the steps of the task processing methods according to various embodiments of this specification described in the above embodiments.

[0052] The internal structure of the computing device can be as follows: Figure 4 As shown, the computing device includes a processor, memory, network interface, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it follows the steps of the task processing methods according to various embodiments of this specification as described in the above embodiments.

[0053] The processor may include the main processor, as well as baseband chips, modems, etc.

[0054] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0055] It is understood that the memory in the embodiments of this specification may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0056] Input devices may include devices that receive data and information input by the user, such as keyboards, mice, cameras, scanners, light pens, voice input devices, touch screens, pedometers, or gravity sensors.

[0057] Output devices may include devices that allow information to be output to the user, such as displays, printers, speakers, etc.

[0058] The communication interface may include any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0059] The computing device may also include a display component and a voice component. The display component may be a liquid crystal display screen or an e-ink display screen. The input device of the computing device may be a touch layer covering the display component, or a button, trackball or touchpad set on the casing of the computing device, or an external keyboard, touchpad or mouse, etc.

[0060] Those skilled in the art will understand that Figure 4 The structures shown are merely block diagrams of some structures related to the solutions in this specification and do not constitute a limitation on the computing devices on which the solutions in this specification are applied. Specific computing devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.

[0061] Exemplary computer program products and storage media In addition to the methods and devices described above, the task processing methods provided in the embodiments of this specification can also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the task processing methods according to various embodiments of this specification as described in the "Exemplary Methods" section above.

[0062] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0063] The computer program product described herein can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments described herein. These programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0064] Furthermore, embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor of the steps in the task processing methods according to various embodiments of this specification as described in the "Exemplary Methods" section above.

[0065] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this specification can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may 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), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0066] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0067] The embodiments described above are merely illustrative of several implementation methods outlined in this specification. While the descriptions are specific and detailed, they should not be construed as limiting the scope of the solutions provided in this specification. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this specification, and these all fall within the scope of protection of this specification. Therefore, the scope of protection for this patent should be determined by the appended claims.

Claims

1. A task processing method, characterized in that, Applied to a computing device, the computing device establishes a communication connection with a target peripheral device. The computing device includes a first operating system and a virtual machine. The first operating system deploys a terminal program, and the virtual machine includes a second operating system, an agent program deployed in the second operating system, and a driver for the target peripheral device. The virtual machine has control permissions over the target peripheral device. The task processing method includes: In response to a task processing request, the agent program invokes the driver program of the target peripheral to execute the target task; The peripheral data corresponding to the target task is transmitted between the agent program and the terminal program through a buffer. The buffer is a storage space established by the agent program in the virtual address space, and the virtual address space is the address space of the virtual machine's virtual machine manager process.

2. The method according to claim 1, characterized in that, The task processing request includes a first task request, and the task processing method further includes: The terminal program detects the first task operation, writes the first peripheral data corresponding to the first task operation into the buffer, and sends the first task request to the agent program. In response to a task processing request, the agent program invokes the driver program of the target peripheral to execute the target task, including: In response to the first task request, the agent program performs a first operation, which includes: reading the first peripheral data from the buffer and invoking the driver of the target peripheral to instruct the target peripheral to perform a first task based on the first peripheral data.

3. The method according to claim 2, characterized in that, The computing device further includes: a target register; The terminal program sends the first task request to the agent program including: The terminal program writes the metadata of the first task request into the target register and requests the virtual machine manager to inject a first target instruction into the agent program. The first target instruction includes an instruction that does not change the processor state of the computing device after execution. The agent program, in response to the first task request, performs the first operation, including: The agent program responds to the first target instruction and performs the first operation based on the metadata of the first task request in the target register.

4. The method according to claim 1, characterized in that, The task processing request includes a second task request, and the task processing method further includes: The agent program detects the second task operation and calls the driver of the target peripheral to receive the second peripheral data corresponding to the second task operation; The agent program writes the second peripheral data into the buffer and sends a second task request to the terminal program through the virtual machine manager; In response to the second task request, the terminal program performs a second operation, which includes: reading the second peripheral data from the buffer and obtaining the file corresponding to the second task request based on the second peripheral data.

5. The method according to claim 4, characterized in that, The computing device further includes: a target register; the agent program sending a second task request to the terminal program through the virtual machine manager includes: The agent program writes the metadata of the second task request into the target register and executes the second target instruction; The virtual machine manager detects that the second target instruction has been executed and sends the second task request to the terminal program; The terminal program, in response to the second task request, performs the second operation, including: In response to the second task request, the terminal program performs the second operation based on the metadata of the second task request in the target register.

6. The method according to any one of claims 1 to 5, characterized in that, The task processing method further includes: The agent program receives status information returned by the driver of the target peripheral device, the status information being used to characterize at least one of the current status of the target peripheral device and the execution status information of the target task. The agent program returns the status information to the terminal program through the virtual machine manager; The terminal program updates the information displayed on the target interface based on the status information, and the target interface includes the human-computer interaction interface provided by the first operating system.

7. The method according to claim 6, characterized in that, The computing device further includes a target register, and the agent program returns the status information to the terminal program through the virtual machine manager, including: The agent program writes the metadata of the state update request and the state information into the target register, and executes the third target instruction, which includes instructions that do not change the processor state of the computing device after execution. The virtual machine manager detects that the third target instruction has been executed and notifies the terminal program to execute the status update request. Based on the status information, the terminal program updates the information displayed on the target interface, including: In response to the status update request, the terminal program reads the status information from the target register based on the metadata of the status update request, and updates the information displayed on the target interface according to the status information.

8. The method according to any one of claims 1 to 5, characterized in that, The target peripheral device includes at least one of printing and scanning functions, and the target task includes at least one of printing and scanning tasks.

9. A computing device, characterized in that, The computing device establishes a communication connection with the target peripheral. The computing device includes a first operating system and a virtual machine. The first operating system deploys a terminal program. The virtual machine includes a second operating system, an agent program deployed in the second operating system, and a driver for the target peripheral. The virtual machine has control permissions over the target peripheral, wherein: The agent is configured to: in response to a task processing request, invoke the driver of the target peripheral to execute the target task; The peripheral data corresponding to the target task is transmitted between the agent program and the terminal program through a buffer. The buffer is a storage space established by the agent program in the virtual address space, and the virtual address space is the address space of the virtual machine's virtual machine manager process.

10. A task processing system, characterized in that, include: A computing device and a target peripheral device, wherein the computing device is the computing device as described in claim 9.

11. A storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the task processing method according to any one of claims 1 to 8.

12. A computer program product, characterized in that, The computer program product includes a computer program, which, when executed by a processor, implements the task processing method as described in any one of claims 1 to 8.