CN112069131A - Name generation method and device for data file - Google Patents

Name generation method and device for data file Download PDF

Info

Publication number
CN112069131A
CN112069131A CN202010744380.5A CN202010744380A CN112069131A CN 112069131 A CN112069131 A CN 112069131A CN 202010744380 A CN202010744380 A CN 202010744380A CN 112069131 A CN112069131 A CN 112069131A
Authority
CN
China
Prior art keywords
file
data file
change
name
record table
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
CN202010744380.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.)
Guangdong Flying Enterprise Internet Technology Co Ltd
Original Assignee
Guangdong Flying Enterprise Internet 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 Guangdong Flying Enterprise Internet Technology Co Ltd filed Critical Guangdong Flying Enterprise Internet Technology Co Ltd
Priority to CN202010744380.5A priority Critical patent/CN112069131A/en
Publication of CN112069131A publication Critical patent/CN112069131A/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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • 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/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs

Abstract

The invention relates to a method and a device for generating names of data files, wherein preset change information is extracted from a change event by acquiring the change event of the data file, the operation type of a change operation is recorded in the change information, the name of the changed data file is generated according to the change information, and the change information of the data file is associated with the name of the data file, so that the file change information loss caused by the fact that the data file is separated from a document management system is avoided.

Description

Name generation method and device for data file
Technical Field
The present invention relates to the field of data file name generation technologies, and in particular, to a data file name generation method and apparatus.
Background
In the name generation of an enterprise data file, file version management is important. It is also not uncommon for version upsets of files to cause serious economic losses and credit crisis.
At present, the version number of a file is often identified by record information of a database in a file version management mode, but when the file leaves a corresponding document management system, the version information of the file is lost, and the finally determined file is difficult to distinguish.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating names of data files, which can avoid file change information loss caused by the fact that the data files are separated from a document management system, and facilitate management of the data files. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for generating a name of a data file, including the following steps: the method comprises the following steps:
acquiring a change event of a data file; wherein the change event is generated in response to a change operation of the data file;
extracting preset change information from the change event, wherein the change information is recorded with an operation type of the change operation;
and generating the name of the changed data file according to the change information.
Optionally, the change information includes a modification date, and after generating a name of the changed data file according to the change information, the method further includes:
generating a plurality of random codes;
generating the name of the target folder according to the date of the file modification and the random code;
and storing the changed data file into the target folder.
Optionally, the change information includes a version number, and preset change information is extracted from the change event, including;
judging whether the data file comprises a version number or not according to the name of the data file;
if yes, extracting a version number from the data file; otherwise, the initial version number is automatically generated.
Optionally, generating a name of the changed data file according to the change information includes:
acquiring a corresponding identifier according to the operation type;
incrementing the version number;
and generating the name of the changed data file according to the identifier and the increased version number.
Optionally, before the step of obtaining the change event of the data file, the method further includes:
and acquiring each file in the target folder and the MD5 value thereof according to a set time interval, and generating a file record table.
Optionally, the obtaining a change event of the data file includes:
acquiring a first file record table and a second file record table at different times, comparing the first file record table and the second file record table, and acquiring a change event of the data file in the target folder according to a comparison result;
if the MD5 values of the same file in the first file record table and the second file record table are different, acquiring the change event as a modification;
if the number of the files in the first file record table is larger than the number of the files in the second file record table, the change event is acquired as new addition;
and if the number of the files in the first file record table is smaller than the number of the files in the second file record table, obtaining the change event as deletion.
Optionally, when the change event is deletion and the number of files in the second file record table is 0, a blank file is created as the changed file in the target folder.
In a second aspect, an embodiment of the present application provides a name generating apparatus for a data file, including:
the change event acquisition module is used for acquiring change events of the data files; wherein the change event is generated in response to a change operation of the data file;
the change information extraction module is used for extracting preset change information from the change event, and the change information is recorded with the operation type of the change operation;
and the name generation module is used for generating the name of the changed data file according to the change information.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the name generation method for a data file as described in any one of the above.
In a fourth aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable by the processor, and when the processor executes the computer program, the processor implements the steps of the name generation method for the data file according to any one of the above items.
In the embodiment of the application, preset change information is extracted from a change event by acquiring the change event of a data file, the operation type of the change operation is described in the change information, the name of the changed data file is generated according to the change information, and the change information of the data file is associated with the name of the data file, so that the file change information loss caused by the fact that the data file is separated from a document management system is avoided.
For a better understanding and practice, the invention is described in detail below with reference to the accompanying drawings.
Drawings
Fig. 1 is a schematic view of an application scenario of a name generation method for a data file in an exemplary embodiment of the present invention;
FIG. 2 is a flow chart of a method for name generation for a data file in an exemplary embodiment of the invention;
fig. 3 is a schematic structural diagram of a name generation apparatus for a data file according to an exemplary embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that the embodiments described are only some embodiments of the present application, and not all embodiments. All other examples, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments in the present application, belong to the scope of protection of the embodiments in the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the present application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims. In the description of the present application, it is to be understood that the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not necessarily used to describe a particular order or sequence, nor are they to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
In addition, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Referring to fig. 1, which is an application environment diagram of a name generation method for data files according to the present invention, a client 10 and a data center 30 are communicatively connected through a network 20, and the steps of the name generation method for data files provided in the present application can be applied to generate names of data files in the data center 30.
The client 10 is configured to provide an interactive interface to a user, so that the user can log in the data center 30 and operate the data center 30. The client 10 may be a personal computer, a notebook computer, a mobile phone, a tablet computer, or other devices that can be connected to the data center 30.
The data center 30 is a computer cluster composed of a plurality of servers. The data center 30 provides cloud storage and cloud computing functions for generating names of data files.
Referring to fig. 2, the present invention provides a method for generating names of data files, including the following steps:
step S1: acquiring a change event of a data file; wherein the change event is generated in response to a change operation of the data file.
The change event may be determined according to the number of data files or the change of file contents or ID numbers. In one example, the change operations include modify, delete, and add.
Step S2: and extracting preset change information from the change event, wherein the change information records the operation type of the change operation.
The operation type is obtained according to the change operation, for example: when the change operation is modification, acquiring the operation type as modification; when the change operation is deletion, acquiring the operation type as deletion; and when the change operation is newly added, acquiring the operation type as newly added.
In one example, the change information may also include a change date. The change date can be obtained by reading the information of the locally changed file;
step S3: and generating the name of the changed data file according to the change information.
The name of the data file can be used for indicating specific change information, and a mapping rule between the name of the data file and the change information can be set according to user requirements.
In the embodiment of the application, preset change information is extracted from a change event by acquiring the change event of a data file, the operation type of the change operation is described in the change information, the name of the changed data file is generated according to the change information, and the change information of the data file is associated with the name of the data file, so that the file change information loss caused by the fact that the data file is separated from a document management system is avoided, and convenience is brought to a user to manage the data file.
In an exemplary embodiment, the change information includes a modification date, and after generating a name of the changed data file according to the change information, the method further includes:
a number of random codes are generated.
Generating the name of the target folder according to the date of the file modification and the random code;
and storing the changed data file into the target folder.
The modification date may include a modified year, month, day.
The random code can be generated by using an existing random code generator or a random code generation program, and the number of bits of the random code can be set according to actual requirements.
In a preferred example, the random code is 4 bits, the random code is generated according to a 60-system number composed of 26 capital letters, 26 lowercase letters and 10 data, and the random code can be large in compatibility and can be compatible with 147763365 files.
The modified date of the modified data file is associated with the folder name, and the modified data file is stored in the target folder, so that the difficulty in searching for the modified data file due to the fact that the modified version of the data file is too much is avoided, and meanwhile, the modified data file is convenient to manage.
In an exemplary embodiment, the change information includes a version number, and preset change information is extracted from the change event, including;
judging whether the data file comprises a version number or not according to the name of the data file;
if yes, extracting a version number from the data file; otherwise, the initial version number is automatically generated.
When the data file comprises the version number, the version number can be obtained by reading the name of the data file, and performing text cleaning and keyword extraction on the obtained name.
The number of bits of the version number can be set according to actual requirements.
In a preferred example, the version number is 3 bits, and the random code is generated from a 60-ary number consisting of 26 capital letters, 26 small letters and 10 data, which can generate 238327 version numbers.
In an exemplary embodiment, generating a name of the changed data file according to the change information includes:
acquiring a corresponding identifier according to the operation type;
incrementing the version number;
and generating the name of the changed data file according to the identifier and the increased version number.
The version number may be incremented by 1 or other user-defined unit value.
The identifier is 3 or more symbols corresponding to the operation types of adding, modifying and deleting, and can be set according to the requirements of users. In one example, the new addition, modification, and deletion correspond to identifiers of "-", "! "," "A".
The name of the changed data file may be a name formed by a combination of the identifier and the incremented version number, and in one example, the name of the changed data file is a combination of a file name, an identifier and a version number.
The name of the changed data file may be used to indicate the version of the file and what changes were made, as follows:
"Intelligent office operation manual-v 00 a-. doc" means: in the 36(00a) versions, a document of the intelligent office operation manual doc is added.
"Intelligent office operation manual-v 00 b! Doc "denotes: in the 37(00b) versions, a document of the intelligent office operation manual, doc, was modified.
"Intelligent office operation manual-v 00c ^. doc" indicates that in 38(00c) versions, a document of the intelligent office operation manual. doc is deleted.
In an exemplary embodiment, before the step of obtaining the change event of the data file, the method further includes:
and acquiring each file in the target folder and the MD5 value thereof according to a set time interval, and generating a file record table.
The MD5 value (Message-Digest Algorithm 5) is a 128-bit (16-byte) hash value that can be used as the ID for a file whose MD5 value changes if the file is modified.
In an exemplary embodiment, the obtaining a change event of the data file includes:
and acquiring a first file record table and a second file record table at different times, comparing the first file record table and the second file record table, and acquiring a change event of the data file in the target folder according to a comparison result.
And if the MD5 values of the same file in the first file record table and the second file record table are different, acquiring the change event as modification.
And if the number of the files in the first file record table is greater than the number of the files in the second file record table, obtaining that the change event is newly increased.
And if the number of the files in the first file record table is smaller than the number of the files in the second file record table, obtaining the change event as deletion.
In an exemplary embodiment, when the change event is deletion and the number of files in the second file record table is 0, a blank file is created as the changed file in the target folder.
Referring to fig. 3, an embodiment of the present application further provides a device for generating a name of a data file, including:
the change event acquisition module 1 is used for acquiring change events of the data files; wherein the change event is generated in response to a change operation of the data file;
a change information extraction module 2, configured to extract preset change information from the change event, where the change information describes an operation type of the change operation;
and the name generating module 3 is used for generating the name of the changed data file according to the change information.
In an exemplary embodiment, the change information includes a modification date, and the name generating device of the data file further includes:
the random code generating module is used for generating a plurality of random codes;
the folder name generation module is used for generating the name of the target folder according to the date of the file modification and the random code;
and the storage module is used for storing the changed data file into the target folder.
In an exemplary embodiment, the change information includes a version number, and the change information extraction module 2 includes;
the judging unit is used for judging whether the data file comprises a version number according to the name of the data file; if yes, extracting a version number from the data file; otherwise, the initial version number is automatically generated.
In an exemplary embodiment, the name generation module 3 includes:
the identifier acquisition unit is used for acquiring a corresponding identifier according to the operation type;
a version number increment unit for incrementing the version number;
and the file name generating unit is used for generating the name of the changed data file according to the identifier and the increased version number.
In an exemplary embodiment, the name generating device of the data file further includes:
and the file record table generating module is used for acquiring each file in the target folder and the MD5 value thereof according to a set time interval and generating a file record table.
In an exemplary embodiment, the change event acquiring module 1 includes:
the change event acquisition unit is used for acquiring a first file record table and a second file record table at different times, comparing the first file record table and the second file record table, and acquiring a change event of the data file in the target folder according to a comparison result;
if the MD5 values of the same file in the first file record table and the second file record table are different, acquiring the change event as a modification;
if the number of the files in the first file record table is larger than the number of the files in the second file record table, the change event is acquired as new addition;
and if the number of the files in the first file record table is smaller than the number of the files in the second file record table, obtaining the change event as deletion.
In an exemplary embodiment, the change event acquiring unit further includes:
and the file creating unit is used for creating a blank file as the changed file in the target folder when the acquired change event is deletion and the number of the files in the second file record table is 0.
It should be noted that, when the name generating apparatus for a data file provided in the foregoing embodiment executes the name generating method for a data file, the above-mentioned division of each functional module is merely used as an example, and in practical applications, the above-mentioned function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above-mentioned functions. In addition, the name generation device of the data file and the name generation method of the data file provided by the above embodiment belong to the same concept, and specific implementation processes thereof are described in the method embodiment and are not described herein again.
The present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the name generation method for a data file as described in any one of the above.
Embodiments of the present application may take the form of a computer program product embodied on one or more storage media including, but not limited to, disk storage, CD-ROM, optical storage, and the like, in which program code is embodied. Computer readable storage media, which include both non-transitory and non-transitory, removable and non-removable media, may implement any method or technology for storage of information. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of the storage medium of the computer include, but are not limited to: phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by a computing device.
The embodiment of the present application further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable by the processor, and when the processor executes the computer program, the processor implements the steps of the name generation method for the data file according to any one of the above items.
The present invention is not limited to the above-described embodiments, and various modifications and variations of the present invention are intended to be included within the scope of the claims and the equivalent technology of the present invention if they do not depart from the spirit and scope of the present invention.

Claims (10)

1. A name generation method of a data file is characterized by comprising the following steps:
acquiring a change event of a data file; wherein the change event is generated in response to a change operation of the data file;
extracting preset change information from the change event, wherein the change information is recorded with an operation type of the change operation;
and generating the name of the changed data file according to the change information.
2. The method of claim 1, wherein the change information includes a modification date, and wherein generating the name of the changed data file according to the change information further comprises:
generating a plurality of random codes;
generating the name of the target folder according to the date of the file modification and the random code;
and storing the changed data file into the target folder.
3. The method according to claim 1, wherein the change information includes a version number, and preset change information is extracted from the change event, including;
judging whether the data file comprises a version number or not according to the name of the data file;
if yes, extracting a version number from the data file; otherwise, the initial version number is automatically generated.
4. The method of claim 3, wherein generating a name of the changed data file based on the change information comprises:
acquiring a corresponding identifier according to the operation type;
incrementing the version number;
and generating the name of the changed data file according to the identifier and the increased version number.
5. The method of claim 1, further comprising, before the step of obtaining a change event of the data file:
and acquiring each file in the target folder and the MD5 value thereof according to a set time interval, and generating a file record table.
6. The method according to claim 5, wherein the obtaining of the change event of the data file comprises:
acquiring a first file record table and a second file record table at different times, comparing the first file record table and the second file record table, and acquiring a change event of the data file in the target folder according to a comparison result;
if the MD5 values of the same file in the first file record table and the second file record table are different, acquiring the change event as a modification;
if the number of the files in the first file record table is larger than the number of the files in the second file record table, the change event is acquired as new addition;
and if the number of the files in the first file record table is smaller than the number of the files in the second file record table, obtaining the change event as deletion.
7. The method according to claim 6, wherein when the change event is deletion and the number of files in the second file record table is 0, a blank file is created as the changed file in the target folder.
8. A name generating apparatus for a data file, comprising:
the change event acquisition module is used for acquiring change events of the data files; wherein the change event is generated in response to a change operation of the data file;
the change information extraction module is used for extracting preset change information from the change event, and the change information is recorded with the operation type of the change operation;
and the name generation module is used for generating the name of the changed data file according to the change information.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program realizing the steps of the name generation method of a data file according to any one of claims 1 to 7 when being executed by a processor.
10. A computer device, characterized by: comprising a memory, a processor and a computer program stored in said memory and executable by said processor, said processor implementing the steps of the name generation method of a data file according to any of claims 1-7 when executing said computer program.
CN202010744380.5A 2020-07-29 2020-07-29 Name generation method and device for data file Pending CN112069131A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010744380.5A CN112069131A (en) 2020-07-29 2020-07-29 Name generation method and device for data file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010744380.5A CN112069131A (en) 2020-07-29 2020-07-29 Name generation method and device for data file

Publications (1)

Publication Number Publication Date
CN112069131A true CN112069131A (en) 2020-12-11

Family

ID=73657360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010744380.5A Pending CN112069131A (en) 2020-07-29 2020-07-29 Name generation method and device for data file

Country Status (1)

Country Link
CN (1) CN112069131A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1522530A (en) * 2001-06-30 2004-08-18 �ʼҷ����ֵ������޹�˾ Receiver apparatus and method
US20060173937A1 (en) * 2005-02-03 2006-08-03 Barry Sia Release-dependant filenames for device drivers
CN101739278A (en) * 2009-12-17 2010-06-16 中国电力科学研究院 Enterprise-level application software updating method and system
CN110263007A (en) * 2019-06-28 2019-09-20 深圳市迅雷网络技术有限公司 A kind of file naming method, system and electronic equipment and storage medium
CN110347423A (en) * 2019-06-28 2019-10-18 北京你财富计算机科技有限公司 The online management method of file modification and device
CN110825408A (en) * 2019-10-30 2020-02-21 中国农业银行股份有限公司 Program version updating method, self-service equipment and version control server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1522530A (en) * 2001-06-30 2004-08-18 �ʼҷ����ֵ������޹�˾ Receiver apparatus and method
US20060173937A1 (en) * 2005-02-03 2006-08-03 Barry Sia Release-dependant filenames for device drivers
CN101739278A (en) * 2009-12-17 2010-06-16 中国电力科学研究院 Enterprise-level application software updating method and system
CN110263007A (en) * 2019-06-28 2019-09-20 深圳市迅雷网络技术有限公司 A kind of file naming method, system and electronic equipment and storage medium
CN110347423A (en) * 2019-06-28 2019-10-18 北京你财富计算机科技有限公司 The online management method of file modification and device
CN110825408A (en) * 2019-10-30 2020-02-21 中国农业银行股份有限公司 Program version updating method, self-service equipment and version control server

Similar Documents

Publication Publication Date Title
CN103049491A (en) Method and device for managing picture file
EP2778953A1 (en) Encoded-search database device, method for adding and deleting data for encoded search, and addition/deletion program
US20140310324A1 (en) Systems and methods for automatically sorting and indexing electronic files
CN111291235A (en) Metadata storage method and device based on time sequence database
CN110096509A (en) Realize that historical data draws the system and method for storage of linked list modeling processing under big data environment
CN104714957A (en) List structure changing method and device
CN112416880A (en) Method and device for optimizing storage performance of mass small files based on real-time merging
CN106250501B (en) Report processing method and reporting system
CN108009049A (en) The offline restoration methods of MYISAM storage engines deletion records, storage medium
EP3343395B1 (en) Data storage method and apparatus for mobile terminal
CN110162607B (en) Government organization official document information tracing method and device based on convolutional neural network
CN112069131A (en) Name generation method and device for data file
CN111045994A (en) KV database-based file classification retrieval method and system
CN116414935A (en) Method for distributed Search space vector data based on Elastic Search
CN111444194B (en) Method, device and equipment for clearing indexes in block chain type account book
CN112632266B (en) Data writing method and device, computer equipment and readable storage medium
CN107291574B (en) Backup data recovery primary key generation method based on interpretation system
CN104252488A (en) Data processing method and server
US20200401569A1 (en) System and method for data reconciliation
CN106874486A (en) Method and mobile terminal that a kind of Folder Name shows
CN109241011B (en) Virtual machine file processing method and device
CN110019507B (en) Data synchronization method and device
US8630984B1 (en) System and method for data extraction from email files
CN107506189A (en) A kind of iOS data persistence methods realized based on factory mode
CN115098459A (en) Data sharing method and device, terminal equipment and storage 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