CN113448927A - File naming method and device, electronic equipment and storage medium - Google Patents

File naming method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113448927A
CN113448927A CN202110729712.7A CN202110729712A CN113448927A CN 113448927 A CN113448927 A CN 113448927A CN 202110729712 A CN202110729712 A CN 202110729712A CN 113448927 A CN113448927 A CN 113448927A
Authority
CN
China
Prior art keywords
file
field information
dynamic
dynamic field
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.)
Granted
Application number
CN202110729712.7A
Other languages
Chinese (zh)
Other versions
CN113448927B (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.)
Vivo Software Technology Co Ltd
Original Assignee
Vivo Software 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 Vivo Software Technology Co Ltd filed Critical Vivo Software Technology Co Ltd
Priority to CN202110729712.7A priority Critical patent/CN113448927B/en
Publication of CN113448927A publication Critical patent/CN113448927A/en
Application granted granted Critical
Publication of CN113448927B publication Critical patent/CN113448927B/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
    • G06F16/164File meta data generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a file naming method and device, electronic equipment and a storage medium, and belongs to the field of data processing. Receiving a first input under the condition that a first file is stored in a first folder, wherein the first file is a first file in the first folder; and responding to the first input, creating a second file in the first folder, and generating a second file name of the second file according to the first dynamic field information and the first static field information of the first file.

Description

File naming method and device, electronic equipment and storage medium
Technical Field
The application belongs to the field of data processing, and particularly relates to a file naming method and device, electronic equipment and a storage medium.
Background
In the continuous popularization of information technology, more and more files are digitalized, more and more files need to be managed by a user, and for specific files such as working files, more standard requirements are provided for file naming and storage path management, and the file names generally need standardized information such as date and version information.
When a user newly creates a file in a folder, the user can rename the file, but manual renaming operation is tedious and easy to name wrongly, so that a correct file cannot be found in the later period.
Therefore, how to better implement file naming has become an urgent problem to be solved in the industry.
Disclosure of Invention
The embodiment of the application aims to provide a file naming method, a file naming device, electronic equipment and a storage medium, and the problem of better file name naming can be solved.
In a first aspect, an embodiment of the present application provides a file naming method, including:
receiving a first input under the condition that a first file is stored in a first folder, wherein the first file is a first file in the first folder;
and responding to the first input, creating a second file in the first folder, and generating a second file name of the second file according to the first dynamic field information and the first static field information of the first file.
In a second aspect, an embodiment of the present application provides a file naming apparatus, including:
the device comprises a receiving module, a judging module and a display module, wherein the receiving module is used for receiving a first input under the condition that a first file is stored in a first folder, and the first file is a first file in the first folder;
and the creating module is used for responding to the first input, creating a second file in the first folder, and generating a second file name of the second file according to the first dynamic field information and the first static field information of the first file.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In the embodiment of the application, in the process of creating a new file, first static field information which cannot be changed in new and old file names is determined based on the file name of a first file stored in the same folder in advance, and meanwhile, dynamic field information of the new file is generated based on a dynamic field in the first file, so that a second file name of a second file is automatically generated according to the dynamic field information and the first static field information which cannot be changed.
Drawings
FIG. 1 is a schematic flow chart of a file naming method described in the present application;
FIG. 2 is a schematic diagram of sample filenames provided by an embodiment of the present application;
FIG. 3 is a schematic illustration of BIO labeling provided in an embodiment of the present application;
FIG. 4 is a schematic illustration of a BIOE annotation provided in an embodiment of the present application;
fig. 5 is a schematic network structure diagram of a preset named entity recognition model provided in an embodiment of the present application;
FIG. 6 is a schematic overall flowchart of file naming described in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a file naming device according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an electronic device provided by an embodiment of the present application;
fig. 9 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
Fig. 1 is a schematic flow chart of a file naming method described in the present application, and as shown in fig. 1, the file naming method includes:
step 110, receiving a first input under the condition that a first file is stored in a first folder, wherein the first file is a first file in the first folder;
specifically, the first folder described in the present application may refer to a folder in an electronic device, and the electronic device may specifically refer to a smart phone, a tablet computer, a notebook computer, a computer host, or the like.
The first input described in this application may specifically refer to an input for creating the second file in the first folder, which may be an input from a user, or an instruction input from the electronic device, for example, it may be an operation of a user to create a new file, or an operation of a user to paste a file.
The first file described in this application may be specifically a data file, a shortcut file, a folder, or the like, and the first file in this application refers to a first file stored in the first folder.
The file naming method described in the embodiment of the present application can be applied only when the first file needs to be stored in the first folder, because the file naming method in the present application can only implement automatic filling of the file name of the newly created file based on the first file name of the first file, so that when the first file is newly created in the folder, the file name cannot be automatically generated, and when the second file is newly created in the folder, the file name can only be automatically generated.
Step 120, in response to the first input, creating a second file in the first folder, and generating a second file name of the second file according to the first dynamic field information and the first static field information of the first file;
when the electronic equipment responds to the first input and creates a second file in the first folder, second dynamic field information of the second file is generated according to a first dynamic field generation rule corresponding to the first dynamic field information.
Specifically, the first static field information described in this application refers to fields included in both the newly created file and the stored file in the first folder, that is, the file names of all files in the first folder carry the first static field information.
The first dynamic field information described in this application is a field that may change in the file name of the newly added file, that is, the dynamic fields of the files in the first folder may be different. The field information may be various types of dynamic field information, for example, the first dynamic field information may be date dynamic field information, version dynamic field information, or current time dynamic field information, and each type of dynamic field information corresponds to a different dynamic field generation rule.
After the second file name of the second file is generated, the second file name is still in an editable state at the moment, and the dynamic field information, the static field information and the extension field information in the second file name are respectively identified through different types of labels, for example, the static field is marked with yellow, the dynamic field is marked with blue, and the extension field is marked with green in the editable state.
And if the position of the first static field information in the automatically generated second file name is manually adjusted by the user, it indicates that the prediction of the preset field identification model on the file name is inaccurate, and a new sample needs to be generated according to the newly generated second file name for iterative training of the preset field identification model to optimize the model effect.
If the position of the field in the second file name is correct, the user manually adjusts the content of the second dynamic field information in the second file name, and the system automatically updates the first dynamic field generation rule corresponding to the first dynamic field.
In the embodiment of the application, in the process of creating a new file, first static field information which cannot be changed in new and old file names is determined based on the file name of a first file stored in the same folder in advance, and meanwhile, dynamic field information of the new file is generated based on a dynamic field in the first file, so that a second file name of a second file is automatically generated according to the dynamic field information and the first static field information which cannot be changed.
Optionally, when the first dynamic field information belongs to a dependent field, before generating the second filename of the second file according to the first dynamic field information and the first static field information, the method further includes:
storing the first dynamic field information and the first static field information into a first hidden file of the first folder;
the generating a second file name of the second file according to the first dynamic field information and the first static field information includes:
determining first dynamic field information corresponding to the first static field information in the first hidden file based on the first static field information;
generating second dynamic field information based on a first dynamic field generation rule corresponding to the first dynamic field information and the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
More specifically, the dependent field described in this application refers to dynamic field information that needs to rely on the dynamic field information of an existing filename to generate new filename dynamic field information.
In this embodiment of the application, whether the first dynamic field information belongs to the dependent field may be determined according to a specific type of the first dynamic field information, for example, when the first dynamic field information is version dynamic field information or numerical value dynamic field information, the first dynamic field information belongs to the dependent field.
Since the generation of the dynamic field of the second file name needs to depend on the first dynamic field information, in the embodiment of the present application, the first dynamic field information is used as a dependent value, and the dependent value and the first static field information are stored in the first hidden file together.
The first hidden file is also stored in the first folder, but the file is not in a visible state, and the system may invoke the dependency value based on the first static field information when generating the second dynamic field information for the second filename.
The first dynamic field generation rule corresponding to the first dynamic field information described in this application may specifically be an operation of incrementing or decrementing the dependent value, or an operation of replacing the dependent value with another value. For example, the first dynamic field generation rule may specifically be to increase or decrease the dependency value by one.
Therefore, in the present application, the second filename of the second file is generated according to the first dynamic field information and the first static field information, specifically, a dependency value is found in the first hidden file according to the first static field information, and then the dependency value is processed based on the first dynamic field generation rule corresponding to the first dynamic field information, so as to generate the second dynamic field information.
And because the static field information of the newly-built file in the first folder cannot be changed, the static field of the second file name is still the first static field information, and finally the second file name of the second file is generated according to the second dynamic field information and the first static field information.
For example, the first file name of the first file is "inference platform-V1.0", the first static field information in the first file name is "inference platform", the first dynamic field information in the first file name is "V1.0", the first dynamic field generation rule corresponding to the first dynamic field information is to increment the dependency value by 0.1, and the automatically generated second file name is "inference platform-V1.1".
In the embodiment of the present application, because the dynamic field of the newly-created file often needs to be depended on the dynamic field of the stored file when being generated, in the present application, the first dynamic field information is stored in the hidden file of the first folder as a dependent value in advance, the dependent value can be called from the hidden file through the static field information subsequently, and the dependent value is adjusted incrementally or decrementally by combining with the dynamic field generation rule to generate a new dynamic field, and finally, a new file name is automatically generated according to the new dynamic field and the first static field information.
Optionally, after generating the second file name of the second file based on the second dynamic field information and the first static field information, the method further includes:
updating the dynamic field information in the first hidden file based on the second dynamic field information to obtain a second hidden file;
in the process of creating a third file in the first folder, determining second dynamic field information corresponding to the first static field information in the second hidden file based on the first static field information;
generating third dynamic field information based on the first dynamic field generation rule and the second dynamic field information;
and obtaining a third file name of the third file based on the third dynamic field information and the first static field information.
Specifically, in the embodiment of the present application, after the filename of the new file is determined, the dependency value in the hidden file is updated according to the dynamic field information of the new filename, so as to ensure the accuracy of subsequently generating the filename.
In the application, after the second file name is determined, the dependent value in the hidden file is updated according to the second dynamic field information in the second file name, that is, the dynamic field information in the first hidden file is updated, so that the updated second hidden file is obtained.
Therefore, in the process of creating the third file, an updated dependency value is determined in the second hidden file based on the first static field information, then the dependency value is processed according to the first dynamic field generation rule, so as to obtain the second dynamic field information, for example, the updated dependency value is V1.1, then the third dynamic field information is V1.2 after the updated dependency value is incremented according to the first dynamic field generation rule, and finally, based on the third dynamic field information and the first static field information, the third file name of the obtained third file may be "inference platform-V1.2".
In the embodiment of the application, after the file name of the new file is determined, the dependency value in the hidden file is updated according to the dynamic field of the new file, so that the new dynamic field generated according to the dependency value can be updated in time in the subsequent new file, and thus, the accurate file name can be effectively and automatically generated for the new file.
Optionally, in a case that the first dynamic field information belongs to an independent field, the generating a second filename of the second file according to the first dynamic field information and the first static field information includes:
generating second dynamic field information based on a first dynamic field generation rule and system information corresponding to the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
Specifically, the independent field described in the embodiment of the present application may specifically refer to dynamic field information that does not need to rely on the dynamic field information of an existing file name to generate new file name dynamic field information.
For example, when the first dynamic field information is a date type dynamic field or a time type dynamic field, it belongs to a dependency field.
Specifically, the system information described in this application may include current time information and date information of the electronic device system, and when the first dynamic field information is a date type dynamic field, the first dynamic field generation rule may specifically be to acquire the current date information from the system information, and use the current date information as the second dynamic field information.
Optionally, the dynamic field generation rule may also add different information inputs to the system for more personalized naming requirements, and more complicated automatic naming of the new file is completed, for example, the dynamic field generation rule is "start date of the week-end date of the week", and the creation date of the weekly report may be any day of the week. The model, upon recognizing the pattern, also needs to obtain calendar information to determine the start date and end date of the current work day of the week. The model may also have access to external data interfaces, such as national holiday information. Thus, the national public holiday date can be automatically avoided, and the starting date and the ending date of the weekly report can be more accurately determined.
More specifically, certain file new creation automation is realized while the file name filling automation is realized. For example, weekly reports are always created between 4 and 5 pm on friday afternoons. The system can automatically perform the new creation of the file within the time frame. Further reducing the workload of the user.
When the first dynamic field information is a time type dynamic field, the first dynamic field generation rule may specifically be to acquire date information from the system information as the second dynamic field information.
And because the static field information of the newly-built file in the first folder cannot be changed, the static field of the second file name is still the first static field information, and finally the second file name of the second file is generated according to the second dynamic field information and the first static field information.
In the embodiment of the application, a scheme of generating a new file name without depending on an existing file name is also specifically supported, and specific information can be extracted from system information to generate a dynamic field of a new file when the new file is generated aiming at the dynamic field belonging to an independent field, so that automatic naming of the file can be better realized.
Optionally, before generating the second filename of the second file according to the first dynamic field information and the first static field information of the first file, the method further includes:
inputting a character sequence of a first file name into an embedded layer in a preset field recognition model to obtain a first word vector matrix corresponding to the first file name, wherein the first file name is the file name of the first file;
inputting the first word vector matrix into a bidirectional long-time and short-time memory network layer in the preset field recognition model to obtain first neuron information;
and inputting the first neuron information into a conditional random field layer in the preset field recognition model to obtain first dynamic field information and first static field information of a first file.
Specifically, in the embodiment of the present application, the preset field identification model is obtained by training based on a sample filename carrying a dynamic field tag and a static field tag.
In the embodiment of the application, a character sequence of a file name is input into an Embedding layer in a preset field recognition model, the character sequence is converted into an integer ID sequence in the Embedding layer, and then an NxM first word vector matrix is obtained through calculation of a neural network, wherein N is the length of the character sequence, and M is the dimension of a word vector.
And then inputting the first word vector matrix into a bidirectional Short-Term Memory network (BilSTM) layer. In order to better enlarge the receptive field of the network, the NxM sequence and the reverse sequence of the first word vector matrix are respectively used as input into a Long Short-Term Memory network (LSTM) and a reverse-sequence LSTM in sequence to obtain two LSTM neurons, the matrix shape of the LSTM neurons is NxW, and W is the dimension of the LSTM neurons. Finally, two LSTM neurons in the shape of N × W are spliced into a neuron with a larger dimension, namely first neuron information, wherein the shape of the first neuron information is N × 2W.
Inputting a first neuron into a Conditional Random Field (CRF) layer, and performing neural network operation on the CRF layer to obtain first dynamic Field information and first static Field information of a first file.
In the embodiment of the application, the dynamic field and the static field in the first file name of the first file are identified through the preset field identification model, so that the file naming processing can be performed.
Optionally, before the generating a second file name of the second file according to the first dynamic field information and the first static field information, the method further includes:
generating a plurality of sample file names based on the static field information of the plurality of sample files and the dynamic field information of the plurality of sample files;
acquiring a dynamic field label and a static field label corresponding to each sample file name;
taking each sample file name carrying a dynamic field label and a static field label as a training sample, and obtaining a plurality of training samples;
and training a preset named entity recognition model by using a plurality of training samples to obtain the preset field recognition model.
Specifically, before the dynamic field and the static field of the first filename are identified through the preset field identification model, training of the preset field identification model needs to be completed in advance.
The static field information of the plurality of sample files and the dynamic field information of the plurality of sample files described in the application can be obtained by a user simulating a common file name in advance or according to a historical file name database, namely a historical dynamic field database.
Meanwhile, the preset field identification model is obtained through deep learning model training, the effect of the deep learning model depends on the number and diversity of samples, fig. 2 is a schematic diagram for generating sample file names provided by the embodiment of the application, as shown in fig. 2, M × N sample file names can be generated through cartesian product operation according to static field information and N sample file dynamic field information of M sample files in the embodiment of the application, and then samples can be enriched continuously according to the real running condition of the online model to improve the data and diversity of the samples.
After a plurality of sample file names are generated, further dividing the sample file names into dynamic fields and static fields, that is, labeling sample tags, and obtaining dynamic field tags and static field tags corresponding to each sample file name, in the embodiment of the present application, serialization labeling may be performed in a way of BIO or BIO, and the like, where the dynamic field tags described in the present application specifically refer to the category of the dynamic fields, such as a date type dynamic field or a time type dynamic field, and the like, fig. 3 is a BIO labeling diagram provided in the embodiment of the present application, fig. 4 is a BIO labeling diagram provided in the embodiment of the present application, as shown in fig. 3 and fig. 4, the sample file name is "inference platform weekly report 20210501", a label O indicates that the word does not belong to a target field, a label at the beginning of B indicates that the word is the beginning of the target field, and a label at the beginning of I indicates that the word belongs to the target field, if BIOE, E indicates that the word is the end of target field tag, and B-Date, I-Date, E-Date are Date type dynamic fields.
After a plurality of training samples are obtained, training a preset named entity recognition model is started, wherein the network structure of the preset named entity recognition model can be a bidirectional long-time and short-time memory network + a conditional random field or other models capable of realizing the function.
Fig. 5 is a schematic network structure diagram of a preset named entity recognition model provided in an embodiment of the present application, and as shown in fig. 5, a BiLSTM + CRF network structure mainly includes three parts, which are respectively: the method comprises a word vector Embedding layer, a BilSTM two-way long and short term memory network layer and a CRF condition random field layer, wherein in the training process, firstly, the character sequences of B training samples are input into the Embedding layer network. B character sequences in the layer are firstly converted into B integer ID sequences, and then a matrix of BxNxM is obtained through calculation of a neural network, wherein N is the length of the character sequences, and M is the dimension of a character vector; the word vector matrix bxnxm is then input to the BiLSTM layer. In order to better enlarge the receptive field of the network, two ways of sequence and reverse sequence of B word vector matrixes NxM are respectively used as input into the sequential LSTM and the reverse-sequence LSTM to obtain two LSTM neurons, the matrix shape of the two LSTM neurons is BxNxW, and W is the dimension of the LSTM neurons. Finally, two B multiplied by N multiplied by W shaped LSTM neurons are spliced into a larger dimension neuron, the shape of which is B multiplied by N multiplied by 2W. This larger bxnx 2W neuron is then input into the CRF layer. At this layer, firstly, neural network operation is carried out to obtain a BxN x K matrix, wherein K corresponds to the number of labels, and then a CRF function is utilized to select one label to obtain the BxN matrix. And comparing the B multiplied by N matrix of the predicted label obtained in the last step with the B multiplied by N matrix of the real sample label to obtain an error, correcting the parameters of each network layer by utilizing the back propagation of the neural network so as to achieve the best fitting effect, stopping training and obtaining a preset field recognition model.
In the embodiment of the application, a plurality of sample file names can be generated independently through the static field information of a plurality of sample files and the dynamic field information of a plurality of sample files, the problem that training samples are difficult to collect from a public way is avoided, meanwhile, the generated training samples are convenient for label marking, and the dynamic field and the static field of the file names can be effectively divided through training of a preset field identification model, so that the accurate generation of the follow-up file names is ensured.
Fig. 6 is a schematic overall flow chart of file naming described in the embodiment of the present application, and as shown in fig. 6, the method includes: step 601, firstly, generating a corpus and generating a plurality of sample file names; step 602, dividing static fields and dynamic fields, and performing serialization labeling by using BIO or BIOE and other modes, thereby realizing sample label labeling; step 603, fitting the training sample by using a named entity recognition model to obtain a preset field recognition model; step 604, the user creates and names the first file, namely, creates and names the first file; step 605, the model detects the first file name; if the dynamic field is detected, go to step 606, generate the filename of the new file according to the dynamic field generation rule corresponding to the dynamic field, if the dynamic field is not detected, go to step 607, and perform padding according to the padding rule in the prior art; step 608, the user confirms or modifies the auto-populated filename.
It should be noted that, in the file naming method provided in the embodiment of the present application, the execution main body may be a file naming device, or a control module in the file naming device for executing the file naming method. In the embodiment of the present application, a method for a file naming device to perform file naming is taken as an example, and a file naming device provided in the embodiment of the present application is described.
Fig. 7 is a schematic structural diagram of a file naming device provided in an embodiment of the present application, as shown in fig. 7, including: a receiving module 710 and a creating module 720; the receiving module 710 is configured to receive a first input when a first file is stored in a first folder, where the first file is a first file in the first folder; the creating module 720 is configured to create a second file in the first folder in response to the first input, and generate a second file name of the second file according to the first dynamic field information and the first static field information of the first file.
Optionally, the apparatus further comprises: a first storage module;
the first storage module is used for storing the first dynamic field information and the first static field information into a first hidden file of the first folder;
the creating module is specifically configured to determine, in the first hidden file, first dynamic field information corresponding to the first static field information based on the first static field information;
generating second dynamic field information based on a first dynamic field generation rule corresponding to the first dynamic field information and the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
Optionally, the creating module is specifically configured to generate second dynamic field information based on a first dynamic field generation rule and system information corresponding to the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
Optionally, the identification module is configured to input a character sequence of a first filename into an embedded layer in a preset field identification model, so as to obtain a first word vector matrix corresponding to the first filename, where the first filename is the filename of the first file;
inputting the first word vector matrix into a bidirectional long-time and short-time memory network layer in the preset field recognition model to obtain first neuron information;
and inputting the first neuron information into a conditional random field layer in the preset field recognition model to obtain first dynamic field information and first static field information of a first file.
Optionally, the apparatus further comprises: a training module;
the training module is specifically used for generating a plurality of sample file names based on the static field information of a plurality of sample files and the dynamic field information of the plurality of sample files;
acquiring a dynamic field label and a static field label corresponding to each sample file name;
taking each sample file name carrying a dynamic field label and a static field label as a training sample, and obtaining a plurality of training samples;
and training a preset named entity recognition model by using a plurality of training samples to obtain the preset field recognition model.
In the embodiment of the application, in the process of creating a new file, first static field information which cannot be changed in new and old file names is determined based on the file name of a first file stored in the same folder in advance, and meanwhile, dynamic field information of the new file is generated based on a dynamic field in the first file, so that a second file name of a second file is automatically generated according to the dynamic field information and the first static field information which cannot be changed.
The file naming device in the embodiment of the present application may be a device, and may also be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The file naming device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The file naming device provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to 6, and is not described here again to avoid repetition.
Optionally, fig. 8 is a schematic view of an electronic device according to an embodiment of the present application, and as shown in fig. 8, an electronic device 800 according to an embodiment of the present application is further provided, and includes a processor 801, a memory 802, and a program or an instruction stored in the memory 802 and capable of running on the processor 801, and when the program or the instruction is executed by the processor 801, the program or the instruction implements each process of the above-mentioned file naming method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 9 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 900 includes, but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910.
Those skilled in the art will appreciate that the electronic device 900 may further include a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 910 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system. The electronic device structure shown in fig. 9 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is not repeated here.
The user input unit 907 receives a first input when a first file is stored in a first folder, where the first file is a first file in the first folder;
processor 910, in response to the first input, creates a second file in the first folder, and generates a second filename of the second file according to the first dynamic field information and the first static field information of the first file.
Processor 910 stores the first dynamic field information and the first static field information in a first hidden file of the first folder;
determining first dynamic field information corresponding to the first static field information in the first hidden file based on the first static field information;
generating second dynamic field information based on a first dynamic field generation rule corresponding to the first dynamic field information and the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
Processor 910 updates the dynamic field information in the first hidden file based on the second dynamic field information to obtain a second hidden file;
processor 910 generates second dynamic field information based on a first dynamic field generation rule and system information corresponding to the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
Processor 910 generates second dynamic field information based on a first dynamic field generation rule and system information corresponding to the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
The processor 910 generates a plurality of sample file names based on the plurality of sample file static field information and the plurality of sample file dynamic field information;
acquiring a dynamic field label and a static field label corresponding to each sample file name;
taking each sample file name carrying a dynamic field label and a static field label as a training sample, and obtaining a plurality of training samples;
and training a preset named entity recognition model by using a plurality of training samples to obtain the preset field recognition model.
In the embodiment of the application, in the process of creating a new file, first static field information which cannot be changed in new and old file names is determined based on the file name of a first file stored in the same folder in advance, and meanwhile, dynamic field information of the new file is generated based on a dynamic field in the first file, so that a second file name of a second file is automatically generated according to the dynamic field information and the first static field information which cannot be changed.
It should be understood that, in the embodiment of the present application, the input Unit 904 may include a Graphics Processing Unit (GPU) 9041 and a microphone 9042, and the Graphics Processing Unit 9041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 907 includes a touch panel 9071 and other input devices 9072. A touch panel 9071 also referred to as a touch screen. The touch panel 9071 may include two parts, a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. Memory 909 can be used to store software programs as well as various data including, but not limited to, application programs and operating systems. The processor 910 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 910.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above-mentioned file naming method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above file naming method embodiment, and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, 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 like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. A file naming method is characterized by comprising the following steps:
receiving a first input under the condition that a first file is stored in a first folder, wherein the first file is a first file in the first folder;
and responding to the first input, creating a second file in the first folder, and generating a second file name of the second file according to the first dynamic field information and the first static field information of the first file.
2. The file naming method according to claim 1, wherein, in a case where the first dynamic field information belongs to a dependent field, before the generating of the second file name of the second file according to the first dynamic field information and the first static field information, further comprises:
storing the first dynamic field information and the first static field information into a first hidden file of the first folder;
the generating a second file name of the second file according to the first dynamic field information and the first static field information includes:
determining first dynamic field information corresponding to the first static field information in the first hidden file based on the first static field information;
generating second dynamic field information based on a first dynamic field generation rule corresponding to the first dynamic field information and the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
3. The file naming method according to claim 1, wherein, in the case where the first dynamic field information belongs to an independent field, the generating a second file name of the second file according to the first dynamic field information and the first static field information includes:
generating second dynamic field information based on a first dynamic field generation rule and system information corresponding to the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
4. The file naming method according to claim 1, before generating the second file name of the second file according to the first dynamic field information and the first static field information of the first file, further comprising:
inputting a character sequence of a first file name into an embedded layer in a preset field recognition model to obtain a first word vector matrix corresponding to the first file name, wherein the first file name is the file name of the first file;
inputting the first word vector matrix into a bidirectional long-time and short-time memory network layer in the preset field recognition model to obtain first neuron information;
and inputting the first neuron information into a conditional random field layer in the preset field recognition model to obtain first dynamic field information and first static field information of a first file.
5. The method for file naming according to claim 1, wherein before said generating a second file name of said second file according to the first dynamic field information and the first static field information, the method further comprises:
generating a plurality of sample file names based on the static field information of the plurality of sample files and the dynamic field information of the plurality of sample files;
acquiring a dynamic field label and a static field label corresponding to each sample file name;
taking each sample file name carrying a dynamic field label and a static field label as a training sample, and obtaining a plurality of training samples;
and training a preset named entity recognition model by using a plurality of training samples to obtain the preset field recognition model.
6. A file naming apparatus, comprising:
the device comprises a receiving module, a judging module and a display module, wherein the receiving module is used for receiving a first input under the condition that a first file is stored in a first folder, and the first file is a first file in the first folder;
and the creating module is used for responding to the first input, creating a second file in the first folder, and generating a second file name of the second file according to the first dynamic field information and the first static field information of the first file.
7. The file naming apparatus according to claim 6, wherein said apparatus further comprises: a first storage module;
the first storage module is used for storing the first dynamic field information and the first static field information into a first hidden file of the first folder;
the creating module is specifically configured to determine, in the first hidden file, first dynamic field information corresponding to the first static field information based on the first static field information;
generating second dynamic field information based on a first dynamic field generation rule corresponding to the first dynamic field information and the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
8. The file naming device according to claim 6, wherein the creating module is specifically configured to generate second dynamic field information based on a first dynamic field generation rule and system information corresponding to the first dynamic field information;
generating a second filename of the second file based on the second dynamic field information and the first static field information.
9. The file naming apparatus according to claim 6, wherein said apparatus further comprises: an identification module;
the identification module is used for inputting a character sequence of a first file name into an embedded layer in a preset field identification model to obtain a first word vector matrix corresponding to the first file name, wherein the first file name is the file name of the first file;
inputting the first word vector matrix into a bidirectional long-time and short-time memory network layer in the preset field recognition model to obtain first neuron information;
and inputting the first neuron information into a conditional random field layer in the preset field recognition model to obtain first dynamic field information and first static field information of a first file.
10. The file naming apparatus according to claim 6, wherein said apparatus further comprises: a training module;
the training module is specifically used for generating a plurality of sample file names based on the static field information of a plurality of sample files and the dynamic field information of the plurality of sample files;
acquiring a dynamic field label and a static field label corresponding to each sample file name;
taking each sample file name carrying a dynamic field label and a static field label as a training sample, and obtaining a plurality of training samples;
and training a preset named entity recognition model by using a plurality of training samples to obtain the preset field recognition model.
11. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the file naming method as claimed in any one of claims 1-5.
12. A readable storage medium, on which a program or instructions are stored, which program or instructions, when executed by a processor, carry out the steps of the file naming method according to any one of claims 1-5.
CN202110729712.7A 2021-06-29 2021-06-29 File naming method, device, electronic equipment and storage medium Active CN113448927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110729712.7A CN113448927B (en) 2021-06-29 2021-06-29 File naming method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110729712.7A CN113448927B (en) 2021-06-29 2021-06-29 File naming method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113448927A true CN113448927A (en) 2021-09-28
CN113448927B CN113448927B (en) 2024-06-21

Family

ID=77814269

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110729712.7A Active CN113448927B (en) 2021-06-29 2021-06-29 File naming method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113448927B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077285A (en) * 2013-03-26 2014-10-01 联想(北京)有限公司 File designation method and first electronic equipment
CN105677891A (en) * 2016-01-29 2016-06-15 广东欧珀移动通信有限公司 Folder naming method and device and terminal
CN107341155A (en) * 2016-04-29 2017-11-10 阿里巴巴集团控股有限公司 File designation method and device
CN109240997A (en) * 2018-08-24 2019-01-18 华强方特(深圳)电影有限公司 A kind of upload store method, system and the client of file
CN109344125A (en) * 2018-08-27 2019-02-15 维沃移动通信有限公司 A kind of file name update method and terminal device
CN110263007A (en) * 2019-06-28 2019-09-20 深圳市迅雷网络技术有限公司 A kind of file naming method, system and electronic equipment and storage medium
CN110703972A (en) * 2019-09-29 2020-01-17 维沃移动通信有限公司 File control method and electronic equipment
CN112765104A (en) * 2021-01-28 2021-05-07 维沃移动通信有限公司 File saving method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077285A (en) * 2013-03-26 2014-10-01 联想(北京)有限公司 File designation method and first electronic equipment
CN105677891A (en) * 2016-01-29 2016-06-15 广东欧珀移动通信有限公司 Folder naming method and device and terminal
CN107341155A (en) * 2016-04-29 2017-11-10 阿里巴巴集团控股有限公司 File designation method and device
CN109240997A (en) * 2018-08-24 2019-01-18 华强方特(深圳)电影有限公司 A kind of upload store method, system and the client of file
CN109344125A (en) * 2018-08-27 2019-02-15 维沃移动通信有限公司 A kind of file name update method and terminal device
CN110263007A (en) * 2019-06-28 2019-09-20 深圳市迅雷网络技术有限公司 A kind of file naming method, system and electronic equipment and storage medium
CN110703972A (en) * 2019-09-29 2020-01-17 维沃移动通信有限公司 File control method and electronic equipment
CN112765104A (en) * 2021-01-28 2021-05-07 维沃移动通信有限公司 File saving method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113448927B (en) 2024-06-21

Similar Documents

Publication Publication Date Title
CN107808004B (en) Model training method and system, server and storage medium
US10521278B2 (en) Format-specific data object passing between applications
CN111159982B (en) Document editing method, device, electronic equipment and computer readable storage medium
CN111985229A (en) Sequence labeling method and device and computer equipment
CN112527383A (en) Method, apparatus, device, medium, and program for generating multitask model
KR20210090576A (en) A method, an apparatus, an electronic device, a storage medium and a program for controlling quality
CN106775337A (en) The method for sorting and mobile terminal of multipad icon
CN112799658A (en) Model training method, model training platform, electronic device, and storage medium
CN110780970B (en) Data screening method, device, equipment and computer readable storage medium
CN117234505A (en) Interactive page generation method, device, equipment and storage medium thereof
CN113448927B (en) File naming method, device, electronic equipment and storage medium
CN115756692A (en) Method for automatically combining and displaying pages based on style attributes and related equipment thereof
CN112765946B (en) Chart display method and device and electronic equipment
CN115185625A (en) Self-recommendation type interface updating method based on configurable card and related equipment thereof
CN112084753B (en) Method and system for assisting in editing document
CN113901033A (en) Data migration method, device, equipment and medium
CN117371448A (en) Entity identification and model training method and device, electronic equipment and storage medium
CN114637831A (en) Data query method based on semantic analysis and related equipment thereof
CN114218431A (en) Video searching method and device, electronic equipment and storage medium
CN112257812A (en) Method and device for determining labeled sample, machine readable medium and equipment
CN112069807A (en) Text data theme extraction method and device, computer equipment and storage medium
CN110019547B (en) Method, device, equipment and medium for acquiring association relation between clients
CN115952376B (en) Webpage access method and device, electronic equipment and storage medium
WO2019156788A1 (en) Invoke a service in an electronic document using a trigger entry
CN114895836B (en) Touch control method and device based on intelligent full-flow data touch screen and electronic equipment

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