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

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

Info

Publication number
CN117130983A
CN117130983A CN202311103305.0A CN202311103305A CN117130983A CN 117130983 A CN117130983 A CN 117130983A CN 202311103305 A CN202311103305 A CN 202311103305A CN 117130983 A CN117130983 A CN 117130983A
Authority
CN
China
Prior art keywords
file
storage path
directory
target file
folder
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
CN202311103305.0A
Other languages
Chinese (zh)
Inventor
马秋红
彭飞
刘孟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information 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 Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN202311103305.0A priority Critical patent/CN117130983A/en
Publication of CN117130983A publication Critical patent/CN117130983A/en
Pending legal-status Critical Current

Links

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/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the application provides a file storage method, a file storage device, electronic equipment and a storage medium. In the embodiment of the application, based on the file content of the target file, a file storage path matched with the file type and the content theme of the target file under a default storage path is predicted by utilizing a pre-trained directory intelligent matching model, so that the target file can be conveniently matched with a storage path with highest adaptation degree; further, whether a file directory corresponding to the file storage path exists below the default path can be judged based on the predicted file storage path of the target file, and if not, the file directory corresponding to the predicted file storage path is created below the default storage path, and the target file is stored under the file directory, so that on one hand, the storage mode of the target file is simplified, and the flexibility of the storage mode of the target file is improved, and on the other hand, the file type and the content theme of the target file and the adaptation degree of the file directory can be improved.

Description

File storage method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for storing files, an electronic device, and a storage medium.
Background
At present, when the notebook software stores files, a simpler storage mode of a fixed path is used, namely the provided file storage path is usually default, or is selected in advance before a storage operation is carried out by a user, and then the files to be stored are stored in folders corresponding to the fixed storage path.
However, the existing file storage methods are either inflexible or cumbersome.
Disclosure of Invention
The application provides a file storage method, a file storage device, electronic equipment and a storage medium, which are used for solving the technical problems that the existing file storage mode is not flexible and complicated.
An exemplary embodiment of the present application provides a file storage method, including: responding to the operation of storing the target file, and obtaining the target file, wherein the target file has file content; generating a file storage path adapted to the file type and the content theme of the target file based on the file content of the target file; displaying the complete storage path information obtained by splicing the default storage path and the file storage path, so that a user can confirm whether to store the target file according to the complete storage path information; responding to a save operation sent by a user aiming at a target file, and judging whether a file directory corresponding to a file storage path exists below a default storage path; if the target file does not exist, a file directory corresponding to the file storage path is created under the default storage path, and the target file is stored under the file directory.
An exemplary embodiment of the present application also provides a file storage device, including: the acquisition module is used for responding to the operation of storing the target file and acquiring the target file, wherein the target file has file content; the prediction module is used for predicting a file storage path matched with the file type and the content theme of the target file by utilizing a pre-trained directory intelligent matching model based on the file content of the target file; the display module is used for displaying the complete storage path information obtained by splicing the default storage path and the file storage path so as to ensure that a user confirms whether to store the target file according to the complete storage path information; the judging module is used for responding to the save operation sent by the user aiming at the target file and judging whether a file directory corresponding to the file storage path exists below the default storage path or not; if the judging result of the judging module is that the file is not stored, the creating module creates a file directory corresponding to the file storage path under the default storage path, and stores the target file under the file directory.
An exemplary embodiment of the present application also provides an electronic device, including: a memory and a processor; the memory has stored therein a computer program, and the processor is coupled to the memory for executing the computer program for carrying out the steps of the above method.
The embodiments of the present application also provide a computer-readable storage medium storing a computer program, which when executed by a processor causes the processor to implement the steps in the above method.
In the embodiment of the application, based on the file content of the target file, a file storage path matched with the file type and the content theme of the target file under a default storage path is predicted by utilizing a pre-trained directory intelligent matching model, so that the target file can be conveniently matched with a storage path with highest adaptation degree; further, whether a file directory corresponding to the file storage path exists below the default path can be judged based on the predicted file storage path of the target file, and if not, the file directory corresponding to the predicted file storage path is created below the default storage path, and the target file is stored under the file directory, so that on one hand, the storage mode of the target file is simplified, and the flexibility of the storage mode of the target file is improved, and on the other hand, the file type and the content theme of the target file and the adaptation degree of the file directory can be improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flowchart illustrating a method for storing files according to an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram of a file storage device according to an exemplary embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flowchart of a file storage method according to an exemplary embodiment of the present application. As shown in fig. 1, the method includes:
101. responding to the operation of storing the target file, and obtaining the target file, wherein the target file has file content;
102. predicting a file storage path matched with the file type and the content theme of the target file by utilizing a pre-trained directory intelligent matching model based on the file content of the target file;
103. Displaying the complete storage path information obtained by splicing the default storage path and the file storage path, so that a user can confirm whether to store the target file according to the complete storage path information;
104. responding to a save operation sent by a user aiming at a target file, and judging whether a file directory corresponding to a file storage path exists below a default storage path;
105. if the target file does not exist, a file directory corresponding to the file storage path is created under the default storage path, and the target file is stored under the file directory.
In this embodiment, in response to an operation of storing a target file, the target file may be acquired, where the target file has file contents. The operation of storing the target file may be initiated by the current user, and when the current user has a requirement of storing the target file, the operation of storing the target file may be initiated. Or the system can be automatically triggered, and when a new file to be saved appears, the system automatically triggers the operation of storing the target file.
The file type of the target file is not limited in this embodiment. The file type of the target file may be, for example, a learning class file, a work class file, a signing class file, and so forth. Where a signed class file is a file that requires a signature or seal, such as an electronic contract, agreement, and the like. The attribute of the target file is not limited in this embodiment. The attributes of the target file may be, for example, a PPT file, an audio file, a WPS or Office document file, and so forth. Wherein the audio file is a file whose file content is audio, video, such as a movie or a television video, etc. The file content of the target file is not limited in this embodiment. When the target file is a learning file, the corresponding file content can be knowledge points, problem data and the like; when the target file is a work class file, the corresponding file content can be work content, work requirement or specification, and the like; where the target file is a signed-class file, the corresponding file content may be a collaborative clause, an agreement requirement, and so forth.
After the target file is obtained, file content in the target file is read, and a file storage path matched with the file type and the content theme of the target file is predicted by utilizing a pre-trained directory intelligent matching model based on the file content of the target file. In this embodiment, multiple content topics are included under the same file type. The content subject matter of the target file is not limited in this embodiment. Taking the example that the file type of the target file is a signature class file and the signature class file is a contract file, the content subject of the contract file may be labor contract, material purchase contract, and the like. The file storage path refers to a description of the physical location of the target file in the computer, and is typically named with the volume label of the hard disk, the name of the folder, and the file name.
The implementation of predicting a file storage path that is adapted to the file type and content theme of the target file is not limited. For example, a pair of storage paths named to fit the file type and content theme of the target file may be selected from the existing storage paths according to the file type and content theme of the target file as the file storage path of the target file. Or, splicing the type name of the file type of the target file and the theme name of the content theme, and taking the spliced name character string as the file storage path of the target file. For a more preferred embodiment, reference is made to the following description of examples, which are not repeated here.
In an embodiment of the present application, the storage path of the target file has a score of the file storage path and the default storage path. The default storage path is a path corresponding to a previous-level directory from the root directory and pointing to a current directory (a current directory corresponding to a target file); the file storage path refers to a storage path corresponding to the current directory; and splicing the default storage path and the file storage path to obtain a complete storage path of the target file. In addition, the storage path corresponds to path information. The default storage path corresponds to default storage path information, wherein the default storage path information is path information which starts from a root directory and points to a previous-level directory of the current directory; the file storage path corresponds to file storage path information, and the file storage path information is path information corresponding to the current directory; and splicing the default storage path information and the file storage path information to obtain the complete storage path information.
After predicting the file storage path matched with the file type and the content theme of the target file, displaying the complete storage path information obtained by splicing the default storage path information and the file storage path through a graphical user interface, namely displaying the complete storage path information obtained by splicing the default storage path information and the file storage path information through the graphical user interface, so that a user can confirm whether to store the target file according to the complete storage path information. When the default storage path and the file storage path are spliced, the default storage path information and the file storage path information are spliced, and the splicing of the path information can be realized through a connector "/".
In the embodiment of the application, a file storage path of the target file may exist below the default storage path, or a file storage path of the target file does not exist below the default storage path. And under the condition that the user confirms that the target file is saved according to the complete storage path information displayed on the graphical user interface, responding to the save operation sent by the user for the target file, judging whether a file directory corresponding to the file storage path exists under the default storage path.
The embodiment of determining whether or not a file directory corresponding to the file storage path already exists below the default storage path is not limited. For example, all the file directories under the default storage path may be obtained, and the file directory corresponding to the file storage path and each of all the file directories under the default storage path may be matched one by one; if the matching is successful, determining that a file directory corresponding to the file storage path exists below the default storage path; if the matching is unsuccessful, determining that a file directory corresponding to the file storage path does not exist below the default storage path. More preferred embodiments may be found in the following description of examples, which are not repeated here.
Further, in an alternative embodiment, the target file is stored directly under the file directory in case there is already a file directory corresponding to the file storage path under the default storage path.
In another alternative embodiment, in the case that the file directory corresponding to the file storage path does not exist under the default storage path, the file directory corresponding to the file storage path may be created under the default storage path, and the target file may be stored under the file directory. The file directory corresponding to the file storage path is a multi-level folder name, and the folder name of the next level is connected to the back of the folder name of the previous level through a connector.
According to the technical scheme provided by the embodiment of the application, based on the file content of the target file, the file storage path matched with the file type and the content theme of the target file under the default storage path is predicted by utilizing the pre-trained directory intelligent matching model, so that the target file can be conveniently matched with the storage path with the highest adaptation degree; further, whether a file directory corresponding to the file storage path exists below the default path can be judged based on the predicted file storage path of the target file, and if not, the file directory corresponding to the predicted file storage path is created below the default storage path, and the target file is stored under the file directory, so that on one hand, the storage mode of the target file is simplified, and the flexibility of the storage mode of the target file is improved, and on the other hand, the file type and the content theme of the target file and the adaptation degree of the file directory can be improved.
In an embodiment of the present application, a preferred implementation manner for determining whether a file directory corresponding to a file storage path already exists below a default storage path includes:
s1, judging whether the folder name of the current level exists below a default storage path according to the folder name of the current level; if yes, executing step S2; if not, executing step S5;
s2, judging whether the folder name of the current level is the folder name of the last level in the multi-level folder names; if not, executing the step S3; if yes, executing step S4;
s3, acquiring a folder name of a next level behind the folder name of the current level from the multi-level folder names according to the connector, re-using the acquired folder name of the next level as the folder name of the current level, and returning to the step S1;
s4, determining that a file directory corresponding to the folder name exists under the default storage path, and ending the operation;
s5, determining that file directories corresponding to the folder names of the current level and the folder names of the subsequent level do not exist below the default storage path.
In an optional embodiment, in the step S1, determining whether the folder name of the current hierarchy exists below the default path includes: acquiring the current folder name and the folder names of all levels under a default storage path; comparing the current folder name with the folder names of all levels under the default storage path; if the folder names with the consistent comparison results exist, determining that the folder names of the current level exist below the default storage path; if the folder names consistent with the comparison result do not exist, determining that the folder names of the current level do not exist under the default storage path.
In an alternative embodiment, creating a file directory corresponding to a file storage path below a default storage path includes: judging whether the folder name of the current level belongs to the folder name of the first level in the multi-level folder names under the condition that the file directory corresponding to the folder name of the current level and the folder names of the subsequent levels does not exist under the default storage path; if the judgment result is yes, directly taking the default storage path as a starting directory, and creating file directories respectively corresponding to the folder names of the current level and the folder names of the subsequent level under the starting directory according to the level relation between the folder names of the current level and the folder names of the subsequent level; if the judgment result is negative, determining a file directory corresponding to the folder name of the previous level of the folder name of the current level as a starting directory under the default storage path, and creating file directories corresponding to the folder names of the current level and the folder names of the subsequent level under the starting directory according to the level relation between the folder names of the current level and the folder names of the subsequent level.
In an alternative embodiment, based on the file content of the target file, predicting a folder storage path adapted to the file type and content theme of the target file by using a pre-trained directory intelligent matching model includes: inputting the file content of the target file into a pre-trained directory intelligent matching model, and identifying the file type and the content theme of the target file according to the file content of the target file in the directory intelligent matching model; and respectively splicing the file types and the content topics of the target file as upper and lower path information to obtain the folder names of the storage paths of the characterization target file.
In the embodiment of the application, based on the file content of the target file, the file folder storage path which is predicted by using the pre-trained directory intelligent matching model and is matched with the file type and the content theme of the target file may be inaccurate. In this regard, the user may make modifications based on the predicted folder storage path that is adapted to the file type and content theme of the target file. Modifying based on the predicted folder storage path adapted to the file type and content theme of the target file, including: responding to a modification operation sent by a user aiming at the folder names in the storage path information, acquiring the folder names modified by the user, and generating new storage path information according to the modified folder names and the default storage paths; judging whether a file directory corresponding to the modified folder name exists under the default storage path; if the file directory does not exist, creating a file directory corresponding to the modified folder name under the default storage path, and storing the target file under the file directory.
Further, in order to improve the accuracy of the prediction function of the directory intelligent matching model, after modifying the folder storage path adapted to the file type and the content theme of the target file, the directory intelligent matching model may be retrained according to the modified folder name and the target file, so as to obtain the directory intelligent matching model adapted to the storage habit of the user.
For ease of understanding, the training, use, i.e., updating, of the directory intelligent matching model is described in detail below. The specific process is as follows:
step one, collecting and processing sample data. A certain number of files (including file types and content topics) such as notes, blogs and the like on the network are collected as a data set for model training, and the files are preprocessed. Preprocessing is extracting text from a collected file as a text data set (TextSet). In addition, the file may contain contents such as pictures and audio besides characters. Correspondingly, the keywords in the pictures are extracted by adopting a picture text extraction machine learning model to add text when preprocessing, and the text in the audio is extracted by adopting an audio text extraction machine learning model to add text.
Training the directory intelligent matching model. And training the TextSet collected in the last step by adopting natural language processing neural networks such as NLP/RNN/LSTM and the like. Wherein TextSet is used as the input of the model, and file type and content theme are used as the output of the model.
And thirdly, using a catalog intelligent matching model. The directory intelligent matching model can be deployed to a server (whether the local exists or not is judged firstly, and if the local exists or not, the directory intelligent matching model is downloaded) and the directory intelligent matching model is remotely downloaded to the app when the app is used by a user. When a user uses the app to newly build a target file for storage, collecting the content of the file to be stored, preprocessing the data by adopting the operation in the first step, and then sending the preprocessed content into the directory intelligent matching model for prediction to obtain the file type and the content theme corresponding to the content of the file. When the user operates, the specific flow is as follows:
a) The path information of the dialog box is displayed as a default storage path and a predicted file storage path of the target file.
b) And responding to the save operation of the user, judging whether a file storage path of the target file exists in the default storage path, if so, directly storing the target file in a folder of a file directory corresponding to the file storage path of the target file, and if not, generating a new file storage path and saving the target file in the folder of the file directory corresponding to the new file storage path.
c) The user modifies the folder name corresponding to the directory, which illustrates that the model prediction has deviation, and records the data (files and modified directory names) as a data set in the next model update.
And step four, updating the directory intelligent matching model. The directory intelligent matching model obtained in the second step is a general model, but different users may have different tendencies for classifying and storing files, and in order to obtain a model more suitable for the corresponding user, the directory intelligent matching model is updated according to the tendencies of classifying and storing of different users. And particularly, training the directory intelligent matching model again by using the TextSet recorded in the operation of the step 3-c), and predicting the best saved directory which is more prone to the user saving habit based on the directory intelligent matching model when similar files are saved.
Fig. 2 is a schematic diagram of a file storage device according to an exemplary embodiment of the present application. As shown in fig. 2, the apparatus includes: the system comprises an acquisition module 21, a generation module 22, a display module 23, a judgment module 24, a creation module 25 and a storage module 26.
An obtaining module 21, configured to obtain a target file in response to an operation of storing the target file, where the target file has file contents;
A generating module 22, configured to predict, based on file content of the target file, a file storage path adapted to a file type and a content theme of the target file using a pre-trained directory intelligent matching model;
the display module 23 is configured to display complete storage path information obtained by splicing a default storage path and the file storage path, so that a user confirms whether to store the target file according to the complete storage path information;
a judging module 24, configured to respond to a save operation sent by a user for the target file, and judge whether a file directory corresponding to the file storage path already exists below the default storage path;
if the judging result of the judging module 24 is that the target file does not exist, a file directory corresponding to the file storing path is created under the default storing path through the creating module 25, and the target file is stored under the file directory through the storing module.
Further optionally, the method further comprises: in the case where it is determined by the determination module 24 that there is already a file directory corresponding to the file storage path below the default storage path, the target file is stored under the file directory directly by the storage module 26.
In the embodiment of the application, the file directory corresponding to the file storage path is a multi-level folder name, and the folder name of the next level is connected to the back of the folder name of the previous level through a connector. Based on this, in an alternative embodiment, the determining module 24 is specifically configured to, when configured to determine whether a file directory corresponding to the file storage path already exists below the default storage path, perform the following steps:
s1, judging whether the folder name of the current level exists below a default storage path according to the folder name of the current level; if yes, executing step S2; if not, executing step S5;
s2, judging whether the folder name of the current level is the folder name of the last level in the multi-level folder names; if not, executing the step S3; if yes, executing step S4;
s3, acquiring a folder name of a next level behind the folder name of the current level from the multi-level folder names according to the connector, re-using the acquired folder name of the next level as the folder name of the current level, and returning to the step S1;
s4, determining that a file directory corresponding to the folder name exists under the default storage path, and ending the operation;
S5, determining that file directories corresponding to the folder names of the current level and the folder names of the subsequent level do not exist below the default storage path.
In an alternative embodiment, the creation module 25, when configured to create a file directory corresponding to a file storage path below a default storage path, is specifically configured to: judging whether the folder name of the current level belongs to the folder name of the first level in the multi-level folder names under the condition that the file directory corresponding to the folder name of the current level and the folder names of the subsequent levels does not exist under the default storage path; if the judgment result is yes, directly taking the default storage path as a starting directory, and creating file directories respectively corresponding to the folder names of the current level and the folder names of the subsequent level under the starting directory according to the level relation between the folder names of the current level and the folder names of the subsequent level; if the judgment result is negative, determining a file directory corresponding to the folder name of the previous level of the folder name of the current level as a starting directory under the default storage path, and creating file directories corresponding to the folder names of the current level and the folder names of the subsequent level under the starting directory according to the level relation between the folder names of the current level and the folder names of the subsequent level.
In an alternative embodiment, the generating module 22 is specifically configured to, when configured to predict, based on the file content of the target file, a folder name adapted to the file type and the content theme of the target file using a pre-trained directory intelligent matching model: inputting the file content of the target file into a pre-trained directory intelligent matching model, and identifying the file type and the content theme of the target file according to the file content of the target file in the directory intelligent matching model; and respectively splicing the file types and the content topics of the target file as upper and lower path information to obtain the folder names of the storage paths of the characterization target file.
Further optionally, the method further comprises: a modifying module, configured to respond to a modifying operation sent by a user for a folder name in the storage path information, obtain the folder name modified by the user through the obtaining module 21, and generate new storage path information through the generating module 22 according to the modified folder name and the default storage path; judging whether a file directory corresponding to the modified folder name exists under the default storage path or not through a judging module 24; if not, a file directory corresponding to the modified folder name is created under the default storage path by the creation module 25, and the target file is stored under the file directory by the storage module 26.
Further optionally, the method further comprises: and the model training module is used for retraining the directory intelligent matching model according to the modified folder names and the target files so as to obtain the directory intelligent matching model which is matched with the storage habit of the user.
It should be noted that, the specific implementation principles and the technical effects that can be generated by the above modules may be referred to the corresponding content in the above method embodiments, which is not described herein again.
Fig. 3 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application. As shown in fig. 3, includes: a memory 30a and a processor 30b; the memory 30a has stored therein a computer program, and the processor 30b is coupled to the memory 30a for executing the computer program for carrying out the steps of:
responding to the operation of storing a target file, and acquiring the target file, wherein the target file has file content; predicting a file storage path matched with the file type and the content theme of the target file by utilizing a pre-trained directory intelligent matching model based on the file content of the target file; displaying complete storage path information obtained by splicing a default storage path and the file storage path, so that a user can confirm whether to store the target file according to the complete storage path information; responding to a save operation sent by a user aiming at the target file, and judging whether a file directory corresponding to the file storage path exists below the default storage path; if the judgment result is that the file is not present, creating a file directory corresponding to the file storage path under the default storage path, and storing the target file under the file directory.
Further alternatively, the processor 30b is further configured to: in the case where a file directory corresponding to the file storage path already exists below the default storage path, the target file is directly stored under the file directory.
In the embodiment of the application, the file directory corresponding to the file storage path is a multi-level folder name, and the folder name of the next level is connected to the back of the folder name of the previous level through a connector. Based on this, in an alternative embodiment, processor 30b, when configured to determine whether a file directory corresponding to the file storage path already exists below the default storage path, is specifically configured to perform the following steps:
s1, judging whether the folder name of the current level exists below a default storage path according to the folder name of the current level; if yes, executing step S2; if not, executing step S5;
s2, judging whether the folder name of the current level is the folder name of the last level in the multi-level folder names; if not, executing the step S3; if yes, executing step S4;
s3, acquiring a folder name of a next level behind the folder name of the current level from the multi-level folder names according to the connector, re-using the acquired folder name of the next level as the folder name of the current level, and returning to the step S1;
S4, determining that a file directory corresponding to the folder name exists under the default storage path, and ending the operation;
s5, determining that file directories corresponding to the folder names of the current level and the folder names of the subsequent level do not exist below the default storage path.
In an alternative embodiment, processor 30b, when configured to create a file directory corresponding to a file storage path below a default storage path, is specifically configured to: judging whether the folder name of the current level belongs to the folder name of the first level in the multi-level folder names under the condition that the file directory corresponding to the folder name of the current level and the folder names of the subsequent levels does not exist under the default storage path; if the judgment result is yes, directly taking the default storage path as a starting directory, and creating file directories respectively corresponding to the folder names of the current level and the folder names of the subsequent level under the starting directory according to the level relation between the folder names of the current level and the folder names of the subsequent level; if the judgment result is negative, determining a file directory corresponding to the folder name of the previous level of the folder name of the current level as a starting directory under the default storage path, and creating file directories corresponding to the folder names of the current level and the folder names of the subsequent level under the starting directory according to the level relation between the folder names of the current level and the folder names of the subsequent level.
In an alternative embodiment, the processor 30b, when configured to predict a folder name adapted to a file type and a content topic of the target file based on file content of the target file using a pre-trained directory intelligent matching model, is specifically configured to: inputting the file content of the target file into a pre-trained directory intelligent matching model, and identifying the file type and the content theme of the target file according to the file content of the target file in the directory intelligent matching model; and respectively splicing the file types and the content topics of the target file as upper and lower path information to obtain the folder names of the storage paths of the characterization target file.
Further optionally, the processor 30b is further configured to respond to a modification operation sent by the user for a folder name in the storage path information, obtain the folder name modified by the user, and generate new storage path information according to the modified folder name and the default storage path; judging whether a file directory corresponding to the modified folder name exists under the default storage path; if the file directory does not exist, creating a file directory corresponding to the modified folder name under the default storage path, and storing the target file under the file directory.
Further optionally, the processor 30b is further configured to retrain the directory intelligent matching model according to the modified folder name and the target file, so as to obtain a directory intelligent matching model adapted to the storage habit of the user.
Furthermore, as shown in fig. 3, the electronic device further includes: communication component 30c, display 30d, power component 30e, audio component 30f, and other components. Only some of the components are schematically shown in fig. 3, which does not mean that the electronic device only comprises the components shown in fig. 3.
It should be noted that, the specific implementation principles and the technical effects of the above modules may be referred to the corresponding content in the above method or apparatus embodiments, which are not described herein.
An exemplary embodiment of the present application also provides a computer-readable storage medium storing a computer program, which when executed by a processor, causes the processor to implement the steps in the above file storage method.
The Memory may be implemented by any type or combination of volatile or non-volatile Memory devices, such as Static Random-Access Memory (SRAM), electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read Only Memory, EEPROM), erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The communication component is configured to facilitate wired or wireless communication between the device in which the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as a mobile communication network of WiFi,2G, 3G, 4G/LTE, 5G, etc., or a combination thereof. In one exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component further includes a near field communication (Near Field Communication, NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on radio frequency identification (Radio Frequency Identification, RFID) technology, infrared data association (Infrared Data Association, irDA) technology, ultra Wideband (UWB) technology, blueTooth (BT) technology, and other technologies.
The display includes a screen, which may include a liquid crystal display (Liquid Crystal Display, LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or sliding action, but also the duration and pressure associated with the touch or sliding operation.
The power supply component provides power for various components of equipment where the power supply component is located. The power components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the devices in which the power components are located.
The audio component described above may be configured to output and/or input an audio signal. For example, the audio component includes a Microphone (MIC) configured to receive external audio signals when the device in which the audio component is located is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may be further stored in a memory or transmitted via a communication component. In some embodiments, the audio assembly further comprises a speaker for outputting audio signals.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, magnetic disk storage, CD-ROM (Compact Disc Read-Only Memory), optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (Central Processing Unit, CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random access memory (Random Access Memory, RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of a storage medium for a computer include, but are not limited to, phase-change memory (Phase-change Random Access Memory, PRAM), static Random Access Memory (SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), other types of Random Access Memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (eeprom)
(EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disks (Digital Video Disc, DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that 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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (10)

1. A method of storing a file, comprising:
responding to the operation of storing a target file, and acquiring the target file, wherein the target file has file content;
predicting a file storage path matched with the file type and the content theme of the target file by utilizing a pre-trained directory intelligent matching model based on the file content of the target file;
displaying complete storage path information obtained by splicing a default storage path and the file storage path, so that a user can confirm whether to store the target file according to the complete storage path information;
responding to a save operation sent by a user aiming at the target file, and judging whether a file directory corresponding to the file storage path exists below the default storage path;
if the target file does not exist, creating a file directory corresponding to the file storage path under the default storage path, and storing the target file under the file directory.
2. The method as recited in claim 1, further comprising:
and directly storing the target file under the file directory under the condition that the file directory corresponding to the file storage path exists under the default storage path.
3. The method of claim 1, wherein the file directory to which the file storage path corresponds is a multi-level folder name, and a next-level folder name is connected to the back of a previous-level folder name by a connector; judging whether a file directory corresponding to the file storage path exists under the default storage path or not, comprising:
s1, judging whether the folder name of the current level exists below the default storage path according to the folder name of the current level; if yes, executing step S2; if not, executing step S5;
s2, judging whether the folder name of the current level is the folder name of the last level in the multi-level folder names; if not, executing the step S3; if yes, executing step S4;
s3, acquiring a folder name of a next level behind the folder name of the current level from the multi-level folder names according to the connector, re-using the acquired folder name of the next level as the folder name of the current level, and returning to execute the step S1;
s4, determining that a file directory corresponding to the folder name exists below the default storage path, and ending the operation;
And S5, determining that a file directory corresponding to the folder name of the current level and the folder name of the subsequent level does not exist below the default storage path.
4. A method according to claim 3, wherein creating a file directory corresponding to the file storage path below the default storage path comprises:
judging whether the folder name of the current level belongs to the folder name of the first level in the multi-level folder names or not under the condition that the file catalogue corresponding to the folder name of the current level and the folder names of the subsequent levels does not exist under the default storage path;
if the judgment result is yes, directly taking the default storage path as a starting directory, and creating file directories respectively corresponding to the folder names of the current level and the folder names of the subsequent level under the starting directory according to the hierarchical relationship between the folder names of the current level and the folder names of the subsequent level;
if the judgment result is negative, determining a file directory corresponding to the folder name of the previous level of the folder name of the current level as a starting directory under the default storage path, and creating file directories corresponding to the folder names of the current level and the folder names of the subsequent levels under the starting directory according to the level relation between the folder names of the current level and the folder names of the subsequent levels.
5. The method of any of claims 1-4, wherein predicting a file storage path that is adapted to a file type and content topic of the target file using a pre-trained directory intelligent matching model based on file content of the target file, comprises:
inputting the file content of the target file into a pre-trained directory intelligent matching model, and identifying the file type and the content theme of the target file according to the file content of the target file in the directory intelligent matching model;
and respectively splicing the file types and the content topics of the target file as upper and lower path information to obtain the folder names of the storage paths of the characterization target file.
6. The method as recited in claim 5, further comprising:
responding to a modification operation sent by a user for the folder names in the storage path information, acquiring the folder names modified by the user, and generating new storage path information according to the modified folder names and the default storage path;
judging whether a file directory corresponding to the modified folder name exists under the default storage path;
If not, creating a file directory corresponding to the modified folder name under the default storage path, and storing the target file under the file directory.
7. The method as recited in claim 6, further comprising:
and retraining the directory intelligent matching model according to the modified folder names and the target files to obtain the directory intelligent matching model which is adapted to the storage habits of the users.
8. A file storage device, comprising: the system comprises an acquisition module, a generation module, a display module, a judgment module, a creation module and a storage module; wherein,
the acquisition module is used for responding to the operation of storing the target file and acquiring the target file, wherein the target file has file content;
the prediction module is used for predicting a file storage path matched with the file type and the content theme of the target file by utilizing a pre-trained directory intelligent matching model based on the file content of the target file;
the display module is used for displaying the complete storage path information obtained by splicing the default storage path and the file storage path so as to ensure that a user confirms whether to store the target file according to the complete storage path information;
The judging module is used for responding to the save operation sent by the user aiming at the target file and judging whether a file directory corresponding to the file storage path exists below the default storage path or not;
if the judging result of the judging module is that the target file does not exist, a file directory corresponding to the file storage path is created under the default storage path through the creating module, and the target file is stored under the file directory through the storage module.
9. An electronic device, comprising: a memory and a processor; the memory having stored therein a computer program, the processor being coupled to the memory for executing the computer program for implementing the steps in the method of any of claims 1-7.
10. A computer readable storage medium storing a computer program, which when executed by a processor causes the processor to carry out the steps of the method of any one of claims 1-7.
CN202311103305.0A 2023-08-29 2023-08-29 File storage method and device, electronic equipment and storage medium Pending CN117130983A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311103305.0A CN117130983A (en) 2023-08-29 2023-08-29 File storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311103305.0A CN117130983A (en) 2023-08-29 2023-08-29 File storage method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117130983A true CN117130983A (en) 2023-11-28

Family

ID=88852405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311103305.0A Pending CN117130983A (en) 2023-08-29 2023-08-29 File storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117130983A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453153A (en) * 2023-12-26 2024-01-26 柏科数据技术(深圳)股份有限公司 File storage method, device, terminal and medium based on flush rule

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117453153A (en) * 2023-12-26 2024-01-26 柏科数据技术(深圳)股份有限公司 File storage method, device, terminal and medium based on flush rule
CN117453153B (en) * 2023-12-26 2024-04-09 柏科数据技术(深圳)股份有限公司 File storage method, device, terminal and medium based on flush rule

Similar Documents

Publication Publication Date Title
US20210042662A1 (en) Interactive Information Capture and Retrieval with User-Defined and/or Machine Intelligence Augmented Prompts and Prompt Processing
CN107210033B (en) Updating language understanding classifier models for digital personal assistants based on crowd sourcing
WO2018213740A1 (en) Action recipes for a crowdsourced digital assistant system
KR101855147B1 (en) An analysis method for user preference and device therefor
US20160179899A1 (en) Method of providing content and electronic apparatus performing the method
CN105518662A (en) Access and management of entity-augmented content
CN108369600A (en) Web browser extends
CN110175223A (en) A kind of method and device that problem of implementation generates
KR101709427B1 (en) Method and device for selecting information
US11907316B2 (en) Processor-implemented method, computing system and computer program for invoking a search
KR20190053675A (en) Electronic apparatus and operating method thereof
CN104035995A (en) Method and device for generating group tags
US20220283831A1 (en) Action recipes for a crowdsourced digital assistant system
CN105528403A (en) Target data identification method and apparatus
CN117130983A (en) File storage method and device, electronic equipment and storage medium
US10834236B2 (en) Server-driven custom context menus
CN104063424B (en) Web page picture shows method and demonstration device
CN113177419B (en) Text rewriting method and device, storage medium and electronic equipment
CN113434134A (en) Component processing method and device, electronic equipment and storage medium
CN111796690A (en) Data processing method and device and electronic equipment
CN111400443B (en) Information processing method, device and storage medium
CN104376030B (en) The method and apparatus of browser bookmark intelligent packet
CN111737972A (en) Method and device for realizing natural language understanding in human-computer interaction system
CN111444687A (en) Label generation method and device, server and storage medium
WO2022105229A1 (en) Input method and apparatus, and apparatus for inputting

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