CN113407999B - File protection method, computing device and storage medium - Google Patents

File protection method, computing device and storage medium Download PDF

Info

Publication number
CN113407999B
CN113407999B CN202110801313.7A CN202110801313A CN113407999B CN 113407999 B CN113407999 B CN 113407999B CN 202110801313 A CN202110801313 A CN 202110801313A CN 113407999 B CN113407999 B CN 113407999B
Authority
CN
China
Prior art keywords
file
protection
protected
directory
superior
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
CN202110801313.7A
Other languages
Chinese (zh)
Other versions
CN113407999A (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.)
Wuhan Deepin Technology Co ltd
Original Assignee
Wuhan Deepin 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 Wuhan Deepin Technology Co ltd filed Critical Wuhan Deepin Technology Co ltd
Priority to CN202110801313.7A priority Critical patent/CN113407999B/en
Publication of CN113407999A publication Critical patent/CN113407999A/en
Application granted granted Critical
Publication of CN113407999B publication Critical patent/CN113407999B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • 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/11File system administration, e.g. details of archiving or snapshots
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a file protection method, which is suitable for being executed in a local client, wherein the local client is in communication connection with one or more remote clients, and the method comprises the following steps: determining a file to be protected in a local client, and adding a protection attribute to the file; traversing the superior directory of the file to obtain all superior directory file sets of the file to be protected; adding a protection attribute to each superior directory file in the superior directory file set; when a local client receives a file deletion command of a remote client, judging whether a file to be deleted by the file deletion command is added with a protection attribute; and if the file to be deleted by the file deletion command is added with the protection attribute, refusing to execute the file deletion command. The invention also discloses a computing device and a computer readable storage medium.

Description

File protection method, computing device and storage medium
The application is a divisional application of an invention patent application filed on 2021, 5, month and 6, and the application number of the original application is as follows: 2021104878157, title of the invention: a file protection method, a computing device and a storage medium are provided.
Technical Field
The present invention relates to the field of computer file management, and in particular, to a file protection method, a computing device, and a storage medium.
Background
With the development of the internet and communication technology, computers can communicate with other computers to form a local area network, or access the internet to communicate with other computers remotely. When the computer can communicate with other computers, a file sharing function on a local area network and a wide area network is brought out. When a file is important, a protection function needs to be added to the file to prevent the file from being deleted by mistake in the process of operating the shared file by the computer and other computers.
In the prior art, a read-only folder is usually established, and all files to be protected are placed in the read-only folder, so that the files can only be read and cannot be deleted. However, this method is troublesome to operate, and requires pasting and copying files and managing files in the read-only folder; the method not only destroys the file storage sequence of the original file management system under the read-only folder to cause file management confusion, but also avoids the deletion operation of personnel with root directory authority on the read-only folder.
For this reason, a new file protection method is required.
Disclosure of Invention
To this end, the present invention provides a file protection method that seeks to solve, or at least mitigate, the above-identified problems.
According to one aspect of the present invention, there is provided a file protection method adapted to be executed in a local client communicatively connected to one or more remote clients, the method comprising the steps of: determining a file to be protected in a local client, and adding a protection attribute to the file; traversing the superior directory of the file to obtain all superior directory file sets of the file to be protected; adding a protection attribute to each superior directory file in the superior directory file set; when a local client receives a file deletion command of a remote client, judging whether a file to be deleted by the file deletion command is added with a protection attribute; and if the file to be deleted by the file deletion command is added with the protection attribute, refusing to execute the file deletion command.
Optionally, in the method according to the present invention, adding the protection attribute to the file comprises the steps of: and determining the unique identification number of the file, and constructing a protection mark of the file according to the identification number.
Optionally, in the method according to the present invention, adding a protection attribute to each upper level directory file in the upper level directory file set comprises the steps of: determining the identification number of the superior directory file; determining the identification number of the subfile added with the protection attribute under the superior directory file; and constructing a protection mark of the superior directory file according to the identification numbers of the superior directory file and the subfiles.
Optionally, in the method according to the present invention, a protection driver is running in the local client, including the steps of: the protection driver initiates a file delete command listening event to listen for file delete commands from remote clients and users.
Optionally, in the method according to the present invention, further comprising the step of: when a file deletion command monitoring event receives a file deletion command from a user, judging whether a file to be deleted by the file deletion command is added with a protection attribute; and if the file to be deleted by the file deletion command is added with the protection attribute, refusing to execute the file deletion command.
Optionally, in the method according to the present invention, further comprising the step of: determining a file to be protected in a local client, and canceling a protection attribute of the file; and performing modification protection attribute operation on each upper directory file in the upper directory set of the file.
Optionally, in the method according to the present invention, the step of removing the protection attribute from the file includes: determining whether the file has a protection attribute; and if the file is determined to have the protection attribute, deleting the protection mark of the file.
Optionally, in the method according to the present invention, performing a modify protection attribute operation on each upper directory file in the upper directory set of files includes the steps of: when the superior directory file is the superior directory of the file to be protected, determining whether the protection mark of the superior directory file only comprises the identification number of the file to be protected; if the protection mark only comprises the identification number of the file to be protected, protecting the superior directory file, and deleting the protection mark of the superior directory file; if the protection mark also comprises the identification numbers of other files, deleting the identification number of the file to be protected in the upper-level directory file protection mark.
Optionally, in the method according to the present invention, further comprising the step of: when the superior directory file is a non-superior directory of the file to be protected, judging whether the superior directory file protection mark comprises an identification number of the sub-file to be protected; and if the identification number of the sub-file to be protected is included, deleting the identification number of the sub-file to be protected in the upper-level directory protection mark.
Optionally, in the method according to the present invention, further comprising the step of: and if the protection mark of the upper-level directory protection file only comprises the identification number of the sub file to be protected, deleting the protection mark of the upper-level protection directory.
According to another aspect of the present invention, there is provided a computing device comprising: one or more processors; a memory; an image display system; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing any of the methods of a file protection method according to the present invention.
According to a further aspect of the present invention there is provided a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform any of a file protection method according to the present invention.
The file protection method is suitable for being executed in a local client, firstly, a file to be protected in the local client is determined, a protection attribute is added to the file, and then, the protection attribute is added to all superior directory files of the file to be protected; therefore, the method not only protects the files to be protected against deletion, but also protects all the superior directory files of the files against deletion, and avoids deleting the protected files in a mode of deleting the superior directory files. The file added with the protection attribute does not influence the file per se, and the content and the size of the file are not changed.
And further, a protection driver is operated in the local client, the protection driver starts a file deletion command monitoring event, monitors file deletion commands from the remote client and the user, and refuses to execute the file deletion command when the file to be deleted by the file deletion command is added with a protection attribute, so that the protected file is protected from being deleted.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 illustrates a block diagram of a computing device 100, according to an exemplary embodiment of the invention;
FIG. 2 illustrates a flowchart of a file protection method 200 according to an exemplary embodiment of the invention; and
FIG. 3 illustrates a schematic diagram of a local client and a remote client communicative connection according to an exemplary embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art. Like reference numerals generally refer to like parts or elements.
The file protection method is suitable for being executed at a local client. FIG. 3 illustrates a schematic diagram of a local client and a remote client communicative connection according to an exemplary embodiment of the present invention. As shown in fig. 3, the local client 310 can be communicatively coupled to a plurality of remote clients 331 and 333 via a switch 320. The present invention does not limit the number of remote clients to which local client 310 is connected. The local client may also communicate with other remote clients 334 and 336 connected to the internet 340 by accessing the internet 340.
Both the local client 310 and the remote client 331-336 of the present invention can be implemented as a computing device. The file protection method can be operated in any one computing device, when the file protection method is executed in a remote client, the remote client is used as a local client, and other connected clients are used as remote clients.
FIG. 1 shows a block diagram of a computing device 100, according to an example embodiment of the present invention. As shown in FIG. 1, in a basic configuration 102, a computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing, including but not limited to: a microprocessor (μ P), a microcontroller (μ C), a Digital Signal Processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a level one cache 110 and a level two cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include an operating system 120, one or more programs 122, and program data 128. In some embodiments, the program 122 may be arranged to execute instructions of the method 200 according to the invention on an operating system by one or more processors 104 using the program data 128.
The computing device 100 may include a storage interface bus 134. The storage interface bus 134 enables communication from the storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to the basic configuration 102 via the bus/interface controller 130. At least a portion of the operating system 120, applications 122, and data 124 may be stored on removable storage 136 and/or non-removable storage 138, and loaded into system memory 106 via storage interface bus 134 and executed by the one or more processors 104 when the computing device 100 is powered on or the applications 122 are to be executed.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus/interface controller 130. The example output device 142 includes a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communications with one or more other computing devices 162 over a network communication link via one or more communication ports 164.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, in a modulated data signal, such as a carrier wave or other transport mechanism, and may include any information delivery media. A "modulated data signal" may be a signal that has one or more of its data set or its changes in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, Radio Frequency (RF), microwave, Infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In a computing device 100 according to the present invention, the application 122 includes program instructions for performing a file protection method 200 that may instruct the processor 104 to perform some of the steps of a file protection method 200 that operates in a computing device 100 according to the present invention, such that various portions of the computing device 100 implement protection of files in a computer by performing a file protection method 200 according to the present invention.
Computing device 100 may be implemented as a server, e.g., file server 140, database 150, a server, an application server, etc., which may be a device such as a Personal Digital Assistant (PDA), a wireless web-browsing device, an application-specific device, or a hybrid device that include any of the above functions. May be implemented as a personal computer including both desktop and notebook computer configurations, and in some embodiments, the computing device 100 is configured to perform a file protection method 200.
Fig. 2 shows a flowchart of a file protection method 200 according to an exemplary embodiment of the present invention. The method 200 is suitable for execution in the computing device 100. The method 200 is described below using the local client 310 and the remote client 331 as examples. As shown in fig. 2, a file protection method 200 begins at step S210 by determining a file to be protected in a local client 310 and adding a protection attribute to the file.
The local client 310 runs an operating system, the operating system includes a file management system, the key management system manages files in the storage medium of the local client 310, the storage medium may be implemented as a hard disk included in the local client 310, and the type of the storage medium is not limited in the present invention. Files stored in the storage medium have a number of configuration attributes including the size of the file, creation and modification dates, file type, etc. The configuration attribute of the file exists in the form of a key-value pair, wherein a key (key) of the key-value pair is the file, and a value (value) is one configuration attribute of the file. One of the configuration attributes of a file is a protection attribute. The protection attribute determines whether the file is a protected file. When the configuration attribute of the file comprises the protection attribute, the file is a protected file and cannot be deleted; when the configuration attribute of the file does not include the protection attribute, the file is an unprotected file and can be deleted.
When a file needs to be protected in the local client 310, it is first determined whether the file has a protection attribute, and if not, the protection attribute is added to the file. Protected files are not limited to files that can be opened and run by an application, but can also be implemented as a folder that includes a plurality of executable files, which can also be considered as files to be protected. Adding protection attributes to a file can be accomplished through a plug-in tool running in the operating system, and the invention does not limit the tools and ways for accomplishing the protection.
Each file stored in the storage medium has a unique identification number (inode), and when a protection attribute is added to the file, a protection mark of the file is constructed according to the identification number by determining the unique identification number of the file. According to one embodiment of the present invention, the structure of the protection mark is:
{uosp:inode}
wherein uosp indicates that the file is protected, and inode is the identification number of the file.
According to one embodiment of the invention, when the file to be protected is uosimage.iso, (iso is the file type of the file), the identification number of the file is inode1, and the storage address of the file in the storage medium is home/aaa/bbb/uosimage.iso. If the plug-in tool that operates in the operating system of the local client 310 and protects the file is P, P executes the following instruction to protect the file uosimage.
P-home/aaa/bbb/uosimage.iso
Construct a protection mark for the file uosimage. And { uosp: inode1}, namely finishing the protection of the file.
Subsequently, step S220 is executed to traverse the upper directory of the file, and obtain all upper directory file sets of the file to be protected. In order to avoid deleting a protected file by deleting a higher-level directory file, it is necessary to protect all higher-level directory files of the file from being deleted. Traversal is started from the upper level directory to be protected until the root directory is traversed.
In accordance with one embodiment of the invention, a traversal is made of the superordinate directory of the file uosci, starting from the superordinate directory home/aaa/bbb/until the root directory home/end, all superordinate directory file sets of the uosci include: home/aaa/bbb, home/aaa and home. These upper level directory files are used as directory files to be protected.
Subsequently, step S230 is executed to add a protection attribute to each upper directory file in the upper directory file set. First, the identification number of the upper directory file is determined, and since the upper directory is also treated as a file, it also has a unique identification number. And then, determining the identification number of the subfile added with the protection attribute under the superior directory file, and constructing a protection mark of the superior directory file according to the superior directory file and the identification number of the subfile. The protection flag format of the upper directory is:
{uosp:inode1,inode2,……,inoden}
the protection mark comprises a plurality of identification numbers, which represent that the file with the protection mark has a next-level directory, and a plurality of protected files included under the directory are separated by 'the space', wherein the first identification number is the index number of the directory file of the current level, and the other identification numbers are the index numbers of the included next-level directory files.
According to one embodiment of the invention, the identification number of the home/aaa/bbb file is inode2, the identification number of the home/aaa file is inode3, and the identification number of the home file is inode 4. The plug-in tool P performs the following instructions to protect the home/aaa/bbb:
P-home/aaa/bbb
when the home/aaa/bbb is protected, the identification number of the home/aaa/bbb is inode2, and the identification number of the sub-file uosimage. Then, according to the identification numbers of the last level directory file home/aaa/bbb and the sub-file uosimage. iso, a protection label of the last level directory file home/aaa/bbb is constructed as { uosp: inode2, inode1 }. In the protection mark, inode2 is the identification number of the top level directory file home/aaa/bbb, and inode1 is the identification number of the subfile uosimage.
After the protection mark is set for the home/aaa/bbb of the upper-level directory file, whether the home/aaa/bbb is the root directory file or not is judged, if not, the protection mark is further set for the file of the upper level, namely, the protection mark is set for the home/aaa. Similarly, plug-in tool P sets a protection flag for home/aaa: { uosp: inode3, inode2}, until the setting of the protection flag for the root directory home is completed: { uosp: inode4, inode3 }.
In accordance with an embodiment of the present invention, a protection driver is also running in the local client 310, and the protection driver initiates a file delete command listening event to listen for file delete commands from the remote client 331 and the user.
Subsequently, step S240 is executed, when the local client 310 receives the file deletion command from the remote client 331, it is determined whether the file to be deleted by the file deletion command is added with the protection attribute. The local client 310, upon receiving a file deletion command from the remote client 331 or from a user operating the local client 310, determines whether a file to be deleted by the file deletion command has a protection attribute added thereto. And the protection driver opens the configuration attributes of the file to be deleted and judges whether the protection attributes (uosp) are protected or not in the configuration attributes.
Finally, step S250 is executed, and if the file to be deleted by the file deletion command is added with the protection attribute, the file deletion command is refused to be executed. According to one embodiment of the invention, a root directory stored in the storage medium further comprises a file abc. Iso files may be deleted when local client 310 receives a command to delete the file. But when local client 310 receives a delete command for the home/aaa file:
P-rm-home/aaa
and if the protection attribute is added to the home/aaa file, not executing a file deleting command for the home/aaa file.
According to an embodiment of the invention, when the protected file needs to be protected and further management operation is facilitated, the file can be protected by canceling the protection attribute. First, a file to be protected in the local client 310 is determined, the protection attribute of the file is cancelled, and then, a protection attribute modification operation is performed on each upper directory file in the upper directory set of the file.
When the protection attribute of the file is cancelled, whether the file has the protection attribute or not is determined, and if the file does not have the protection attribute, the file is not protected by the table name. And if the file is determined to have the protection attribute, deleting the protection mark of the file. According to an embodiment of the present invention, when a file to be protected is uosimage. iso, (iso is the file type of the file), the identification number of the file is inode1, and the storage address of the file in the storage medium is home/aaa/bbb/uosimage. iso. If the plug-in tool that operates in the operating system of the local client 310 and protects the file is P, P executes the following instruction to protect the file uosimage.
P-r-home/aaa/bbb/uosimage.iso
Delete protection flag to file uosimage. And { uosp: inode1}, namely finishing the protection of the file.
When each superior directory file in the superior directory set of the file is subjected to the operation of modifying the protection attribute, firstly, when the superior directory file is the superior directory of the file to be protected, whether the protection mark of the superior directory file only comprises the identification number of the file to be protected is determined; and if the protection mark only comprises the identification number of the file to be protected, protecting the superior directory file, and deleting the protection mark of the superior directory file. If only one protected file is the file to be protected under the previous-level directory file of the file to be protected and the file to be protected is to be cancelled, the protected file is not included under the previous-level directory file after the file is protected, and the previous-level directory file is also protected.
According to one embodiment of the invention, the file to be protected is uosimage. When the upper-level directory file home/aaa/bbb only includes a uosimage.iso that is a protected file, the upper-level directory file home/aaa/bbb does not include the protected file after the uosimage.iso is protected, and therefore the home/aaa/bbb needs to be protected. When the home/aaa/bbb is protected, the protection mark of the superior directory file can be directly deleted. The plug-in tool P executes the following instructions to take protection for the file home/aaa/bbb:
P-r-home/aaa/bbb
delete protection flag for file home/aaa/bbb: { uosp: inode2, inode1}, namely finishing protection of home/aaa/bbb.
If the upper level directory file of the file to be canceled the protection mark includes other protected files besides the file to be protected, the upper level directory file still needs to be protected. If the protection mark also comprises the identification numbers of other files, deleting the identification number of the file to be protected in the upper-level directory file protection mark.
According to an embodiment of the present invention, when the upper level directory file home/aaa/bbb includes a uosimage.iso file which is protected in addition to the uosimage.iso file, only the identification number of the uosimage.iso file to be protected in the protection flag of the upper level directory file home/aaa/bbb is deleted, and the identification number inode5 of the uosimage1.iso file is reserved. When the plug-in tool P takes protection from the file home/aaa/bbb, the inode1 is deleted from the protection marks { uosp: inode2, inode1 and inode5} of the file home/aaa/bbb, so as to obtain the modified protection marks { uosp: inode2 and inode5 }.
When the superior directory file is a non-superior directory of the file to be protected, judging whether the superior directory file protection mark comprises the identification number of the sub-file to be protected, and if the superior directory file protection mark comprises the identification number of the sub-file to be protected, deleting the identification number of the sub-file to be protected in the superior directory protection mark. When the identification number of the upper-level directory file is deleted, the upper-level directory file needs to traverse to the root directory file. However, after a file is protected, the protection attribute of the folder of the file is not necessarily affected, and thus, the higher-level directory needs to be traversed step by step.
According to one embodiment of the invention, when the directory file under the home/aaa file includes the home/aaa/bbb for protection, the identification number of the protected sub-file home/aaa/bbb in the home/aaa file needs to be deleted. If the protection is performed on the uosimage. iso file, but the home/aaa/bbb of the upper-level directory file is still in the protection state, the protection state of the home/aaa file is not processed.
The protection mark of the upper-level protection directory is deleted if the protection mark of the upper-level directory protection file only comprises the identification number of the sub-file to be protected.
According to an embodiment of the present invention, after the processing of the protection state of the home/aaa file is completed, the determination of the protection state of the upper directory file is continued until the processing of the protection state of the home of the root directory file is completed.
The file protection method is suitable for being executed in a local client, firstly, a file to be protected in the local client is determined, a protection attribute is added to the file, and then, all superior directory files of the file to be protected are added with the protection attribute; therefore, the method not only protects the files to be protected against deletion, but also protects all the superior directory files of the files against deletion, and avoids deleting the protected files in a mode of deleting the superior directory files. The file added with the protection attribute does not influence the file per se, and the content and the size of the file are not changed.
And further, a protection driver is operated in the local client, the protection driver starts a file deletion command monitoring event, monitors file deletion commands from the remote client and the user, and refuses to execute the file deletion command when the file to be deleted by the file deletion command is added with a protection attribute, so that the protected file is not deleted.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
A9, the method according to A8, further comprising the steps of:
when the superior directory file is a non-superior directory of a file to be protected, judging whether the superior directory file protection mark comprises an identification number of a sub-file to be protected;
and if the identification number of the sub-file to be protected is included, deleting the identification number of the sub-file to be protected in the upper-level directory protection mark.
A10, the method of A9, further comprising the steps of:
and if the protection mark of the superior directory protection file only comprises the identification number of the sub-file to be protected, deleting the protection mark of the superior directory protection file.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or groups of devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. Modules or units or groups in embodiments may be combined into one module or unit or group and may furthermore be divided into sub-modules or sub-units or sub-groups. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, hard drives, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the method for determining the apparatus shutdown state of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer readable media includes both computer storage media and communication media. Computer storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of computer readable media.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense, and the scope of the present invention is defined by the appended claims.

Claims (10)

1. A file protection method adapted to be executed at a local client communicatively coupled to one or more remote clients, the method comprising the steps of:
determining a file to be protected in a local client, and adding a protection attribute to the file;
traversing the superior directory of the file to obtain all superior directory file sets of the file to be protected;
adding a protection attribute to each superior directory file in the superior directory file set;
when the local client receives a file deleting command of a remote client, judging whether a file to be deleted by the file deleting command is added with a protection attribute;
if the file to be deleted by the file deletion command is added with the protection attribute, refusing to execute the file deletion command;
when the file needs to be protected, determining the file to be protected in a local client, and canceling the protection attribute of the file;
modifying and protecting the attribute of each superior directory file in the superior directory set of the files;
wherein the adding a protection attribute to each superior directory file in the superior directory file set includes:
determining the identification number of the superior directory file;
determining the identification number of the subfile added with the protection attribute under the superior directory file;
and constructing a protection mark of the superior directory file according to the identifier numbers of the superior directory file and the subfiles.
2. The method of claim 1, wherein said adding a protection attribute to said file comprises the steps of:
and determining the unique identification number of the file, and constructing a protection mark of the file according to the identification number.
3. The method of claim 1, wherein a protection driver is running in the local client, the method further comprising the steps of:
the protection driver initiates a file delete command listening event to listen for file delete commands from the remote client and user.
4. The method of claim 3, wherein the method further comprises the steps of:
when the file deleting command monitoring event receives a file deleting command from a user, judging whether a file to be deleted by the file deleting command is added with a protection attribute;
and if the file to be deleted by the file deletion command is added with the protection attribute, refusing to execute the file deletion command.
5. The method of claim 4, wherein said unprotecting said file comprises the steps of:
determining whether the file has a protection attribute;
and if the file is determined to have the protection attribute, deleting the protection mark of the file.
6. The method as claimed in claim 5, wherein said performing a modify protection attribute operation on each superordinate directory file in said superordinate directory set of files comprises the steps of:
when the superior directory file is the superior directory of the file to be protected, determining whether the protection mark of the superior directory file only comprises the identification number of the file to be protected;
if only the identification number of the file to be protected is included, protecting the superior directory file, and deleting the protection mark of the superior directory file;
if the protection mark also comprises the identification numbers of other files, the identification number of the file to be protected in the superior directory file protection mark is deleted.
7. The method of claim 6, further comprising the steps of:
when the superior directory file is a non-superior directory of a file to be protected, judging whether the superior directory file protection mark comprises an identification number of a sub-file to be protected;
and if the protection mark comprises the identification number of the sub file to be protected, deleting the identification number of the sub file to be protected in the superior directory file protection mark.
8. The method of claim 7, further comprising the steps of:
and if the file protection mark of the superior directory only comprises the identification number of the sub-file to be protected, deleting the file protection mark of the superior directory.
9. A computing device, comprising:
one or more processors;
a memory; and
one or more devices comprising instructions for performing any of the methods of claims 1-8.
10. A computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform any of the methods of claims 1-8.
CN202110801313.7A 2021-05-06 2021-05-06 File protection method, computing device and storage medium Active CN113407999B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110801313.7A CN113407999B (en) 2021-05-06 2021-05-06 File protection method, computing device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110801313.7A CN113407999B (en) 2021-05-06 2021-05-06 File protection method, computing device and storage medium
CN202110487815.7A CN112989427B (en) 2021-05-06 2021-05-06 File protection method, computing device and storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202110487815.7A Division CN112989427B (en) 2021-05-06 2021-05-06 File protection method, computing device and storage medium

Publications (2)

Publication Number Publication Date
CN113407999A CN113407999A (en) 2021-09-17
CN113407999B true CN113407999B (en) 2022-09-06

Family

ID=76336998

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110801313.7A Active CN113407999B (en) 2021-05-06 2021-05-06 File protection method, computing device and storage medium
CN202110487815.7A Active CN112989427B (en) 2021-05-06 2021-05-06 File protection method, computing device and storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202110487815.7A Active CN112989427B (en) 2021-05-06 2021-05-06 File protection method, computing device and storage medium

Country Status (1)

Country Link
CN (2) CN113407999B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386108A (en) * 2021-10-21 2022-04-22 统信软件技术有限公司 File protection method, computing device and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1764103B (en) * 2004-10-20 2010-05-12 联想(新加坡)私人有限公司 Privacy protection method and apparatus for remote control
US8266696B2 (en) * 2005-11-14 2012-09-11 Cisco Technology, Inc. Techniques for network protection based on subscriber-aware application proxies
CN102243636B (en) * 2010-05-13 2015-04-22 深圳市朗科科技股份有限公司 Method and device for storing file information to be protected and protecting file
CN102982289A (en) * 2012-11-14 2013-03-20 广东欧珀移动通信有限公司 Method of data protection and mobile intelligent terminal
US10248801B2 (en) * 2016-10-07 2019-04-02 American Express Travel Related Services Company, Inc. Systems and methods for role-based file access control
CN109117667A (en) * 2018-07-27 2019-01-01 郑州云海信息技术有限公司 A kind of document protection method, system, equipment and computer readable storage medium
CN111881473B (en) * 2020-07-22 2024-03-19 深圳市友杰智新科技有限公司 Privacy file protection method, device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN112989427A (en) 2021-06-18
CN112989427B (en) 2021-08-20
CN113407999A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
US8719691B2 (en) Document providing system and computer-readable storage medium
US8413231B1 (en) Document control
US8959120B2 (en) Information processing apparatus, information processing method, and function expansion program
JP5652220B2 (en) File management apparatus and program
US20140223570A1 (en) Information processing apparatus, information processing system, and license management method
CN113076170B (en) Remote assistance method, system, device, computing equipment and storage medium
CN109033313B (en) Method and terminal equipment for realizing full-disk scanning function by using USN
WO2022237046A1 (en) Data encryption method and computing device
WO2022222350A1 (en) Method for encrypting data, and computing device
US7421560B2 (en) Method and system of computing quota usage
JP4516598B2 (en) How to control document copying
WO2021169163A1 (en) File data access method and apparatus, and computer-readable storage medium
CN113568787A (en) Power failure protection method, computing device and storage medium
CN113407999B (en) File protection method, computing device and storage medium
US20100228801A1 (en) Information processing apparatus, file management system, information processing method and computer readable medium
CN106469281B (en) Management method of data files in cloud, cloud management point and system
JP2010079444A (en) File management method and system by metadata
JP2004133505A (en) File management system
JP2006004024A (en) Program for execution by directory server
JP2007172281A (en) File management program, file management device and file processing method
JP2003316624A (en) Document management system, method and program and storage medium
US8190589B2 (en) System and method for controlling access to a document being edited
JP2006235751A (en) Virtual storage device, virtual storage method and program
JP4507609B2 (en) File management program and file management apparatus
JP2008037031A (en) Image processing device and image processing 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