Clipboard management method and device, storage medium and electronic equipment

By obtaining permissions and monitoring data access operations through the clipboard manager, obtaining window properties and data content, and performing data management and processing, the problem of insufficient clipboard data security in domestic operating systems is solved, and precise control of clipboard operations and data security are achieved.

CN120654245APending Publication Date: 2025-09-16BEIJING HONGTENG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410302326.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the existing technology, the clipboard data security of domestic operating systems is insufficient, which can easily lead to information leakage, and there is an urgent need to improve data security.

Method used

Obtain permissions through the clipboard manager, monitor data access operations in the target window, obtain window attribute information and data content, and perform data control based on this information, including allowing or prohibiting data access operations.

Benefits of technology

It achieves precise control over clipboard operations, ensures data security and prevents information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654245A_ABST
    Figure CN120654245A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a clipboard management method and device, a storage medium and electronic equipment, and the method comprises the steps: controlling a clipboard manager to obtain the clipboard authority of a clipboard, and when it is monitored that a target window initiates a data access operation for the clipboard, starting the clipboard authority of the clipboard; window attribute information of the target window and data content corresponding to the data access operation are obtained, and a clipboard manager is controlled to conduct data management and control processing on a clipboard based on the data access operation, the window attribute information and the data content. By adopting the method, the authority of the clipboard is allocated to the clipboard manager, so that when the data access operation which is initiated by other windows and aims at the clipboard is monitored, data management and control processing can be conveniently performed on the clipboard through the clipboard manager, and therefore, the data of the clipboard can be taken over through the clipboard manager, and the data access efficiency can be improved. Accurate control over clipboard operation is achieved, and therefore the safety of data corresponding to clipboard behaviors is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a clipboard management method, device, storage medium, and electronic device. Background Art

[0002] With the rapid development of information technology, computers and the internet have become an integral part of modern society. For a country, relying on operating systems from external suppliers can pose security risks and potential information leaks. Therefore, to protect national information security and core interests, my country has begun to intensify its efforts to independently develop domestic operating systems. With the increasing use of domestically produced systems, ensuring data security on these systems is a crucial task. Summary of the Invention

[0003] The present application provides a clipboard management method, device, computer storage medium, and electronic device. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a clipboard management method, the method comprising:

[0005] Control the clipboard manager to obtain the clipboard permissions of the clipboard;

[0006] When it is detected that a target window initiates a data access operation to the clipboard, acquiring window attribute information of the target window and data content corresponding to the data access operation;

[0007] The clipboard manager is controlled to perform data management and control processing on the clipboard based on the data access operation, the window attribute information and the data content.

[0008] In a feasible implementation, when monitoring that a target window initiates a data access operation on the clipboard, obtaining window attribute information of the target window and data content corresponding to the data access operation includes:

[0009] When it is detected that the target window initiates a data copy operation on the clipboard, obtaining a content type list acquisition request for the data copy operation;

[0010] Obtaining the content type list corresponding to the content type list acquisition request and the window attribute information of the target window;

[0011] The clipboard manager determines a target content type in the content type list, and obtains data content corresponding to the target content type.

[0012] In a feasible implementation manner, the obtaining of the content type list corresponding to the content type list acquisition request and the window attribute information of the target window includes:

[0013] Obtaining window attribute information of the target window;

[0014] Controlling the clipboard manager to send the content type list acquisition request to the target window, wherein the content type list acquisition request is used to instruct the target window to determine a content type list;

[0015] The clipboard manager is controlled to obtain the content type list from the target window.

[0016] In a feasible implementation manner, determining the target content type in the content type list by the clipboard manager includes:

[0017] Get the preset content type management collection;

[0018] The clipboard manager is controlled based on the preset content type management set to determine a target content type in the content type list.

[0019] In a feasible implementation, when monitoring that a target window initiates a data access operation on the clipboard, obtaining window attribute information of the target window and data content corresponding to the data access operation includes:

[0020] When it is detected that the target window initiates a data paste operation on the clipboard, acquiring window attribute information of the target window;

[0021] The data content corresponding to the data pasting operation is determined in the clipboard.

[0022] In a feasible implementation manner, controlling the clipboard manager to perform data management and control processing on the clipboard based on the data access operation, the window attribute information, and the data content includes:

[0023] Determining an access operation type of the data access operation and determining a content privacy type corresponding to the data content;

[0024] Determine the window data permission type corresponding to the window attribute information;

[0025] Determine a data control result based on the window data permission type, the access operation type, and the content privacy type;

[0026] The clipboard manager is controlled to perform data control processing on the clipboard based on the data control result.

[0027] In a feasible implementation manner, determining the data control result based on the window data permission type, the access operation type, and the content privacy type includes:

[0028] If the window data permission type, the access operation type, and the content privacy type match, a data permission control result is generated;

[0029] If any two of the window data permission type, the access operation type, and the content privacy type do not match, a data prohibition control result is generated.

[0030] In a feasible implementation manner, controlling the clipboard manager to perform data control processing on the clipboard based on the data control result includes:

[0031] If the data control result is the data permission control result, controlling the clipboard manager to perform a data response operation for the data access operation;

[0032] If the data control result is the data prohibition control result, the clipboard manager is controlled to clear the data content or intercept the data access operation.

[0033] In a second aspect, an embodiment of the present application provides a clipboard management device, the device comprising:

[0034] The permission configuration module is used to control the clipboard manager to obtain the clipboard permission of the clipboard;

[0035] a data acquisition module, configured to acquire window attribute information of the target window and data content corresponding to the data access operation when detecting that a target window initiates a data access operation on the clipboard;

[0036] A data control module is used to control the clipboard manager to perform data control processing on the clipboard based on the data access operation, the window attribute information and the data content.

[0037] Optionally, the data acquisition module includes:

[0038] A first acquiring unit is configured to acquire a content type list acquisition request for the data copy operation when it is detected that a target window initiates a data copy operation for the clipboard;

[0039] a second acquiring unit, configured to acquire the content type list corresponding to the content type list acquisition request and the window attribute information of the target window;

[0040] A third acquiring unit is configured to determine a target content type in the content type list through the clipboard manager, and acquire data content corresponding to the target content type.

[0041] Optionally, the second acquiring unit is specifically configured to:

[0042] Obtaining window attribute information of the target window;

[0043] Controlling the clipboard manager to send the content type list acquisition request to the target window, wherein the content type list acquisition request is used to instruct the target window to determine a content type list;

[0044] The clipboard manager is controlled to obtain the content type list from the target window.

[0045] Optionally, the third acquiring unit is specifically configured to:

[0046] Get the preset content type management collection;

[0047] The clipboard manager is controlled based on the preset content type management set to determine a target content type in the content type list.

[0048] Optionally, the data acquisition module is specifically used to:

[0049] When it is detected that the target window initiates a data paste operation on the clipboard, acquiring window attribute information of the target window;

[0050] The data content corresponding to the data pasting operation is determined in the clipboard.

[0051] Optionally, the data control module includes:

[0052] a first control unit, configured to determine an access operation type of the data access operation and a content privacy type corresponding to the data content;

[0053] A second control unit is configured to determine a window data permission type corresponding to the window attribute information;

[0054] a third control unit, configured to determine a data control result based on the window data permission type, the access operation type, and the content privacy type;

[0055] A fourth control unit is configured to control the clipboard manager to perform data control processing on the clipboard based on the data control result.

[0056] Optionally, the third control unit is specifically configured to:

[0057] If the window data permission type, the access operation type, and the content privacy type match, a data permission control result is generated;

[0058] If any two of the window data permission type, the access operation type, and the content privacy type do not match, a data prohibition control result is generated.

[0059] Optionally, the fourth control unit is specifically configured to:

[0060] If the data control result is the data permission control result, controlling the clipboard manager to perform a data response operation for the data access operation;

[0061] If the data control result is the data prohibition control result, the clipboard manager is controlled to clear the data content or intercept the data access operation.

[0062] In a third aspect, an embodiment of the present application provides a computer storage medium, which has multiple instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.

[0063] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a memory and a processor; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the memory and executing the above-mentioned method steps.

[0064] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0065] In an embodiment of the present application, the clipboard manager is controlled to obtain the clipboard permissions of the clipboard. When a target window is detected to initiate a data access operation to the clipboard, the window attribute information of the target window and the data content corresponding to the data access operation are obtained. Based on the data access operation, the window attribute information and the data content, the clipboard manager is controlled to perform data control processing on the clipboard. Using this method, the embodiment of the present application assigns the clipboard permissions to the clipboard manager, so that when a data access operation to the clipboard is detected initiated by other windows, the clipboard manager can perform data control processing on the clipboard. Therefore, by taking over the clipboard data through the clipboard manager, precise control of clipboard operations is achieved, thereby ensuring the security of the data corresponding to the clipboard behavior. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0067] Figure 1 This is a flowchart of a clipboard management method provided by an embodiment of the present application;

[0068] Figure 2 This is a flowchart of another clipboard management method provided by an embodiment of the present application;

[0069] Figure 3 This is a flowchart of another clipboard management method provided in an embodiment of the present application;

[0070] Figure 4 This is a structural diagram of a clipboard management device provided in an embodiment of the present application;

[0071] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0072] In order to make the purpose, features, and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.

[0073] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance. In the description of this application, it should be noted that, unless otherwise expressly specified and limited, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "and / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0074] With the increasing use of domestic operating systems, data security on domestic Linux systems is becoming increasingly important. The clipboard is a crucial operating system tool, used to temporarily store copied or cut data and to transfer data between applications. While the clipboard is crucial to the operating system, it is also the data most vulnerable to leakage and presents security issues. Therefore, ensuring the security of clipboard data is a pressing technical issue.

[0075] In order to solve the above technical problems, the present application is described in detail below with reference to specific embodiments.

[0076] In the following method embodiments, for ease of description, only the electronic device is used as the execution subject of each step for description.

[0077] See Figure 1 , which is a flow chart of a clipboard management method provided in an embodiment of the present application.

[0078] like Figure 1 As shown, the method of the embodiment of the present application may include the following steps:

[0079] S101, controlling the clipboard manager to obtain the clipboard permission of the clipboard.

[0080] It is easy to understand that the clipboard manager refers to a software tool for managing clipboard content. In the embodiment of the present application, the clipboard manager can configure corresponding clipboard management functions according to business needs.

[0081] The clipboard is a useful tool built into the operating system, used to temporarily store text, images, or other data copied or cut by the user, so that it can be pasted elsewhere later. The clipboard can be called a data transfer station, storing the most recently copied or cut content. New clippings overwrite older clippings. Different applications in the operating system share the same clipboard.

[0082] Clipboard permissions refer to the right to manage the clipboard. The operating system only allows one window to have clipboard permissions at a time. A window is the visual container used to display and interact with the user interface in the operating system. Specifically, in the Linux platform, in the X Window System, the clipboard is called a "selection." The clipboard can be divided into two types: primary selection and clipboard selection. Clipboard permissions include the right to manage both primary selection and clipboard selection. Primary selection refers to selecting content for copying using the mouse or keyboard, while clipboard selection refers to copying using the menu or shortcut keys.

[0083] In some embodiments, controlling the clipboard manager to obtain the clipboard permission of the clipboard can be understood as obtaining a declaration command from the clipboard manager to the operating system to obtain the clipboard permission, thereby assigning the clipboard permission of the clipboard to the clipboard manager. The declaration command from the clipboard to the operating system to obtain the clipboard permission can be a method in which the clipboard uses a declaration function to declare the permission to the operating system.

[0084] When the embodiment of the present application is applied to the X window system in the Linux platform, the clipboard permissions obtained by the clipboard manager may include permissions for two selections: main selection and clipboard selection.

[0085] S102 : When it is detected that the target window initiates a data access operation to the clipboard, the window attribute information of the target window and the data content corresponding to the data access operation are obtained.

[0086] For easy understanding, data access operations refer to operations that store data in or retrieve data from the clipboard. Data access operations can include data copy operations and data paste operations. Data copy operations refer to operations that copy or paste data, and can be triggered by the mouse, keyboard, or menu item. Data paste operations refer to operations that paste data, and can also be triggered by the mouse, keyboard, or menu item.

[0087] A target window is a graphical representation of an application, file, folder, or other operating system resource other than the Clipboard Manager. A target window is a visually independent area or container for displaying and interacting with user interface content.

[0088] Window attribute information refers to the attribute information of the target window, which may include but is not limited to the window name, window identifier, window type, and data types supported by the window. The data types supported by the window refer to the types of data that the window can output and display to the user. The data types supported by the window may include but are not limited to image types, text types, table types, etc. Window type refers to

[0089] The data content corresponding to a data access operation refers to the data content of the data access operation. Specifically, when the data access operation is a data copy operation, the data content is the copied data content; when the data access operation is a data paste operation, the data content is the data content to be pasted. Data content can include text, images, file names, tables, and other types of content.

[0090] In some embodiments, after the clipboard permissions of the clipboard are assigned to the clipboard manager, it is possible to monitor whether a data access operation for the clipboard is received initiated by the target window. When it is monitored that the target window initiates a data access operation, the steps of obtaining the window attribute information of the target window and the data content corresponding to the data access operation are executed.

[0091] Obtaining the target window's window attribute information can be understood as follows: since one or both of the target window's window name and window identifier are known when a data access operation is detected, the window type corresponding to the target window, the data types supported by the window, and other attribute information can be queried in the window configuration file based on the window name or window identifier. The window configuration file is used to store the window attribute information for each window.

[0092] Obtaining the data content corresponding to the data access operation can be understood as, when the data access operation is a data copy operation, the copied data content can be obtained from the target window; when the data access operation is a data paste operation, the data content to be pasted can be obtained from the clipboard. At this time, the content stored in the clipboard is the data content copied by the data copy operation before this data paste operation.

[0093] S103: Controlling the clipboard manager to perform data management and control on the clipboard based on the data access operation, window attribute information, and data content.

[0094] In some embodiments, executing step S103 may be: obtaining a preset data control policy based on the reference data access operation, reference window attribute information, and reference data content configuration, and performing data control processing on the clipboard through the clipboard manager according to the preset data control policy. The preset data control policy includes two types of control policies, one is a permitted response policy, and the other is a prohibited response policy. When the preset data control policy is a permitted response policy, performing data control processing on the clipboard through the clipboard manager can be understood as controlling the clipboard manager to perform a data response operation for the data access operation; a data response operation for the data copy operation can be storing the data content corresponding to the data copy operation into the clipboard; a data response operation for the data paste operation can be storing the data content corresponding to the data paste operation from the clipboard into the target window. When the preset data control policy is a prohibit response policy, data control processing is performed on the clipboard through the clipboard manager, which can be understood as controlling the clipboard manager to perform data interception operations for data access operations; the data interception operation for data paste operations can be to prohibit the data content corresponding to the data paste operation from being stored from the clipboard to the target window; the data response operation for the data copy operation can be to clear the data content corresponding to the data copy operation from the clipboard.

[0095] The preset data control policy may be a data control policy previously determined based on multiple reference data access operations, window attribute information of multiple reference windows, and multiple reference data contents. More specifically, the preset data control policy may include a window data control policy for each reference window. Each reference window may correspond to multiple window data control policies, each corresponding to a specific reference data content type under each reference data access operation.

[0096] For example, assuming that the reference data access operations are data copy operations and data paste operations, the reference data content may include three types of data content: text, pictures, and tables. Assuming that the reference window is the window of Notepad software, its corresponding window data management policy may be the control policy for text type data content under the data copy operation, the control policy for picture type data content under the data copy operation, the control policy for table type data content under the data copy operation, the control policy for text type data content under the data paste operation, the control policy for picture type data content under the data paste operation, and the control policy for table type data content under the data paste operation.

[0097] It should be noted that the concept of the reference window is the same as the concept of the target window described above, and the reference window described here is to distinguish it from the target window. The concept of the reference data access operation is the same as the concept of the data access operation described above, and the reference data access operation described here is to distinguish it from the data access operation described above.

[0098] In an embodiment of the present application, the clipboard manager is controlled to obtain the clipboard permissions of the clipboard. When a target window is detected to initiate a data access operation to the clipboard, the window attribute information of the target window and the data content corresponding to the data access operation are obtained. Based on the data access operation, the window attribute information and the data content, the clipboard manager is controlled to perform data control processing on the clipboard. Using this method, the embodiment of the present application assigns the clipboard permissions to the clipboard manager, so that when a data access operation to the clipboard is detected initiated by other windows, the clipboard manager can perform data control processing on the clipboard. Therefore, by taking over the clipboard data through the clipboard manager, precise control of clipboard operations is achieved, thereby ensuring the security of the data corresponding to the clipboard behavior.

[0099] See Figure 2 , which is a flow chart of a clipboard management method provided in an embodiment of the present application.

[0100] like Figure 2 As shown, the method of the embodiment of the present application may include the following steps:

[0101] S201, controlling the clipboard manager to obtain the clipboard permission of the clipboard.

[0102] Specifically, see Figure 1 The description of S101 in the illustrated embodiment will not be repeated here.

[0103] S202 : When it is detected that the target window initiates a data copy operation on the clipboard, a content type list acquisition request for the data copy operation is obtained.

[0104] A data copy operation refers to copying data entered by the user in the target window. Data copy operations can include cut and copy operations. Initiating a data copy operation means saving the data in the target window to the clipboard.

[0105] The content type list acquisition request refers to a request for acquiring a data content type list, and the data content type list refers to a data type list of data content corresponding to the data copy operation.

[0106] In some embodiments, within the electronic device, the operating system monitors whether a target window initiates a data copy operation to the clipboard. The operating system can monitor the data copy operation initiated by the target window by using a process management mechanism to monitor whether the target window executes the data copy operation. Specifically, each application is assigned an independent process in the operating system, and the operating system can track information such as the process's status, resource usage, and execution time. Through process management, the operating system can monitor applications and record their execution status.

[0107] Inside the electronic device, the operating system obtains a content type list acquisition request for the data copy operation. Specifically, the operating system may obtain the content type list request in the following manner: the operating system forwards the data copy operation to the clipboard manager to inform the clipboard manager that the target window has initiated a data copy operation, and the operating system receives the content type list acquisition request sent by the clipboard manager based on the data copy operation.

[0108] S203: Obtain a content type list corresponding to the content type list acquisition request and window attribute information of the target window.

[0109] In some embodiments, executing step S203 may include the following operations: A1, obtaining window attribute information of the target window; A2, controlling the clipboard manager to send a content type list acquisition request to the target window; A3, controlling the clipboard manager to obtain the content type list from the target window.

[0110] The content type list refers to a list of data types corresponding to the data copy operation. The data types in the content type list may include but are not limited to file names of string type, URL paths of URL type, binary data of image type, etc.

[0111] When executing step A1, specifically, since the operating system has learned one or both of the window name and window identifier of the target window when monitoring the data copy operation initiated by the target window, the operating system can query the window configuration file for other attribute information such as the window type corresponding to the target window, the data type supported by the window, etc. according to the window name or window identifier. The window configuration file is used to store the window attribute information of each window. In the embodiment of the present application, there is no limit on how many types of window attribute information can be obtained. One or more types of window attribute information listed above can be obtained. The specific type of window attribute information to be obtained can be set according to the actual application requirements of the clipboard manager.

[0112] When executing step A2, specifically, the operating system may send the content type list acquisition request received from the clipboard manager to the target window, and instruct the target window to respond to the content type list acquisition request.

[0113] When executing step A3, specifically, the target window receives a content type label acquisition request sent by the operating system, and in response to the content type list acquisition request, the target window determines a content type list of the data content corresponding to the data copy operation according to the content type list acquisition request, and the target window sends the content type list to the operating system, and the operating system sends the content type list to the clipboard manager.

[0114] S204: Determine the target content type in the content type list through the clipboard manager, and obtain data content corresponding to the target content type.

[0115] In some embodiments, the step of determining the target content type in the content type list through the clipboard manager may specifically include the following operations: B1, obtaining a preset content type management set; B2, controlling the clipboard manager to determine the target content type in the content type list based on the preset content type management set.

[0116] The preset content type management set refers to a set of multiple preset content types pre-configured by the clipboard manager. A preset content type refers to a data type. Preset content types may include, but are not limited to, file names of string type, URL paths of URL type, binary data of image type, etc. The present embodiment does not limit the types and number of preset content types in the preset content type management set. The specific preset content types configured may be determined by the clipboard manager based on actual needs.

[0117] When executing step B1, specifically, the operating system may control the clipboard manager to obtain a preset content type management set.

[0118] When executing step B2, specifically: the operating system controls the clipboard manager to determine the target content type in the content type list according to the preset content type management set, and the clipboard manager can use the data type in both the preset content type management set and the data type in the content type list as the target content type.

[0119] The step of obtaining the data content corresponding to the target content type may specifically be: the operating system obtains the target content type from the clipboard manager, the operating system sends the target content type to the target window, and the target window sends the data content corresponding to the target content type to the operating system, so that the operating system obtains the data content corresponding to the target content type.

[0120] S205 , determining the access operation type of the data access operation and the content privacy type corresponding to the data content, where the data access operation is a data copy operation.

[0121] The access operation type may include a copy type and a paste type.

[0122] The content privacy type may include a privacy type and a non-privacy type.

[0123] In some embodiments, the access operation type of the data access operation is determined. Since the data access operation is a data copy operation, the access operation type may be determined to be a copy type.

[0124] Optionally, the access operation type of the data access operation may be directly determined by the operating system, or the operating system may control the clipboard manager to determine the access operation type of the data access operation.

[0125] One implementation method for determining the content privacy type of data content may include: identifying whether there is privacy content in the data content; if so, determining the content privacy type of the data content to be a privacy type; if not, determining the content privacy type of the data content to be a non-privacy type. Another implementation method may include: identifying the privacy level of the data content; if the privacy level is greater than or equal to a preset level, determining the content privacy type of the data content to be a privacy type; if the privacy level is less than the preset level, determining the content privacy type of the data content to be a non-privacy type.

[0126] Optionally, the operating system may determine the content privacy type corresponding to the data content according to the above two implementations, or the operating system may control the clipboard manager to determine the content privacy type corresponding to the data content according to the above two implementations.

[0127] S206: Determine the window data permission type corresponding to the window attribute information.

[0128] In some embodiments, executing step S206 may include: obtaining a preset window permission mapping relationship corresponding to the reference window attribute information and the reference window data permission type, and searching for the window data permission type corresponding to the window attribute information in the preset window permission mapping relationship. Among them, the reference window attribute information and the window attribute information have the same concept, and the reference window attribute information described here is to distinguish it from the window attribute information. The reference window data permission type may include a copy-allowed type, a copy-prohibited type, a paste-allowed type, and a paste-prohibited type. In the preset window permission mapping relationship, for each window attribute information, there is a corresponding reference window data permission type. For the reference window data permission type corresponding to each window attribute information, it may include one of a copy-allowed type and a copy-prohibited type, and one of a paste-allowed type and a paste-prohibited type.

[0129] Optionally, the operating system may determine the window data permission type corresponding to the window attribute information according to the above implementation, or the operating system may control the clipboard manager to determine the window data permission type corresponding to the window attribute information according to the above implementation.

[0130] S207, determining the data control result based on the window data permission type, access operation type, and content privacy type.

[0131] In some embodiments, if the window data permission type, access operation type, and content privacy type match, a data permission control result is generated; if any two of the window data permission type, access operation type, and content privacy type do not match, a data prohibition control result is generated.

[0132] The data permission control result refers to the control result that allows a response to a data access operation (i.e., a data copy operation or a data paste operation). The data prohibition control result refers to the control result that prohibits a response to a data access operation (i.e., a data copy operation or a data paste operation).

[0133] Optionally, the data permission control result or the data prohibition control result may be generated by the operating system, or the operating system may control the clipboard manager to generate the data permission control result or the data prohibition control result.

[0134] Specifically, determining the type matching between the window data permission type, access operation type, and content privacy type, or determining the mismatch between any two of the window data permission type, access operation type, and content privacy type, can be achieved through the following operations: obtaining a type matching mapping table, and querying the matching results corresponding to the window data permission type, access operation type, and content privacy type in the type matching mapping table; if the matching result is a match, it can be determined that the window data permission type, access operation type, and content privacy type match each other; if the matching result is a mismatch between two types or a mismatch between three types, it can be determined that any two of the window data type permission type, access operation type, and content privacy type do not match each other.

[0135] The type matching mapping table can store the reference matching results associated with each reference window data permission type, each reference access operation type, and each reference content privacy type. For example, see the following table showing a type matching mapping table:

[0136]

[0137] It can be seen from the above table that when the reference window data permission type of window 4 includes the allow copy type and the allow paste type, the reference access operation type of window 4 is the copy type, and the reference content privacy type of window 4 is the non-privacy type, the reference matching results corresponding to these types are matches.

[0138] S208: Control the clipboard manager to perform data control processing on the clipboard based on the data control result.

[0139] In some embodiments, executing step S208 may include the following operations: if the data control result is a data permission control result, controlling the clipboard manager to perform a data response operation for the data access operation; if the data control result is a data prohibition control result, controlling the clipboard manager to clear the data content or intercept the data access operation.

[0140] Specifically, in the case where the data access operation is a data copy operation, if the data control result is a data permission control result, the operation of controlling the clipboard manager's data response operation for the data access operation can be understood as controlling the clipboard manager to store the data content corresponding to the data copy operation into the clipboard; if the data control result is a data prohibition control result, it is to control the clipboard manager to clear the data content, that is, to control the clipboard manager to clear the data content corresponding to the data copy operation from the clipboard.

[0141] In the case where the data access operation is a data paste operation, if the data control result is a data permission control result, the operation of controlling the clipboard manager's data response operation for the data access operation can be understood as controlling the clipboard manager to store the data content corresponding to the data copy operation from the clipboard to the target window; if the data control result is a data prohibition control result, it is to control the clipboard manager to intercept the data paste operation, that is, to control the clipboard manager to intercept the data paste operation and prohibit responding to the data paste operation, that is, to prohibit storing the data content corresponding to the data paste operation from the clipboard to the target window.

[0142] In an embodiment of the present application, when it is monitored that the target window initiates a data copy operation on the clipboard, the data control result is determined from multiple angles through the window data permission type, access operation type, and content privacy type to ensure the comprehensiveness and accuracy of the data control result. The clipboard manager is controlled to perform data control processing on the clipboard based on the comprehensive and accurate data control results, thereby realizing precise control of the clipboard copy operation through the clipboard, thereby ensuring the security of the data corresponding to the clipboard copy behavior.

[0143] See Figure 3 , which is a flow chart of a clipboard management method provided in an embodiment of the present application.

[0144] like Figure 3 As shown, the method of the embodiment of the present application may include the following steps:

[0145] S301: Control the clipboard manager to obtain the clipboard permission of the clipboard.

[0146] Specifically, see Figure 1 The description of S101 in the illustrated embodiment will not be repeated here.

[0147] S302: When it is detected that the target window initiates a data paste operation on the clipboard, the window attribute information of the target window is obtained.

[0148] The data paste operation refers to the operation of pasting data entered by the user in the target window.

[0149] Window attribute information refers to the attribute information of the target window. Window attribute information may include, but is not limited to, the target window's window name, window identifier, window type, and the data types supported by the window. The data types supported by a window refer to the types of data that the window can output and display to the user. The data types supported by a window may include, but are not limited to, image types, text types, table types, and the like.

[0150] In some embodiments, within the electronic device, the operating system monitors whether a target window initiates a data paste operation to the clipboard. This monitoring can be accomplished by using a process management mechanism to monitor whether the target window executes the data paste operation. Specifically, each application is assigned a separate process within the operating system, and the operating system can track information such as the process's status, resource usage, and execution time. Through process management, the operating system can monitor applications and record their execution status.

[0151] Obtaining the window attribute information of the target window can be specifically as follows: since the operating system has learned one or both of the window name and window identifier of the target window when monitoring the data paste operation initiated by the target window, the operating system can query the window type corresponding to the target window, the data type supported by the window, and other attribute information in the window configuration file based on the window name or window identifier. The window configuration file is used to store the window attribute information of each window. In the embodiment of the present application, there is no limit on how many types of window attribute information can be obtained. One or more types of window attribute information listed above can be obtained. The specific type of window attribute information to be obtained can be set according to the actual application requirements of the clipboard manager.

[0152] S303: Determine the data content corresponding to the data paste operation in the clipboard.

[0153] In some embodiments, the operating system can control the clipboard manager to determine the data content corresponding to the data paste operation in the clipboard, or the operating system can directly determine the data content corresponding to the data paste operation in the clipboard. Determining the data content corresponding to the data paste operation in the clipboard can be understood as using the data content stored in the clipboard as the data content corresponding to the data paste operation. The data content stored in the clipboard is the data content stored in the previous data copy operation.

[0154] S304: Determine the access operation type of the data access operation and the content privacy type corresponding to the data content. The data access operation is a data pasting operation.

[0155] S305: Determine the window data permission type corresponding to the window attribute information.

[0156] S306, determining the data control result based on the window data permission type, access operation type, and content privacy type.

[0157] Specifically, the implementation process of steps S304 to S306 can be found in Figure 2 The description of S205 to S207 in the illustrated embodiment will not be repeated here.

[0158] S307: Control the clipboard manager to perform data control processing on the clipboard based on the data control result.

[0159] Specifically, if the data control result is a data permission control result, the clipboard manager can be controlled to perform a data response operation for the data paste operation, that is, the clipboard manager is controlled to store the data content corresponding to the data paste operation from the clipboard to the target window; if the data control result is a data prohibition control result, the clipboard manager can be controlled to intercept the data paste operation, that is, the clipboard manager is controlled to intercept the data paste operation and prohibit responding to the data paste operation, that is, prohibiting the data content corresponding to the data paste operation from being stored from the clipboard to the target window.

[0160] In an embodiment of the present application, when it is monitored that the target window initiates a data paste operation on the clipboard, the data control result is determined from multiple angles through the window data permission type, access operation type, and content privacy type to ensure the comprehensiveness and accuracy of the data control result. The clipboard manager is controlled to perform data control processing on the clipboard based on the comprehensive and accurate data control results, thereby realizing precise control of the clipboard paste operation through the clipboard, thereby ensuring the security of the data corresponding to the clipboard paste behavior.

[0161] The following will be combined Figure 4 , the clipboard management device provided in the embodiment of the present application is introduced in detail. It should be noted that, Figure 4 The clipboard management device shown is used to execute the application Figures 1 to 3 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figures 1 to 3 The embodiment shown.

[0162] See Figure 3 , which shows a schematic diagram of the structure of the clipboard management device of an embodiment of the present application. The clipboard management device 1 can be implemented as all or part of the device through software, hardware, or a combination of both. According to some embodiments, the clipboard management device 1 includes a permission configuration module 11, a data acquisition module 12, and a data control module 13, which are specifically used to:

[0163] The permission configuration module 11 is used to control the clipboard manager to obtain the clipboard permission of the clipboard;

[0164] The data acquisition module 12 is configured to acquire window attribute information of the target window and data content corresponding to the data access operation when detecting that the target window initiates a data access operation to the clipboard;

[0165] The data control module 13 is configured to control the clipboard manager to perform data control processing on the clipboard based on the data access operation, the window attribute information, and the data content.

[0166] Optionally, the data acquisition module 12 includes:

[0167] A first acquiring unit is configured to acquire a content type list acquisition request for the data copy operation when it is detected that a target window initiates a data copy operation for the clipboard;

[0168] a second acquiring unit, configured to acquire the content type list corresponding to the content type list acquisition request and the window attribute information of the target window;

[0169] A third acquiring unit is configured to determine a target content type in the content type list through the clipboard manager, and acquire data content corresponding to the target content type.

[0170] Optionally, the second acquiring unit is specifically configured to:

[0171] Obtaining window attribute information of the target window;

[0172] Controlling the clipboard manager to send the content type list acquisition request to the target window, wherein the content type list acquisition request is used to instruct the target window to determine a content type list;

[0173] The clipboard manager is controlled to obtain the content type list from the target window.

[0174] Optionally, the third acquiring unit is specifically configured to:

[0175] Get the preset content type management collection;

[0176] The clipboard manager is controlled based on the preset content type management set to determine a target content type in the content type list.

[0177] Optionally, the data acquisition module 12 is specifically configured to:

[0178] When it is detected that the target window initiates a data paste operation on the clipboard, acquiring window attribute information of the target window;

[0179] The data content corresponding to the data pasting operation is determined in the clipboard.

[0180] Optionally, the data control module 13 includes:

[0181] a first control unit, configured to determine an access operation type of the data access operation and a content privacy type corresponding to the data content;

[0182] A second control unit is configured to determine a window data permission type corresponding to the window attribute information;

[0183] a third control unit, configured to determine a data control result based on the window data permission type, the access operation type, and the content privacy type;

[0184] A fourth control unit is configured to control the clipboard manager to perform data control processing on the clipboard based on the data control result.

[0185] Optionally, the third control unit is specifically configured to:

[0186] If the window data permission type, the access operation type, and the content privacy type match, a data permission control result is generated;

[0187] If any two of the window data permission type, the access operation type, and the content privacy type do not match, a data prohibition control result is generated.

[0188] Optionally, the fourth control unit is specifically configured to:

[0189] If the data control result is the data permission control result, controlling the clipboard manager to perform a data response operation for the data access operation;

[0190] If the data control result is the data prohibition control result, the clipboard manager is controlled to clear the data content or intercept the data access operation.

[0191] Please refer to Figure 5 , which shows a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of this specification. The electronic device described in this specification may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via the bus 150.

[0192] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the terminal. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, as well as accesses data stored in the memory 120, to perform various functions of the terminal 100 and process data. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communications chip.

[0193] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an iOS system developed by Apple, including a system deeply developed based on the iOS system, or other systems.

[0194] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0195] The input device 130 is used to receive input commands or data and includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch-sensitive device. The output device 140 is used to output commands or data and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 may be a touch-sensitive display.

[0196] The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of this specification.

[0197] In addition, those skilled in the art will understand that the structures of the electronic devices shown in the above figures do not limit the electronic devices. The electronic devices may include more or fewer components than shown, or may combine certain components, or arrange the components differently. For example, the electronic devices may also include radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules, and other components, which will not be described in detail here.

[0198] exist Figure 5 In the electronic device shown, the processor 110 may be configured to call a program of a clipboard management method stored in the memory 120 and specifically perform the following operations:

[0199] Control the clipboard manager to obtain the clipboard permissions of the clipboard;

[0200] When it is detected that a target window initiates a data access operation to the clipboard, acquiring window attribute information of the target window and data content corresponding to the data access operation;

[0201] The clipboard manager is controlled to perform data management and control processing on the clipboard based on the data access operation, the window attribute information and the data content.

[0202] In one embodiment, when the processor 110 executes the step of acquiring the window attribute information of the target window and the data content corresponding to the data access operation when detecting that the target window initiates a data access operation on the clipboard, the processor 110 specifically performs the following operations:

[0203] When it is detected that the target window initiates a data copy operation on the clipboard, obtaining a content type list acquisition request for the data copy operation;

[0204] Obtaining the content type list corresponding to the content type list acquisition request and the window attribute information of the target window;

[0205] The clipboard manager determines a target content type in the content type list, and obtains data content corresponding to the target content type.

[0206] In one embodiment, when executing the step of obtaining the content type list corresponding to the content type list acquisition request and the window attribute information of the target window, the processor 110 specifically performs the following operations:

[0207] Obtaining window attribute information of the target window;

[0208] Controlling the clipboard manager to send the content type list acquisition request to the target window, wherein the content type list acquisition request is used to instruct the target window to determine a content type list;

[0209] The clipboard manager is controlled to obtain the content type list from the target window.

[0210] In one embodiment, when executing the step of determining the target content type in the content type list by the clipboard manager, the processor 110 specifically performs the following operations:

[0211] Get the preset content type management collection;

[0212] The clipboard manager is controlled based on the preset content type management set to determine a target content type in the content type list.

[0213] In one embodiment, when the processor 110 executes the step of acquiring the window attribute information of the target window and the data content corresponding to the data access operation when detecting that the target window initiates a data access operation on the clipboard, the processor 110 specifically performs the following operations:

[0214] When it is detected that the target window initiates a data paste operation on the clipboard, acquiring window attribute information of the target window;

[0215] The data content corresponding to the data pasting operation is determined in the clipboard.

[0216] In one embodiment, when executing the step of controlling the clipboard manager to perform data management and processing on the clipboard based on the data access operation, the window attribute information, and the data content, the processor 110 specifically performs the following operations:

[0217] Determining an access operation type of the data access operation and determining a content privacy type corresponding to the data content;

[0218] Determine the window data permission type corresponding to the window attribute information;

[0219] Determine a data control result based on the window data permission type, the access operation type, and the content privacy type;

[0220] The clipboard manager is controlled to perform data control processing on the clipboard based on the data control result.

[0221] In one embodiment, when the processor 110 performs the step of determining the data control result based on the window data permission type, the access operation type, and the content privacy type, the processor 110 specifically performs the following operations:

[0222] If the window data permission type, the access operation type, and the content privacy type match, a data permission control result is generated;

[0223] If any two of the window data permission type, the access operation type, and the content privacy type do not match, a data prohibition control result is generated.

[0224] In one embodiment, when the processor 110 executes the step of controlling the clipboard manager to perform data control processing on the clipboard based on the data control result, the processor 110 specifically performs the following operations:

[0225] If the data control result is the data permission control result, controlling the clipboard manager to perform a data response operation for the data access operation;

[0226] If the data control result is the data prohibition control result, the clipboard manager is controlled to clear the data content or intercept the data access operation.

[0227] An embodiment of the present application further provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the clipboard management method as described in the above embodiments.

[0228] An embodiment of the present application further provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the clipboard management method described in the above embodiments.

[0229] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0230] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A clipboard management method, characterized in that: The method comprises: Control the clipboard manager to obtain the clipboard permissions of the clipboard; When it is detected that a target window initiates a data access operation to the clipboard, acquiring window attribute information of the target window and data content corresponding to the data access operation; The clipboard manager is controlled to perform data management and control processing on the clipboard based on the data access operation, the window attribute information and the data content.

2. The method according to claim 1, characterized in that When it is detected that the target window initiates a data access operation to the clipboard, obtaining the window attribute information of the target window and the data content corresponding to the data access operation includes: When it is detected that the target window initiates a data copy operation on the clipboard, obtaining a content type list acquisition request for the data copy operation; Obtaining the content type list corresponding to the content type list acquisition request and the window attribute information of the target window; The clipboard manager determines a target content type in the content type list, and obtains data content corresponding to the target content type.

3. The method according to claim 2, characterized in that The obtaining of the content type list corresponding to the content type list obtaining request and the window attribute information of the target window includes: Obtaining window attribute information of the target window; Controlling the clipboard manager to send the content type list acquisition request to the target window, wherein the content type list acquisition request is used to instruct the target window to determine a content type list; The clipboard manager is controlled to obtain the content type list from the target window.

4. The method according to claim 2, characterized in that Determining the target content type in the content type list by the clipboard manager includes: Get the preset content type management collection; The clipboard manager is controlled based on the preset content type management set to determine a target content type in the content type list.

5. The method according to claim 1, wherein When it is detected that the target window initiates a data access operation to the clipboard, obtaining the window attribute information of the target window and the data content corresponding to the data access operation includes: When it is detected that the target window initiates a data paste operation on the clipboard, acquiring window attribute information of the target window; The data content corresponding to the data pasting operation is determined in the clipboard.

6. The method according to claim 1, characterized in that The controlling the clipboard manager to perform data management and control processing on the clipboard based on the data access operation, the window attribute information, and the data content includes: Determining an access operation type of the data access operation and determining a content privacy type corresponding to the data content; Determine the window data permission type corresponding to the window attribute information; Determine a data control result based on the window data permission type, the access operation type, and the content privacy type; The clipboard manager is controlled to perform data control processing on the clipboard based on the data control result.

7. The method according to claim 6, characterized in that The determining of the data control result based on the window data permission type, the access operation type, and the content privacy type includes: If the window data permission type, the access operation type, and the content privacy type match, a data permission control result is generated; If any two of the window data permission type, the access operation type, and the content privacy type do not match, a data prohibition control result is generated.

8. A clipboard management device, characterized in that: The device comprises: The permission configuration module is used to control the clipboard manager to obtain the clipboard permission of the clipboard; a data acquisition module, configured to acquire window attribute information of the target window and data content corresponding to the data access operation when detecting that a target window initiates a data access operation on the clipboard; A data control module is used to control the clipboard manager to perform data control processing on the clipboard based on the data access operation, the window attribute information and the data content.

9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps according to any one of claims 1 to 7.