CN111858515A - File management method and device - Google Patents

File management method and device Download PDF

Info

Publication number
CN111858515A
CN111858515A CN202010771075.5A CN202010771075A CN111858515A CN 111858515 A CN111858515 A CN 111858515A CN 202010771075 A CN202010771075 A CN 202010771075A CN 111858515 A CN111858515 A CN 111858515A
Authority
CN
China
Prior art keywords
file
file management
management table
record
service information
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.)
Pending
Application number
CN202010771075.5A
Other languages
Chinese (zh)
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.)
Beijing Zhongxiaoyun Iot Institute Co ltd
Original Assignee
Beijing Zhongxiaoyun Iot Institute 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 Beijing Zhongxiaoyun Iot Institute Co ltd filed Critical Beijing Zhongxiaoyun Iot Institute Co ltd
Priority to CN202010771075.5A priority Critical patent/CN111858515A/en
Publication of CN111858515A publication Critical patent/CN111858515A/en
Pending legal-status Critical Current

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/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a file management method and device. Wherein, the method comprises the following steps: creating a file management table, wherein the file management table is used for storing a plurality of information of a file; storing a plurality of information of the file into a file management table in the process of processing the file; and managing the files according to the file management table. The method and the device solve the technical problem that server resources are wasted due to the fact that a large number of useless files exist in a service system.

Description

File management method and device
Technical Field
The present application relates to the field of file management, and in particular, to a method and an apparatus for managing files.
Background
In the process of developing software, resource files are often used for uploading, processing and clearing, if files are uploaded once in a business system, the files have problems, the files are uploaded for the second time and then stored, and actually the resource files uploaded for the first time are useless, and a lot of junk data are caused.
Aiming at the problem that a large number of useless files exist in a service system to cause waste of server resources, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the application provides a file management method and device, and aims to at least solve the technical problem that server resources are wasted due to the fact that a large number of useless files exist in a service system.
According to an aspect of an embodiment of the present application, there is provided a file management method, including: creating a file management table, wherein the file management table is used for storing a plurality of information of a file; storing a plurality of information of the file into a file management table in the process of processing the file; and managing the files according to the file management table.
Optionally, the plurality of information of the file includes at least: the file management system comprises a file identifier, a file name, a file type, a file thumbnail path, a file original path and a service information identifier, wherein the service information identifier is used for representing whether the file is used in the service.
Optionally, in the process of processing the file, storing a plurality of information of the file to the file management table includes: in the process of uploading the file to the server, adding information except the service information identifier in the plurality of pieces of information of the file as records corresponding to the file to a file management table, wherein a field corresponding to the service information identifier in the record is empty; when the file is used in the service, data is added in the field corresponding to the service information identification.
Optionally, managing the file according to the file management table includes: and deleting the target record from the file management table according to a preset time interval corresponding to a preset timer, wherein a field corresponding to the service information identifier in the target record is empty, and deleting the file corresponding to the target record.
Optionally, before deleting the target record from the file management table according to a preset time interval corresponding to the preset timer, the method further includes: judging whether a field corresponding to the service information identifier in each record stored in the file management list is empty or not; if the field corresponding to the service information identifier in the record is not empty, taking the record as an effective record, and taking the file corresponding to the effective record as an effective file; and if the field corresponding to the service information identifier in the record is empty, taking the record as a target record.
Optionally, before deleting the target record from the file management table according to a preset time interval corresponding to the preset timer, the method further includes: a timer is created.
According to another aspect of the embodiments of the present application, there is also provided a file management apparatus, including: the file management system comprises a creating module, a storage module and a processing module, wherein the creating module is used for creating a file management table, and the file management table is used for storing a plurality of information of files; the processing module is used for storing a plurality of information of the file to the file management table in the process of processing the file; and the management module is used for managing the files according to the file management table.
Optionally, the plurality of information of the file includes at least: the file management system comprises a file identifier, a file name, a file type, a file thumbnail path, a file original path and a service information identifier, wherein the service information identifier is used for representing whether the file is used in the service.
According to still another aspect of the embodiments of the present application, there is provided a computer-readable storage medium including a stored program, where the program, when executed, controls a device in which the computer-readable storage medium is located to execute the above file management method.
According to still another aspect of the embodiments of the present application, there is also provided a processor configured to execute a program stored in a memory, where the program executes the above file management method.
In the embodiment of the application, a file management table is created, wherein the file management table is used for storing a plurality of information of a file; storing a plurality of information of the file into a file management table in the process of processing the file; the method for managing the files according to the file management table achieves the aim of clearing useless resource files uploaded by the system on time, thereby achieving the technical effects of effectively managing the resource files and reducing the pressure of a file server, and further solving the technical problem of server resource waste caused by a large number of useless files in a service system.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow chart of a method for managing files according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another file management method according to an embodiment of the present application;
fig. 3 is a configuration diagram of a file management apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the present application, there is provided an embodiment of a file management method, it should be noted that the steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that here.
Fig. 1 is a flowchart of a file management method according to an embodiment of the present application, and as shown in fig. 1, the method includes the following steps:
step S102, a file management table is created, wherein the file management table is used for storing a plurality of information of the file.
According to an alternative embodiment of the present application, the file management table may be a linked list in a data structure, or may be a database.
In another optional embodiment of the present application, the plurality of information of the above document at least includes: the file management system comprises a file identifier, a file name, a file type, a file thumbnail path, a file original path and a service information identifier, wherein the service information identifier is used for representing whether the file is used in the service.
It should be noted that the service information identifier is a unique service information identifier, for example, a student management system, the student information has a student avatar, and the service information identifier can be regarded as a student information record ID, which means that a picture file is bound to the student information.
Step S104, in the process of processing the file, storing a plurality of information of the file in a file management table.
Step S106, managing the file according to the file management table.
Through the steps, the aim of clearing useless resource files uploaded by the system on time is fulfilled, so that the technical effects of effectively managing the resource files and reducing the pressure of a file server are achieved.
According to an alternative embodiment of the present application, step S104 is implemented by: in the process of uploading the file to the server, adding information except the service information identifier in the plurality of pieces of information of the file as records corresponding to the file to a file management table, wherein a field corresponding to the service information identifier in the record is empty; when the file is used in the service, data is added in the field corresponding to the service information identification.
When uploading a file, a record is added in the file management table created in step S102, but the service information identifier is empty and no service is bound, and when we use the record in a service, we need to fill the service information identifier, and only data with a value of the service information identifier is considered as valid data.
In some optional embodiments of the present application, when step S106 is executed, the target record is deleted from the file management table according to a preset time interval corresponding to a preset timer, a field corresponding to the service information identifier in the target record is null, and the file corresponding to the target record is deleted.
In the step, a timer is set, the data with the empty service information identification is regularly cleaned every night, and the resource files are cleaned, so that the resource files can be well managed, and the pressure of the server is reduced.
According to an optional embodiment of the present application, before deleting a target record from the file management table according to a preset time interval corresponding to a preset timer, it is further required to determine whether a field corresponding to a service information identifier in each record stored in the file management table is empty; if the field corresponding to the service information identifier in the record is not empty, taking the record as an effective record, and taking the file corresponding to the effective record as an effective file; and if the field corresponding to the service information identifier in the record is empty, taking the record as a target record.
In this step, whether the record is valid data is judged through the service information identifier in each record stored in the file management table, if the field corresponding to the service information identifier is not empty, the record is taken as valid data, otherwise, the record is taken as invalid data to be deleted.
According to an alternative embodiment of the present application, before deleting the target record from the file management table according to a preset time interval corresponding to a preset timer, the timer is also required to be created.
According to the file management method, the file resource processing technology and the service are completely independent, the mutual influence is avoided, the implantation performance is good, the file management method can be associated with different system services, and the expandability is good.
Fig. 2 is a schematic diagram of another file management method according to an embodiment of the present application, and as shown in fig. 2, a file 1, a file 2, and a file 3 are all files uploaded to a server, and when the file 1, the file 2, and the file 3 are uploaded to the server, a record is added to a file management table, and at this time, bindId (the service information identifier in the foregoing text) is empty. File 1 and file 2 are not used to process the business logic, and invalid data with bindId empty and resources are deleted regularly every night. File 3 is used to process service logic, bind (i.e. field filling data corresponding to service information identifier), and file 3 is valid file data without timing clear.
Fig. 3 is a configuration diagram of a file management apparatus according to an embodiment of the present application, and as shown in fig. 3, the apparatus includes:
the creating module 30 is configured to create a file management table, where the file management table is used for storing a plurality of information of a file.
According to an alternative embodiment of the present application, the plurality of information of the above document at least includes: the file management system comprises a file identifier, a file name, a file type, a file thumbnail path, a file original path and a service information identifier, wherein the service information identifier is used for representing whether the file is used in the service.
The processing module 32 is configured to store a plurality of pieces of information of the file in the file management table during the process of processing the file.
And the management module 34 is used for managing the files according to the file management table.
It should be noted that, reference may be made to the description related to the embodiment shown in fig. 1 for a preferred implementation of the embodiment shown in fig. 3, and details are not described here again.
The embodiment of the application also provides a computer-readable storage medium, which comprises a stored program, wherein when the program runs, the device where the computer-readable storage medium is located is controlled to execute the above file management method.
The computer-readable storage medium is used for storing a program for executing the following functions: creating a file management table, wherein the file management table is used for storing a plurality of information of a file; storing a plurality of information of the file into a file management table in the process of processing the file; and managing the files according to the file management table.
The embodiment of the application also provides a processor, wherein the processor is used for running the program stored in the memory, and the management method of the file is executed when the program runs.
The processor is used for running a program for executing the following functions: creating a file management table, wherein the file management table is used for storing a plurality of information of a file; storing a plurality of information of the file into a file management table in the process of processing the file; and managing the files according to the file management table.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a read-Only Memory (ROM), a random access Memory (RZXYUM, r zxyunnd zxyaccess Memory), a portable hard disk, a magnetic disk, or an optical disk.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for managing a file, comprising:
creating a file management table, wherein the file management table is used for storing a plurality of information of files;
storing a plurality of information of the file to the file management table in the process of processing the file;
and managing the file according to the file management table.
2. The method of claim 1, wherein the plurality of information of the file comprises at least: the file management system comprises a file identifier, a file name, a file type, a file thumbnail path, a file original path and a service information identifier, wherein the service information identifier is used for representing whether the file is used in service or not.
3. The method according to claim 2, wherein storing a plurality of information of the file to the file management table during processing of the file comprises:
in the process of uploading the file to a server, adding information except the service information identifier in the plurality of pieces of information of the file as a record corresponding to the file management table, wherein a field corresponding to the service information identifier in the record is empty;
and when the file is used in the service, adding data in a field corresponding to the service information identifier.
4. The method according to claim 3, wherein managing the file according to the file management table comprises:
deleting a target record from the file management table according to a preset time interval corresponding to a preset timer, wherein a field corresponding to a service information identifier in the target record is empty, and deleting a file corresponding to the target record.
5. The method of claim 4, wherein before deleting the target record from the file management table at a preset time interval corresponding to a preset timer, the method further comprises:
judging whether a field corresponding to the service information identifier in each record stored in the file management list is empty or not;
if the field corresponding to the service information identifier in the record is not empty, taking the record as an effective record, and taking the file corresponding to the effective record as an effective file;
and if the field corresponding to the service information identifier in the record is empty, taking the record as the target record.
6. The method of claim 4, wherein before deleting the target record from the file management table at a preset time interval corresponding to a preset timer, the method further comprises: the timer is created.
7. An apparatus for managing a file, comprising:
the file management system comprises a creating module, a storing module and a processing module, wherein the creating module is used for creating a file management table, and the file management table is used for storing a plurality of information of files;
the processing module is used for storing a plurality of information of the file to the file management table in the process of processing the file;
and the management module is used for managing the file according to the file management table.
8. The apparatus of claim 7, wherein the plurality of information of the file comprises at least: the file management system comprises a file identifier, a file name, a file type, a file thumbnail path, a file original path and a service information identifier, wherein the service information identifier is used for representing whether the file is used in service or not.
9. A computer-readable storage medium, comprising a stored program, wherein when the program runs, the program controls a device on which the computer-readable storage medium is located to execute the file management method according to any one of claims 1 to 6.
10. A processor for executing a program stored in a memory, wherein the program executes to perform the file management method according to any one of claims 1 to 6.
CN202010771075.5A 2020-08-03 2020-08-03 File management method and device Pending CN111858515A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010771075.5A CN111858515A (en) 2020-08-03 2020-08-03 File management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010771075.5A CN111858515A (en) 2020-08-03 2020-08-03 File management method and device

Publications (1)

Publication Number Publication Date
CN111858515A true CN111858515A (en) 2020-10-30

Family

ID=72953157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010771075.5A Pending CN111858515A (en) 2020-08-03 2020-08-03 File management method and device

Country Status (1)

Country Link
CN (1) CN111858515A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1298149A (en) * 1999-11-25 2001-06-06 戴尔美国公司 Factory software management system
US20140164450A1 (en) * 2012-12-12 2014-06-12 Hitachi Information & Telecommunication Engineering, Ltd. File management system, method and computer program
CN105760486A (en) * 2016-02-17 2016-07-13 深圳市共进电子股份有限公司 Method and device for managing video files
CN108170787A (en) * 2017-12-27 2018-06-15 努比亚技术有限公司 A kind of image file delet method, mobile terminal and computer readable storage medium
CN110737604A (en) * 2019-08-30 2020-01-31 北京奇艺世纪科技有限公司 method, device, electronic equipment and storage medium for automatically cleaning memory
CN111061689A (en) * 2019-12-13 2020-04-24 北京金山云网络技术有限公司 File expiration processing method and device for object storage system and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1298149A (en) * 1999-11-25 2001-06-06 戴尔美国公司 Factory software management system
US20140164450A1 (en) * 2012-12-12 2014-06-12 Hitachi Information & Telecommunication Engineering, Ltd. File management system, method and computer program
CN105760486A (en) * 2016-02-17 2016-07-13 深圳市共进电子股份有限公司 Method and device for managing video files
CN108170787A (en) * 2017-12-27 2018-06-15 努比亚技术有限公司 A kind of image file delet method, mobile terminal and computer readable storage medium
CN110737604A (en) * 2019-08-30 2020-01-31 北京奇艺世纪科技有限公司 method, device, electronic equipment and storage medium for automatically cleaning memory
CN111061689A (en) * 2019-12-13 2020-04-24 北京金山云网络技术有限公司 File expiration processing method and device for object storage system and electronic equipment

Similar Documents

Publication Publication Date Title
CN111555963B (en) Message pushing method and device, electronic equipment and storage medium
CN103119550B (en) Store the digital content with time-varying characteristics
CN103152390B (en) The node configuration method of distributed memory system, device, node and system
CN101217571A (en) Write/read document operation method applied in multi-copy data grid system
CN102202087A (en) Method for identifying storage equipment and system thereof
CN107402870A (en) The processing method and processing device of daily record section in a kind of meta data server
CN106325870A (en) Realization method and device of API (Application Programming Interface) of dynamic form
CN110209736A (en) Device, method and the storage medium of block chain data processing
CN105653209A (en) Object storage data transmitting method and device
CN111683114A (en) Method and device for upgrading equipment program, terminal equipment and storage medium
CN102932476B (en) Network storage synchro system
CN111026711A (en) Block chain based data storage method and device, computer equipment and storage medium
CN104915376B (en) A kind of archival compression method of file in cloud storage
CN104536852B (en) Data recovery method and device
CN106570005A (en) Database cleaning method and device
CN113296891A (en) Multi-scene knowledge graph processing method and device based on platform
CN107623705B (en) Storage mode upgrading method, device and system based on video cloud storage system
CN110795674B (en) Configuration updating method and device
CN105677579A (en) Data access method and system in cache system
CN111858515A (en) File management method and device
CN109766313A (en) Geological project data processing method, device and computer equipment
CN102710433A (en) Online updating processing method as well as related device and system
CN110059081A (en) Data output method, device and the computer equipment shown based on data
CN109669815A (en) A kind of method and system restored by the long-range Mapping implementation Backup Data of LUN
US11531642B2 (en) Synchronous object placement for information lifecycle management

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