Parallel port redirection method, device, system and storage medium
By deploying parallel port redirection services on the cloud desktop client and server side, synchronizing parallel port status and realizing forwarding of parallel port operation commands, the problems of parallel port device connection status query and synchronization in the existing technology are solved, and the simultaneousness of cloud desktop and local terminals are realized by realizing the simultaneousness of cloud desktop and local terminals The functions of using parallel devices have improved the user experience.
Patent Information
- Application Number
- CN202111239348.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-10-25
AI Technical Summary
The existing parallel port redirection technology cannot support query and synchronization of parallel port device connection status, resulting in poor user experience when using parallel port devices at the same time on cloud desktop and local terminals. The existing technology has limitations on the use of parallel port devices and cannot cover it. All parallel devices.
By deploying parallel port redirection services on the cloud desktop client and server side, monitoring parallel port status changes in real time, and synchronizing status information to the cloud desktop server side, establishing a mapping relationship between parallel port and virtual parallel port, realizing the forwarding of parallel port operation commands and Feedback of execution results adopts a time-sharing multiplexing mechanism to support multi-terminal sharing of parallel devices.
It realizes the use of all parallel port devices in the cloud desktop, synchronizes parallel port status information, solves the technical problem of parallel port devices being used in multiple places, and enhances the user experience.
Smart Images

Figure CN114168257B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a parallel port redirection method, device, system and storage medium. Background Art
[0002] With the development of network technology and virtualization technology, in order to achieve centralized data control and unified resource scheduling, more and more units, enterprises and schools use cloud desktops provided by virtual desktop infrastructure (VDI) for government affairs processing and daily office work. In these scenarios, there are many printer devices with only parallel ports, such as receipt printers, etc. Therefore, using parallel port printer devices in cloud desktops has become an urgent need for users.
[0003] The parallel port protocol itself does not maintain the device connection status, but the Windows system allocates a memory for each parallel port to record the device status. Some special software for parallel port printers will detect whether the current parallel port connection status is normal and whether the printer device is connected after opening. If the correct connection status cannot be read, the special software for the parallel port printer will not work properly. The existing parallel port redirection technology cannot support the query of the parallel port device connection status.
[0004] At the same time, in some office scenarios, users need to use parallel port printers on both local terminals and cloud desktops. However, the existing parallel port redirection technology has long-term exclusive use of parallel ports. When used on a local terminal, it cannot be used on the cloud desktop, and vice versa. Such back-and-forth switching leads to a very poor user experience.
[0005] Printer redirection technology intercepts and forwards the print commands issued by the application software to the terminal's printer through the printer protocol at the application layer, without requiring the terminal to exclusively own the printer device. Printer redirection technology allows cloud desktops and terminals to share printer devices. However, printer redirection technology is targeted at printer-type devices, while parallel ports can be connected to printers and other peripherals, such as parallel port disks and parallel port plotters. Therefore, printer redirection has obvious limitations and cannot cover all parallel port devices.
[0006] The parallel port redirection technology solution based on the parallel port protocol has no synchronization function specifically for the device connection status of the parallel port, so the server-side application software cannot query the parallel port status and cannot obtain the correct status value, which may cause the parallel port software to be unusable.
[0007] If you use a USB-to-parallel cable to connect a parallel port device, use USB redirection to redirect the USB-to-parallel cable to the cloud desktop, and replace the parallel port connection information with the USB connection information. This method is not suitable for office scenarios with high security requirements. In places where the use of USB interfaces is prohibited, the USB-to-parallel cable solution cannot be used, and only the terminal's native parallel port can be used. In addition, since the use of a USB-to-parallel cable requires two more data conversions, the reliability is not as good as directly using the native parallel port. At the same time, USB redirection is exclusive. After the parallel port device is redirected to the cloud desktop, it cannot be used on the local terminal. Devices such as parallel port printers that need to be used in multiple places will be limited by the use of USB redirection. Summary of the invention
[0008] In view of this, the present invention provides a parallel port redirection method, device, system and storage medium for solving the technical problem of cloud desktops and terminal devices using a common parallel port in a virtual desktop infrastructure framework.
[0009] Based on one aspect of an embodiment of the present invention, the present invention provides a parallel port redirection method, which is applied to a local terminal where a cloud desktop client is located, and a client parallel port redirection service is arranged in the local terminal, and the method includes:
[0010] The client parallel port redirection service obtains the parallel port information on the local terminal and sends the parallel port information to the cloud desktop server, so that the cloud desktop server establishes a mapping relationship between the parallel port in the local terminal and the virtual parallel port on the cloud desktop server;
[0011] The client parallel port redirection service monitors the changes in the parallel port status on the local terminal in real time, and synchronizes the parallel port status information to the cloud desktop server in real time;
[0012] When the client parallel port redirection service receives the parallel port operation command sent by the cloud desktop server, it sends the parallel port operation command to the parallel port driver of the local terminal for execution, and feeds back the execution result to the cloud desktop server.
[0013] Furthermore, when the parallel port operation command sent by the cloud desktop server and received by the client parallel port redirection service is a parallel port opening operation command, the method further includes:
[0014] The client parallel port redirection service determines whether the parallel port specified by the parallel port opening operation command is occupied by a parallel port application on the local terminal;
[0015] When the parallel port is occupied, the client parallel port redirection service caches the parallel port opening operation command sent by the server, and caches subsequent read / write operation commands for the same parallel port;
[0016] When the parallel port is not occupied, the client parallel port redirection service sends the cached parallel port opening operation command and the read and write operation command for the same parallel port;
[0017] When the client parallel port redirection service receives an operation command for refreshing the parallel port cache sent by the cloud desktop server, the parallel port specified by the command is closed.
[0018] Based on one aspect of an embodiment of the present invention, the present invention provides a parallel port redirection device, which is applied to a local terminal where a cloud desktop client is located, and the device includes:
[0019] The parallel port mapping module is used to obtain the parallel port information on the local terminal and send the parallel port information to the cloud desktop server so that the cloud desktop server can establish a mapping relationship between the parallel port in the local terminal and the virtual parallel port on the cloud desktop server;
[0020] The status synchronization module is used to monitor the changes of the parallel port status on the local terminal in real time and synchronize the parallel port status information to the cloud desktop server in real time;
[0021] The command processing module is used to send the parallel port operation command to the parallel port driver of the local terminal for execution when receiving the parallel port operation command sent by the cloud desktop server, and feed back the execution result to the cloud desktop server.
[0022] Furthermore, the device also includes:
[0023] A judgment module, used for judging whether the parallel port specified by the parallel port opening operation command is occupied by a parallel port application on the local terminal when the parallel port operation command sent by the cloud desktop server is an open parallel port operation command;
[0024] The time-sharing processing module is used to cache the parallel port opening operation command sent by the server when the parallel port is occupied, and cache the subsequent read / write operation commands for the same parallel port; when the parallel port is not occupied, send the cached parallel port opening operation command and the read / write operation command for the same parallel port;
[0025] The refresh module is used to close the parallel port specified by the command when receiving an operation command for refreshing the parallel port cache sent by the cloud desktop server.
[0026] Based on one aspect of an embodiment of the present invention, the present invention further provides a parallel port redirection method, which is applied to a cloud desktop server, and the method includes:
[0027] When the server-side parallel port redirection service receives the parallel port information sent by the client-side parallel port redirection service, a mapping relationship between the parallel port in the local terminal where the cloud desktop client is located and the virtual parallel port on the cloud desktop server is established;
[0028] When the server-side parallel port redirection service receives the parallel port status information sent by the client-side parallel port redirection service, it updates the status of the local corresponding virtual parallel port based on the mapping relationship;
[0029] When the server-side parallel port redirection service receives the parallel port operation command sent by the virtual parallel port bus driver, it forwards the parallel port operation command to the client-side parallel port redirection service, so that the client-side parallel port redirection service sends it to the parallel port mapped by the virtual parallel port for execution.
[0030] Furthermore, the parallel port operation command includes an operation command for opening the parallel port, a read / write operation command, and an operation command for refreshing the parallel port cache;
[0031] When the server-side parallel port redirection service receives the execution result of the parallel port operation command from the client-side parallel port redirection service, the execution result is written into the corresponding virtual parallel port so that the parallel port application can read the execution result;
[0032] When the server-side parallel port redirection service receives an operation command to refresh the parallel port cache from the virtual parallel port bus driver, the operation command to refresh the parallel port cache is forwarded to the client-side parallel port redirection service, so that the local terminal where the cloud desktop client is located closes the parallel port specified by the command.
[0033] Based on one aspect of an embodiment of the present invention, the present invention further provides a parallel port redirection device, which is applied to a cloud desktop server, and includes:
[0034] The virtual parallel port mapping module is used to receive the parallel port information sent by the client parallel port redirection service and establish a mapping relationship between the parallel port in the local terminal where the cloud desktop client is located and the virtual parallel port on the cloud desktop server;
[0035] The virtual parallel port status synchronization module is used to receive the parallel port status information sent by the client parallel port redirection service, and update the status of the local corresponding virtual parallel port based on the mapping relationship;
[0036] The virtual parallel port command processing module is used for forwarding the parallel port operation command to the client parallel port redirection service when receiving the parallel port operation command sent by the virtual parallel port bus driver, so that the client parallel port redirection service sends it to the parallel port mapped by the virtual parallel port for execution.
[0037] Furthermore, the parallel port operation command includes an operation command for opening the parallel port, a read / write operation command, and an operation command for refreshing the parallel port cache;
[0038] When the virtual parallel port command processing module receives the execution result of the parallel port operation command fed back by the client parallel port redirection service, the execution result is written into the corresponding virtual parallel port so that the parallel port application can read the execution result;
[0039] When the virtual parallel port command processing module receives an operation command for refreshing the parallel port cache sent from the virtual parallel port bus driver, it forwards the operation command for refreshing the parallel port cache to the client parallel port redirection service, so that the local terminal where the cloud desktop client is located closes the parallel port specified by the command.
[0040] Based on one aspect of an embodiment of the present invention, the present invention provides a parallel port redirection system, the system comprising a client parallel port redirection service located in a local terminal where a cloud desktop client is located and a server parallel port redirection service located at a cloud desktop server;
[0041] The client-side parallel port redirection service obtains the parallel port information on the local terminal and sends the parallel port information to the server-side parallel port redirection service. The server-side parallel port redirection service establishes a mapping relationship between the parallel port in the local terminal and the virtual parallel port according to the parallel port information.
[0042] The client-side parallel port redirection service monitors the changes in the parallel port status on the local terminal in real time, and synchronizes the parallel port status information to the server-side parallel port redirection service in real time; the server-side parallel port redirection service updates the status of the local corresponding virtual parallel port based on the mapping relationship;
[0043] When the server-side parallel port redirection service receives the parallel port operation command sent by the virtual parallel port bus driver, it forwards the parallel port operation command to the client-side parallel port redirection service; when the client-side parallel port redirection service receives the parallel port operation command sent by the server-side parallel port redirection service, it sends the parallel port operation command to the parallel port driver of the local terminal for execution, and feeds back the execution result to the server-side parallel port redirection service.
[0044] In the present invention, a client-side parallel port redirection service is deployed in the local terminal where the cloud desktop is located, and a server-side parallel port redirection service is deployed on the cloud desktop server. The redirection of the parallel port protocol and the synchronization of the parallel port status information are realized through the two redirection services. In addition, by adopting a time-division multiplexing mechanism on the local terminal side, the parallel port applications in the cloud desktop and the local terminal can use the parallel port on the local terminal. The present invention can realize the use of all parallel port devices in the cloud desktop, realize the synchronization of parallel port status information, and further solve the technical problem of sharing parallel port devices at both ends. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments of the present invention or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present invention.
[0046] Figure 1A schematic diagram of a parallel port redirection framework structure provided by an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of the steps for implementing real-time query of the status of a parallel port device in a parallel port redirection method provided in an embodiment of the present invention;
[0048] Figure 3 A schematic diagram of a time-division multiplexing method for parallel port devices provided by an embodiment of the present invention;
[0049] Figure 4 A schematic diagram of the structure of a parallel port redirection device located at a local terminal provided by an embodiment of the present invention;
[0050] Figure 5 A schematic diagram of the structure of a parallel port redirection device located at a cloud desktop server provided by an embodiment of the present invention;
[0051] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, rather than limiting the embodiments of the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings. The term "and / or" used in the present invention refers to any or all possible combinations of one or more associated listed items.
[0053] It should be understood that although the terms first, second, third, etc. may be used to describe various information in embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of embodiments of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "at the time of" or "when" or "in response to determining".
[0054] The purpose of the present invention is to provide a cloud desktop parallel port redirection method, which solves the need for all parallel port devices to be used in the cloud desktop through the parallel port redirection technology. The basic idea of the present invention is to deploy parallel port redirection services on both ends of the local terminal device where the cloud desktop terminal is located and the cloud desktop server, so as to realize the redirection of the parallel port protocol and the synchronization of the parallel port status information, and realize the function of the cloud desktop and the parallel port applications in the local terminal to use the parallel port on the local terminal together by adopting the mechanism of time-sharing multiplexing.
[0055] Figure 1A schematic diagram of a parallel port redirection framework structure provided by an embodiment of the present invention. Based on the parallel port redirection framework provided by the present invention, it is necessary to install a virtual parallel port driver on the cloud desktop server in the virtual desktop infrastructure and install a virtual parallel port bus driver at the same time. The cloud desktop server can correspond to a virtual machine or container that provides virtual desktop services to users in the virtual desktop infrastructure.
[0056] The virtual parallel port driver mainly completes the functions related to the parallel port protocol. The virtual parallel port bus driver is used to create a virtual parallel port instance and maintain information such as the connection status of the virtual parallel port. On the server side, the kernel layer will virtualize the corresponding virtual parallel port according to the physical parallel port configuration on the terminal device (referred to as the local terminal) where the cloud desktop client is located.
[0057] In the parallel port redirection framework provided by the embodiment of the present invention, a server-side parallel port redirection service and a client-side parallel port redirection service are deployed on the server and the client, respectively.
[0058] In order to enable the parallel port application in the cloud desktop to use the parallel port device on the local terminal side, it is first necessary to establish a mapping relationship between the parallel port on the local terminal and the virtual parallel port in the cloud desktop. The mapping relationship establishment process is as follows:
[0059] Step 101. The client parallel port redirection service enumerates the parallel ports on the local terminal and obtains the parallel port information on the local terminal. The parallel port information may include the parallel port serial number, the parallel port unique identifier and the parallel port connection status, etc.;
[0060] Step 102: The client-side parallel port redirection service sends the parallel port information to the server-side parallel port redirection service through the cloud desktop client;
[0061] Step 103. The server-side parallel port redirection service sends the received parallel port information to the virtual parallel port bus driver;
[0062] Step 104: The virtual parallel port bus driver establishes a mapping relationship between the local virtual parallel port and the parallel port on the local terminal side based on the parallel port information.
[0063] Usually, when installing a virtual parallel port bus driver, one or more virtual parallel port instances will be automatically created according to the configuration information. When the cloud desktop client is connected to the virtual machine, the client parallel port redirection service reports the parallel port information on the local terminal to the server parallel port redirection service in the virtual machine through the cloud desktop client, and the server parallel port redirection service sends the parallel port information to the virtual parallel port bus driver, which establishes a mapping relationship between the parallel port on the local terminal and the virtual parallel port on the cloud desktop server.
[0064] Each virtual parallel port maintains the connection status information of the parallel port on the terminal device mapped by the virtual parallel port, and records the device connection status of the parallel port corresponding to the local terminal and other information.
[0065] Take the Windows operating system as an example. In the Windows operating system, a fixed memory segment (hereinafter referred to as the parallel port memory segment) is allocated to each parallel port. One of the functions of the parallel port memory segment is to describe the device connection status of the parallel port. The application software can obtain the device connection status of the corresponding parallel port by querying the parallel port status information in the parallel port memory segment. However, this parallel port status information has nothing to do with the parallel port protocol itself. Therefore, simply redirecting the parallel port protocol message cannot realize the function of querying the parallel port device connection status on the cloud desktop client on the server side.
[0066] The client parallel port redirection service in the local terminal will monitor the device connection status of each parallel port on the local terminal in real time. When a device is connected / disconnected to the parallel port of the local terminal, its device status will be passed by the parallel port redirection service on the local terminal to the server parallel port redirection service of the cloud desktop. The server parallel port redirection service will update the device connection status of the virtual parallel port that has a mapping relationship with the parallel port in the cloud desktop client, and synchronously write it to the memory allocated by the Windows operating system for the virtual parallel port, namely the virtual parallel port memory segment.
[0067] Figure 2 A schematic diagram of the steps of implementing real-time query of the status of a parallel port device in a parallel port redirection method provided in an embodiment of the present invention.
[0068] Step S1. When the physical parallel port device on the local terminal is powered on, the status of the parallel port 1 to which the parallel port device is connected is updated to the connected status;
[0069] Step S2. The client parallel port redirection service monitors the device connection status of each parallel port on the local terminal in real time;
[0070] The client parallel port redirection service can monitor the status of parallel port 1 in real time by polling the parallel port memory segment of parallel port 1 in the local terminal.
[0071] Step S3. When the client parallel port redirection service monitors the status change of parallel port 1, the client parallel port redirection service sends the status information of parallel port 1 to the server parallel port redirection service, and the status information includes at least the unique identifier of parallel port 1 and the parallel port status;
[0072] Step S4. The server-side parallel port redirection service finds the virtual parallel port 1 that has a mapping relationship with the parallel port 1 according to the unique identifier of the parallel port 1, and updates the status information in the virtual parallel port memory segment of the virtual parallel port 1 in the cloud desktop server;
[0073] Step S5. When the virtual parallel port device driver in the cloud desktop server intercepts the operation command of the parallel port application software in the cloud desktop to read the status of the virtual parallel port 1, the status information in the memory segment of the virtual parallel port 1 is read, and the read status information is returned to the parallel port application software in the cloud desktop;
[0074] When you open a parallel port application software in the cloud desktop, such as a parallel port printer software, the virtual parallel port device driver will intercept the command to read the device connection status sent by the application layer, and will return the read virtual parallel port status information to the parallel port application based on the parallel port status information in the virtual parallel port memory segment.
[0075] Through the above steps, it is possible to provide real-time device connection status information for parallel port devices in the Windows system, solving the problem that some parallel port devices cannot be used in the cloud desktop. For other types of operating systems, the overall idea is the same and will not be repeated here.
[0076] Step S6. After the parallel port application software of the cloud desktop server obtains the connection status of the virtual parallel port, it can issue an operation command for the virtual parallel port 1 (such as an operation command to write data);
[0077] Step S7. The virtual parallel port driver intercepts the operation command, performs protocol encapsulation on the operation command, and then forwards it to the virtual parallel port bus driver, which then forwards the operation command to the server-side parallel port redirection service.
[0078] The operation command encapsulated by the virtual parallel port driver should carry the unique identifier of the parallel port 1 on the local terminal side to which the virtual parallel port 1 is mapped.
[0079] Step S8. The server-side parallel port redirection service forwards the operation command to the client-side parallel port redirection service;
[0080] Step S9. The client parallel port redirection service sends the operation command to the parallel port driver on the local terminal, and the parallel port driver executes the operation command for parallel port 1;
[0081] When the operation command is to read the parallel port data, the read parallel port data will be returned to the server-side parallel port redirection service as a response message according to the transmission path of the operation command, and forwarded to the virtual parallel port bus driver by the server-side parallel port redirection service. Then, the virtual parallel port driver writes the parallel port data into the storage space of the virtual parallel port 1, and the server-side parallel port application software can read the required parallel port data from the virtual parallel port 1. Through the above-mentioned parallel port operation command redirection processing process, the parallel port application software can believe that the operation is a real physical parallel port device.
[0082] In order to solve the problem that conflicts may occur when using a parallel port device on a local terminal device and in a cloud desktop at the same time, the present invention proposes a time-division multiplexing solution. Figure 3 A schematic diagram of a time-division multiplexing method for a parallel port device provided in an embodiment of the present invention, the method comprising:
[0083] Step 301: After the client parallel port redirection service receives the parallel port opening operation command sent by the server parallel port redirection service, the parallel port opening operation command is cached and is not immediately sent to the parallel port driver on the local terminal;
[0084] After redirecting the parallel port of the local terminal, if the parallel port application in the cloud desktop sends an operation command to open the virtual parallel port to the virtual parallel port driver, the virtual parallel port driver forwards the operation command to open the virtual parallel port to the server-side parallel port redirection service, and the server-side parallel port redirection service sends the operation command to open the parallel port to the parallel port redirection service of the local terminal based on the mapping relationship. After the client-side parallel port redirection service receives the operation command to open the parallel port, it first determines whether the corresponding parallel port on the current local terminal is occupied by the parallel port application on the local terminal, and performs different processing based on the occupation status.
[0085] Step 302. The client parallel port redirection service determines whether the parallel port specified by the parallel port opening operation command is currently occupied by a parallel port application on the local terminal. If so, step 303 is executed; otherwise, step 304 is executed.
[0086] Step 303: When the parallel port is occupied, the client parallel port redirection service caches the parallel port opening operation command sent by the server, and caches subsequent read and write operation commands for the same parallel port until the parallel port application of the local terminal no longer occupies the corresponding parallel port;
[0087] Step 304: When the parallel port is not occupied, the client parallel port redirection service sends the parallel port opening operation command sent by the server, and caches the read / write operation command that has been sent for the same parallel port.
[0088] For example, when the parallel port application in the cloud desktop performs a read or write operation on the parallel port, the parallel port redirection service program of the local terminal will first detect whether the parallel port is currently occupied. If there is no data reading or writing on the parallel port, it means that there is no parallel port application on the local terminal using the parallel port. At this time, the previously cached parallel port opening operation command will be sent and subsequent read / write operation commands will be executed.
[0089] Step 305: When the parallel port application in the cloud desktop server completes the parallel port read and write operations, it will issue an operation command to refresh the parallel port cache. After the parallel port redirection service of the local terminal receives this command, it executes a command to close the parallel port.
[0090] Following the same principle, if the current server-side parallel port application is occupying the parallel port of the local terminal, the parallel port application on the local terminal can first cache the parallel port opening command and read / write operation commands, and wait for the server-side parallel port application to send an operation command to refresh the parallel port cache. The client-side parallel port redirection service then closes the parallel port on the local terminal specified by the command according to the operation command to refresh the parallel port cache.
[0091] Through the above method, the local terminal and the server can realize the function of using the parallel port device on the local terminal alternately in time sharing, so as to solve the problem of using the parallel port device on the local terminal and the cloud desktop at the same time.
[0092] Through the parallel port redirection method provided by the present invention, the parallel port application software can operate the parallel port device in the cloud desktop and query the device connection status of the parallel port on the local terminal; at the same time, it supports users to use the same parallel port device at different times in the same time period of the local terminal and the cloud desktop, thereby enhancing the user experience of using peripherals for office work in the cloud desktop.
[0093] Figure 4 This is a schematic diagram of the structure of a parallel port redirection device located at a local terminal provided by an embodiment of the present invention. Each functional module in the device 400 can be implemented by software, hardware, or a combination of software and hardware. The device 400 is applied to the local terminal where the cloud desktop client is located, corresponding to the client parallel port redirection service, and the device 400 includes:
[0094] The parallel port mapping module 401 is used to obtain the parallel port information on the local terminal and send the parallel port information to the cloud desktop server so that the cloud desktop server can establish a mapping relationship between the parallel port in the local terminal and the virtual parallel port on the cloud desktop server;
[0095] The status synchronization module 402 is used to monitor the changes of the parallel port status on the local terminal in real time and synchronize the parallel port status information to the cloud desktop server in real time;
[0096] The command processing module 403 is used to send the parallel port operation command to the parallel port driver of the local terminal for execution when receiving the parallel port operation command sent by the cloud desktop server, and feed back the execution result to the cloud desktop server.
[0097] In order to realize the function of the cloud desktop and the parallel port application software on the local terminal using the parallel port together, the device 400 may also include: a judgment module, a time-sharing processing module and a refresh module.
[0098] The judging module is used for judging whether the parallel port specified by the parallel port opening operation command is occupied by the parallel port application on the local terminal when the parallel port opening operation command sent by the cloud desktop server is a parallel port opening operation command;
[0099] The time-sharing processing module is used to cache the parallel port opening operation command sent by the server when the parallel port is occupied, and cache the subsequent read / write operation commands for the same parallel port; when the parallel port is not occupied, send the cached parallel port opening operation command and the read / write operation command for the same parallel port;
[0100] The refresh module is used to close the parallel port specified by the command when receiving an operation command for refreshing the parallel port cache sent by the cloud desktop server.
[0101] Figure 5 This is a schematic diagram of the structure of a parallel port redirection device located at a cloud desktop server provided by an embodiment of the present invention. Each functional module in the device 500 can be implemented by software, hardware, or a combination of software and hardware. The device 500 is applied to the cloud desktop server, corresponding to the server-side parallel port redirection service, and includes:
[0102] The virtual parallel port mapping module 501 is used to receive the parallel port information sent by the client parallel port redirection service, and establish a mapping relationship between the parallel port in the local terminal where the cloud desktop client is located and the virtual parallel port on the cloud desktop server;
[0103] The virtual parallel port status synchronization module 502 is used to receive the parallel port status information sent by the client parallel port redirection service, and update the status of the local corresponding virtual parallel port based on the mapping relationship;
[0104] The virtual parallel port command processing module 503 is used to forward the parallel port operation command to the client parallel port redirection service when receiving the parallel port operation command sent by the virtual parallel port bus driver, so that the client parallel port redirection service sends it to the parallel port mapped by the virtual parallel port for execution.
[0105] Furthermore, the parallel port operation command includes an operation command for opening the parallel port, a read / write operation command, and an operation command for refreshing the parallel port cache;
[0106] When the virtual parallel port command processing module receives the execution result of the parallel port operation command fed back by the client parallel port redirection service, the execution result is written into the corresponding virtual parallel port so that the parallel port application can read the execution result;
[0107] When the virtual parallel port command processing module receives an operation command for refreshing the parallel port cache sent from the virtual parallel port bus driver, it forwards the operation command for refreshing the parallel port cache to the client parallel port redirection service, so that the local terminal where the cloud desktop client is located closes the parallel port specified by the command.
[0108] Figure 6This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, and the device 600 includes: a processor 610 such as a central processing unit (CPU), a communication bus 620, a communication interface 640, and a storage medium 630. The processor 610 and the storage medium 630 can communicate with each other through the communication bus 620. The storage medium 630 stores a computer program, and when the computer program is executed by the processor 610, the function of each step of the method provided by the present invention can be realized.
[0109] Among them, the storage medium may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. In addition, the storage medium may also be at least one storage device located away from the aforementioned processor. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0110] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory memory. The method may be implemented in a computer program using standard programming techniques, including a non-transitory storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner. Each program may be implemented in a high-level process or object-oriented programming language to communicate with a computer system. However, if necessary, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose. In addition, the operation of the process described in the present invention may be performed in any suitable order, unless the present invention otherwise indicates or otherwise clearly contradicts the context. The process described in the present invention (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as a code (e.g., executable instructions, one or more computer programs, or one or more applications) executed on one or more processors in common, by hardware or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.
[0111] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described in the present invention includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention also includes the computer itself.
[0112] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A parallel port redirection method, characterized in that: The method is applied to a local terminal where a cloud desktop client is located, wherein a client parallel port redirection service is arranged in the local terminal, and the method comprises: The client parallel port redirection service obtains the parallel port information on the local terminal and sends the parallel port information to the cloud desktop server, so that the cloud desktop server establishes a mapping relationship between the parallel port in the local terminal and the virtual parallel port on the cloud desktop server; The client parallel port redirection service monitors the changes in the parallel port status on the local terminal in real time, and synchronizes the parallel port status information to the cloud desktop server in real time; When the client parallel port redirection service receives the parallel port operation command sent by the cloud desktop server, it sends the parallel port operation command to the parallel port driver of the local terminal for execution, and feeds back the execution result to the cloud desktop server, so that the cloud desktop server writes the execution result into the corresponding virtual parallel port, so that the parallel port application can read the execution result; When the parallel port operation command sent by the cloud desktop server and received by the client parallel port redirection service is a parallel port opening operation command, the method further includes: The client parallel port redirection service determines whether the parallel port specified by the parallel port opening operation command is occupied by a parallel port application on the local terminal; When the parallel port is occupied, the client parallel port redirection service caches the parallel port opening operation command sent by the server, and caches subsequent read / write operation commands for the same parallel port; When the parallel port is not occupied, the client parallel port redirection service sends the cached parallel port opening operation command and the read and write operation command for the same parallel port; When the client parallel port redirection service receives an operation command for refreshing the parallel port cache sent by the cloud desktop server, the parallel port specified by the command is closed.
2. A parallel port redirection device, characterized in that: The device is applied to a local terminal where a cloud desktop client is located, and the device includes: The parallel port mapping module is used to obtain the parallel port information on the local terminal and send the parallel port information to the cloud desktop server so that the cloud desktop server can establish a mapping relationship between the parallel port in the local terminal and the virtual parallel port on the cloud desktop server; The status synchronization module is used to monitor the changes of the parallel port status on the local terminal in real time and synchronize the parallel port status information to the cloud desktop server in real time; The command processing module is used for sending the parallel port operation command to the parallel port driver of the local terminal for execution when receiving the parallel port operation command sent by the cloud desktop server, and feeding back the execution result to the cloud desktop server, so that the cloud desktop server writes the execution result into the corresponding virtual parallel port, so that the parallel port application can read the execution result; A judgment module, used for judging whether the parallel port specified by the parallel port opening operation command is occupied by a parallel port application on the local terminal when the parallel port operation command sent by the cloud desktop server is an open parallel port operation command; The time-sharing processing module is used to cache the parallel port opening operation command sent by the server when the parallel port is occupied, and cache the subsequent read / write operation commands for the same parallel port; when the parallel port is not occupied, send the cached parallel port opening operation command and the read / write operation command for the same parallel port; The refresh module is used to close the parallel port specified by the command when receiving an operation command for refreshing the parallel port cache sent by the cloud desktop server.
3. A parallel port redirection method, characterized in that: The method is applied to a cloud desktop server, and the method includes: When the server-side parallel port redirection service receives the parallel port information sent by the client-side parallel port redirection service, a mapping relationship between the parallel port in the local terminal where the cloud desktop client is located and the virtual parallel port on the cloud desktop server is established; When the server-side parallel port redirection service receives the parallel port status information sent by the client-side parallel port redirection service, it updates the status of the local corresponding virtual parallel port based on the mapping relationship; When the server-side parallel port redirection service receives the parallel port operation command sent by the virtual parallel port bus driver, it forwards the parallel port operation command to the client-side parallel port redirection service, so that the client-side parallel port redirection service sends it to the parallel port mapped by the virtual parallel port for execution; The parallel port operation commands include a parallel port opening operation command, a read / write operation command, and a parallel port buffer refresh operation command; When the server-side parallel port redirection service receives the execution result of the parallel port operation command from the client-side parallel port redirection service, the execution result is written into the corresponding virtual parallel port so that the parallel port application can read the execution result; When the server-side parallel port redirection service receives an operation command to refresh the parallel port cache from the virtual parallel port bus driver, the operation command to refresh the parallel port cache is forwarded to the client-side parallel port redirection service, so that the local terminal where the cloud desktop client is located closes the parallel port specified by the command.
4. A parallel port redirection device, characterized in that: The device is applied to a cloud desktop server, and includes: The virtual parallel port mapping module is used to receive the parallel port information sent by the client parallel port redirection service and establish a mapping relationship between the parallel port in the local terminal where the cloud desktop client is located and the virtual parallel port on the cloud desktop server; The virtual parallel port status synchronization module is used to receive the parallel port status information sent by the client parallel port redirection service, and update the status of the local corresponding virtual parallel port based on the mapping relationship; The virtual parallel port command processing module is used for forwarding the parallel port operation command to the client parallel port redirection service when receiving the parallel port operation command sent by the virtual parallel port bus driver, so that the client parallel port redirection service sends it to the parallel port mapped by the virtual parallel port for execution; The parallel port operation commands include a parallel port opening operation command, a read / write operation command, and a parallel port buffer refresh operation command; When the virtual parallel port command processing module receives the execution result of the parallel port operation command fed back by the client parallel port redirection service, the execution result is written into the corresponding virtual parallel port so that the parallel port application can read the execution result; When the virtual parallel port command processing module receives an operation command for refreshing the parallel port cache sent from the virtual parallel port bus driver, it forwards the operation command for refreshing the parallel port cache to the client parallel port redirection service, so that the local terminal where the cloud desktop client is located closes the parallel port specified by the command.
5. A parallel port redirection system, characterized in that: The system includes a client-side parallel port redirection service located in a local terminal where a cloud desktop client is located and a server-side parallel port redirection service located at a cloud desktop server; The client-side parallel port redirection service obtains the parallel port information on the local terminal and sends the parallel port information to the server-side parallel port redirection service. The server-side parallel port redirection service establishes a mapping relationship between the parallel port in the local terminal and the virtual parallel port according to the parallel port information. The client-side parallel port redirection service monitors the changes in the parallel port status on the local terminal in real time, and synchronizes the parallel port status information to the server-side parallel port redirection service in real time; The server-side parallel port redirection service updates the status of the local corresponding virtual parallel port based on the mapping relationship; When the server-side parallel port redirection service receives the parallel port operation command sent by the virtual parallel port bus driver, it forwards the parallel port operation command to the client-side parallel port redirection service; When the client parallel port redirection service receives the parallel port operation command sent by the server parallel port redirection service, it sends the parallel port operation command to the parallel port driver of the local terminal for execution, and feeds back the execution result to the server parallel port redirection service; The parallel port operation commands include a parallel port opening operation command, a read / write operation command, and a parallel port buffer refresh operation command; When the server-side parallel port redirection service receives the execution result of the parallel port operation command from the client-side parallel port redirection service, the execution result is written into the corresponding virtual parallel port so that the parallel port application can read the execution result; When the server-side parallel port redirection service receives an operation command to refresh the parallel port cache from the virtual parallel port bus driver, the server-side parallel port redirection service forwards the operation command to refresh the parallel port cache to the client-side parallel port redirection service; When the client parallel port redirection service receives an operation command for refreshing the parallel port cache sent by the cloud desktop server, the parallel port specified by the command is closed; When the parallel port operation command sent by the cloud desktop server is received by the client parallel port redirection service as an open parallel port operation command, the client parallel port redirection service determines whether the parallel port specified by the open parallel port operation command is occupied by a parallel port application on the local terminal; When the parallel port is occupied, the client parallel port redirection service caches the parallel port opening operation command sent by the server, and caches subsequent read / write operation commands for the same parallel port; When the parallel port is not occupied, the client parallel port redirection service sends the cached parallel port opening operation command and the read and write operation commands for the same parallel port.
6. A storage medium having a computer program stored thereon, characterized in that: The computer program implements the method steps of any one of claims 1 or 3 when executed by a processor.
