CN113792326B - File content copy limiting method and device - Google Patents

File content copy limiting method and device Download PDF

Info

Publication number
CN113792326B
CN113792326B CN202110880666.0A CN202110880666A CN113792326B CN 113792326 B CN113792326 B CN 113792326B CN 202110880666 A CN202110880666 A CN 202110880666A CN 113792326 B CN113792326 B CN 113792326B
Authority
CN
China
Prior art keywords
file
window
name
limited
current foreground
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110880666.0A
Other languages
Chinese (zh)
Other versions
CN113792326A (en
Inventor
涂高元
邱志斌
郭永兴
陆云燕
时宜
游伟东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XIAMEN TIPRAY TECHNOLOGY CO LTD
Original Assignee
XIAMEN TIPRAY TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XIAMEN TIPRAY TECHNOLOGY CO LTD filed Critical XIAMEN TIPRAY TECHNOLOGY CO LTD
Priority to CN202110880666.0A priority Critical patent/CN113792326B/en
Publication of CN113792326A publication Critical patent/CN113792326A/en
Application granted granted Critical
Publication of CN113792326B publication Critical patent/CN113792326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the application provides a method and a device for limiting copying of file contents, wherein the method comprises the steps of obtaining the process name of a current foreground window of a computer system when determining that the file to be limited for copying is in an occupied state, confirming that the file to be limited for copying is opened by the process of the current foreground window if the process name of the current foreground window is determined to be in a process name record of office software, obtaining the file name of the file to be limited for copying, and determining whether the file name of the file to be limited for copying is in a file name record of the file to be limited for copying or not if the file name of the file to be limited for copying is in the file name record of the file to be limited for copying, and limiting copying the content of the file to be limited for copying. Therefore, the scheme can realize the copy limiting function of a certain copy limiting file without setting a password for each copy limiting file, and can ensure the high efficiency and convenience of copy limiting of file contents.

Description

File content copy limiting method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for restricting copying of file contents.
Background
With the progress of the age and the development of scientific technology, office software of various types is more and more, and various types of documents corresponding to the office software are also layered endlessly, so how to quickly and effectively limit specified document contents from being copied in a plurality of documents, and accordingly avoid the problem that the specified document contents are revealed to be urgently needed to be solved.
At present, for the content limited copy of the document, there are two main processing modes, the first processing mode is to start forced protection for characters by utilizing the window form of the document for review protection; the second processing mode is to directly start a process in the computer to limit the global copy function of the computer. However, the first processing mode is suitable for the situation that the documents are fewer, and a password is required to be set for each document limited to be copied, if the documents are more, the passwords required to be set are too many, and meanwhile, the time required for setting the passwords is longer, so that the management is inconvenient; the second processing method can limit the content of a plurality of documents to be unable to be copied in a short time, but at the same time, other applications in the local computer system cannot normally use the copy function.
In summary, there is a need for a method for restricting copying of file contents, which is used for ensuring the high efficiency and convenience of restricting copying of file contents.
Disclosure of Invention
The embodiment of the application provides a method and a device for restricting copying of file contents, which are used for ensuring the high efficiency and convenience of restricting copying of file contents.
In a first aspect, an embodiment of the present application provides a method for restricting copying of file content, including:
when determining that the file to be restricted from being copied is in an occupied state, acquiring a process name of a current foreground window of the computer system;
if the process name of the current foreground window is determined to be in the process name record of the office software, confirming that the process of the current foreground window is opened to the file to be limited to be copied, and acquiring the file name of the file to be limited to be copied;
determining whether the file name of the file to be limited to copy is positioned in a file name record of file content limited to copy;
if yes, limiting copying is carried out on the content of the file to be limited to copy.
According to the technical scheme, the process name of the current foreground window of the computer system is acquired when the file to be limited to copy is determined to be in the occupied state, so that the consumption of computer system resources caused by acquiring the process name of the current foreground window of the computer system when other files without limiting to copy are in the occupied state can be avoided. Then, if the process name of the current foreground window is determined to be in the process name record of the office software, it can be accurately confirmed that the process of the current foreground window opens the file to be limited from being copied, and meanwhile, the file name of the file to be limited from being copied can be timely obtained, so that when the file name of the file to be limited from being copied is determined to be in the file name record of the file content limited from being copied, the limited copying of the content of the file to be limited from being copied is realized. Therefore, the scheme can realize the copy limiting function of a certain copy limiting file without setting a password for each copy limiting file, and can simultaneously prevent copy limiting for other copy limiting files, thereby ensuring the high efficiency and convenience of file content copy limiting, ensuring the safety of the content of the copy limiting file, and reducing the risk of leakage of the content of the copy limiting file. In addition, when the copying is limited for the files needing to be limited, the scheme does not influence the normal use of the copying function of other applications in the local computer system, and has good compatibility.
In one possible implementation manner, the obtaining the process name of the current foreground window of the computer system includes:
acquiring a process identifier of the current foreground window through a window process identifier acquisition function;
and acquiring the process name of the current foreground window matched with the process identifier of the current foreground window through a window process name acquisition function.
According to the technical scheme, the process identification of the current foreground window can be timely obtained by utilizing the window process identification obtaining function, and the process name of the current foreground window matched with the process identification of the current foreground window can be timely and accurately obtained from a plurality of process names in the computing system based on the window process name obtaining function.
In one possible implementation manner, the obtaining the file name of the file to be restricted from being copied includes:
acquiring a window title of the current foreground window through a window title acquisition function;
and identifying the file name of the file to be restricted from being copied from the window title of the current foreground window.
According to the technical scheme, after the software type of the current foreground window opened by the process is determined to belong to office software, the window title of the current foreground window can be accurately obtained through the window title obtaining function, and the file name of the file to be limited and copied can be timely identified from the window title of the current foreground window, so that support is provided for limiting and copying whether the content of the file to be limited and copied, which is opened by the process of the current foreground window, is subsequently carried out.
In one possible implementation, the method further includes:
if the process name of the current foreground window is determined not to be in the process name record of the office software, confirming that the software type of the current foreground window opened by the process does not belong to the office software, and copying the software content corresponding to the software type of the current foreground window opened by the process is not limited.
In the above technical solution, when it is determined that the software type of the current foreground window that is opened by the process does not belong to office software, the copy restriction may not be performed on the software content corresponding to the software type of the current foreground window that is opened by the process, and the step of continuously monitoring the attribute state of the file to be copied may be returned.
In one possible implementation, the method further includes:
and when the file to be limited to be copied is determined not to be in the occupied state, continuing to monitor the attribute state of the file to be limited to be copied.
In the above technical solution, when determining that the file to be restricted from copying is not in an occupied state, in order to avoid the risk of copying the content of the file to be restricted from occurring, it is necessary to continuously monitor the attribute state (whether the file to be restricted from copying is in an occupied state) of the file to be restricted from being copied, so that the copy restricting function can be started in time when determining that the file to be restricted from copying is opened by the current foreground window process, thereby providing support for ensuring the security of the content of the file to be restricted from being copied.
In one possible implementation, the process name record of the office software is determined by:
setting a process name of at least one office software;
and storing the process name of the at least one office software in a process name record of the office software.
According to the technical scheme, the process names of the office software are preset, so that whether the process name of the current foreground window belongs to the process name of the office software can be conveniently and accurately determined in time, and reliable and accurate support is provided for limiting copying of software contents which are required to be opened for the process of the current foreground window.
In one possible implementation, the file name record of the file content limited copy is determined by:
setting at least one file name of which the file content needs to be limited to be copied;
storing the file name of the at least one file content requiring limited copy in a file name record of the file content limited copy.
According to the technical scheme, the file names of the file contents needing to be limited to copy are preset, so that support can be provided for the follow-up timely and accurate determination of whether the software contents needing to be opened for the process of the current foreground window are limited to copy.
In a second aspect, an embodiment of the present application further provides an apparatus for restricting copying of file content, including:
the acquisition unit is used for acquiring the process name of the current foreground window of the computer system when the file to be restricted from copying is determined to be in an occupied state;
the processing unit is used for confirming that the process of the current foreground window is opened by the file to be limited and obtaining the file name of the file to be limited and copied if the process name of the current foreground window is determined to be in the process name record of the office software; determining whether the file name of the file to be limited to copy is positioned in a file name record of file content limited to copy; if yes, limiting copying is carried out on the content of the file to be limited to copy.
In a possible implementation manner, the acquiring unit is specifically configured to:
acquiring a process identifier of the current foreground window through a window process identifier acquisition function;
and acquiring the process name of the current foreground window matched with the process identifier of the current foreground window through a window process name acquisition function.
In a possible implementation manner, the processing unit is specifically configured to:
acquiring a window title of the current foreground window through a window title acquisition function;
and identifying the file name of the file to be restricted from being copied from the window title of the current foreground window.
In a possible implementation, the processing unit is further configured to:
if the process name of the current foreground window is determined not to be in the process name record of the office software, confirming that the software type of the current foreground window opened by the process does not belong to the office software, and copying the software content corresponding to the software type of the current foreground window opened by the process is not limited.
In a possible implementation, the processing unit is further configured to:
and when the file to be limited to be copied is determined not to be in the occupied state, continuing to monitor the attribute state of the file to be limited to be copied.
In a possible implementation manner, the processing unit is specifically configured to:
setting a process name of at least one office software;
and storing the process name of the at least one office software in a process name record of the office software.
In a possible implementation manner, the processing unit is specifically configured to:
setting at least one file name of which the file content needs to be limited to be copied;
storing the file name of the at least one file content requiring limited copy in a file name record of the file content limited copy.
In a third aspect, embodiments of the present application provide a computing device comprising:
a memory for storing a computer program;
and the processor is used for calling the computer program stored in the memory and executing the method for limiting copying of the file content according to the obtained program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer-executable program for causing a computer to perform the steps of a method for restricting copying of file content.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating a method for restricting copying of file contents according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another method for restricting copying of file contents according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for restricting copying of file contents according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The exemplary embodiments of the present application and their description are for explaining the present application, but are not limiting of the application. In addition, the same or similar reference numerals are used for the same or similar parts in the drawings and the embodiments.
It is to be understood that the terms "first," "second," and the like, as used herein, are not specifically intended to be used in a sequential or ordinal sense, nor are they intended to limit the application, and are interchangeable as appropriate, merely to distinguish between components or operations described in the same technical term.
The terms "comprising," "including," "having," "containing," and the like as used herein are intended to be inclusive and mean that they are encompassed by, but not limited to. In addition, the term "and/or" as used in this disclosure includes any or all combinations of such things.
Fig. 1 illustrates a flow of a method for restricting copying of file contents, which may be performed by an apparatus for restricting copying of file contents according to an embodiment of the present application.
As shown in fig. 1, the process specifically includes:
step 101, when determining that the file to be restricted from being copied is in an occupied state, obtaining the process name of the current foreground window of the computer system.
Step 102, if it is determined that the process name of the current foreground window is located in the process name record of the office software, it is determined that the process of the current foreground window is open to the file to be restricted from being copied, and the file name of the file to be restricted from being copied is obtained.
Step 103, determining whether the file name of the file to be limited to copy is in the file name record of the file content limited to copy.
And 104, if the file name of the file to be limited to copy is determined to be in the file name record of the file content limited to copy, limiting copy is carried out on the content of the file to be limited to copy.
In step 101, in order to ensure that the content of the file to be restricted from being copied, the technical solution in the embodiment of the present application needs to detect whether the file to be restricted from being copied is in an occupied state, and if it is determined that the file to be restricted from being copied is in an occupied state, the process name of the current foreground window of the computer system is obtained, so that the consumption of computer system resources caused by obtaining the process name of the current foreground window of the computer system when other files to be restricted from being copied are not in an occupied state can be avoided. If it is determined that the file to be limited and copied is not in the occupied state, in order to avoid the risk of copying the content of the file to be limited and copied, the attribute state of the file to be limited and copied needs to be continuously monitored, so that the copy limiting function can be started in time when the file to be limited and copied opened by the current foreground window process is determined.
Specifically, after determining that the file to be restricted from being copied is in an occupied state, the process identifier of the current foreground window can be timely acquired by utilizing the window process identifier acquisition function, and the process name of the current foreground window matched with the process identifier of the current foreground window can be timely and accurately acquired from a plurality of process names in the computing system based on the window process name acquisition function.
Taking a file needing to be limited to be copied as a text document as an example, the embodiment of the application can judge whether the text document is in an occupied state or not through an ISFileInuser, and if the text document is not in the occupied state, the attribute state of the text document needs to be acquired again; if the text document is in an occupied state, a foreground window handle in the local computer system can be acquired by using GetForeground. Then, a process identification or window title of the subsequent current foreground window may be acquired based on the foreground window handle as a pointer. For example, the process ID of the current foreground window may be obtained by a window process identifier obtaining function (e.g., getWindowThreadProcessId, etc.), and then the process name of the current foreground window that matches the process ID of the current foreground window may be further obtained by a window process name obtaining function (e.g., getProcessNameById, etc.).
It should be noted that, in the embodiment of the present application, the technical scheme is to detect whether the file to be restricted from being copied is in an occupied state; the method has the advantages that aiming at files which do not need to be limited to copy, whether the files are in an occupied state or not is not detected, and the follow-up step of limiting the copy of the file contents is not needed to be executed, so that the limited copy of the file contents is more targeted, the operation flow of limiting the copy is not needed to be executed for each file, the computer system resources consumed by the method flow of executing the scheme for the files which do not need to be limited to copy can be reduced, and the efficiency of limiting the copy of the file contents can be improved. For example, there are three files, namely, a file a, a file B and a file C, wherein, if the content of the specified file a needs to be restricted from being copied, it is only determined whether the file a is in an occupied state for the file a, and whether the file B or the file C is in an occupied state for the file B or the file C. The file requiring copy restriction is a pre-designated file requiring copy restriction.
In step 102, after the process name of the current foreground window of the computer system is obtained, it is determined whether the process name of the current foreground window is located in the process name record of the office software. If the process name of the current foreground window is determined to be in the process name record of the office software, the process of the current foreground window can be accurately confirmed to open the file to be limited from being copied, and meanwhile, the file name of the file to be limited from being copied can be timely obtained. Namely, the window title of the current foreground window is obtained through the window title obtaining function, and the file name of the file to be limited to copy is identified from the window title of the current foreground window, so that support can be provided for limiting copy of the content of the file to be limited to copy, which is opened for the process of the current foreground window or not. If the process name of the current foreground window is determined not to be in the process name record of the office software, confirming that the software type of the current foreground window opened by the process does not belong to the office software, and copying the software content corresponding to the software type of the current foreground window opened by the process is not limited. When the software type of the current foreground window, which is opened by the process, is confirmed not to belong to office software, the software content corresponding to the software type of the current foreground window, which is opened by the process, can be not required to be limited to be copied, and the step of continuously monitoring the attribute state of the file to be limited to be copied can be returned.
The process name record of the office software is determined by the following method: setting a process name of at least one office software, and storing the process name of the at least one office software in a process name record of the office software. Therefore, by presetting the process names of the office software, whether the process name of the current foreground window belongs to the process name of the office software can be conveniently and accurately determined in time, and reliable and accurate support is provided for limiting copying of software contents which are required to be opened for the process of the current foreground window.
Taking a file needing to be limited to copy as an example, if it is determined that the process name of the current foreground window is not located in the process name record of the office software, it is indicated that the software type of the process opening of the current foreground window is not office software, and limited copy is not required for the software content corresponding to the software type of the process opening of the current foreground window. If the process name of the current foreground window is determined to be in the process name record of the office software, the software type for indicating that the process of the current foreground window is opened is office software, so that the window title of the current foreground window can be acquired through a window title acquisition function (such as GetWindow text and the like), and the file name of the text document is identified from the window title.
In the above steps 103 and 104, after the file name of the file to be limited to copy is obtained, it is determined whether the file name of the file to be limited to copy is located in the file name record of the file content limited to copy. If the file name of the file to be limited to copy is determined to be in the file name record of the file content limited to copy, limiting copy is carried out on the content of the file to be limited to copy; if it is determined that the file name of the file to be restricted from copying is not located in the file name record of the file content restricted from copying, it is not necessary to restrict copying with respect to the content of the file to be restricted from copying.
Wherein the file name record of the file content limited copy is determined by: setting a file name of at least one file content requiring copy restriction, and storing the file name of at least one file content requiring copy restriction in a file name record of the file content requiring copy restriction. Therefore, the file names of the file contents needing to be limited for copying are preset, so that support can be provided for the follow-up timely and accurate determination of whether the software contents which need to be opened for the process of the current foreground window are limited for copying.
Taking a file requiring copy restriction as an example, the method further includes determining whether the file name of the text document is in a file name record of file content copy restriction after the file name of the text document is acquired, that is, determining whether the file name of the text document belongs to the file restricted from copy. If the file name of the text document does not belong to the document which is limited to be copied, the file name indicates that the limited copy is not required for the content of the text document opened by the current office software window interface; if the file name of the text document belongs to the document which is limited to be copied, the text document which is opened by the current office software window interface needs to enable the copy limiting function so as to be capable of timely limiting the copy of the content of the text document which is opened by the current office software window interface, thereby realizing the copy limiting function for a certain text document or a certain type of text document, having good portability, and further solving the problems that in the prior art, the copy limiting of a single document or a certain batch of documents cannot be performed due to the global copy function of a computer system which is limited by the starting process.
In order to better explain the embodiment of the method for restricting copying of file contents of the present application, the following describes the flow of another method for restricting copying of file contents provided by the embodiment of the present application through a specific implementation scenario.
As shown in fig. 2, the process includes the steps of:
step 201, it is determined whether the file to be restricted from being copied is in an occupied state. If yes, go to step 202; and if not, re-acquiring the attribute state of the file to be restricted from being copied.
Step 202, obtaining the process name of the current foreground window.
Step 203, it is determined whether the process name of the current foreground window is the process name of the office software. If yes, go to step 204; if not, go to step 201.
Step 204, obtaining the file name of the file opened by the process of the current office software.
Step 205, it is determined whether the file name of the file belongs to the file name of which copying is restricted. If yes, go to step 206; if not, go to step 201.
And 206, limiting the content of the file opened by the current foreground window interface, and not allowing copying.
The above embodiment shows that, by acquiring the process name of the current foreground window of the computer system only when the file to be restricted from copying is determined to be in the occupied state, the consumption of computer system resources caused by acquiring the process name of the current foreground window of the computer system when other files not restricted from copying are in the occupied state can be avoided. Then, if the process name of the current foreground window is determined to be in the process name record of the office software, it can be accurately confirmed that the process of the current foreground window opens the file to be limited from being copied, and meanwhile, the file name of the file to be limited from being copied can be timely obtained, so that when the file name of the file to be limited from being copied is determined to be in the file name record of the file content limited from being copied, the limited copying of the content of the file to be limited from being copied is realized. Therefore, the scheme can realize the copy limiting function of a certain copy limiting file without setting a password for each copy limiting file, and can simultaneously prevent copy limiting for other copy limiting files, thereby ensuring the high efficiency and convenience of file content copy limiting, ensuring the safety of the content of the copy limiting file, and reducing the risk of leakage of the content of the copy limiting file. In addition, when the copying is limited for the files needing to be limited, the scheme does not influence the normal use of the copying function of other applications in the local computer system, and has good compatibility.
Based on the same technical concept, fig. 3 illustrates an apparatus for restricting copying of file contents, which is provided by an embodiment of the present application, and the apparatus may perform a flow of a method for restricting copying of file contents.
As shown in fig. 3, the apparatus includes:
an obtaining unit 301, configured to obtain a process name of a current foreground window of the computer system when it is determined that a file to be restricted from being copied is in an occupied state;
the processing unit 302 is configured to, if it is determined that the process name of the current foreground window is located in the process name record of the office software, confirm that the process of the current foreground window opens the file to be restricted from being copied, and obtain a file name of the file to be restricted from being copied; determining whether the file name of the file to be limited to copy is positioned in a file name record of file content limited to copy; if yes, limiting copying is carried out on the content of the file to be limited to copy.
In one possible implementation manner, the acquiring unit 301 is specifically configured to:
acquiring a process identifier of the current foreground window through a window process identifier acquisition function;
and acquiring the process name of the current foreground window matched with the process identifier of the current foreground window through a window process name acquisition function.
In one possible implementation, the processing unit 302 is specifically configured to:
acquiring a window title of the current foreground window through a window title acquisition function;
and identifying the file name of the file to be restricted from being copied from the window title of the current foreground window.
In a possible implementation manner, the processing unit 302 is further configured to:
if the process name of the current foreground window is determined not to be in the process name record of the office software, confirming that the software type of the current foreground window opened by the process does not belong to the office software, and copying the software content corresponding to the software type of the current foreground window opened by the process is not limited.
In a possible implementation manner, the processing unit 302 is further configured to:
and when the file to be limited to be copied is determined not to be in the occupied state, continuing to monitor the attribute state of the file to be limited to be copied.
In one possible implementation, the processing unit 302 is specifically configured to:
setting a process name of at least one office software;
and storing the process name of the at least one office software in a process name record of the office software.
In one possible implementation, the processing unit 302 is specifically configured to:
setting at least one file name of which the file content needs to be limited to be copied;
storing the file name of the at least one file content requiring limited copy in a file name record of the file content limited copy.
Based on the same technical idea, an embodiment of the present application provides a computing device, including:
a memory for storing a computer program;
and the processor is used for calling the computer program stored in the memory and executing the method for limiting copying of the file content according to the obtained program.
Based on the same technical idea, an embodiment of the present application provides a computer-readable storage medium storing a computer-executable program for causing a computer to execute steps of a method for restricting copying of file contents.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, or may be loaded onto a computer or other programmable data processing apparatus such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although the application has been described in conjunction with specific features and embodiments thereof, it is evident that those skilled in the art may make numerous modifications and variations to the application without departing from the spirit and scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (9)

1. A method for restricting copying of file content, comprising: when determining that the file to be restricted from being copied is in an occupied state, acquiring a process name of a current foreground window of the computer system;
if the process name of the current foreground window is determined to be in the process name record of the office software, confirming that the process of the current foreground window is opened to the file to be limited to be copied, and acquiring the file name of the file to be limited to be copied;
determining whether the file name of the file to be limited to copy is positioned in a file name record of file content limited to copy;
if yes, limiting copying is carried out on the content of the file to be limited to copy;
the process name of the current foreground window of the computer system is obtained, which comprises the following steps: acquiring a process identifier of the current foreground window through a window process identifier acquisition function;
acquiring a process name of the current foreground window matched with a process identifier of the current foreground window through a window process name acquisition function; judging whether the text document is in an occupied state or not through ISFileInuse, and if the text document is not in the occupied state, acquiring the attribute state of the text document again; if the text document is in an occupied state, a foreground window handle in the local computer system is acquired by utilizing GetForeground window, then, the process identification or window title of a subsequent current foreground window can be acquired based on the foreground window handle as a pointer, the process ID of the current foreground window is acquired by a window process identification acquisition function GetWindow ThreadProcess Id, and then, the process name of the current foreground window matched with the process ID of the current foreground window is acquired by a window process name acquisition function GetProcessNameById.
2. The method of claim 1, wherein the obtaining the file name of the file to be restricted from copying comprises: acquiring a window title of the current foreground window through a window title acquisition function;
and identifying the file name of the file to be restricted from being copied from the window title of the current foreground window.
3. The method of claim 1, wherein the method further comprises: if the process name of the current foreground window is determined not to be in the process name record of the office software, confirming that the software type of the current foreground window opened by the process does not belong to the office software, and copying the software content corresponding to the software type of the current foreground window opened by the process is not limited.
4. The method of claim 1, wherein the method further comprises: and when the file to be limited to be copied is determined not to be in the occupied state, continuing to monitor the attribute state of the file to be limited to be copied.
5. The method of claim 1, wherein the process name record for the office software is determined by: setting a process name of at least one office software;
and storing the process name of the at least one office software in a process name record of the office software.
6. The method of claim 1, wherein the file name record for the file content limited copy is determined by: setting at least one file name of which the file content needs to be limited to be copied;
storing the file name of the at least one file content requiring limited copy in a file name record of the file content limited copy.
7. An apparatus for restricting copying of file content, comprising: the acquisition unit is used for acquiring the process name of the current foreground window of the computer system when the file to be restricted from copying is determined to be in an occupied state;
the processing unit is used for confirming that the process of the current foreground window is opened by the file to be limited and obtaining the file name of the file to be limited and copied if the process name of the current foreground window is determined to be in the process name record of the office software; determining whether the file name of the file to be limited to copy is positioned in a file name record of file content limited to copy; if yes, limiting copying is carried out on the content of the file to be limited to copy; the process name of the current foreground window of the computer system is obtained, which comprises the following steps: acquiring a process identifier of the current foreground window through a window process identifier acquisition function;
acquiring a process name of the current foreground window matched with a process identifier of the current foreground window through a window process name acquisition function; judging whether the text document is in an occupied state or not through ISFileInuse, and if the text document is not in the occupied state, acquiring the attribute state of the text document again; if the text document is in an occupied state, a foreground window handle in the local computer system is acquired by utilizing GetForeground window, then, the process identification or window title of a subsequent current foreground window can be acquired based on the foreground window handle as a pointer, the process ID of the current foreground window is acquired by a window process identification acquisition function GetWindow ThreadProcess Id, and then, the process name of the current foreground window matched with the process ID of the current foreground window is acquired by a window process name acquisition function GetProcessNameById.
8. A computing device, comprising:
a memory for storing a computer program;
a processor for invoking a computer program stored in said memory, performing the method according to any of claims 1 to 6 in accordance with the obtained program.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer-executable program for causing a computer to execute the method of any one of claims 1 to 6.
CN202110880666.0A 2021-08-02 2021-08-02 File content copy limiting method and device Active CN113792326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110880666.0A CN113792326B (en) 2021-08-02 2021-08-02 File content copy limiting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110880666.0A CN113792326B (en) 2021-08-02 2021-08-02 File content copy limiting method and device

Publications (2)

Publication Number Publication Date
CN113792326A CN113792326A (en) 2021-12-14
CN113792326B true CN113792326B (en) 2023-12-15

Family

ID=79181409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110880666.0A Active CN113792326B (en) 2021-08-02 2021-08-02 File content copy limiting method and device

Country Status (1)

Country Link
CN (1) CN113792326B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010078812A1 (en) * 2008-12-29 2010-07-15 成都市华为赛门铁克科技有限公司 Method and apparatus for controlling operation of document
CN104376270A (en) * 2013-08-12 2015-02-25 深圳中兴网信科技有限公司 File protection method and system
CN106919665A (en) * 2017-02-16 2017-07-04 江苏神州信源系统工程有限公司 The management-control method and device of e-file in a kind of Windows operating system
CN106980797A (en) * 2017-03-24 2017-07-25 北京奇虎科技有限公司 A kind of method, device and computing device for realizing file protection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010078812A1 (en) * 2008-12-29 2010-07-15 成都市华为赛门铁克科技有限公司 Method and apparatus for controlling operation of document
CN104376270A (en) * 2013-08-12 2015-02-25 深圳中兴网信科技有限公司 File protection method and system
CN106919665A (en) * 2017-02-16 2017-07-04 江苏神州信源系统工程有限公司 The management-control method and device of e-file in a kind of Windows operating system
CN106980797A (en) * 2017-03-24 2017-07-25 北京奇虎科技有限公司 A kind of method, device and computing device for realizing file protection

Also Published As

Publication number Publication date
CN113792326A (en) 2021-12-14

Similar Documents

Publication Publication Date Title
CN107193750B (en) Script recording method and device
WO2015131804A1 (en) Call stack relationship acquiring method and apparatus
CN108763951B (en) Data protection method and device
US20110023007A1 (en) Associating Workflows With Code Sections In A Document Control System
US9009175B2 (en) System and method for database migration and validation
CN111506386A (en) Virtual machine online migration method, device, equipment and computer readable storage medium
CN108121774B (en) Data table backup method and terminal equipment
CN110245074B (en) Log record generation method and device, storage medium and server
WO2020211233A1 (en) Method and device for batch data editing, computer device, and storage medium
CN111694843A (en) Missing number detection method and device, electronic equipment and storage medium
CN113792326B (en) File content copy limiting method and device
CN107766131B (en) Task scheduling method and device
CN105975567B (en) Method and device for processing internal file of application program
CN117112522A (en) Concurrent process log management method, device, equipment and storage medium
CN109558249B (en) Control method and device for concurrent operation
CN111309463B (en) Method and device for determining task execution time and readable storage medium
CN110348984B (en) Automatic credit card data input method and related equipment under different transaction channels
US11182492B2 (en) Secure portable data apparatus
CN111967764A (en) Service access verification method and device and electronic equipment
CN111625784B (en) Anti-debugging method of application, related device and storage medium
US20220366035A1 (en) Execution control system, execution control method, and program
CN115686477A (en) Application program creating method and device and electronic equipment
CN113836020A (en) Code detection method, device and storage medium
CN106293877B (en) Virtual machine creating method and system
CN114020684A (en) Remote operation behavior control method and system for file manager of desktop system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant