Shear plate management method, device, equipment, medium and product

By comparing data processes and content through the clipboard manager, and using the Wayland protocol and MD5 algorithm for deduplication, the issues of lag and memory consumption during large data transfers are resolved, improving the smoothness and efficiency of clipboard operation.

CN120929286BActive Publication Date: 2026-01-20UNIONTECH SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511445694.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-01-20
Estimated Expiration
2045-10-10

AI Technical Summary

Technical Problem

Existing clipboard management solutions cannot effectively interrupt the data transmission process during large data transfers, resulting in user interface lag and failure to directly filter copied content, increasing memory usage and resource consumption.

Method used

The clipboard manager compares the data to be added to the clipboard with the data being added to determine whether to interrupt or filter data transmission. It uses the Wayland protocol extension interface to obtain the process identifier and uses the MD5 algorithm to deduplicate the data content.

Benefits of technology

It effectively avoids lag caused by multiple large data copying operations, reduces memory usage, improves user operation smoothness and system efficiency, and provides clearer clipboard content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929286B_ABST
    Figure CN120929286B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computers, and provides a clipboard management method, device, equipment, medium and product. The clipboard management method comprises: in response to receiving a clipboard instruction for adding first data to a clipboard, comparing the first data with data indicated to be added to the clipboard before the first data; and determining whether to add the first data to the clipboard according to a result of the comparison. The present disclosure can solve the problem that the user may experience lag when performing a clipboard operation multiple times because the copy or cut operation cannot be interrupted, improve the smoothness and efficiency of the operation, reduce the waiting time of the user, avoid interface lag and other problems, and bring the user a more smooth operation efficiency and system experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a clipboard management method and device, equipment, medium and product. BACKGROUND

[0002] In an operating system, the clipboard as an important mechanism for data transmission, its performance and use experience are crucial to users. With the development of computer technology, the implementation of the clipboard function has changed significantly. In some cases, the clipboard manager can be used to manage and save copied or cut content, and improve the data transmission efficiency of the clipboard.

[0003] However, when performing copying or cutting, if the operation of adding data to the clipboard needs to be performed multiple times, it may cause problems such as data transmission duplication, too long transmission time, etc., resulting in a user interface that appears to be stuck, which seriously affects the operation efficiency and user experience. SUMMARY

[0004] In view of the problem that the data duplication of the copying or cutting operation, the too long transmission time, etc. in the related art may cause the user interface to appear to be stuck, the present disclosure provides a clipboard management method, device, equipment, medium and product to at least solve or alleviate the above problems. The technical solutions of the present disclosure are as follows:

[0005] According to a first aspect of the present disclosure, a clipboard management method is provided, which is applied to a clipboard manager, and the clipboard management method comprises: in response to receiving a clipboard instruction of adding first data to a clipboard, comparing the first data with data indicated to be added to the clipboard before the first data; and determining whether to add the first data to the clipboard according to a result of the comparison.

[0006] Optionally, the comparison of the first data with the data indicated to be added to the clipboard before the first data comprises: in response to the existence of second data being currently added to the clipboard, comparing a first process of the first data with a second process of the second data, and the determination of whether to add the first data to the clipboard according to the result of the comparison comprises: in response to the first process being the same as the second process, interrupting the addition of the second data to the clipboard, and determining to add the first data to the clipboard.

[0007] Optionally, the clipboard instruction carries a process identifier of the first process, and the clipboard instruction is sent by the window manager to the clipboard manager through a Wayland protocol, where the Wayland protocol comprises an extension interface used to obtain the process identifier of the process to which the data to be added to the clipboard corresponds.

[0008] Optionally, the comparison of the first data with the data indicated to be added to the clipboard before the first data comprises: comparing the first data with each data that has been added to the clipboard, and the determination of whether to add the first data to the clipboard according to the comparison result comprises: in response to the first data being the same as fourth data that has been added to the clipboard, stopping adding the first data to the clipboard and placing the fourth data at a head position of the clipboard.

[0009] Optionally, the clipboard management method further comprises: in response to the first process being different from the second process, continuing to add the second data to the clipboard, and adding the first data to the clipboard after the addition of the second data is completed.

[0010] Optionally, the comparison of the first data with the data indicated to be added to the clipboard before the first data comprises: comparing the first data with each data that has been added to the clipboard, and the determination of whether to add the first data to the clipboard according to the comparison result comprises: in response to the first data being the same as fourth data that has been added to the clipboard, stopping adding the first data to the clipboard and placing the fourth data at a head position of the clipboard.

[0011] Optionally, the determination of whether to add the first data to the clipboard according to the comparison result further comprises: in response to the first data being different from each data that has been added to the clipboard, performing the step of starting to add the first data to the clipboard.

[0012] Optionally, the comparison of the first data with each data that has been added to the clipboard comprises: comparing a data type of the first data with data types of each data that has been added to the clipboard, and in response to the data type of the first data being the same as a data type of any data, comparing a data feature of the first data with a data feature of the any data, where the data feature represents content of data, and the same data feature indicates the same data.

[0013] According to a second aspect of the present disclosure, a clip board management apparatus is provided, which is applied to a clip board manager, and the clip board management apparatus comprises: a comparison unit configured to compare first data with data indicated to be added to a clip board before the first data in response to receiving a clip board instruction of adding the first data to the clip board; and a determination unit configured to determine whether to add the first data to the clip board according to a result of the comparison.

[0014] According to a third aspect of the present disclosure, a computing device is provided, which comprises: a processor; and a memory for storing computer executable instructions, wherein the computer executable instructions, when executed by the processor, cause the processor to perform the clip board management method according to an embodiment of the present disclosure.

[0015] According to a fourth aspect of the present disclosure, a computer readable storage medium is provided, which, when instructions in the computer readable storage medium are executed by a processor of a computing device, enables the computing device to perform the clip board management method according to an embodiment of the present disclosure.

[0016] According to a fifth aspect of the present disclosure, a computer program product is provided, which comprises computer executable instructions, which, when executed by at least one processor, implement the clip board management method according to an embodiment of the present disclosure.

[0017] The technical solutions provided by the present disclosure bring at least the following beneficial effects:

[0018] By using the clip board management scheme of the present disclosure, the first data can be compared with the data indicated to be added to the clip board before the first data, and according to a result of the comparison, it is determined whether to add the first data to the clip board. In this way, the data of the current operation can be compared with the data that has been added to or is being added to the clip board, so as to determine whether to continue the operation of adding the first data to the clip board according to the result of the data comparison, thereby determining whether to perform the operation on the subsequently copied / cut data in consideration of the previously copied / cut data, so as to avoid unnecessary data transmission, improve the fluency and efficiency of the operation, reduce the waiting time of the user, and avoid interface lag and other problems, thereby bringing the user a more smooth operation efficiency and system experience.

[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate implementations of the present disclosure and, together with the description, explain the principles of the present disclosure, and, without in any way limiting the present disclosure, illustrate the implementations.

[0021] Figure 1 is a schematic flowchart of a clipboard management method according to an exemplary embodiment of the present disclosure.

[0022] Figure 2 is a schematic flowchart of data filtering based on a process in a clipboard management method according to an exemplary embodiment of the present disclosure.

[0023] Figure 3 is a schematic flowchart of data filtering based on data content in a clipboard management method according to an exemplary embodiment of the present disclosure.

[0024] Figure 4 is a schematic flowchart of an application example of a clipboard management method according to an exemplary embodiment of the present disclosure.

[0025] Figure 5 is a schematic block diagram of a clipboard management apparatus according to an exemplary embodiment of the present disclosure.

[0026] Figure 6 is a block diagram of a computing device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] In order to make the ordinary person skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily represent a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0029] It should be noted that in the present disclosure, "at least one of a plurality of items" means that any one of the plurality of items, a combination of any number of the plurality of items, and all of the plurality of items are included. For example, "including at least one of A and B" includes the following three cases: (1) including A; (2) including B; (3) including A and B. For another example, "performing at least one of step one and step two" means the following three cases: (1) performing step one; (2) performing step two; (3) performing step one and step two.

[0030] As mentioned earlier, in related technologies, due to the inability to interrupt copy or cut operations, users may experience lag when repeatedly performing clipboard operations.

[0031] Taking Unix-like systems as an example, the Wayland protocol is a display protocol for Unix-like systems that can define how to manage windows and aims to provide efficient and secure window management services. Compared with the traditional XWindow system, the Wayland protocol uses a more concise and direct communication method, making the interaction between applications and display servers more efficient and secure.

[0032] In the Wayland protocol, the implementation of the clipboard function has changed significantly. The Wayland protocol adopts a decentralized design, allowing applications to communicate directly without going through a central server. This design improves data transmission efficiency and enhances system security.

[0033] However, when it comes to large data copy (including copy and cut) operations, the clipboard may still face some problems. Specifically, since data needs to be transmitted directly between applications, if the data volume is too large, it may cause the transmission time to be too long, affecting user experience. In addition, some applications may filter or convert clipboard data, which will increase the complexity and time-consuming of copy operations.

[0034] To solve these problems, the Wayland protocol and related implementations can take some optimization measures. For example, a data compression mechanism can be introduced to reduce the amount of data transmitted, thereby reducing the time-consuming of copy operations. In addition, asynchronous transmission support can be provided, allowing applications to continue performing other tasks while copy operations are in progress, thereby avoiding user interface lag and long waiting times.

[0035] Here, for the filtering and cleaning of data, in some cases, the application may not want to receive all the data in the clipboard, or need to filter out some specific content. For example, a text editor may want to filter out HTML tags or special characters in the copied content. The clipboard service can clean and filter the data before sending it to the target application.

[0036] In addition, for data that needs a long time to process (such as large files or complex format conversion), an asynchronous processing mode can be used. That is, when the data is copied to the clipboard, a marker indicating the start of the operation can be returned, and then the data processing and conversion can be performed in the background. In this way, the user can continue other operations without waiting for the data processing to complete.

[0037] However, in the existing clipboard filtering scheme, there are still obvious defects, one of the most prominent problems is that when processing large data transmission, the filtering mechanism cannot effectively interrupt the data transmission process. This means that once the large data starts to copy from the source application to the clipboard, the user must wait for the entire transmission process to complete, and cannot cancel or pause in the middle. This non-interruptible feature often causes the user interface to freeze when copying large data, seriously affecting user experience and efficiency.

[0038] In addition, the existing clipboard filtering scheme also has another problem, that is, there is no direct filtering of the copied content. This means that no matter what the copied content is, it will be completely copied to the clipboard and stored in memory first. This processing method not only increases the memory usage required during copying, but also may cause unnecessary resource consumption. Especially when dealing with large data, since the data needs to be completely copied to the clipboard, this undoubtedly further exacerbates the problem of memory usage, and may even cause system resource shortages, affecting the normal operation of other applications.

[0039] Overall, the existing clipboard management scheme has obvious shortcomings in large data transmission and memory management. In order to solve these problems, a more efficient and flexible filtering mechanism is needed, which can implement the interrupt function during data transmission, and in addition, can directly filter the copied content to reduce memory usage and improve system performance.

[0040] In view of the above, the exemplary embodiments of the present disclosure propose a clipboard management method, a clipboard management device, a computing device, a computer readable storage medium and a computer program product, which can solve or at least alleviate the above problems.

[0041] In a first aspect of the example embodiments of the present disclosure, a clipboard management method is provided. The method can be applied to a clipboard manager. An example implementation scenario of the clipboard management method according to the example embodiments of the present disclosure is given below.

[0042] The execution subject of the method can be a computing device capable of performing a copy operation and / or a cut operation. For example, the operating system of the computing device can be loaded with a clipboard manager. The clipboard manager can manage data added to the clipboard by performing the clipboard management method according to the embodiments of the present disclosure.

[0043] The computing device can be, but is not limited to, a desktop computer, a notebook computer, a tablet computer, a personal digital assistant, a smart phone, or other devices capable of performing the above method. However, the implementation scenario of the above method is only an example scenario. The method according to the example embodiments of the present disclosure can also be applied to other application scenarios. For example, a user can request a server to perform a copy or cut operation through a network via a user terminal (e.g., a mobile phone, a desktop computer, a tablet computer, etc.). The server can manage the clipboard by performing the method according to the example embodiments of the present disclosure. Here, the server can be a standalone server, a server cluster, a cloud computing platform, or a virtualization center.

[0044] The example embodiments of the clipboard management method according to the present disclosure will be described below with reference to the accompanying drawings. Figures 1 to 4 The clipboard management method according to the embodiments of the present disclosure can be applied to a clipboard manager. As shown in Figure 1 The method can include the following steps:

[0045] In step 110, the first data can be compared with data indicated to be added to the clipboard before the first data in response to receiving a clipboard instruction to add the first data to the clipboard.

[0046] In step 120, it can be determined whether to add the first data to the clipboard according to the comparison result.

[0047] Specifically, the clipboard instruction can be generated based on a copy operation or a cut operation input by a user for the first data.

[0048] The first data can be data in any application under any process. The data type of the first data can include, but is not limited to, video, image, text, audio, application, etc.

[0049] Here, the comparison object can include at least one of the following: a process in which the data is located; a data type of the data; and a data content of the data.

[0050] In an example, the comparison object can be a process where the data is located. Specifically, in step 110, comparing the first data with the data indicated to be added to the clipboard before the first data can include: in response to the second data currently existing and being added to the clipboard, comparing a first process of the first data with a second process of the second data.

[0051] Here, the first process can be a process performing a copy operation or a cut operation on the first data, for example, it can be a process that the user is operating, which can be a process in any application.

[0052] In this example, the first process can be determined by identifying the source of the first data, for example, the first data and information characterizing the source of the first data can be provided together to the clipboard manager.

[0053] For example, taking the Wayland protocol as an example, when the user performs a copy or cut operation on the first data in any application, the application can send the first data to the window manager (for example, KWIN), the window manager can receive the first data, and record the source of the first data, for example, the process (for example, the first process described above) performing the copy or cut on the first data. In Unix systems, KWIN is a window manager in the desktop environment, which constitutes part of the desktop environment, and can be used alone or in other desktop environments.

[0054] In addition, the window manager can also generate a clipboard instruction indicating that the first data is added to the clipboard, and can send the clipboard instruction to the clipboard manager. Here, the clipboard instruction can include address information of the first data.

[0055] As an example, the process identifier (PID) of the first process can be carried in the clipboard instruction, and the clipboard instruction can be sent by the window manager to the clipboard manager through the Wayland protocol.

[0056] Here, the Wayland protocol can be extended to be able to send the process identifier of the first process to the clipboard manager. Specifically, the Wayland protocol can include an extension interface, which can be used to obtain the process identifier of the process corresponding to the data to be added to the clipboard.

[0057] For example, the global clipboard protocol wlr-data-control-unstable-v1 can be extended with an extension interface, and in order to ensure compatibility, the version number can be controlled, and an example code of the extension interface is as follows:

[0058] <interface name="zwlr_data_control_offer_v1" version="2">

[0059] <description summary="offer to transfer data">

[0060] 一个wlr_data_control_offer表示由另一个客户端(源客户端)提供用于传输的数据片段。该提议描述了数据可以转换为的不同

[0061] MIME类型,并提供了直接从源客户端传输数据的机制。

[0062] MIME types that the data can be converted to and provides the mechanism

[0063] for transferring the data directly from the source client.

[0064] <!-- Added the get_pid event (since version 2) to transfer the process ID of the source client, facilitating the recipient to identify the data source -->

[0065] <!-- Can be used to prevent repeated transmissions by the same process, implement clipboard deduplication, security policy control, etc.-->

[0066] < / description>

[0067] <!-- Sent by the synthesizer to announce the process ID (PID) of the client providing this data to the receiver -->

[0068] <!-- The receiver can use this PID to determine if it is the same source, for deduplication or to avoid data looping back -->

[0069] <!-- Must be sent before data transmission starts, and only if the synthesizer supports getting the source process PID -->

[0070] <event name="get_pid" since="2">

[0071] <description summary="advertise get pid">

[0072] Sent by the compositor to inform the receiver of the sourceclient's process ID.

[0073] < / description>

[0074] <arg name="pid" type="uint" summary="process ID of the sourceclient" / >

[0075] < / event>

[0076] < / interface>

[0077] The above code is only an example of an extended interface. The Wayland protocol can also be modified in other ways, as long as the window manager can add the process identifier of the current copy or cut operation process (for example, the first process described above) to the clipboard instruction when sending the clipboard instruction through the Wayland protocol.

[0078] In the above manner, based on the existing Wayland protocol, the clipboard manager can learn the source or process corresponding to the data to be added to the clipboard, so as to identify the data that needs to be filtered out or interrupted in subsequent steps.

[0079] In an embodiment of the present disclosure, in response to receiving the clipboard instruction for the first data, it can be determined whether there is currently data being added to the clipboard. When there is second data being added to the clipboard, it can be determined whether the first process of the first data and the second process of the second data are consistent.

[0080] Specifically, the second data can be data that is executed with a copy operation or a cut operation before the first data. For example, the second data can be large data, and therefore it takes a long time to add the second data to the clipboard. During the process of adding the second data to the clipboard, the clipboard manager receives a copy operation or a cut operation for the first data.

[0081] For this process, in the related art, the first data needs to be added to the clipboard after the second data is completely added to the clipboard. If the amount of data of the second data is large, the user side can perceive a lag in the copy or cut operation of the first data due to the transmission of the second data, which affects the operation efficiency and system experience of the user. In an embodiment of the present disclosure, by adding a comparison between the first data to be added to the clipboard and the second data being added to the clipboard, it can be determined whether the second data needs to be filtered out.

[0082] Here, the second data can be data in any process of any application, and the data type thereof can include, but is not limited to, video, image, text, audio, application, and the like. The second process can be a process that performs a copy operation or a cut operation on the second data, for example, a process that has been operated or is being operated by the user, which can be a process in any application. In addition, the second data can be any data related to or completely unrelated to the first data.

[0083] Further, since the second data is data that is copied or cut before the first data, similarly to the process described above for the first data, in response to receiving the clipboard instruction to add the second data to the clipboard, the clipboard manager can determine the second process, for example, can determine the second process by identifying the source of the second data, for example, the second data and information characterizing the source of the second data can be provided together to the clipboard manager. Similarly, the process identification (PID) of the second process can be carried in the clipboard instruction for the second data, and the clipboard instruction for the second data can be sent by the window manager to the clipboard manager through the Wayland protocol.

[0084] In this example, the clipboard manager can compare the process identification of the first process with the process identification of the second process.

[0085] In this example, in step 120, determining whether to add the first data to the clipboard according to the comparison result can include: in response to the first process being the same as the second process, interrupting the addition of the second data to the clipboard, and determining to add the first data to the clipboard.

[0086] Specifically, in the case where the first process is the same as the second process, it indicates that the user performs the copy or cut operation for the second data, the first data in the same process in sequence, and only the data copied or cut later, i.e., the first data, can be retained, while the data copied or cut earlier, i.e., the second data, can be interrupted or discarded, thereby solving the problem of large data being copied multiple times and improving the user experience of large data copying.

[0087] Further, in the method according to the embodiments of the present disclosure, in response to the first process being different from the second process, the addition of the second data to the clipboard can be continued, and the first data is added to the clipboard after the addition of the second data is completed.

[0088] In this case, it can be considered that both the first data and the second data need to be added to the clipboard, and therefore can be added in sequence.

[0089] Further, in judging whether there is currently data being added to the clipboard, as an example, in response to there being no data currently being added to the clipboard, the addition of the second data to the clipboard can be continued, and the first data is added to the clipboard after the addition of the second data is completed.

[0090] As another example, comparing the first data with the data indicated to be added to the clipboard before the first data further includes: in response to there being no data currently being added to the clipboard, the first process can be compared with the processes of the data already added to the clipboard.

[0091] In this example, according to the result of the comparison, it is determined whether to add the first data to the clipboard, including: in response to the first process being the same as a third process of third data that has been added to the clipboard, and an interval time of the clipboard instruction for the first data and a clipboard instruction for the third data being less than a preset time length, stopping adding the first data to the clipboard.

[0092] Specifically, the third data is data that has completed the operation of adding to the clipboard, which can be data that has been executed with a copy operation or a cut operation before the first data.

[0093] Here, the interval time of receiving the clipboard instruction for the first data and the clipboard instruction for the third data can be determined, and in the case that the interval time is less than the preset time length, it can be considered that key sticking or delay occurs, resulting in two copy or cut operations in a short period of time, while the user actually only performs one copy or cut operation. In this case, it can be considered that the third data is the same as the first data, and the addition of the first data can be stopped to avoid unnecessary data transmission. Here, the preset time length can be set according to the actual situation, for example, it can be 200 ms.

[0094] In addition, in response to the first process being different from the process of all data that has been added to the clipboard, or the interval time of the clipboard instruction for the first data and the clipboard instruction for the third data being greater than or equal to the preset time length, the first data can be added to the clipboard, or other subsequent steps (for example, the data filtering process based on data content described below) can be performed.

[0095] Figure 2 An example of data filtering based on process in a clipboard management method according to an embodiment of the present disclosure is shown. As shown in Figure 2 As shown, in step S201, the application can send a copy or cut operation for the first data to the window manager; in step S202, the window manager can send a clipboard instruction to the clipboard manager to add the first data to the clipboard; in step S203, the clipboard manager can perform data verification on the first data, and in step S204, the process identifier of the first process of the first data can be determined.

[0096] At step S205, the clipboard manager can determine whether there is data being transmitted (or being added to the clipboard) in response to the presence, at step S206, directly close the last transmission process and start a new transmission process to add the first data to the clipboard. In response to the absence, at step S207, it can be determined whether there is data with the same process as the first data and the interval time of the two clipboard instructions is less than the preset time length, if less than the preset time length, at step S208, the first data can be stopped from being added to the clipboard; if not less than the preset time length, at step S209, the first data can be added to the clipboard, or other subsequent steps (such as performing a data filtering process based on the data content) can be performed.

[0097] The above describes that in the clipboard management method according to the embodiments of the present disclosure, the object of comparison can be the process in which the data is located, and by comparing the processes of each data, it is determined whether the transmission of the previous data needs to be interrupted or the transmission of the subsequent data needs to be stopped. In another example of the present disclosure, the object of comparison can also be the data type of the data and / or the data content of the data.

[0098] Specifically, in step 110, comparing the first data with the data indicated to be added to the clipboard before the first data can include comparing the first data with each data already added to the clipboard, and according to the comparison result, determining whether to add the first data to the clipboard can include: in response to the first data being the same as the fourth data already added to the clipboard, stopping adding the first data to the clipboard, and placing the fourth data at the head position of the clipboard.

[0099] In addition, according to the comparison result, determining whether to add the first data to the clipboard can also include: in response to the first data being different from each data already added to the clipboard, a step of adding the first data to the clipboard can be performed.

[0100] Specifically, before adding the first data to the clipboard, if there is fourth data in the clipboard that is the same as the first data, adding the first data to the clipboard can be stopped, and the fourth data can be placed at the head position of the clipboard for subsequent paste operations and the like. If there is no fourth data in the clipboard that is the same as the first data, the first data can be added to the clipboard.

[0101] In the above manner, the same data can be avoided from being repeatedly added to the clipboard, and the memory space of the clipboard can be occupied.

[0102] In the above process, as an example, the first data can be directly compared with each data that has been added to the clipboard, however, in order to improve the processing efficiency of the clipboard manager, as another example, the data feature of the first data can be compared with the data feature of each data that has been added to the clipboard.

[0103] Here, the data feature can represent the content of the data, and the same data feature indicates the same data. The data feature can be, for example, an MD5 value, and specifically, the MD5 value of the first data can be calculated by the MD5 algorithm as the data feature of the first data. In the case of the same data feature, it can be considered that the contents of the two data are the same. In this way of data feature comparison, the data with the same content can be more quickly identified. Here, the MD5 algorithm is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure the integrity of information transmission. However, embodiments of the present disclosure are not limited thereto, and the data feature can also be extracted in other ways for comparison.

[0104] As a further example, comparing the first data with each data that has been added to the clipboard includes: comparing the data type of the first data with the data type of each data that has been added to the clipboard; and in response to the data type of the first data being the same as the data type of any data, comparing the data feature of the first data with the data feature of the any data.

[0105] Here, the data type can be represented by, for example, mimetype (Multipurpose Internet Mail Extensions type) in the Wayland protocol, and as an example, the data type can include video, image, text, audio, application, and various data formats. As an example, the clipboard instruction can also carry the data type of the data, and thus the data type and the process identifier can be sent together in the clipboard instruction by the window manager to the clipboard manager through the Wayland protocol.

[0106] In embodiments of the present disclosure, in response to the data type of the first data being different from the data type of any data, the first data can be added to the clipboard.

[0107] Specifically, the data types of the data can be compared first, and in the case of the same data type, the data features can be further compared, while in the case of different data types, the data feature comparison is not needed, for example, in the case of the first data being text, the first data can only be compared with the data that has been added to the clipboard and is of the text type in terms of data features. In this way, the process of data comparison can be simplified, the amount of calculation of data comparison can be reduced, and the repeated data can be more quickly located and the non-repeated data can be excluded.

[0108] Figure 3 An example of data filtering based on data content in the clipboard management method according to the embodiments of the present disclosure is shown. As shown in Figure 3 At step S301, the application can send a copy or cut operation for the first data to the window manager; at step S302, the window manager can send a clipboard instruction to the clipboard manager to add the first data to the clipboard; at step S303, the clipboard manager can perform data checking on the first data, and can compare the data type of the first data with the data type of the data already added to the clipboard, and can further compare the data features of the first data with the data features of the data of the same type.

[0109] At step S304, according to the comparison result, it can be determined whether the first data is duplicated with the data already added to the clipboard, if duplicated, at step S305, the same data as the first data can be placed at the top of the clipboard, and the first data does not need to be stored to the clipboard; if not duplicated, at step S306, the first data can be added / stored to the clipboard.

[0110] In the above example, the process of comparing data types and / or data content can be performed separately, or after comparing the processes of each data, for example, in the case of determining to interrupt adding the second data to the clipboard and adding the first data to the clipboard, the data filtering based on the content of the data itself can be performed before adding the first data to the clipboard, so as to reduce unnecessary clipboard data transmission.

[0111] Figure 4 An example of the clipboard management method according to the embodiments of the present disclosure is shown. As shown in Figure 4 At step S401, the application can send a copy or cut operation for the first data to the window manager. At step S402, the window manager can send a clipboard instruction to the clipboard manager through the Wayland protocol to add the first data to the clipboard, and the clipboard instruction can carry the data type and process identification of the first data.

[0112] At step S403, the clipboard manager can perform data checking on the first data, specifically, after receiving the clipboard instruction for the first data from the window manager, the clipboard manager can determine whether the first data and the data being received have the same process identification, if the same, the data checking filtering can be performed, specifically, if the process identifications are the same, the last transmission can be directly disconnected, and the current first data can be received.

[0113] Further, in step S403, after receiving the clipboard instruction of the first data from the window manager, the clipboard manager can also determine whether the first data has the same mimetype as the stored data, and if so, content MD5 verification can be performed. Specifically, if the first data has a duplicate of the stored data, the existing data in the clipboard can be directly placed at the top position, and the order of the clipboard content can be set to activate the current data. If there is no duplicate data of the first data, the first data can be directly stored, and the clipboard content can be set to activate the first data.

[0114] In step S404, according to the comparison result, it can be determined whether the first data has a duplicate of the data already added to the clipboard. If there is a duplicate, in step S405, the same data as the first data can be placed at the top position of the clipboard, and the first data does not need to be added to the clipboard. If there is no duplicate, in step S406, the first data can be added to the clipboard.

[0115] As an important data sharing mechanism in the operating system, the clipboard undertakes the task of transferring data between different application programs. However, the clipboard technical solution in the related art has obvious deficiencies in large data copying / cutting and data duplication filtering. In order to solve these problems, the embodiment of the present disclosure proposes a brand-new clipboard management scheme, which aims to solve the large data multiple copying / cutting lag problem to improve the large data copying user experience, and solve the repeated data multiple storage problem to reduce the system memory space occupation and improve the system fluency, so as to improve the performance of the clipboard in large data copying / cutting and data filtering.

[0116] Specifically, according to the example embodiment of the present disclosure, when the clipboard manager receives new data, it first determines the source based on the process ID of the sending end. If it is the same as the process ID of the current data transmission, it is considered to be a continuous or repeated operation of the same source, and the previous transmission can be interrupted to avoid resource waste. On this basis, the MIME type of the newly received data and the stored data in the clipboard is further compared. When the types are the same, the content-level deduplication mechanism is started, and the MD5 digest value of the two is calculated and compared to determine whether the content is consistent. If it is consistent, it is determined to be completely duplicate data, and the new data is discarded. Otherwise, the clipboard content is updated.

[0117] In the above process, "process ID judgment" is the first layer of filtering, which can quickly exclude duplicate triggers of the same source. "MIME+MD5" is the second layer of fine filtering, which can prevent data redundancy of different sources but the same content. The two constitute a complete deduplication system with logical levels, thus embodying strong correlation and technical synergy.

[0118] Specifically, for the lag phenomenon caused by multiple copies of large data, the embodiments of the present disclosure significantly improve the user experience of large data copying by optimizing the copy mechanism, wherein a process identifier and an interval time verification mechanism are introduced, effectively reducing the number of unnecessary data transmissions, thereby greatly improving the fluency and efficiency of the copy operation.

[0119] In addition, for the problem of excessive system memory occupation caused by multiple storage of repeated data, the embodiments of the present disclosure can automatically identify and filter repeated content before data is copied to the clipboard by implementing an efficient data deduplication mechanism, thereby avoiding multiple storage of repeated data. This improvement not only effectively reduces the occupied space of system memory, but also improves the efficiency and accuracy of data management. In addition, it also provides users with clearer and more concise clipboard content, improving the user's convenience.

[0120] Overall, the embodiments of the present disclosure achieve precise filtering of clipboard data by comprehensively using the extended image protocol and interval time verification mechanism, significantly reducing the number of data transmissions. In addition, by using an advanced data content filtering method, the memory occupation is effectively reduced, and the system resource utilization efficiency is improved. This method is suitable for any scene such as PC Wayland clipboard development, providing developers with more efficient and flexible clipboard data processing means.

[0121] In a second aspect of the example embodiments of the present disclosure, a clipboard management apparatus is provided, such as Figure 5 As shown, the clipboard management apparatus 500 can include a comparison unit 510 and a determination unit 520.

[0122] The comparison unit 510 is configured to, in response to receiving a clipboard instruction to add first data to a clipboard, compare the first data with data that was instructed to be added to the clipboard before the first data.

[0123] The determination unit 520 is configured to determine whether to add the first data to the clipboard according to a result of the comparison.

[0124] As an example, the comparison unit 510 is configured to, in response to there currently being second data being added to the clipboard, compare a first process of the first data with a second process of the second data, and the determination unit 520 is configured to, in response to the first process being the same as the second process, interrupt the addition of the second data to the clipboard and determine to add the first data to the clipboard.

[0125] As an example, the process identifier of the first process is carried in the clipboard instruction, and the clipboard instruction is sent by the window manager to the clipboard manager through a Wayland protocol, wherein the Wayland protocol comprises an extension interface, and the extension interface is used to obtain the process identifier of the process to which the data to be added to the clipboard corresponds.

[0126] As an example, the comparison unit 510 is configured to compare the first process with processes of data already added to the clipboard in response to the current absence of data being added to the clipboard, and the determination unit 520 is configured to stop adding the first data to the clipboard in response to the first process being identical to a third process of third data already added to the clipboard and an interval time between the clipboard instruction for the first data and a clipboard instruction for the third data being less than a preset time length.

[0127] As an example, the determination unit 520 is further configured to continue adding the second data to the clipboard and add the first data to the clipboard after completing the addition of the second data in response to the first process being different from the second process.

[0128] As an example, the comparison unit 510 is configured to compare the first data with data already added to the clipboard, and the determination unit 520 is configured to stop adding the first data to the clipboard and place fourth data already added to the clipboard at a head position of the clipboard in response to the first data being identical to the fourth data.

[0129] As an example, the determination unit 520 is further configured to execute the step of starting to add the first data to the clipboard in response to the first data being different from each of data already added to the clipboard.

[0130] As an example, the comparison unit 510 is configured to compare a data type of the first data with data types of data already added to the clipboard, and compare a data feature of the first data with data features of any data in response to the data type of the first data being identical to a data type of any data, wherein the data feature represents the content of the data, and the same data feature indicates the same data.

[0131] As to the apparatus in the above embodiments, the specific manners in which the units perform operations have been described in detail in the embodiments of the method, and each unit in the clipboard management apparatus can perform the corresponding steps in the method according to the clipboard management method in the method embodiments of the first aspect, which will not be described in detail here.

[0132] In a third aspect of the example embodiments of the present disclosure, a computing device is provided, comprising: a processor; a memory for storing computer-executable instructions, wherein the computer-executable instructions, when executed by the processor, cause the processor to perform the clipboard management method according to the present disclosure.

[0133] Figure 6 is an example block diagram of a computing device according to the example embodiments of the present disclosure. As shown, the computing device 600 can include a processor 610 and a memory 620, which can be used to store computer-executable instructions 621 and an operating system 622. Here, the computer-executable instructions, when executed by the processor 610, cause the processor 610 to perform the clipboard management method as described in the example embodiments above. The computer-executable instructions 621 can be executed in the processor together with the operating system 622. Figure 6

[0134] As an example, the computing device 600 need not be a single device, but can be a collection of devices or circuits that can individually or jointly execute the instructions (or sets of instructions) described above. The computing device 600 can also be part of an integrated control system or system manager, or can be configured as a server that interfaces with a local or remote (e.g., via wireless transmission) interface.

[0135] In the computing device 600, the processor 610 can include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. As an example and not by way of limitation, the processor 610 can also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0136] The processor 610 can execute instructions or code stored in the memory 620, which can also store data. The instructions and data can also be sent and received over a network via a network interface device, which can employ any known transmission protocol.

[0137] The memory 620 can be integrated with the processor 610, e.g., disposed within an integrated circuit microprocessor, etc. Further, the memory 620 can include a separate device, such as an external disk drive, a storage array, or any other storage device usable by a database system. The memory 620 and the processor 610 can be operatively coupled, or can communicate with each other, e.g., through I / O ports, network connections, etc., so that the processor 610 can read files stored in the memory 620.

[0138] ​In addition, the computing device 600 can also include a video display such as a liquid crystal display and a user interface such as a keyboard, a mouse, a touch input device, etc. All components of the computing device 600 can be connected to each other via a bus and / or a network.

[0139] In an example embodiment, a computer readable storage medium can also be provided, which, when instructions in the computer readable storage medium are executed by a processor of a computing device, enables the computing device to perform the clipboard management method as described in the example embodiments above. The computer readable storage medium may, for example, be a memory including instructions, and optionally, the computer readable storage medium can be: a read-only memory (ROM), a random access memory (RAM), a random access programmable read-only memory (PROM), an electrically erasable programmable read-only memory (EEPROM), a dynamic random access memory (DRAM), a static random access memory (SRAM), a flash memory, a non-volatile memory, a CD-ROM, a CD-R, a CD+R, a CD-RW, a CD+RW, a DVD-ROM, a DVD-R, a DVD+R, a DVD-RW, a DVD+RW, a DVD-RAM, a BD-ROM, a BD-R, a BD-R LTH, a BD-RE, a Blu-ray or optical disc memory, a hard disk drive (HDD), a solid state drive (SSD), a card memory such as a multimedia card, a secure digital (SD) card, or an extreme digital (XD) card, a magnetic tape, a floppy disk, a magneto-optical data storage device, an optical data storage device, a hard disk, a solid state disk, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the computer readable storage medium described above can be run in an environment deployed in a computer device such as a client, a host, a proxy device, a server, etc., and, in one example, the computer program and any associated data, data files, and data structures are distributed over a networked computer system so that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner by one or more processors or computers.

[0140] According to an example embodiment of the present disclosure, a computer program product can also be provided, which includes computer executable instructions that, when executed by at least one processor, implement the clipboard management method according to an example embodiment of the present disclosure.

[0141] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the disclosure be construed as including any patents, patent applications, publications, publications, or other disclosure of the prior art that are referred to by citation above. The specification and examples given herein are to be considered illustrative and not restrictive. The scope of the disclosure is to be determined by the appended claims.

[0142] Furthermore, it is to be understood that, unless otherwise expressly provided herein, any of the steps of the processes described herein can be performed in any order. Furthermore, it is to be understood that, although the steps of the above-described embodiments have been described in conjunction with the above-described examples, other steps and / or examples can modify, augment, or omit one or more of the steps described above.

[0143] It is to be understood that the embodiments of the present disclosure are not limited to the precise structures herein described and illustrated above, and that various modifications and changes can be made without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the claims that follow.

Claims

1. A clipboard management method, characterized in that, The clipboard management method is applied to the clipboard manager, wherein the clipboard management method includes: In response to receiving a clipboard instruction to add first data to the clipboard, the first data is compared with data that was previously instructed to be added to the clipboard. Based on the comparison results, determine whether to add the first data to the clipboard. The comparison of the first data with data previously indicated for addition to the clipboard includes: in response to the presence of second data currently being added to the clipboard, comparing a first process of the first data with a second process of the second data. The step of determining whether to add the first data to the clipboard based on the comparison result includes: in response to the first process being the same as the second process, interrupting the addition of the second data to the clipboard, and determining that the first data should be added to the clipboard. The comparison of the first data with data previously indicated for addition to the clipboard further includes: in response to the absence of data currently being added to the clipboard, comparing the first process with the processes of each piece of data already added to the clipboard. The step of determining whether to add the first data to the clipboard based on the comparison result further includes: stopping the addition of the first data to the clipboard in response to the fact that the first process is the same as the third process of the third data that has already been added to the clipboard, and the interval between the clipboard command for the first data and the clipboard command for the third data is less than a preset time.

2. The shear board management method according to claim 1, characterized in that, The clipboard command carries the process identifier of the first process. The clipboard command is sent to the clipboard manager by the window manager via the Wayland protocol. The Wayland protocol includes an extension interface for obtaining the process identifier of the process corresponding to the data to be added to the clipboard.

3. The shear board management method according to claim 1, characterized in that, The clipboard management method further includes: In response to the difference between the first process and the second process, the second data is added to the clipboard, and the first data is added to the clipboard after the second data is added.

4. The shear plate management method according to any one of claims 1 to 3, characterized in that, The comparison of the first data with data that was previously instructed to be added to the clipboard also includes: Compare the first data with the data that have already been added to the clipboard. The step of determining whether to add the first data to the clipboard based on the comparison result includes: In response to the fact that the first data is the same as the fourth data that has already been added to the clipboard, the addition of the first data to the clipboard is stopped, and the fourth data is placed at the beginning of the clipboard.

5. The shear plate management method according to claim 4, characterized in that, The step of determining whether to add the first data to the clipboard based on the comparison result further includes: In response to the fact that the first data is different from all the data already added to the clipboard, the step of adding the first data to the clipboard is performed.

6. The shear plate management method according to claim 4, characterized in that, The comparison of the first data with each piece of data already added to the clipboard includes: Compare the data type of the first data with the data types of each data already added to the clipboard; In response to the fact that the data type of the first data is the same as the data type of any data, the data features of the first data are compared with the data features of the arbitrary data, wherein the data features characterize the content of the data, and the same data features indicate that the data are the same.

7. A shearing plate management device, characterized in that, The clipboard management device is applied to the clipboard manager, wherein the clipboard management device includes: The comparison unit is configured to compare the first data with data that was previously instructed to be added to the clipboard in response to receiving a clipboard instruction to add the first data to the clipboard. The determining unit is configured to determine, based on the result of the comparison, whether to add the first data to the clipboard. The comparison unit is configured to: in response to the existence of second data being added to the clipboard, compare a first process of the first data with a second process of the second data; wherein the determining unit is configured to: in response to the first process and the second process being the same, interrupt the addition of the second data to the clipboard, and determine to add the first data to the clipboard. The comparison unit is configured to: in response to the absence of data being added to the clipboard, compare the first process with the processes of each data already added to the clipboard; wherein the determination unit is configured to: in response to the first process being the same as the third process of the third data already added to the clipboard, and the interval between the clipboard command for the first data and the clipboard command for the third data being less than a preset time, stop adding the first data to the clipboard.

8. A computing device, characterized in that, The computing device includes: processor; Memory used to store executable instructions for a computer. Wherein, when the computer-executable instructions are executed by the processor, they cause the processor to execute the clipboard management method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of a computing device, the computing device is able to perform the clipboard management method according to any one of claims 1 to 6.

10. A computer program product comprising computer-executable instructions, characterized in that, When the computer-executable instructions are executed by at least one processor, they implement the clipboard management method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for reading clipboard content and electronic equipment

    CN115408168A

  • System and method for manipulating multiple clip items of data

    US20040100496A1