CN110795400B - File management method, device, equipment and medium - Google Patents

File management method, device, equipment and medium Download PDF

Info

Publication number
CN110795400B
CN110795400B CN201910968188.1A CN201910968188A CN110795400B CN 110795400 B CN110795400 B CN 110795400B CN 201910968188 A CN201910968188 A CN 201910968188A CN 110795400 B CN110795400 B CN 110795400B
Authority
CN
China
Prior art keywords
file
target
descriptor
virtual
descriptors
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
CN201910968188.1A
Other languages
Chinese (zh)
Other versions
CN110795400A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201910968188.1A priority Critical patent/CN110795400B/en
Publication of CN110795400A publication Critical patent/CN110795400A/en
Application granted granted Critical
Publication of CN110795400B publication Critical patent/CN110795400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Abstract

The invention discloses a file management method, which comprises the following steps: creating corresponding virtual descriptors according to the file descriptors acquired by the process; counting the number of all virtual descriptors; judging whether the number is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the system restricted process; if yes, after an application instruction for opening the file is received, the target descriptor meeting the preset requirement is obtained to be deleted, and the file corresponding to the target descriptor is closed. Therefore, when the number of the files opened by the process reaches the upper limit of the system requirement, the process can normally open new files again; the method avoids the complex process of modifying the system parameters, ensures that the file can be normally operated efficiently and conveniently, and improves the experience of the user. In addition, the file management device, the equipment and the medium correspond to the method.

Description

File management method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for managing files.
Background
With the rapid development of science and technology, a data management system needs to perform read and write operations on a large amount of data. Therefore, file management is an important technology for a data management system.
In a data management system, when a process creates or opens a file, the system assigns a file descriptor to the file that uniquely identifies the file that has been opened. Furthermore, the system limits the number of files that can be opened by a process, i.e., the file descriptors that can be obtained by a process are limited. When the number of files opened by one process reaches the limit number, the situation of opening failure will occur when the files are opened again, and meanwhile, the corresponding file descriptors cannot be acquired.
In the prior art, for the above situations, a mode of modifying a limiting parameter in a system is required, so that the number of files that can be opened by one process is increased, and a situation of file opening failure is avoided. However, since the change of the limiting parameters may affect other operations of the system, the frequent change is not convenient; moreover, the operation of changing the system parameters each time is complicated, so that the waste of time resources is caused, and the user experience is reduced. Therefore, it is necessary to provide a convenient and efficient file management method.
Disclosure of Invention
The invention aims to provide a file management method, a file management device, file management equipment and a file management medium. When the number of files opened by the process reaches the upper limit of the system requirement, the process can normally open a new file again by deleting the target descriptor and closing the corresponding file. The complicated process of modifying the system parameters is avoided, the file can be efficiently and conveniently normally operated, and the experience of a user is improved.
In order to solve the above technical problem, the present invention provides a file management method, including:
creating corresponding virtual descriptors according to the file descriptors acquired by the process;
counting the number of all the virtual descriptors;
judging whether the number is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the process limited by the system;
if yes, after an application instruction for opening the file is received, the target descriptor meeting the preset requirement is obtained to be deleted, and the file corresponding to the target descriptor is closed.
Preferably, the information included in the virtual descriptor specifically includes an identification number of the process, a file name, a use frequency of the file descriptor, and a last use time.
Preferably, the obtaining and deleting the target descriptor meeting the preset requirement specifically includes:
acquiring the virtual descriptor with the least use frequency as the target descriptor;
deleting the target descriptor.
Preferably, the obtaining and deleting the target descriptor meeting the preset requirement specifically includes:
acquiring the virtual descriptor with the earliest last use time as the target descriptor;
deleting the target descriptor.
Preferably, the method further comprises the following steps:
a log is generated for recording the deleted target descriptor.
Preferably, the method further comprises the following steps:
judging whether the file is abnormal in the opening and closing processes;
and if so, prompting in the log.
Preferably, the method further comprises the following steps:
and updating the target quantity according to parameters set by the system.
In order to solve the above technical problem, the present invention further provides a file management apparatus, including:
the creating module is used for creating corresponding virtual descriptors according to the file descriptors acquired by the process;
a counting module for counting the number of all the virtual descriptors;
the judging module is used for judging whether the number is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the process limited by the system; if yes, entering a closing module;
and the closing module is used for acquiring the target descriptor meeting the preset requirement for deletion after receiving the application instruction for opening the file, and closing the file corresponding to the target descriptor.
In order to solve the above technical problem, the present invention further provides a file management device, including a memory for storing a computer program;
a processor for implementing the steps of the file management method according to any one of the preceding claims when executing said computer program.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of the file management method according to any one of the above.
The invention provides a file management method, which comprises the steps of firstly, establishing corresponding virtual descriptors according to file descriptors acquired by a process when operating files; judging whether the number of all the virtual descriptors is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the system restricted process; therefore, whether the number of files opened by the process reaches the upper limit required by the system is judged, and if the number of files opened by the process reaches the upper limit required by the system, the process cannot continue to open the files. When an application instruction for opening the file is received again, the target descriptors meeting the preset requirements are deleted, the files corresponding to the target descriptors are closed, the number of the current virtual descriptors is smaller than the target number, and the number of the currently opened files is smaller than the maximum number limited to be opened by the system, so that the process can normally open the new files. Therefore, when the number of files opened by the process reaches the upper limit of the system requirement, the method provided by the invention enables the process to normally open a new file again by deleting the target descriptor and closing the corresponding file; the method avoids the complex process of modifying the system parameters, saves a large amount of time, ensures that the file can be normally operated efficiently and conveniently, and improves the experience of the user.
In addition, the file management device, the equipment and the medium provided by the invention correspond to the method and have the same beneficial effects.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in 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 invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a file management method according to an embodiment of the present invention;
FIG. 2 is a flowchart of another file management method according to an embodiment of the present invention;
FIG. 3 is a block diagram of a file management apparatus according to an embodiment of the present invention;
fig. 4 is a structural diagram of a file management device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
The core of the invention is to provide a file management method, a device, equipment and a medium. When the number of files opened by the process reaches the upper limit of the system requirement, the process can normally open a new file again by deleting the target descriptor and closing the corresponding file. The complicated process of modifying the system parameters is avoided, the file can be efficiently and conveniently normally operated, and the experience of a user is improved.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flowchart of a file management method according to an embodiment of the present invention; as shown in fig. 1, the file management method provided in the embodiment of the present invention includes steps S101 to S104:
step S101: creating corresponding virtual descriptors according to the file descriptors acquired by the process;
it should be noted that the virtual descriptor proposed in this embodiment is specifically a data structure containing file descriptor information and other file information, and is named as a virtual descriptor here. It is understood that opening different files by one process generates different file descriptors, and different virtual descriptors are correspondingly created according to the different file descriptors. Specifically, the created virtual descriptors may be stored in a buffer pool for management.
In one embodiment, the information included in the virtual descriptor specifically includes an identification number of the process, a file name, a usage frequency of the file descriptor, and a last usage time. The file name is the file name of the currently opened physical file; the using frequency of the file descriptor is the number of times of acquiring the file descriptor in a certain time period; the last usage time is the time of the last usage of the file descriptor from the current time. In addition, other contents may also be recorded in the virtual descriptor, such as: the handle of the corresponding physical file, the state mark bit of the virtual descriptor, the position of the current read-write pointer, the mark when the file is opened and the like. Those skilled in the art can add or delete contents related to the file to the virtual descriptor according to the actual application, and the embodiment is not limited.
Step S102: counting the number of all virtual descriptors;
step S103: judging whether the number is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the system restricted process; if yes, go to step S104;
step S104: and after an application instruction for opening the file is received, acquiring a target descriptor meeting the preset requirement, deleting the target descriptor, and closing the file corresponding to the target descriptor.
In a specific implementation, the number of all the created virtual descriptors is counted, and whether the number is equal to a preset target number, that is, the maximum number of files opened by the system restricted process is determined. When the number of the virtual descriptors is equal to the target number, the number of the files opened by the process reaches the maximum number of the opened files limited by the system, and a new file cannot be opened. When an application instruction for opening a file is received again, a target descriptor meeting preset requirements needs to be acquired first, the target descriptor is deleted, and then the file corresponding to the target descriptor is closed. It should be noted that, of all the virtual descriptors, a virtual descriptor that meets a preset requirement is referred to as a target descriptor. At this time, the number of virtual descriptors becomes smaller than the target number, and the number of process-opened files is also smaller than the maximum number of system limitations. The process may open the new file again.
Specifically, the capacity of the buffer pool is set to be the maximum number of files opened by the system restricted process, and whether the number of virtual descriptors is equal to a preset target number is judged by judging whether the virtual descriptors in the buffer pool are full; when the virtual descriptors of the buffer pool are full, the number of the virtual descriptors is equal to the target number; when the virtual descriptors of the buffer pool are not full, the number of the virtual descriptors is less than the target number. Meanwhile, the condition of the number of the files opened by the current process can be determined.
The invention provides a file management method, which comprises the steps of firstly, establishing corresponding virtual descriptors according to file descriptors acquired by a process when operating files; judging whether the number of all the virtual descriptors is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the system restricted process; therefore, whether the number of files opened by the process reaches the upper limit required by the system is judged, and if the number of files opened by the process reaches the upper limit required by the system, the process cannot continue to open the files. When an application instruction for opening the file is received again, the target descriptors meeting the preset requirements are deleted, the files corresponding to the target descriptors are closed, the number of the current virtual descriptors is smaller than the target number, and the number of the currently opened files is smaller than the maximum number limited to be opened by the system, so that the process can normally open the new files. Therefore, when the number of files opened by the process reaches the upper limit of the system requirement, the method provided by the invention enables the process to normally open a new file again by deleting the target descriptor and closing the corresponding file; the method avoids the complex process of modifying the system parameters, saves a large amount of time, ensures that the file can be normally operated efficiently and conveniently, and improves the experience of the user.
In a specific implementation, the acquiring a target descriptor meeting a preset requirement in the file management method provided by the present invention for deleting specifically includes:
acquiring a virtual descriptor with the least use frequency as a target descriptor;
the target descriptor is deleted.
It should be noted that the use frequency of the file descriptor recorded in the virtual descriptor may be understood as the number of times the file is used within a certain period of time. In one embodiment, the stored virtual descriptors are sorted in the buffer pool according to the order of the use frequency of the file descriptors from high to low; and acquiring the virtual descriptor positioned at the last of the buffer pool as a target descriptor.
It can be understood that the least frequent usage indicates that the file descriptor corresponds to the file with the least number of usage times, and is an uncommon file. The virtual descriptor may be deleted as a target descriptor and the corresponding uncommon file of the virtual descriptor may be closed. Therefore, the requirement of opening a new file by the process can be met; meanwhile, because the closed file is the file with the least use times, the influence of closing the file on the system operation can be reflected to be the minimum.
In a specific implementation, the acquiring a target descriptor meeting a preset requirement in the file management method provided by the present invention for deleting specifically includes:
acquiring a virtual descriptor with the earliest last use time as a target descriptor;
the target descriptor is deleted.
It should be noted that the last usage time, that is, the time of using the file descriptor the most recent time from the current time, is recorded in the virtual descriptor. In one embodiment, the stored virtual descriptors are sorted in the buffer pool in the order of last use time from the current time from near to far; and acquiring the last virtual descriptor stored in the buffer pool as the target descriptor, namely acquiring the virtual descriptor corresponding to the file descriptor with the farthest last use time as the target descriptor.
It can be understood that the last usage time is the earliest, which means that the file corresponding to the file descriptor has not been operated for a long time, and is considered as an unusual file. The virtual descriptor may be deleted as a target descriptor and the corresponding uncommon file of the virtual descriptor may be closed. Therefore, the requirement of opening a new file by the process can be met; meanwhile, since the closed file is not used for a long time, the probability that the file is used in a future period of time is low, and the influence of closing the file on the system operation is minimum.
FIG. 2 is a flowchart of another file management method according to an embodiment of the present invention; as shown in fig. 2, the file management method provided in the embodiment of the present invention further includes steps S105 to S108:
step S105: a log is generated for recording the deleted target descriptor.
Specifically, in the process of deleting the target descriptor, the deleted target descriptor is recorded in the log, so that the deleted target descriptor is supplemented in time when operations such as mistaken deletion or re-addition are required; meanwhile, the staff can know the operation condition of the process on the file according to the target descriptor recorded in the log. The embodiment improves the flexibility of operation and also prevents the influence of the operation of deleting by mistake on other operations of the system.
As shown in fig. 2, the method for managing files according to the embodiment of the present invention further includes:
step S106: judging whether the file is abnormal in the opening and closing processes; if yes, go to step S107;
step S107: and prompting in the log.
In one embodiment, when a file is abnormal in the opening and closing processes, such as an opening failure, a closing failure or a failure to find the file; can carry out unusual suggestion through the log, the staff of being convenient for in time discovers. The method can also be used for processing the data according to the pre-stored contact information of the staff, such as a mail box or a telephone number. And sending the abnormal information to the staff when the abnormality occurs, so that the staff can timely process the abnormal information. The effectiveness and timeliness of the system for file operation are guaranteed.
As shown in fig. 2, the method for managing files according to the embodiment of the present invention further includes:
step S108: and updating the target quantity according to the parameters set by the system.
Specifically, since the parameter of the maximum number of files opened by the running process set in the system is changeable, when the parameter set by the system is changed, the target number needs to be updated accordingly. The target number is ensured to be the currently newly set parameter, so that whether the virtual descriptors are equal to the target number or not can be accurately judged, namely whether the number of the files opened by the process reaches the limited maximum number or not can be accurately judged, other related operations can be conveniently executed subsequently, and the process is ensured not to influence the normal opening of new files under the condition that the number of the opened files reaches the maximum number. The method provided by the embodiment ensures the timeliness of the target data, can be continuously adjusted according to the actual condition, and better meets the requirements of users.
The invention also provides an embodiment corresponding to the file management device, and the file management device is explained based on the angle of the functional module.
FIG. 3 is a block diagram of a file management apparatus according to an embodiment of the present invention; as shown in fig. 3, an apparatus for managing files according to an embodiment of the present invention includes:
a creating module 10, configured to create a corresponding virtual descriptor according to each file descriptor obtained by a process;
a counting module 11, configured to count the number of all virtual descriptors;
a judging module 12, configured to judge whether the number is equal to a preset target number; the target number is specifically the maximum number of files opened by the system restricted process; if yes, entering a closing module 13;
and the closing module 13 is configured to, after receiving an application instruction for opening a file, acquire a target descriptor meeting a preset requirement, delete the target descriptor, and close the file corresponding to the target descriptor.
The file management device provided by the embodiment of the invention further comprises:
a generation module for generating a log for recording the deleted target descriptor;
the judging module is used for judging whether the file is abnormal in the opening and closing processes; if yes, prompting in the log;
and the updating module is used for updating the target quantity according to the parameters set by the system.
Since the embodiments of this section correspond to the embodiments of the method section, reference is made to the description of the embodiments of the method section for the embodiments of this section, and details are not repeated here.
The invention provides a file management device, which comprises the following steps that firstly, corresponding virtual descriptors are created according to file descriptors acquired when a process operates files; judging whether the number of all the virtual descriptors is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the system restricted process; therefore, whether the number of files opened by the process reaches the upper limit required by the system is judged, and if the number of files opened by the process reaches the upper limit required by the system, the process cannot continue to open the files. When an application instruction for opening the file is received again, the target descriptors meeting the preset requirements are deleted, the files corresponding to the target descriptors are closed, the number of the current virtual descriptors is smaller than the target number, and the number of the currently opened files is smaller than the maximum number limited to be opened by the system, so that the process can normally open the new files. Therefore, when the number of files opened by the process reaches the upper limit of the system requirement, the device provided by the invention enables the process to normally open a new file again by deleting the target descriptor and closing the corresponding file; the method avoids the complex process of modifying the system parameters, saves a large amount of time, ensures that the file can be normally operated efficiently and conveniently, and improves the experience of the user.
The invention also provides an embodiment corresponding to the file management device, and the file management device is explained based on the angle of hardware.
Fig. 4 is a structural diagram of a file management apparatus according to an embodiment of the present invention; as shown in fig. 4, the file management apparatus provided by the embodiment of the present invention includes a memory 20 for storing a computer program;
a processor 21 for implementing the steps of the file management method according to any one of the above when executing the computer program.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps in the file management method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, Windows, Unix, Linux, and the like.
In some embodiments, the file management device may further include an input/output interface 22, a communication interface 23, a power supply 24, and a communication bus 25.
Those skilled in the art will appreciate that the configuration shown in FIG. 4 does not constitute a limitation of the file management device and may include more or fewer components than those shown.
Since the embodiment of the device portion and the embodiment of the method portion correspond to each other, please refer to the description of the embodiment of the method portion for the embodiment of the device portion, which is not repeated here.
The file management device provided by the invention can realize the following method: firstly, creating a corresponding virtual descriptor according to each file descriptor acquired by a process when each file is operated; judging whether the number of all the virtual descriptors is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the system restricted process; therefore, whether the number of files opened by the process reaches the upper limit required by the system is judged, and if the number of files opened by the process reaches the upper limit required by the system, the process cannot continue to open the files. When an application instruction for opening the file is received again, the target descriptors meeting the preset requirements are deleted, the files corresponding to the target descriptors are closed, the number of the current virtual descriptors is smaller than the target number, and the number of the currently opened files is smaller than the maximum number limited to be opened by the system, so that the process can normally open the new files. Therefore, when the number of files opened by the process reaches the upper limit of the system requirement, the method provided by the invention enables the process to normally open a new file again by deleting the target descriptor and closing the corresponding file; the method avoids the complex process of modifying the system parameters, saves a large amount of time, ensures that the file can be normally operated efficiently and conveniently, and improves the experience of the user.
Finally, the invention also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and performs all or part of the steps of the methods according to the embodiments of the present invention, or all or part of the technical solution. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The method, device, equipment and medium for managing files provided by the invention are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (9)

1. A method for managing a file, comprising:
creating corresponding virtual descriptors according to the file descriptors acquired by the process;
counting the number of all the virtual descriptors;
judging whether the number is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the process limited by the system;
if yes, after an application instruction for opening a file is received, a target descriptor meeting a preset requirement is obtained to be deleted, and the file corresponding to the target descriptor is closed;
the information contained in the virtual descriptor specifically includes an identification number of the process, a file name, the use frequency of the file descriptor, and the last use time;
storing the created virtual descriptors in a buffer pool, and setting the capacity of the buffer pool as the maximum number of files opened by the process limited by the system;
judging whether the number is equal to a preset target number or not, including:
judging whether the virtual descriptors in the buffer pool are full, wherein when the virtual descriptors in the buffer pool are full, the number of the virtual descriptors is equal to the target number; when the virtual descriptors in the buffer pool are not full, then the number of virtual descriptors is less than the target number.
2. The method for managing files according to claim 1, wherein the obtaining the target descriptor that meets the preset requirement for deletion specifically includes:
acquiring the virtual descriptor with the least use frequency as the target descriptor;
deleting the target descriptor.
3. The method for managing files according to claim 1, wherein the obtaining the target descriptor that meets the preset requirement for deletion specifically includes:
acquiring the virtual descriptor with the earliest last use time as the target descriptor;
deleting the target descriptor.
4. The file management method according to claim 1, further comprising:
a log is generated for recording the deleted target descriptor.
5. The file management method according to claim 4, further comprising:
judging whether the file is abnormal in the opening and closing processes;
and if so, prompting in the log.
6. The file management method according to claim 1, further comprising:
and updating the target quantity according to parameters set by the system.
7. An apparatus for managing a file, comprising:
the creating module is used for creating corresponding virtual descriptors according to the file descriptors acquired by the process;
a counting module for counting the number of all the virtual descriptors;
the judging module is used for judging whether the number is equal to a preset target number or not; the target number is specifically the maximum number of files opened by the process limited by the system; if yes, entering a closing module;
the closing module is used for acquiring a target descriptor meeting a preset requirement for deletion after receiving an application instruction for opening a file, and closing the file corresponding to the target descriptor;
the information contained in the virtual descriptor specifically includes an identification number of the process, a file name, the use frequency of the file descriptor, and the last use time;
storing the created virtual descriptors in a buffer pool, and setting the capacity of the buffer pool as the maximum number of files opened by the process limited by the system;
the determining module is specifically configured to determine whether the virtual descriptors in the buffer pool are full, and when the virtual descriptors in the buffer pool are full, the number of the virtual descriptors is equal to the target number; when the virtual descriptors in the buffer pool are not full, then the number of virtual descriptors is less than the target number.
8. A file management apparatus, comprising a memory for storing a computer program;
processor for implementing the steps of the file management method according to any one of claims 1 to 6 when executing said computer program.
9. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the method for managing files according to any one of claims 1 to 6.
CN201910968188.1A 2019-10-12 2019-10-12 File management method, device, equipment and medium Active CN110795400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910968188.1A CN110795400B (en) 2019-10-12 2019-10-12 File management method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910968188.1A CN110795400B (en) 2019-10-12 2019-10-12 File management method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN110795400A CN110795400A (en) 2020-02-14
CN110795400B true CN110795400B (en) 2022-03-22

Family

ID=69439044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910968188.1A Active CN110795400B (en) 2019-10-12 2019-10-12 File management method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110795400B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111832054B (en) * 2020-07-16 2022-03-15 郑州信大捷安信息技术股份有限公司 Transparent encryption and decryption method, system and storage medium based on multithreading environment
CN112732640B (en) * 2020-12-28 2023-07-25 杭州迪普科技股份有限公司 Method and device for detecting leakage of file descriptor
CN112732560B (en) * 2020-12-31 2023-10-27 杭州迪普科技股份有限公司 Method and device for detecting leakage risk of file descriptor
CN113835891B (en) * 2021-09-24 2023-05-23 哲库科技(北京)有限公司 Resource allocation method, device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107179950A (en) * 2017-06-29 2017-09-19 努比亚技术有限公司 A kind of application process processing method, mobile terminal and computer-readable recording medium
CN107423213A (en) * 2017-04-11 2017-12-01 腾讯科技(深圳)有限公司 A kind of filec descriptor distribution detection method and device
CN108628740A (en) * 2018-04-10 2018-10-09 杭州迪普科技股份有限公司 A kind of filec descriptor leakage detection method and device
CN110309257A (en) * 2018-03-14 2019-10-08 杭州海康威视数字技术股份有限公司 A kind of file read-write deployment method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060184718A1 (en) * 2005-02-16 2006-08-17 Sinclair Alan W Direct file data programming and deletion in flash memories

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423213A (en) * 2017-04-11 2017-12-01 腾讯科技(深圳)有限公司 A kind of filec descriptor distribution detection method and device
CN107179950A (en) * 2017-06-29 2017-09-19 努比亚技术有限公司 A kind of application process processing method, mobile terminal and computer-readable recording medium
CN110309257A (en) * 2018-03-14 2019-10-08 杭州海康威视数字技术股份有限公司 A kind of file read-write deployment method and device
CN108628740A (en) * 2018-04-10 2018-10-09 杭州迪普科技股份有限公司 A kind of filec descriptor leakage detection method and device

Also Published As

Publication number Publication date
CN110795400A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
CN110795400B (en) File management method, device, equipment and medium
CN107256707B (en) Voice recognition method, system and terminal equipment
CN105335099A (en) Memory cleaning method and terminal
KR20160003682A (en) Hydration and dehydration with placeholders
CN106708912B (en) Junk file identification and management method, identification device, management device and terminal
CN108701026A (en) Method and apparatus for the managing process under memory constraints
CN111143039A (en) Virtual machine scheduling method and device and computer storage medium
CN112149419B (en) Method, device and system for normalized automatic naming of fields
CN108764667A (en) Risk data determines method and device
CN110134215A (en) Data processing method, device, electronic equipment and readable storage medium storing program for executing
CN114995759A (en) Barrel fragment processing method, device, equipment and medium
CN114996173A (en) Method and device for managing write operation of storage equipment
CN112000971B (en) File permission recording method, system and related device
CN109783321A (en) Monitoring data management method, device, terminal device
US20230004824A1 (en) Method, Apparatus, and Device for Updating Hard Disk Prediction Model, and Medium
CN114816772A (en) Debugging method, debugging system and computing device for application running based on compatible layer
CN114861003A (en) Object enumeration method, device and medium under specified directory
CN111160011A (en) Organization unit standardization method, device, equipment and storage medium
CN111176571A (en) Method, device, equipment and medium for managing local object
CN114063879B (en) Method for processing operation command, electronic device and storage medium
CN113032288B (en) Method, device and equipment for determining cold and hot data threshold
CN111124285B (en) Solid state disk data holding method, device, equipment and medium
CN108920216B (en) Method, device, terminal and storage medium for closing software compatible mode
CN108958654B (en) Management method and related device of storage system
CN115562815A (en) Tenant resource processing method, device and medium

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