A copy-paste system, method, and electronic device
By using KVM client and server in conjunction, and utilizing out-of-band and in-band controllers to transmit clipboard data, the problem of cross-device copy and paste between computer devices and servers is solved, enabling the synchronization and pasting of various types of data.
Patent Information
- Application Number
- CN202310120059.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-02-15
AI Technical Summary
In situations where computer devices and servers are isolated from the network, cross-device copy and paste operations are not possible.
By coordinating KVM clients and KVM servers, clipboard data can be transmitted using out-of-band and in-band controllers, enabling cross-device data synchronization and pasting.
It enables cross-device copy and paste functionality for different types of data, including synchronous pasting of numbers, letters, symbols, text, images, videos, and files, and supports bidirectional cross-device copy and paste.
Smart Images

Figure CN116244095B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a copy-paste system, method and electronic device. Background Technology
[0002] A remote control console (keyboard video mouse, KVM) is used for remote maintenance and control of the server via a baseboard management controller (BMC). KVM consists of a KVM client and a KVM server. The KVM client runs on the user's computer and sends user commands to the KVM server. The KVM server runs on the BMC and forwards the commands from the KVM client to the server's operating system.
[0003] When the network of a computer device is isolated from the network of a server, the operating system on the computer device and the operating system on the server are independent of each other, and there is no direct data channel between them. Therefore, when a user performs a copy operation on the operating system of the computer device, the copied content cannot be pasted onto the operating system of the server. In other words, cross-device copy and paste cannot be implemented in related technologies. Summary of the Invention
[0004] This application provides a copy-paste system, method, and electronic device that enables cross-device copy-paste functionality in remotely controlled scenarios.
[0005] In a first aspect, this application provides a copy-paste system, which includes a first device and a second device. The first device controls the second device via a remote control KVM client. The first device is used to send first data to the KVM server of the second device when a first preset condition is met. The first data is data in the clipboard buffer of the first device. The second device is used to receive the first data and store it in the clipboard buffer of the second device. The second device is also used to retrieve the first data from the clipboard buffer of the second device and paste it to the position indicated by the paste command when a paste command is received.
[0006] In one possible implementation, the first preset condition is that the KVM client is running in the foreground of the first device; and / or, the first data is different from the data that was last sent from the first device to the KVM server of the second device.
[0007] In another possible implementation, the second device includes an out-of-band controller and an in-band controller; the KVM server runs in the out-of-band controller; the out-of-band controller is used to receive the first data sent by the first device and send the first data to the in-band controller; the in-band controller is used to receive the first data sent by the out-of-band controller and store the first data in the clipboard buffer of the second device.
[0008] In another possible implementation, the second device is further configured to send the second data to the KVM client of the first device when the second preset condition is met; wherein the second data is data in the clipboard buffer of the second device; the first device is further configured to receive the second data and store the second data in the clipboard buffer of the first device; the first device is further configured to retrieve the second data from the clipboard buffer of the first device and paste it to the position indicated by the paste command when a paste command is received.
[0009] In another possible implementation, the second preset condition is that the data in the clipboard buffer of the second device has changed; and / or, the second data is different from the data that the second device last sent to the KVM client of the first device.
[0010] Secondly, this application provides a copy-paste method, which is applied to a first device, the first device being used to control a second device through a KVM client; the method includes: when the first device meets a first preset condition, sending first data to the KVM server of the second device, so that the second device stores the first data in the clipboard temporary storage area of the second device, and when the second device receives a paste command, retrieving the first data from the clipboard temporary storage area of the second device and pasting it to the position indicated by the paste command; wherein, the first data is the data in the clipboard temporary storage area of the first device.
[0011] It is understood that in the copy-paste method provided in this application, when the first device meets the first preset condition, it sends the first data in the clipboard buffer of the first device to the KVM server of the second device, so that the second device stores the first data in the clipboard buffer of the second device. It can be seen that, compared with related technologies that cannot achieve cross-device copy-paste, the method provided in this application can use the KVM client in the first device and the KVM server in the second device to transmit clipboard data, synchronizing the first data in the clipboard buffer of the first device to the clipboard buffer of the second device, thus achieving cross-device copy-paste.
[0012] In one possible implementation, the first preset condition is that the KVM client is running in the foreground of the first device; and / or, the first data is different from the data that was last sent from the first device to the KVM server of the second device.
[0013] It is understandable that, since the KVM client is used to remotely control the second device, when the first device detects that the KVM client window is running in the foreground of the first device, it determines that the user wants to paste the data copied by the copy operation (i.e., the first data) into the second device. In addition, to avoid wasting resources by sending data repeatedly, the first device will also check whether the first data is the same as the data that the first device last sent to the second device. Therefore, in the method provided in this application embodiment, when the first device detects that the KVM client window is running in the foreground of the first device and the first data is different from the data that the first device last sent to the second device, it sends the first data in the clipboard buffer of the first device to the KVM server of the second device. In this way, it can both determine the user's intention to paste the first data into the second device and avoid repeated sending.
[0014] In another possible implementation, the first data mentioned above includes one or more of the following: numbers, letters, symbols, text, mouse movement data, images, videos, or files.
[0015] Understandably, the first data can be numbers, letters, symbols, text, mouse movement data, images, videos, or files, etc., enabling cross-device pasting of different types of data and providing complete cross-device copy and paste functionality.
[0016] In another possible implementation, the above method further includes: identifying the type of the first data; wherein the type of the first data includes file type and non-file type; sending the type of the first data to the KVM server of the second device so that the second device can determine the pasting method of the first data according to the type of the first data; different types correspond to different pasting methods.
[0017] It is understood that when the first data is not a file type, the first data includes: the data itself; when the first data is a file type, the first data includes: the storage path of the file to be pasted. It can be seen that the pasted content is different for different types. Therefore, the embodiments of this application can determine the pasting method of the first data according to the type of the first data.
[0018] In another possible implementation, if the first data is a file type, the first data includes: the storage path of the file to be pasted; the above method also includes: sending the file content of the file to be pasted to the KVM server of the second device, so that the second device stores the content of the file to be pasted in the target storage space of the second device, and modifies the storage path of the file to be pasted to the storage path of the target storage space of the second device.
[0019] Understandably, since the first data is a file type, it includes the storage path of the file to be pasted. Therefore, in order to ensure that the file to be pasted can be pasted onto the second device, the file itself needs to be transmitted to the second device.
[0020] In another possible implementation, the method further includes: receiving second data sent by the second device; wherein the second data is data in the clipboard buffer of the second device; writing the second data into the clipboard buffer of the first device; and when a paste command is received, retrieving the second data from the clipboard buffer of the first device and pasting the second data at the position indicated by the paste command.
[0021] It is understood that in the method provided in this application embodiment, the first device can receive second data from the clipboard buffer of the second device and store the second data in the clipboard buffer of the first device; then, in response to the received paste command, it retrieves the second data from the clipboard buffer of the first device and pastes it at the position indicated by the paste command, thereby realizing the pasting of the second data on the first device. It can be seen that the method provided in this application can not only synchronize the first data in the clipboard of the first device to the clipboard of the second device, but also synchronize the second data in the clipboard of the second device to the clipboard of the first device, realizing bidirectional cross-device copy and paste functionality.
[0022] In another possible implementation, the above method further includes: obtaining the type of the second data; wherein the type of the second data includes a file type or a non-file type; determining the pasting method of the second data according to the type of the second data; different types correspond to different pasting methods.
[0023] It is understood that when the second data is not a file type, the second data includes the data itself; when the second data is a file type, the second data includes the storage path of the file to be pasted. It can be seen that the pasted content is different for different types. Therefore, the embodiments of this application can determine the pasting method of the second data according to the type of the second data.
[0024] In another possible implementation, when the type of the second data is a file type, the second data includes: the storage path of the file to be pasted; the method further includes: obtaining the file content of the file to be pasted; storing the file to be pasted in the target storage space of the first device, and modifying the storage path of the file to be pasted to the storage path of the target storage space of the first device; the above-mentioned writing the second data into the clipboard temporary storage area of the first device includes: writing the modified storage path of the file to be pasted into the clipboard temporary storage area of the first device.
[0025] Understandably, since the second data is a file type, it includes the storage path of the file to be pasted. Therefore, to ensure the file can be pasted onto the first device, the first device also needs to obtain the file content of the file to be pasted, store the file content in the target storage space of the first device, modify the storage path of the file to be pasted to the storage path of the target storage space, and write the modified storage path of the file to be pasted to the clipboard temporary area of the first device. Thus, when the first device performs a paste operation, it can retrieve the file to be pasted from the target storage space based on the modified storage path of the file to be pasted and write it to the desired paste location on the first device.
[0026] Thirdly, this application provides a copy-paste method applied to a second device; the method includes: receiving first data sent by a first device; the first data being data in the clipboard buffer of the first device; the first device controlling the second device through a KVM client; storing the first data in the clipboard buffer of the second device; and when a paste command is received, retrieving the first data from the clipboard buffer of the second device and pasting the first data at the position indicated by the paste command.
[0027] In one possible implementation, the above method further includes: obtaining the type of the first data; wherein the type of the first data includes file type and non-file type; determining the pasting method of the first data according to the type of the first data; wherein the pasting method is different for different types.
[0028] In another possible implementation, when the type of the first data is a file type, the first data includes: the storage path of the file to be pasted; the method further includes: obtaining the file content of the file to be pasted; storing the file content of the file to be pasted in the target storage space of the second device, and modifying the storage path of the file to be pasted to the storage path of the target storage space of the second device; storing the first data in the clipboard temporary storage area of the second device includes: storing the modified storage path of the file to be pasted in the clipboard temporary storage area of the second device.
[0029] In another possible implementation, the method further includes: when the second device meets the second preset condition, sending the second data to the KVM client of the first device, so that the first device stores the second data in the clipboard buffer of the first device, and when the first device receives a paste command, retrieving the second data from the clipboard buffer of the first device and pasting it to the position indicated by the paste command; wherein the second data is the data in the clipboard buffer of the second device.
[0030] In another possible implementation, the second preset condition is that the data in the clipboard buffer of the second device has changed; and / or, the second data is different from the data that the second device last sent to the KVM client of the first device.
[0031] In another possible implementation, the method further includes: identifying the type of the second data; wherein the type of the second data includes file type and non-file type; sending the type of the second data to the KVM client of the first device so that the first device can determine the pasting method of the second data according to the type of the second data; different types correspond to different pasting methods.
[0032] In another possible implementation, when the second data is a file type, the second data includes the storage path of the file to be pasted; the method further includes sending the file content of the file to be pasted to the KVM client of the first device, so that the first device stores the content of the file to be pasted in the target storage space of the first device, and modifies the storage path of the file to be pasted to the storage path of the target storage space of the first device.
[0033] Fourthly, this application provides an electronic device, including: an interface and a logic circuit, the logic circuit being used to execute the copy-paste method provided in the second aspect above and any possible implementation thereof.
[0034] Fifthly, this application provides an electronic device, including: an interface and a logic circuit, the logic circuit being used to execute the copy-paste method provided in the third aspect above and any possible implementation thereof.
[0035] Sixthly, this application provides a computer-readable storage medium storing computer-executable instructions that, when executed on a computer, cause the computer to perform any of the copy-paste methods provided in the second and third aspects above.
[0036] In a seventh aspect, this application provides a computer program product including computer instructions that, when executed on a computer, cause the computer to perform any of the copy-paste methods provided in the second and third aspects above.
[0037] For a detailed description of aspects three through seven and their various implementations in this application, please refer to the detailed descriptions in aspects one and two and their various implementations; and for a detailed description of the beneficial effects of aspects one, three through seven and their various implementations, please refer to the beneficial effect analysis in aspects two and their various implementations, which will not be repeated here.
[0038] These or other aspects of this application will become more readily apparent in the following description. Attached Figure Description
[0039] Figure 1 This application provides a schematic diagram of the architecture of a copy-paste system according to an embodiment of the present application.
[0040] Figure 2 A flowchart of a copy-paste method provided in this application embodiment Figure 1 ;
[0041] Figure 3 A flowchart of a copy-paste method provided in this application embodiment Figure 2 ;
[0042] Figure 4 A schematic diagram of the structure of an electronic device provided in this application embodiment. Figure 1 ;
[0043] Figure 5 A schematic diagram of the structure of an electronic device provided in this application embodiment. Figure 2 . Detailed Implementation
[0044] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0045] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0046] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0047] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0048] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0049] As described in the background art, when the network of a computer device is isolated from the network of a server, the operating system on the computer device and the operating system on the server are independent of each other, and there is no direct data channel between them. Therefore, when a user performs a copy operation on the operating system of the computer device, the copied content cannot be pasted onto the operating system of the server. In other words, cross-device copy and paste cannot be implemented in the related technology.
[0050] To address the aforementioned technical problems, this application provides a copy-and-paste method. The method involves: acquiring first data (including numbers, letters, symbols, text, images, videos, or files) from the clipboard buffer of a first device, and sending the first data to the out-of-band controller of a second device. The out-of-band controller then controls the in-band controller of the second device to write the first data into the clipboard buffer of the second device. It can be seen that, compared to related technologies that cannot achieve cross-device copy-and-paste, the method provided in this application can utilize a KVM client in the first device and a KVM server in the second device to transmit clipboard data, synchronizing the first data from the clipboard buffer of the first device to the clipboard buffer of the second device, thus achieving cross-device copy-and-paste. Furthermore, the first data can be numbers, letters, symbols, text, mouse movement data, images, videos, or files, enabling cross-device pasting of different types of content and achieving complete cross-device copy-and-paste functionality.
[0051] Furthermore, in the method provided in this application embodiment, the in-band controller can send the second data in the clipboard buffer of the second device to the out-of-band controller via a transmission channel (e.g., PCIe, USB, eSPI, or LPC), so that the out-of-band controller can send the second data to the KVM client of the first device via the KVM server, thereby realizing the copy and paste of the second data on the first device. It can be seen that this application embodiment can also synchronize the second data in the clipboard buffer of the second device to the clipboard buffer of the first device, realizing bidirectional cross-device copy and paste functionality.
[0052] The embodiments provided in this application will now be described in detail with reference to the accompanying drawings.
[0053] See Figure 1 This is a schematic diagram of the architecture of the copy-paste system provided in an embodiment of this application. Figure 1 As shown, the system includes: a first device 100 and a second device 200.
[0054] The first device 100 is used to remotely control the second device 200. Specifically, the first device 100 includes a KVM client, which is used to control the second device 200 through the KVM client.
[0055] In some embodiments, the first device 100 includes a processor; wherein the processor is the core of computation and control of the first device 100. Optionally, the processor may be a implementation or execution of various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and microprocessors, etc.
[0056] In some embodiments, an operating system (OS) is installed and runs on the processor of the first device 100. The OS is the most basic system software running on the first device 100, and any other software requires the support of the OS to run. For example, the OS in the processor of the first device 100 supports the running of KVM client software programs.
[0057] In some embodiments, the OS of the processor described above runs a clipboard, and the temporary area of the clipboard is used to store data to be pasted.
[0058] In some embodiments, the first device 100 further includes: a memory ( Figure 1 (Not shown in the text) is used to store data such as instructions or program code. For example, the memory may be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0059] In this embodiment, the memory is mainly used to store the file content sent by the second device 200.
[0060] The second device 200 includes: an out-of-band controller and an in-band controller.
[0061] The out-of-band controller is used for out-of-band network management. Out-of-band network management refers to the control, management, and maintenance of the second device 200 by remote electronic devices through a network physical channel. Optionally, the out-of-band controller can be a baseboard management controller (BMC). The BMC can connect to other hardware devices in the second device 200 through different interfaces to manage and control the system hardware within the second device 200. Examples include power-on / off control, fan speed regulation, and electronic tag management.
[0062] An in-band controller is a controller used for in-band network management. In-band network management refers to the information processing and program execution of the second device 200 by a controller within the second device 200. Optionally, the in-band controller may be a implementation or execution of various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The in-band controller may also be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and microprocessors, etc.
[0063] In some embodiments, the out-of-band controller includes a KVM server for receiving control commands and data sent by a KVM client (the KVM client is installed and running in the first device 100).
[0064] In some embodiments, the out-of-band controllers of the first device 100 and the second device 200 are in the same network (i.e., the KVM client and the KVM server are in the same network). For example, as shown... Figure 1 As shown, the out-of-band controllers of both the first device 100 and the second device 200 are in the management network. Therefore, the first device 100 can communicate with the out-of-band controller of the second device 200 through the network transmission channel.
[0065] In some embodiments, the out-of-band controller and the in-band controller communicate via a transmission channel. Optionally, the transmission channel may include various transmission channels such as Universal Serial Bus (USB), Peripheral Component Interconnect Express (PCIe), Enhanced Serial Peripheral Interface (eSPI), or Low Pin Count (LPC).
[0066] In some embodiments, an operating system (OS) is installed and runs on the in-band controller. Exemplary examples show that the OS may be an Android operating system, a Windows operating system, or a Linux operating system, etc., and this application embodiment does not limit this. The in-band controller's operating system includes a clipboard for storing content to be pasted.
[0067] In some embodiments, the in-band controller includes a clipboard service routine for managing the clipboard running in the operating system of the in-band controller. For example, it writes data to be pasted to the clipboard temporary storage area; or retrieves data to be pasted from the clipboard temporary storage area.
[0068] In some embodiments, the network of the out-of-band controller is isolated from the network of the out-of-band controller. For example, such as... Figure 1 As shown, the out-of-band controller is in the management network; the in-band controller is in the service network. The management network and the service network are isolated, meaning their Internet Protocol (IP) addresses, network segments, etc., are different. For example, the management network is used to transmit management data, and the service network is used to transmit service data.
[0069] In some embodiments, the second device 200 further includes a memory ( Figure 1(Not shown in the text) is used to store data such as instructions or program code. For example, the memory may be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0070] In this embodiment, the memory is mainly used to store the file content sent by the first device 100.
[0071] In some embodiments, the first device 100 is used to send first data to the out-of-band controller in the second device 200 (specifically, the first device 100 sends the first data to the KVM server in the out-of-band controller via a KVM client) when a first preset condition is met; the out-of-band controller of the second device 200 sends the first data to the in-band controller of the second device 200 via a transmission channel; and the in-band controller stores the first data in the clipboard buffer of the second device 200. Furthermore, the in-band controller in the second device 200 is also used to retrieve the first data from the clipboard buffer of the second device 200 when a paste command is received, and paste it to the position indicated by the paste command.
[0072] The first preset condition is that the KVM client is running in the foreground of the first device 100; and / or, the first data is different from the data that the first device 100 previously sent to the KVM server of the second device 200.
[0073] In some embodiments, the in-band controller of the second device 200 is further configured to, when the second device 200 meets the second preset condition, send the second data to the out-of-band controller of the second device 200 via a transmission channel, and the out-of-band controller sends the second data to the KVM client of the first device 100 via a KVM server; wherein the second data is data in the clipboard buffer of the second device 200. The first device 100 is further configured to receive the second data and store the second data in the clipboard buffer of the first device 100. The first device 100 is further configured to, upon receiving a paste command, retrieve the second data from the clipboard buffer of the first device 100 and paste it to the position indicated by the paste command.
[0074] The second preset condition is that the data in the clipboard temporary storage area of the second device has changed; and / or the second data is different from the data that the second device last sent to the KVM client of the first device.
[0075] It should be noted that the system architecture described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0076] The following is a detailed description of a copy-paste method provided in an embodiment of this application.
[0077] Optionally, the method provided in this application embodiment can realize bidirectional copy and paste, that is, paste the data in the clipboard temporary area of the first device to the paste position of the second device; and paste the data in the clipboard temporary area of the second device to the paste position of the first device. The bidirectional copy and paste process provided in this application embodiment will be described in detail below.
[0078] In some embodiments, such as Figure 2 As shown, pasting data from the clipboard temporary area of the first device to the paste location on the second device can be achieved through the following steps:
[0079] S301. When the first device meets the first preset condition, the first device sends the first data to the out-of-band controller of the second device.
[0080] The aforementioned first data refers to the data in the clipboard buffer of the first device. The clipboard of the first device refers to the clipboard running on the operating system of the first device. It can be understood that when a user performs a copy operation in the operating system of the first device, the copied content is written to the clipboard buffer of the first device. The clipboard buffer only stores data copied in the most recent copy operation; that is, the data in the current clipboard buffer will be overwritten by the data copied in the next copy operation. Therefore, the aforementioned first data refers to the data in the clipboard buffer of the first device (i.e., the data copied in the most recent copy operation performed on the first device).
[0081] In some embodiments, the first device may obtain the first data according to the GetContent method in the clipboard class of the first device (e.g., the Windows.ApplicationModel.DataTransfer.Clipboard class).
[0082] Optionally, the first data may include one or more of the following: numbers, letters, symbols, text, mouse movement data, images, videos, or files, etc. It is understood that, compared to related technologies that can only copy and paste limited characters, the method provided in this application embodiment can achieve copying and pasting of different types of data, thus improving the remote copy and paste function.
[0083] In some embodiments, the first device includes a KVM client, through which the first device remotely controls the second device. Therefore, the aforementioned first preset condition is that the KVM client is running in the foreground of the first device; and / or, the first data is different from the data previously sent by the first device to the KVM server of the second device.
[0084] As one possible implementation, the aforementioned KVM client registration window activation (Window.Activated) event handler function is used to detect whether the KVM client window is running in the foreground of the first device. Specifically, when the Window.Activated event handler function is triggered, it is determined that the KVM client window is running in the foreground of the first device.
[0085] As one possible implementation, the above method also includes a cyclic redundancy check (CRC32) of the content to be pasted; where CRC32 is a commonly used error detection technique in the fields of data storage and data communication. Thus, embodiments of this application can determine whether the first data and the data previously sent from the first device to the second device are the same based on the CRC32 of the first data and the CRC32 of the data previously sent from the first device to the second device. Specifically, if the CRC32 values of the two data are the same, then they are determined to be the same; if the CRC32 values of the two data are different, then they are determined to be different.
[0086] It is understandable that, since the KVM client is used to remotely control the second device, when the first device detects that the KVM client window is running in the foreground of the first device, it determines that the user wants to paste the content copied by the copy operation (i.e., the first data) onto the second device. In addition, to avoid wasting resources by repeatedly sending data, the first device will also check whether the first data is the same as the data that the first device last sent to the second device. Therefore, in the method provided in this application embodiment, when the first device detects that the KVM client window is running in the foreground of the first device and the first data is different from the data that the first device last sent to the second device, it retrieves the first data from the clipboard buffer of the first device. In this way, it can both determine the user's intention to paste the first data onto the second device and avoid repeated sending.
[0087] In some embodiments, the method further includes: identifying the type of the first data; optionally, the type of the first data includes: file type and non-file type.
[0088] Specifically, the type of the first data obtained through the GetContent method in the Windows.ApplicationModel.DataTransfer.Clipboard class is DataPackageView (a data type in C language, such as floating-point, integer, or character). Since the data types of interest in this embodiment are file types (DataPackageView.StorageItems) and non-file types, this embodiment can identify the type of the first data (i.e., whether the first data is a file type or a non-file type) based on the string processing function (Contains) method in the DataPackageView class.
[0089] In some embodiments, when the type of the first data is not a file type, the first data includes: the data itself. For example, a non-file type may include: text, numbers, or symbols, etc., then when the first data is not a file type, the first data includes: the text, numbers, or symbols themselves.
[0090] In other embodiments, when the type of the first data is a file type, the first data includes: the storage path of the file to be pasted. For example, assuming the file to be pasted is Word document 1, the storage path of the file to be pasted is the storage path of Word document 1.
[0091] In some embodiments, step S301 can be implemented as the following steps:
[0092] Step a1: The first device performs binary serialization on the first data to obtain the binary sequence of the first data.
[0093] Binary serialization refers to the process of converting an object (such as primary data) into binary data.
[0094] Step a2: The first device sends the binary sequence of the first data to the out-of-band controller of the second device.
[0095] It is understandable that the first data is serialized into binary form, which converts the first data into binary form for storage and transmission. Since binary only uses two numbers, 0 and 1, it is less prone to errors during transmission and processing, and has high reliability.
[0096] In some embodiments, when the first data is a file type, the above method further includes: performing binary serialization on the file content of the file to be pasted to obtain a binary sequence of the file to be pasted; and then sending the file content of the file to be pasted to the out-of-band controller of the second device.
[0097] Understandably, since the first data is a file type, it includes the storage path of the file to be pasted. Therefore, in order to ensure that the file to be pasted can be pasted onto the second device, the file itself needs to be transmitted to the second device.
[0098] In some embodiments, the method further includes sending the type of the first data to an out-of-band controller, such that the out-of-band controller sends the type of the first data to an in-band controller.
[0099] The type of the first data is used by the in-band controller to determine how the first data is pasted on the second device; different types correspond to different pasting methods. See the relevant description in S303 below for details.
[0100] S302, The out-of-band controller of the second device sends the first data to the in-band controller of the second device.
[0101] The out-of-band controller and the in-band controller share a transmission channel, allowing the out-of-band controller to send first data to the in-band controller via this channel. Optionally, the transmission channel can be one or more of PCIe, USB, eSPI, or LPC.
[0102] Understandably, since the out-of-band controller includes a KVM server to receive control commands or data sent by the KVM client (installed and running on the first device) and forward them to the in-band controller for remote control or data synchronization, the out-of-band controller needs to send the first data to the in-band controller after receiving it.
[0103] For example, taking an LPC channel as the transmission channel, the above S103 will be illustrated. LPC is a 33MHz 4-bit parallel bus protocol based on the Intel standard, commonly used in the server field for communication between in-band and out-of-band controllers. For instance, the in-band controller can communicate with the out-of-band controller via the Intelligent Platform Management Interface (IPMI) protocol. In this embodiment, the first data can be transmitted based on the IPMI protocol and custom commands. For example, the format of the custom commands can be as shown in Tables 1 and 2 below.
[0104] For example, a command from an in-band controller to obtain first data from an out-of-band controller can take the form shown in Table 1:
[0105] Table 1
[0106] byte order Domain content NetFn 30h CMD 96h
[0107] In this context, NetFn represents the network function code, and CMD represents the command prompt.
[0108] The response to the above command can be in the form shown in Table 2:
[0109] Table 2
[0110]
[0111]
[0112] In the response content, the first byte indicates whether the first data was successfully retrieved; the second byte indicates the data type of the first data; the third byte indicates the data number of the first data; the fourth byte indicates the data length of the first data; the fifth to eighth bytes indicate the data offset of the first data; and the data from the ninth byte onwards is the first data itself.
[0113] It is understandable that, since the in-band controller is the active party in the LPC-based IPMI protocol, communication can only be initiated by the in-band controller (that is, the in-band controller needs to periodically send query messages to the out-of-band controller to check for new clipboard data). In other embodiments, other channels or other protocols may be used, in which case the format of the communication commands needs to be adjusted according to the actual scenario, and this application does not limit this.
[0114] In some embodiments, the method further includes: after receiving the type of the first data, the out-of-band controller sends the type of the first data to the in-band controller via a transmission channel. Optionally, the first data and the type of the first data can be sent in the same instruction; or, the first data and the type of the first data can be sent separately in different instructions.
[0115] In some embodiments, when the type of the first data is a file type, the method further includes: when the out-of-band controller receives the file content of the file to be pasted, it sends the file content of the file to be pasted to the in-band controller. As a possible implementation, the file content of the file to be pasted received by the out-of-band controller can be a binary sequence of the file to be pasted, and then the binary sequence of the file to be pasted is sent to the in-band controller.
[0116] S303, The in-band controller of the second device stores the first data in the clipboard temporary storage area of the second device.
[0117] The clipboard of the second device refers to the clipboard running in the operating system of the second device. The first data sent from the first device can be stored in the temporary storage area of the clipboard of the second device. The clipboard temporary storage area only stores data copied in the most recent copy operation or data most recently received from the first device.
[0118] Understandably, after writing the first data into the clipboard buffer of the second device, multiple paste operations can be performed. Moreover, compared to the method of retrieving the data to be pasted from the first device for each paste operation, writing the data to be pasted into the clipboard buffer of the second device enables convenient and quick pasting.
[0119] In some embodiments, when the first data received by the in-band controller is a binary sequence, the above method further includes: deserializing the binary sequence of the first data to obtain the first data; and then performing the above step S303.
[0120] In some embodiments, the in-band controller determines how the first data is written to the clipboard buffer of the second device based on the type of the first data.
[0121] As one possible implementation, if the first data is not a file type, and the first data includes the data itself, then the above step S303 can be implemented as: the in-band controller writes the first data itself into the clipboard of the second device.
[0122] As another possible implementation, if the first data is a file type, and the first data includes the storage path of the file to be pasted, then step S303 can be implemented as follows:
[0123] Step b1: Store the file to be pasted in the target storage space of the second device.
[0124] The target storage space is used to store the file to be pasted. Optionally, the target storage space can be part or all of the memory of the second device.
[0125] Step b2: Change the storage path of the file to be pasted to the storage path of the target storage space of the second device.
[0126] It is understandable that the storage path of the file to be pasted is the storage path of the file to be pasted in the storage space of the first device. Therefore, after the file to be pasted is stored in the target storage space of the second device, the storage path of the file to be pasted needs to be changed to the storage path of the target storage space of the second device.
[0127] Step b3: Store the modified file path to be pasted in the clipboard temporary area of the second device.
[0128] It is understandable that, since the modified storage path of the file to be pasted is the target storage space of the second device, after the modified storage path of the file to be pasted is written into the clipboard temporary area of the second device, the in-band controller can retrieve the file to be pasted from the target storage space of the second device according to the modified storage path of the file to be pasted, and then paste it.
[0129] S304, The first device sends the first paste command to the out-of-band controller of the second device.
[0130] The first paste instruction is used to instruct the first data to be pasted at the paste location on the second device.
[0131] In some embodiments, when a user performs a first paste operation on the KVM client of the first device, the first device generates a first paste instruction and sends the first paste instruction to the out-of-band controller of the second device.
[0132] It is understandable that when a user performs the first paste operation on the KVM client of the first device, it means that the user wants to perform the paste operation on the second device. Therefore, the first device generates the first paste command and transmits the first paste command to the out-of-band controller of the second device.
[0133] S305, the out-of-band controller of the second device sends the first paste command to the in-band controller of the second device.
[0134] Understandably, since the out-of-band controller includes a KVM server to receive control commands or data sent by the KVM client (installed and running on the first device) and forward them to the in-band controller for remote control or data synchronization, the out-of-band controller needs to send the first paste command to the in-band controller after receiving it.
[0135] S306. The in-band controller of the second device retrieves the first data from the clipboard temporary storage area of the second device and pastes the first data to the position indicated by the first paste command.
[0136] In some embodiments, the method further includes: determining the pasting method of the first data according to the type of the first data; different types correspond to different pasting methods.
[0137] As one possible implementation, if the type of the first data is not a file type, the above step S306 can be implemented as follows: the in-band controller responds to the first paste command, retrieves the first data from the clipboard buffer of the second device, and pastes the first data at the position indicated by the first paste command.
[0138] As another possible implementation, if the type of the first data is a file, the above step S307 can be implemented as follows:
[0139] Step c1: In response to the first paste command, the in-band controller retrieves the first data from the clipboard of the second device.
[0140] Step c2: The in-band controller obtains the storage path of the file to be pasted from the first data.
[0141] Step c3: The in-band controller retrieves the file to be pasted based on its storage path and pastes it at the location indicated by the first paste instruction.
[0142] Specifically, the storage path of the file to be pasted is the storage path of the target storage space of the second device. Therefore, the in-band controller can obtain the file to be pasted from the target storage space of the second device and then paste the file to be pasted at the position indicated by the first paste instruction.
[0143] Understandably, when the first data is a file type, the in-band controller needs to store the file content of the file to be pasted in the target storage space of the second device, modify the storage path of the file to be pasted to the storage path of the target storage space, and then write it to the clipboard temporary area of the second device. Therefore, when performing a paste operation, the in-band controller needs to obtain the storage path of the file to be pasted from the first data, then retrieve the file to be pasted from the target storage space of the second device according to the storage path, and paste it at the position indicated by the first paste command.
[0144] In summary, the copy-paste method provided by the embodiments of this application can bring at least the following beneficial effects: by acquiring the first data (including numbers, letters, symbols, text, images, videos, or files, etc.) in the clipboard buffer of the first device, and sending the first data to the out-of-band controller of the second device, the out-of-band controller of the second device can control the in-band controller of the second device to write the first data into the clipboard buffer of the second device. It can be seen that, compared with related technologies that cannot achieve cross-device copy-paste, the method provided by the embodiments of this application can use the KVM client in the first device and the KVM server in the out-of-band controller to transmit clipboard data, synchronizing the first data in the clipboard buffer of the first device to the clipboard buffer of the second device, thus achieving cross-device copy-paste. Furthermore, the first data can be numbers, letters, symbols, text, mouse movement data, images, videos, or files, etc., enabling cross-device pasting of different types of content and achieving complete cross-device copy-paste functionality.
[0145] In other embodiments, such as Figure 3 As shown, pasting data from the clipboard temporary area of the second device to the paste location on the first device can be achieved through the following steps:
[0146] S401. When the second device meets the second preset conditions, the in-band controller of the second device sends the second data to the out-of-band controller of the second device.
[0147] The second data refers to the data in the clipboard buffer of the second device. Optionally, the second data may include one or more of the following: numbers, letters, symbols, text, mouse movement data, images, videos, or files.
[0148] In some embodiments, the second preset condition is that the data in the clipboard buffer of the second device has changed; and / or, the second data is different from the data that the second device last sent to the KVM client of the first device.
[0149] As one possible implementation, the in-band controller registers clipboard detection events for the second device to detect whether the data in the clipboard's temporary storage area has changed. For example, the `ContentChanged` method in the `Clipboard` class can be used to detect whether the data in the second device's clipboard's temporary storage area has changed.
[0150] One possible implementation is to determine whether the second data is the same as the data previously sent to the first device by the in-band controller based on the CRC32 of the second data and the CRC32 of the data previously sent to the first device by the in-band controller. Specifically, if the CRC32 values are the same, then the data is considered the same; if the CRC32 values are different, then the data is considered different.
[0151] In some embodiments, the method further includes: identifying the type of the second data; optionally, the type of the second data includes: file type and non-file type.
[0152] In some embodiments, when the type of the second data is not a file type, the second data includes: the data itself. For example, a non-file type may include: text, numbers, or symbols, etc., then when the second data is not a file type, the second data includes: the text, numbers, or symbols themselves.
[0153] In other embodiments, when the type of the second data is a file type, the second data includes the storage path of the file to be pasted. For example, assuming the file to be pasted is Word document 2, the storage path of the file to be pasted is the storage path of Word document 2.
[0154] In some embodiments, the in-band controller can transmit second data to the out-of-band controller via a transmission channel. Optionally, the transmission channel can be one or more of PCIe, USB, eSPI, or LPC.
[0155] It is understandable that since the in-band controller and the first device are connected to two different networks and there is no direct connection between them, they cannot communicate directly. Therefore, the in-band controller can send the second data to the out-of-band controller through the transmission channel, and then the KVM server in the out-of-band controller will send the second data to the KVM client in the first device.
[0156] For example, taking an LPC channel as the transmission channel, the above S402 will be illustrated. In this embodiment, the transmission of second data can be based on the IPMI protocol and custom commands. For example, the format of the custom commands can be as shown in Tables 3 and 4 below.
[0157] For example, a command for an in-band controller to send second data to an out-of-band controller can take the form shown in Table 3:
[0158] Table 3
[0159]
[0160]
[0161] In this context, NetFn represents the network function code, and CMD represents the command prompt. The first byte indicates the data type of the second data; the second byte indicates the data number of the second data; the third byte indicates the data length of the second data; bytes 4-7 indicate the data offset of the second data; and bytes 8 onwards constitute the second data itself.
[0162] The response to the above command can be in the form shown in Table 4:
[0163] Table 4
[0164]
[0165] The response content includes one byte, which indicates whether the second data was sent successfully.
[0166] It is understood that, since the initiator of the LPC-based IPMI protocol is the in-band controller, communication can only be initiated by the in-band controller (i.e., the in-band controller actively sends the second data to the out-of-band controller). In other embodiments, other channels or other protocols may be used, in which case the format of the communication commands needs to be adjusted according to the actual scenario, and this application does not limit this.
[0167] In some embodiments, step S401 above can be implemented as the following steps:
[0168] Step d1: The in-band controller performs binary serialization on the second data to obtain the binary sequence of the second data.
[0169] Binary serialization refers to the process of converting an object (such as secondary data) into binary data.
[0170] Step d2: The in-band controller sends the binary sequence of the second data to the out-of-band controller.
[0171] It is understandable that the second data is serialized into binary form, which converts the second data into binary form for storage and transmission. Since binary only uses two numbers, 0 and 1, it is less prone to errors during transmission and processing, and has high reliability.
[0172] In some embodiments, when the second data is a file type, the above method further includes: performing binary serialization on the file content of the file to be pasted to obtain a binary sequence of the file to be pasted; and then sending the file content of the file to be pasted to the out-of-band controller through the transmission channel.
[0173] Understandably, since the second data is a file type, and includes the storage path of the file to be pasted, in order to ensure that the file to be pasted can be pasted onto the first device, the file itself needs to be transmitted to the first device.
[0174] In some embodiments, the method further includes: sending the type of the second data to the out-of-band controller via a transmission channel, so that the out-of-band controller sends the type of the second data to the first device.
[0175] The type of the second data is used by the first device to determine how the second data is pasted on the first device; different types correspond to different pasting methods.
[0176] S402, the out-of-band controller of the second device sends the second data to the first device.
[0177] Understandably, since the out-of-band controller includes a KVM server that can communicate with the KVM client (installed and running on the first device), the out-of-band controller can send the second data to the KVM client of the first device through the KVM server after receiving the second data.
[0178] In some embodiments, the method further includes: after receiving the type of the second data, the out-of-band controller sends the type of the second data to the first device. Optionally, the second data and the type of the second data can be sent in the same instruction; or, the second data and the type of the second data can be sent separately in different instructions.
[0179] In some embodiments, when the type of the second data is a file, the method further includes: when the out-of-band controller receives the file content of the file to be pasted, it sends the file content of the file to be pasted to the first device. As one possible implementation, the file content of the file to be pasted received by the out-of-band controller can be a binary sequence of the file to be pasted, and then the binary sequence of the file to be pasted is sent to the first device.
[0180] S403, The first device stores the second data in the clipboard temporary storage area of the first device.
[0181] The clipboard buffer only stores data copied in the most recent copy operation or data most recently received from the second device. That is, data in the current clipboard buffer will be overwritten by data copied in the next copy operation; or, data in the current clipboard buffer will be overwritten by data received from the second device next time.
[0182] In some embodiments, when the second data received by the first device is a binary sequence, the above method further includes: deserializing the binary sequence of the second data to obtain the second data; and then performing the above step S403.
[0183] In some embodiments, the in-band controller determines how the second data is written to the clipboard of the first device based on the type of the second data.
[0184] As one possible implementation, if the second data is a file type and includes the data itself, then step S403 above can be implemented as follows: the first device writes the data itself to the clipboard of the first device.
[0185] As another possible implementation, if the second data is a file type, and the second data includes the storage path of the file to be pasted, then step S404 can be implemented as follows:
[0186] Step e1: Store the file to be pasted in the target storage space of the first device.
[0187] The target storage space is used to store the file to be pasted. Optionally, the target storage space can be part or all of the memory of the first device.
[0188] Step e2: Change the storage path of the file to be pasted to the storage path of the target storage space of the first device.
[0189] It is understandable that the storage path of the file to be pasted is the storage path of the file to be pasted in the storage space of the second device. Therefore, after the file to be pasted is stored in the target storage space of the first device, the storage path of the file to be pasted needs to be changed to the storage path of the target storage space of the first device.
[0190] Step e3: Store the modified storage path of the file to be pasted in the clipboard temporary area of the first device.
[0191] It is understandable that, since the modified storage path of the file to be pasted is the target storage space of the first device, after the modified storage path of the file to be pasted is written to the clipboard of the first device, when the first device executes the paste command, it can retrieve the file to be pasted from the target storage space of the first device according to the modified storage path of the file to be pasted, and then paste it.
[0192] S404. When the first device receives the second paste instruction, it retrieves the second data from the clipboard temporary storage area of the first device and pastes the second data to the position indicated by the second paste instruction.
[0193] The second paste instruction is used to instruct the second data to be pasted at the location indicated by the second paste instruction.
[0194] In some embodiments, when a user wants to paste second data into the first device, a second paste command can be sent to the first device, and the first device responds to the second paste command by pasting the second data into the location indicated by the second paste command.
[0195] In some embodiments, the method further includes: determining the pasting method of the second data according to the type of the second data; different types correspond to different pasting methods.
[0196] As one possible implementation, if the type of the second data is not a file type, the above step S404 can be implemented as follows: the first device responds to the second paste command, retrieves the second data from the clipboard temporary area of the first device, and pastes the second data at the position indicated by the second paste command.
[0197] As another possible implementation, when the second data is of file type, step S404 above can be implemented as follows:
[0198] Step f1: In response to the second paste command, the first device retrieves the second data from the clipboard buffer of the first device.
[0199] Step f2: The first device obtains the storage path of the file to be pasted from the second data.
[0200] Step f3: The first device retrieves the file to be pasted according to the storage path of the file to be pasted, and pastes the file to be pasted at the position indicated by the second paste instruction.
[0201] Specifically, the storage path of the file to be pasted is the storage path of the target storage space of the first device. Therefore, the first device can obtain the file to be pasted from the target storage space of the first device and then paste the file to be pasted at the location indicated by the second paste instruction.
[0202] Understandably, when the second data is a file type, the first device needs to store the file content of the file to be pasted in the target storage space of the first device, modify the storage path of the file to be pasted to the storage path of the target storage space, and then store it in the clipboard temporary area of the first device. Therefore, when performing a paste operation, the first device needs to obtain the storage path of the file to be pasted from the second data, and then retrieve the file to be pasted from the target storage space of the first device according to the storage path, and paste it at the location indicated by the second paste command.
[0203] In summary, the copy-paste method provided in this application embodiment also brings the following beneficial effects: the in-band controller can send the second data in the clipboard buffer of the second device to the out-of-band controller through a transmission channel (e.g., PCIe, USB, eSPI, or LPC), so that the out-of-band controller can send the second data to the KVM client of the first device through the KVM server, thereby realizing the copy-paste of the second data on the first device. It can be seen that the embodiments of this application can also synchronize the second data in the clipboard buffer of the second device to the clipboard buffer of the first device, realizing bidirectional cross-device copy-paste functionality.
[0204] The foregoing primarily describes the solutions of the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the aforementioned functions, the electronic device includes at least one of the hardware structures and software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0205] This application embodiment can divide the electronic device into functional units according to the above method examples. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0206] like Figure 4 As shown in the diagram, this application provides a schematic diagram of the structure of an electronic device. In some embodiments, the electronic device 500 includes a communication module 501. In other embodiments, the electronic device 500 further includes an identification module 502, a writing module 503, and a pasting module 504.
[0207] The communication module 501 is used to send the first data to the KVM server of the second device when the first device meets the first preset condition, so that the second device stores the first data in the clipboard temporary storage area of the second device, and when the second device receives a paste command, it retrieves the first data from the clipboard temporary storage area of the second device and pastes it to the position indicated by the paste command; wherein, the first data is the data in the clipboard temporary storage area of the first device.
[0208] In one possible implementation, the first preset condition is that the KVM client is running in the foreground of the first device; and / or, the first data is different from the data that was last sent from the first device to the KVM server of the second device.
[0209] In another possible implementation, the first data mentioned above includes one or more of the following: numbers, letters, symbols, text, mouse movement data, images, videos, or files.
[0210] In another possible implementation, the identification module 502 is used to identify the type of the first data; wherein the type of the first data includes file type and non-file type; the communication module 501 is also used to send the type of the first data to the KVM server of the second device, so that the second device can determine the pasting method of the first data according to the type of the first data; different types correspond to different pasting methods.
[0211] In another possible implementation, if the first data is a file type, the first data includes: the storage path of the file to be pasted; the communication module 501 is further configured to send the file content of the file to be pasted to the KVM server of the second device, so that the second device stores the content of the file to be pasted in the target storage space of the second device, and modifies the storage path of the file to be pasted to the storage path of the target storage space of the second device.
[0212] In another possible implementation, the communication module 501 is further configured to receive second data sent by the second device; wherein the second data is data in the clipboard temporary storage area of the second device; the writing module 503 is configured to write the second data into the clipboard temporary storage area of the first device; and the pasting module 504 is configured to retrieve the second data from the clipboard temporary storage area of the first device and paste the second data at the position indicated by the pasting instruction when a paste instruction is received.
[0213] In another possible implementation, the communication module 501 is further used to obtain the type of the second data; wherein the type of the second data includes a file type or a non-file type; and to determine the pasting method of the second data according to the type of the second data; the pasting methods are also different for different types.
[0214] In another possible implementation, when the type of the second data is a file type, the second data includes: the storage path of the file to be pasted; the communication module 501 is further used to obtain the file content of the file to be pasted; store the file to be pasted in the target storage space of the first device, and modify the storage path of the file to be pasted to the storage path of the target storage space of the first device; the writing module 503 is specifically used to write the modified storage path of the file to be pasted into the clipboard temporary storage area of the first device.
[0215] like Figure 5 As shown in the diagram, this application provides a schematic diagram of the structure of an electronic device. In some embodiments, the electronic device 600 includes a communication module 601 and a storage module 602. In other embodiments, the electronic device 600 further includes a determination module 603.
[0216] The communication module 601 is used to receive first data sent by the first device; the first data is data in the clipboard temporary storage area of the first device; the first device controls the second device through a KVM client.
[0217] Storage module 602 is used to store the first data into the clipboard temporary storage area of the second device.
[0218] The communication module 601 is also used to retrieve first data from the clipboard temporary storage area of the second device when a paste command is received, and paste the first data at the position indicated by the paste command.
[0219] In one possible implementation, the communication module 601 is further configured to obtain the type of the first data; wherein the type of the first data includes file type and non-file type. The determining module 603 is configured to determine the pasting method of the first data based on the type of the first data; wherein different types correspond to different pasting methods.
[0220] In another possible implementation, when the type of the first data is a file type, the first data includes: the storage path of the file to be pasted; the communication module 601 is further used to obtain the file content of the file to be pasted; the storage module 602 is further used to store the file content of the file to be pasted in the target storage space of the second device, and modify the storage path of the file to be pasted to the storage path of the target storage space of the second device; and store the modified storage path of the file to be pasted in the clipboard temporary storage area of the second device.
[0221] In another possible implementation, the communication module 601 is further configured to send the second data to the KVM client of the first device when the second device meets the second preset conditions, so that the first device stores the second data in the clipboard temporary storage area of the first device, and when the first device receives a paste command, retrieves the second data from the clipboard temporary storage area of the first device and pastes it to the position indicated by the paste command; wherein the second data is the data in the clipboard temporary storage area of the second device.
[0222] In another possible implementation, the second preset condition is that the data in the clipboard buffer of the second device has changed; and / or, the second data is different from the data that the second device last sent to the KVM client of the first device.
[0223] In another possible implementation, the determining module 603 is further used to identify the type of the second data; wherein the type of the second data includes file type and non-file type; the communication module 601 is further used to send the type of the second data to the KVM client of the first device, so that the first device can determine the pasting method of the second data according to the type of the second data; different types correspond to different pasting methods.
[0224] In another possible implementation, when the second data is a file type, the second data includes: the storage path of the file to be pasted; the determination module 603 is further configured to send the file content of the file to be pasted to the KVM client of the first device, so that the first device stores the content of the file to be pasted in the target storage space of the first device, and modifies the storage path of the file to be pasted to the storage path of the target storage space of the first device.
[0225] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the first device, the in-band controller, or the out-of-band controller can be divided into different functional modules to complete all or part of the functions described above.
[0226] This application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be executed by computer instructions instructing related hardware. This program can be stored in the aforementioned computer-readable storage medium. When executed, the program causes the electronic device to perform the processes of the above method embodiments. The computer-readable storage medium can be any of the foregoing embodiments or memory. The aforementioned computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device. Further, the aforementioned computer-readable storage medium can include both internal storage units of the computer device and external storage devices. The aforementioned computer-readable storage medium is used to store the aforementioned computer program and other programs and data required by the electronic device. The aforementioned computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0227] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform any of the copy-paste methods provided in the above embodiments.
[0228] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0229] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
[0230] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A copy and paste system, characterized by, The system includes a first device and a second device, wherein the first device controls the second device via a remote console KVM client; The first device is used to send the first data to the KVM server of the second device when the first preset condition is met; wherein, the first data is the data in the clipboard temporary storage area of the first device; The second device includes an out-of-band controller and an in-band controller; the KVM server runs on the out-of-band controller; the out-of-band controller is in the management network; the in-band controller is in the service network; wherein, the management network and the service network are isolated. The out-of-band controller is used to receive the first data sent by the first device and send the first data to the in-band controller; The in-band controller is used to receive the first data sent by the out-of-band controller and store the first data in the clipboard temporary storage area of the second device; the clipboard of the second device runs in the in-band controller; The second device is further configured to, upon receiving a paste instruction, retrieve the first data from the clipboard buffer of the second device and paste it to the position indicated by the paste instruction; The first device is also used to identify the type of the first data and send the type of the first data to the KVM server of the second device, so that the second device can determine the pasting method of the first data according to the type of the first data; the type of the first data includes file type and non-file type; different types correspond to different pasting methods.
2. The system of claim 1, wherein, The first preset condition is that the KVM client is running in the foreground of the first device; and / or, the first data is different from the data that was last sent from the first device to the KVM server of the second device.
3. The system of claim 1 or 2, wherein, The second device is further configured to send second data to the KVM client of the first device when a second preset condition is met; wherein the second data is data in the clipboard buffer of the second device; The first device is also configured to receive the second data and store the second data in the clipboard temporary storage area of the first device; The first device is also configured to, upon receiving a paste instruction, retrieve the second data from the clipboard buffer of the first device and paste it to the position indicated by the paste instruction.
4. The system according to claim 3, characterized in that, The second preset condition is that the data in the clipboard temporary storage area of the second device has changed; and / or, the second data is different from the data that the second device last sent to the KVM client of the first device.
5. A copy-and-paste method, characterized in that, The method is applied to a first device; the first device is used to control a second device via a KVM client; the method includes: When the first device meets the first preset condition, the first data is sent to the KVM server of the second device, so that the second device stores the first data in the clipboard temporary storage area of the second device, and when the second device receives a paste command, it retrieves the first data from the clipboard temporary storage area of the second device and pastes it to the position indicated by the paste command. Wherein, the first data is data in the clipboard buffer of the first device; the second device includes an out-of-band controller and an in-band controller; the KVM server runs in the out-of-band controller; the out-of-band controller is used to receive the first data sent by the first device and send the first data to the in-band controller; the in-band controller is used to receive the first data sent by the out-of-band controller and store the first data in the clipboard buffer of the second device; the clipboard of the second device runs in the in-band controller; the out-of-band controller is in the management network; the in-band controller is in the service network; wherein, the management network and the service network are isolated. The type of the first data is identified, and the type of the first data is sent to the KVM server of the second device so that the second device can determine the pasting method of the first data according to the type of the first data; the type of the first data includes file type and non-file type; different types correspond to different pasting methods.
6. The method according to claim 5, characterized in that, The first preset condition is that the KVM client is running in the foreground of the first device; and / or, the first data is different from the data that was last sent from the first device to the KVM server of the second device.
7. The method according to claim 5, characterized in that, If the first data is not a file type, the first data includes one or more of the following: numbers, letters, symbols, text, mouse movement data, images, or videos.
8. The method according to claim 5, characterized in that, When the first data is a file type, the first data includes: the storage path of the file to be pasted; the method further includes: The file content of the file to be pasted is sent to the KVM server of the second device, so that the second device stores the content of the file to be pasted in the target storage space of the second device and modifies the storage path of the file to be pasted to the storage path of the target storage space of the second device.
9. The method according to any one of claims 5 to 8, characterized in that, The method further includes: Receive second data sent by the second device; wherein the second data is data in the clipboard buffer of the second device; Write the second data into the clipboard temporary storage area of the first device; When a paste command is received, the second data is retrieved from the clipboard buffer of the first device and pasted at the location indicated by the paste command.
10. The method according to claim 9, characterized in that, The method further includes: Obtain the type of the second data; wherein, the type of the second data includes a file type or a non-file type; The pasting method for the second data is determined based on its type; different types require different pasting methods.
11. The method according to claim 10, characterized in that, When the type of the second data is a file type, the second data includes: the storage path of the file to be pasted; the method further includes: Obtain the file content of the file to be pasted; The file to be pasted is stored in the target storage space of the first device, and the storage path of the file to be pasted is modified to the storage path of the target storage space of the first device; The step of writing the second data to the clipboard temporary storage area of the first device includes: The modified storage path of the file to be pasted is written into the clipboard temporary storage area of the first device.
12. A copy-and-paste method, characterized in that, Applied to a second device; the method includes: The system receives first data sent by a first device; the first data is data in the clipboard buffer of the first device; the first device controls the second device through a KVM client; the second device includes an out-of-band controller and an in-band controller; the out-of-band controller is in a management network; the in-band controller is in a service network; wherein the management network and the service network are isolated. The KVM server runs in the out-of-band controller; the out-of-band controller is used to receive the first data sent by the first device and send the first data to the in-band controller; The in-band controller is used to receive the first data sent by the out-of-band controller and store the first data in the clipboard temporary storage area of the second device; the clipboard of the second device runs in the in-band controller; The first data is stored in the clipboard temporary storage area of the second device; When a paste command is received, the first data is retrieved from the clipboard buffer of the second device and pasted at the location indicated by the paste command. Obtain the type of the first data; wherein, the type of the first data includes file type and non-file type; The pasting method for the first data is determined based on the type of the first data; different types correspond to different pasting methods.
13. The method according to claim 12, characterized in that, When the type of the first data is a file type, the first data includes: the storage path of the file to be pasted; the method further includes: Obtain the file content of the file to be pasted; The file content of the file to be pasted is stored in the target storage space of the second device, and the storage path of the file to be pasted is modified to the storage path of the target storage space of the second device; The step of storing the first data in the clipboard temporary storage area of the second device includes: The modified storage path of the file to be pasted is stored in the clipboard temporary area of the second device.
14. The method according to claim 12, characterized in that, The method further includes: When the second device meets the second preset conditions, it sends the second data to the KVM client of the first device, so that the first device stores the second data in the clipboard temporary storage area of the first device, and when the first device receives a paste command, it retrieves the second data from the clipboard temporary storage area of the first device and pastes it to the position indicated by the paste command; wherein, the second data is the data in the clipboard temporary storage area of the second device.
15. The method according to claim 14, characterized in that, The second preset condition is that the data in the clipboard temporary storage area of the second device has changed; and / or, the second data is different from the data that the second device last sent to the KVM client of the first device.
16. The method according to claim 14 or 15, characterized in that, The method further includes: Identify the type of the second data; wherein, the type of the second data includes file type and non-file type; The type of the second data is sent to the KVM client of the first device so that the first device can determine the pasting method of the second data according to the type of the second data; different types correspond to different pasting methods.
17. The method according to claim 16, characterized in that, When the second data is a file type, the second data includes: the storage path of the file to be pasted; the method further includes: The file content of the file to be pasted is sent to the KVM client of the first device, so that the first device stores the content of the file to be pasted in the target storage space of the first device and modifies the storage path of the file to be pasted to the storage path of the target storage space of the first device.
18. An electronic device, characterized in that, include: An interface and logic circuitry, the logic circuitry being used to perform the copy-paste method as described in any one of claims 5 to 11.
19. An electronic device, characterized in that, include: An interface and logic circuitry, the logic circuitry being used to perform the copy-paste method as described in any one of claims 12 to 17.
Citation Information
Patent Citations
Improvements related to or involving the pasting of data
CN103608779B
Copying and pasting method and device in remote assistance and electronic equipment
CN107967184A
Software KVM management system based on network communication and audio and video coding technologies
CN108768999A
