CN112988663A - File storage method and electronic equipment - Google Patents
File storage method and electronic equipment Download PDFInfo
- Publication number
- CN112988663A CN112988663A CN202110264774.5A CN202110264774A CN112988663A CN 112988663 A CN112988663 A CN 112988663A CN 202110264774 A CN202110264774 A CN 202110264774A CN 112988663 A CN112988663 A CN 112988663A
- Authority
- CN
- China
- Prior art keywords
- file
- target
- folder
- input
- characteristic information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 230000004044 response Effects 0.000 claims description 28
- 230000006870 function Effects 0.000 abstract description 9
- 238000005192 partition Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 6
- 238000012544 monitoring process Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 238000013459 approach Methods 0.000 description 2
- 238000004140 cleaning Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000006386 memory function Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/113—Details of archiving
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/1727—Details of free space management performed by the file system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a file storage method and electronic equipment, belongs to the technical field of electronics, and aims to solve the problem that storage functions in the prior art cause repeated files to occupy larger storage space. Wherein the method comprises the following steps: when storing a target file, acquiring target characteristic information of the target file; the target characteristic information at least comprises file name information and file size information; under the condition that the target characteristic information is matched with the first characteristic information of the first file, storing a target file identifier of the target file in a target folder; the first file is stored in a first folder, and the target folder is different from the first folder; wherein the target file identification is associated with a storage path of the first file. The file storage method is applied to the electronic equipment.
Description
Technical Field
The application belongs to the technical field of electronics, and particularly relates to a file storage method and electronic equipment.
Background
Generally, the memory function of an electronic device is widely used. For example, in a social scenario, files sent by friends and the like are stored; storing the copied file in a file copying scene; in the download scenario, the downloaded file is stored.
In the process of storing the file, if the folder for storing the file comprises the file which is the same as the current file, the user can be prompted to rename or delete the file. If the same file as the current file is included in the other folders except the folder for storing the file, the user is not prompted and the file is directly stored.
As more files are stored in electronic devices, so too are duplicate files. Therefore, the storage function in the prior art causes repeated files to occupy a large storage space.
Disclosure of Invention
The embodiment of the application aims to provide a file storage method, which can solve the problem that a storage function in the prior art causes repeated files to occupy a large storage space.
In a first aspect, an embodiment of the present application provides a file storage method, where the method includes: when storing a target file, acquiring target characteristic information of the target file; the target characteristic information at least comprises file name information and file size information; under the condition that the target characteristic information is matched with the first characteristic information of the first file, storing a target file identifier of the target file in a target folder; the first file is stored in a first folder, and the target folder is different from the first folder; wherein the target file identification is associated with a storage path of the first file.
In a second aspect, an embodiment of the present application provides a file storage apparatus, including: the acquisition module is used for acquiring target characteristic information of a target file when the target file is stored; the target characteristic information at least comprises file name information and file size information; the storage module is used for storing the target file identifier of the target file in a target folder under the condition that the target characteristic information is matched with the first characteristic information of the first file; the first file is stored in a first folder, and the target folder is different from the first folder; wherein the target file identification is associated with a storage path of the first file.
In a third aspect, embodiments of the present application provide an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, where the program or instructions, when executed by the processor, 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, embodiments of the present application provide 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 this way, in the embodiment of the present application, when the electronic device stores the target file, first, target feature information such as file name information and file size information of the target file is acquired, so as to match the acquired target feature information with feature information of a file already stored in the electronic device. And if the target characteristic information is matched with the first characteristic information of the stored first file, the electronic equipment is considered to store the first file which is the same as the target file. Further, based on the target folder currently used for storing the target file, a target file identification indicating the target file is stored in the target folder. The target file identification is a soft link file and a non-entity file, and the occupied storage space is small. When the user operates the target file identifier, the target file identifier is associated with the storage path of the first file successfully matched with the target file identifier, so that the first file can be opened based on the associated storage path of the first file, and the first file can be displayed as the target file. Therefore, when the electronic device stores files, the electronic device can span different folders to detect whether the files are repeated, and only one file identifier occupying a small space is stored under the condition that the files are detected to be repeated, so that the same files are prevented from being repeatedly stored, and the repeated files are prevented from occupying a large storage space.
Drawings
FIG. 1 is a flow chart of a file storage method according to an embodiment of the present application;
fig. 2 to 6 are schematic interface diagrams of an electronic device according to an embodiment of the present application;
FIG. 7 is a block diagram of a file storage device according to an embodiment of the present application;
fig. 8 is a schematic hardware configuration diagram of a file storage apparatus according to an embodiment of the present application.
Fig. 9 is a second hardware configuration diagram of the file storage apparatus according to the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
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.
The following describes the file storage method provided by the embodiment of the present application in detail through a specific embodiment and an application scenario thereof with reference to the accompanying drawings.
Fig. 1 shows a flowchart of a file storage method according to an embodiment of the present application, which is applied to an electronic device, and includes:
step S1: and when the target file is stored, acquiring target characteristic information of the target file.
The application scenarios of the embodiment are as follows: in the chat software, a user chats with friends, receives files such as pictures sent by the friends, and clicks the 'save' control, so that the files such as the pictures are stored.
The application scenario of this embodiment is as follows: in the chat software, files such as pictures sent by friends are received, and the files such as the pictures are automatically stored.
The application scenario of this embodiment is as follows: the user copies the files in the external device to the electronic device, thereby storing the copied files.
Wherein the target property information includes at least file name information and file size information.
In this step, the purpose of acquiring the target feature information of the target file is to: and comparing the target characteristic information with the characteristic information of the file stored in the electronic equipment to judge whether the file which is the same as the target file is stored in a system of the electronic equipment or not, so that the file which is the same as the target file is prevented from being stored repeatedly.
Optionally, the target property information includes file name information and file size information.
When the file name information and the file size information of the target file are completely the same as the file name information and the file size information of a certain stored file, the fact that the file which is the same as the target file is stored in the system of the electronic equipment is indicated.
Optionally, the target characteristic information may further include more characteristic information for comparison.
Optionally, the target file is any one of a picture, a document, a video, and the like.
Step S2: and storing the target file identification of the target file in the target folder under the condition that the target characteristic information is matched with the first characteristic information of the first file.
The first file is stored in a first folder, and the target folder is different from the first folder.
In this embodiment, the target characteristic information is matched with the first characteristic information of the first file, and the target characteristic information of the target file is completely consistent with the first characteristic information of the first file.
The mark in the present application is used for indicating words, symbols, images, interfaces, time and the like of information, and a control or other container can be used as a carrier for displaying information, including but not limited to a word mark, a symbol mark, an image mark.
Optionally, the target file identification is used to indicate the target file.
For example, the target file is identified as a shortcut icon for representing the target file.
Generally, the storage space of the electronic device is divided into two parts, one part is a system partition, and the user of the partition of the part can not write and only read, so that the problem of writing a duplicate file does not exist. The other part is a data (data) partition, namely a user use space, and the other part is readable and writable; the data partition management divides the data of the kernel file system management user. Therefore, the target folder and the first folder in the embodiment are both located in the data partition, and the kernel file system can monitor the event of the stored file in real time to avoid the phenomenon of writing in the duplicate file.
Further, in this step, in the case of storing the target file, the kernel file system accepts the task of creating the target file, and first inquires whether there is a duplicate file already existing: if the target file does not exist, the creation of the target file is executed, and the target file is stored; and if the target file exists, creating a shortcut icon of the target file, and storing the target file identifier.
The target file identification is a soft link file, and the target file identification is associated with the storage path of the first file.
When the user clicks the target file identifier, the first file may be opened as the target file based on the storage path of the first file.
In this way, in the embodiment of the present application, when the electronic device stores the target file, first, target feature information such as file name information and file size information of the target file is acquired, so as to match the acquired target feature information with feature information of a file already stored in the electronic device. And if the target characteristic information is matched with the first characteristic information of the stored first file, the electronic equipment is considered to store the first file which is the same as the target file. Further, based on the target folder currently used for storing the target file, a target file identification indicating the target file is stored in the target folder. The target file identification is a soft link file and a non-entity file, and the occupied storage space is small. When the user operates the target file identifier, the target file identifier is associated with the storage path of the first file successfully matched with the target file identifier, so that the first file can be opened based on the associated storage path of the first file, and the first file can be displayed as the target file. Therefore, when the electronic device stores files, the electronic device can span different folders to detect whether the files are repeated, and only one file identifier occupying a small space is stored under the condition that the files are detected to be repeated, so that the same files are prevented from being repeatedly stored, and the repeated files are prevented from occupying a large storage space.
In the flow of the file storage method according to another embodiment of the present application, after step S1, the method further includes:
step A1: and under the condition that the target characteristic information is matched with the first characteristic information of the first file, outputting a target prompt message.
The target prompting message is used for prompting that the target characteristic information is matched with the first characteristic information of the first file.
In this embodiment, the output target prompting message is delivered to the application layer, and the application layer delivers the target prompting message to the user.
Optionally, if the delivery is made to the user for the first time, the user is actively entering the function guide interface for setting.
Alternatively, the user may set in advance.
Referring to fig. 2, optionally, the setting scenario of the present embodiment is that, in the setting interface, the user may select any one of the first two manners in the illustration.
Referring to fig. 3, in the first manner shown in fig. 2, a target hint message is notified to the user by a notification bar in the form of a notification message.
Referring to fig. 4, in the second mode shown in fig. 2, the target alert message is notified to the user by a pop-up window in the form of an alert message.
Referring to fig. 3 and 4, the control in which the target prompt message is located further includes a first control and a second control. The first control is an option control such as "reserve", "allow", and the like, and the second control is an option control such as "delete", "block", and the like.
Step A2: a first input to a first control in a target alert message is received.
The first input comprises touch input performed by a user on a screen, and is not limited to input of clicking, sliding, dragging and the like; the first input may also be a first operation, where the first operation includes a blank operation of the user, and is not limited to a gesture action operation, a face action operation, and the like, and the first operation also includes an operation of a physical key on the device, and is not limited to a press operation and the like. Furthermore, the first input includes one or more inputs, wherein the plurality of inputs may be continuous or intermittent.
Application scenarios such as, user clicking on the "keep" option control; as another example, the user clicks on the "allow" options control.
Step A3: in response to a first input, a target file is stored in a target folder.
In this step, the target file may be stored in the target folder based on the user's selection.
Optionally, the target file stored in this step is an entity file.
Optionally, based on the user's settings, this step may also store the target file identification, which is a soft-link file.
Or,
step A4: a second input to a second control in the target alert message is received.
The second input comprises touch input performed by a user on the screen, and is not limited to input of clicking, sliding, dragging and the like; the second input may also be a second operation, the first operation includes a blank operation of the user and is not limited to a gesture action operation, a face action operation and the like, and the second operation also includes an operation of the user on an entity key on the device and is not limited to a press operation and the like. Also, the second input includes one or more inputs, wherein the plurality of inputs may be continuous or intermittent.
An application scenario is that the user clicks a "delete" option control; as another example, the user clicks on the "block" option control.
Step A5: in response to the second input, terminating storing the target file in the target folder.
In this step, based on the user's selection, the storage of the target file in the target folder is terminated, i.e., the target file is not created in the target folder, and at the same time, the target file identification is not created.
Further, the user may find a first file in the first folder that duplicates the target file.
In this embodiment, the user may perform a preset setting, so that the user selects to store or terminate the storage when the duplicate file is stored, which not only prevents the electronic device from automatically storing a large number of duplicate files, saves the user space, but also meets the personalized requirements of the user.
In the flow of the file storage method according to another embodiment of the present application, before step S2, the user may select the fourth mode in the interface shown in fig. 2.
In the fourth approach shown in fig. 2, the target hint message need not be output, but rather the file identification is stored directly.
In this embodiment, the target file identifier is stored in the target folder, so that the target file can be seen in two positions, namely the new directory (target folder) and the old directory (first folder), without occupying the user space.
In the flow of the file storage method according to another embodiment of the present application, after step S1, the method further includes:
step B1: in the case where the target characteristic information matches the first characteristic information of the first file, the storage of the target file in the target folder is terminated.
Prior to this step, the user may select the third way in the interface shown in fig. 2.
In the third approach shown in fig. 2, the target-prompting message does not need to be output, but the storage of the target file is terminated directly.
In this embodiment, in order to avoid the storage space of the device being occupied by the repeated files, the operation of storing the target file and the related content may also be terminated directly based on the setting of the user.
In a file storage method according to another embodiment of the present application, the target folder is a preset folder.
Considering that monitoring the whole data partition may disturb the user due to frequent homonymous file reminding, the user may actually recommend monitoring to the user aiming at the high-frequency folders in which the repeated files appear, and the user sets which folders to monitor.
Referring to fig. 5, a setting scenario is that, in a setting interface, a "folder" control is operated, so that a setting interface of a folder is displayed, and in the setting interface of the folder, a target folder is selected as a preset folder.
For example, the target folder is a folder in a file storage directory corresponding to the social software. As another example, the target folder is an album folder.
In this way, the electronic device monitors only the folders preset by the user. Specifically, when a file is being stored in a preset folder, whether a duplicate file exists is judged based on other files of the data partition.
In addition, when the target folder comprises a plurality of subfolders, whether repeated files exist can be judged based on files in other subfolders in the target folder when any subfolder stores the files, and therefore the matching range can be reduced.
And/or;
the target folder and the first folder are both preset folders.
Referring to fig. 5, a setting scenario is that, in a setting interface, a "folder" control is operated, so that a setting interface of a folder is displayed, and in the setting interface of the folder, a target folder and a first folder are selected as preset folders.
For example, the target folder is a certain folder in a file storage directory corresponding to the social software, and the first folder is an album folder.
In this way, the electronic device monitors only the folders preset by the user. Specifically, when a file is being stored in a preset folder, it is determined whether there is a duplicate file based on all files in the preset folder.
Meanwhile, the folders used for matching and comparing are not all data partitions, the probability of file repetition can be reduced, and the frequency of disturbing a user due to file repetition is further reduced.
And/or;
the target folder is located under a file storage directory corresponding to a preset application program.
Considering that monitoring the whole data partition may disturb the user due to frequent homonym file reminding, the high-frequency application program appearing in the repeated file can be recommended to the user for monitoring, and the user can set which application programs to monitor.
Referring to fig. 5, a setting scenario is that, in a setting interface, an "application list" control is operated, so that the setting interface of the application list is displayed, and in the setting interface of the application list, at least one application program is selected as a preset application program, so that the preset application program includes a target folder.
Therefore, the electronic equipment only monitors the folders in the file storage directory corresponding to the application program preset by the user. Specifically, when a folder in a file storage directory corresponding to a preset application program is storing a file, whether a duplicate file exists is judged based on other files of the data partition.
In addition, when a plurality of folders exist in the file storage directory corresponding to the preset application program, and when any folder stores a file, whether a duplicate file exists or not can be judged based on files in other folders in the file storage directory corresponding to the preset application program, so that the matching range can be reduced.
And/or:
the target folder and the first folder are both located under a file storage directory corresponding to a preset application program.
Referring to fig. 5, a setting scenario is that, in a setting interface, an "application list" control is operated, so that the setting interface of the application list is displayed, and in the setting interface of the application list, at least one application program is selected as a preset application program, so that the preset application program includes a target folder and a first folder.
Therefore, the electronic equipment only monitors the folders in the file storage directory corresponding to the application program preset by the user. Specifically, when a folder in a file storage directory corresponding to a preset application program is storing a file, whether a duplicate file exists is determined based on files in all folders in the file storage directory corresponding to the preset application program.
Meanwhile, the folders used for matching and comparing are not all data partitions, the probability of file repetition can be reduced, and the frequency of disturbing a user due to file repetition is further reduced.
And/or;
the target file and the first file both belong to a preset file type.
Monitoring is carried out aiming at some or several files, such as: doc, excel, mov, jpg, png, pdf, etc.
Referring to fig. 5, a setting scenario is that, in a setting interface, a "file type" control is operated, so that a setting interface of a file type is displayed, and in the setting interface of the file type, at least one file type is selected as a preset file type, so that the target file and the first file are both preset file types.
In this way, the electronic device only monitors the file types preset by the user. Specifically, when the electronic equipment is storing files of a preset file type, whether repeated files exist is judged based on files of the same type of the data partition.
And/or;
the target file and the first file both satisfy a preset file size.
In general, there are many small files in an electronic device, but the consumption of the used space is not large, and a user can set the stored files to exceed a certain size for processing, such as: the stored file is larger than 10 MB.
Referring to fig. 5, in a setting scenario, for example, in a setting interface, a "file size" control is operated, so that a setting interface of the file size is displayed, and in the setting interface of the file size, for example, 10MB is selected as a preset file size, so that both the target file and the first file meet the preset file size.
In this way, the electronic device monitors only files that satisfy the file size preset by the user. Specifically, when the electronic equipment is storing a file, and the file is larger than the preset file size, whether a duplicate file exists is judged based on the files of the same type of the data partition.
In summary, in the embodiment, various settings may be mutually overlapped to achieve the monitoring effect expected by the user, so that not only the usage space of the user is prevented from being occupied by the repeated files, but also the influence on the user caused by frequent storage of the repeated files is avoided, and the personalized requirements of the user are met.
In the flow of the file storage method according to another embodiment of the present application, after step S2, the method further includes:
step C1: a third input is received identifying the target file.
The third input comprises touch input performed by a user on the screen, and is not limited to input of clicking, sliding, dragging and the like; the third input may also be a third operation, where the third operation includes a blank operation of the user, and is not limited to a gesture action operation, a face action operation, and the like, and the third operation also includes an operation of the user on an entity key on the device, and is not limited to a press operation and the like. Also, the third input includes one or more inputs, wherein the plurality of inputs may be continuous or intermittent.
And the application scene is that the user clicks the identification of the target file to enter the display interface of the target file.
Step C2: and responding to the third input, determining the file content of the first file as the file content of the target file, and displaying the file content of the target file.
In this step, the first file is acquired through the storage path of the first file based on the association of the target file identifier and the storage path of the first file, so that the file content of the first file is displayed as the file content of the target file.
Step C3: a fourth input is received for the file content of the target file.
Wherein the fourth input is for updating the file content of the target file.
The fourth input comprises touch input performed by a user on the screen, and is not limited to input of clicking, sliding, dragging and the like; the fourth input may also be a fourth operation, where the fourth operation includes a blank operation of the user, and is not limited to a gesture action operation, a face action operation, and the like, and the fourth operation also includes an operation of the user on an entity key on the device, and is not limited to a press operation and the like. Further, the fourth input includes one or more inputs, wherein the plurality of inputs may be continuous or intermittent.
Application scenarios are e.g. a user editing the content of a file.
Step C4: and in response to a fourth input, storing the target file after the file content is updated in the target folder.
Since the target file identifier is one of the soft-link files of the first file, if the user needs to edit the file content in the target file, the target file may be stored after editing, instead of storing the target file identifier. That is, the target folder stores one entity file.
Alternatively, the user may operate the "file editing" control in the setting interface shown in fig. 5, so as to display the setting interface for file editing, and set the editing rule in the setting interface for file editing, so that this embodiment is implemented. For example, when a user needs to edit the content in the soft link file, a copy of the entity file is first copied.
In this embodiment, in order to avoid the usage space of the user occupied by the repeated files, the repeated files may be stored in the form of file identifiers. When the user needs to perform operations such as editing on the file indicated by the file identifier, in order to avoid editing the original file together, an entity file can be stored again for the edited file, and the file is not a duplicate file any more. In this way, the stored original file and the duplicate file have independence, respectively, so that operability of each file can be ensured.
In a flow of a file storage method according to another embodiment of the present application, in a case where a first file is stored in a first folder, the method further includes:
step D1: a fifth input is received for the first file.
The fifth input comprises touch input performed by a user on the screen, and is not limited to input of clicking, sliding, dragging and the like; the fifth input may also be a fifth operation, where the fifth operation includes a blank operation of the user, and is not limited to a gesture action operation, a face action operation, and the like, and the fifth operation also includes an operation of the user on an entity key on the device, and is not limited to a press operation and the like. Moreover, the fifth input includes one or more inputs, wherein the plurality of inputs may be continuous or intermittent.
An application scenario is that a user edits the file content of the first file; in another example, the user deletes the first file.
Step D2: in response to a fifth input, hiding the first file in the first folder if the storage path of the first file is associated with the at least one file identification.
When a user operates the first file, the storage path of the first file is associated with at least one file identifier, so that the first file is used as an original file and cannot be directly edited and deleted, and a copy is reserved as the original file and is hidden in the first folder.
In this way, when the file identifier associated with the first file is operated, the content of the file indicated by the file identifier can be displayed based on the first file hidden in the first folder.
Optionally, the user may operate the "file editing" and "file deleting" controls in the setting interface shown in fig. 5, so as to correspondingly display the setting interface for file editing and file deleting, and set the editing rule and the deleting rule in different interfaces, so that this embodiment is implemented.
Further, based on the setting of the rule, the method can also realize that if the current file is an entity file and is not associated with a soft link file, the current file is directly deleted; if the current file is an entity file and is associated with a soft link file, hiding the file and not really deleting the file; if the current file is a soft link file but the corresponding entity file is not deleted, only deleting the soft link file; and if the current file is a soft link file, but the corresponding entity file has the deleted operation, deleting the soft link file and the corresponding entity file.
In addition, based on the setting of the rule, when the user performs an operation such as editing on the first file (i.e., the original file), the first file is first hidden, the edited content is updated, and the edited file is stored. Wherein the edited file is defined as a second file for distinction.
Referring to fig. 6, optionally, when a user deletes or edits an entity file, the user may be prompted which soft-linked files the current file is associated with so that the user can know how many applications of a file wish to manipulate it, and thus understand the role of the file.
In this embodiment, when the original file is operated, a copy of the original file before being operated needs to be retained. Therefore, when the user operates the soft link file associated with the original file, the soft link file can be ensured to be normally opened.
In the file storage method according to another embodiment of the present application, when storing a target file, if a user renames a duplicate file based on a prompt for duplicate storage or the user initiatively renames the duplicate file, the user is considered to wish to store a new file, and thus an entity file with a new name is selected by default to be stored.
Optionally, the user may operate the "file renaming" control in the setting interface shown in fig. 5, so as to display the setting interface for renaming the file, and set the processing rule for renaming the file in the setting interface for renaming the file, so that this embodiment is implemented.
In the embodiment, based on the operation of renaming the duplicate file by the user, the file with the new name is stored in consideration of the fact that the user needs to store the file, so that the user requirement is met.
In the file storage method according to another embodiment of the present application, when the user copies a file, the user may select to copy the entity file or copy the soft link file.
Alternatively, the user may operate the "file copy" control in the setting interface shown in fig. 5, so as to display the setting interface of the file copy, and set the processing rule for the copied file in the setting interface of the file copy, so that this embodiment is implemented. Wherein the user can choose to either copy the entity file or copy the soft-link file.
For example, when the copy file is a duplicate file, either of the corresponding entity file or the soft link file may be copied based on the setting of the user.
Alternatively, after the user completes the setup shown in fig. 2, the user may jump to the setup interface shown in fig. 5, and the user completes a series of setups.
In summary, in the embodiments of the present application, in view of the shortcomings of the background art, the present application can avoid the duplicate storage of the same file, save the usage space of the user, avoid the pain of the user in subsequently cleaning the file, and the user does not need to worry about the file being mistaken. In addition, the method and the device do not increase any cost, avoid frequent writing of repeated data by the application, and monitor the data writing amount of the application.
It should be noted that, in the file storage method provided in the embodiment of the present application, the execution main body may be a file storage device, or a control module in the file storage device for executing the file storage method. In the embodiment of the present application, a file storage device executing a file storage method is taken as an example, and a file storage device of the file storage method provided in the embodiment of the present application is described.
FIG. 7 shows a block diagram of a file storage device of another embodiment of the present application, including:
the acquiring module 10 is configured to acquire target feature information of a target file when the target file is stored; the target characteristic information at least comprises file name information and file size information;
the storage module 20 is configured to store a target file identifier of the target file in the target folder if the target feature information matches the first feature information of the first file; the first file is stored in a first folder, and the target folder is different from the first folder;
wherein the target file identification is associated with a storage path of the first file.
In this way, in the embodiment of the present application, when the electronic device stores the target file, first, target feature information such as file name information and file size information of the target file is acquired, so as to match the acquired target feature information with feature information of a file already stored in the electronic device. And if the target characteristic information is matched with the first characteristic information of the stored first file, the electronic equipment is considered to store the first file which is the same as the target file. Further, based on the target folder currently used for storing the target file, a target file identification indicating the target file is stored in the target folder. The target file identification is a soft link file and a non-entity file, and the occupied storage space is small. When the user operates the target file identifier, the target file identifier is associated with the storage path of the first file successfully matched with the target file identifier, so that the first file can be opened based on the associated storage path of the first file, and the first file can be displayed as the target file. Therefore, when the electronic device stores files, the electronic device can span different folders to detect whether the files are repeated, and only one file identifier occupying a small space is stored under the condition that the files are detected to be repeated, so that the same files are prevented from being repeatedly stored, and the repeated files are prevented from occupying a large storage space.
Optionally, the apparatus further comprises:
the output module is used for outputting a target prompt message under the condition that the target characteristic information is matched with the first characteristic information of the first file; the target prompting message is used for prompting that the target characteristic information is matched with the first characteristic information of the first file;
the first input receiving module is used for receiving first input of a first control in the target prompt message;
a first input response module for storing the target file in the target folder in response to the first input; or,
the second input receiving module is used for receiving second input of a second control in the target prompt message;
and the second input response module is used for responding to the second input and terminating the storage of the target file in the target folder.
Optionally, the apparatus further comprises:
and the termination module is used for terminating the storage of the target file in the target folder under the condition that the target characteristic information is matched with the first characteristic information of the first file.
Optionally, the target folder is a preset folder; and/or;
the target folder and the first folder are both preset folders; and/or;
the target folder is positioned under a file storage directory corresponding to a preset application program; and/or;
the target folder and the first folder are both located under a file storage directory corresponding to a preset application program; and/or;
the target file and the first file both belong to preset file types; and/or;
the target file and the first file both satisfy a preset file size.
Optionally, the apparatus further comprises:
the third input receiving module is used for receiving third input of the target file identifier;
the third input response module is used for responding to third input, determining the file content of the first file as the file content of the target file, and displaying the file content of the target file;
the fourth input receiving module is used for receiving fourth input of the file content of the target file; the fourth input is used for updating the file content of the target file;
and the fourth input response module is used for responding to the fourth input and storing the target file with the updated file content in the target folder.
Optionally, the apparatus further comprises:
the fifth input receiving module is used for receiving fifth input of the first file;
a fifth input response module, configured to hide the first file in the first folder in response to a fifth input, in case that the storage path of the first file is associated with the at least one file identifier.
The file storage device in the embodiment of the present application may be a device, or may 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 storage 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 storage device provided in the embodiment of the present application can implement each process implemented by the above method embodiment, and is not described here again to avoid repetition.
Optionally, as shown in fig. 8, an electronic device 100 is further provided in this embodiment of the present application, and includes a processor 101, a memory 102, and a program or an instruction stored in the memory 102 and executable on the processor 101, where the program or the instruction is executed by the processor 101 to implement each process of the foregoing file storage method embodiment, and can achieve the same technical effect, and no further description is provided here to avoid repetition.
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 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.
Those skilled in the art will appreciate that the electronic device 1000 may further comprise a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 1010 through a power management system, so as to implement functions of managing charging, discharging, and power consumption 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 processor 1010 is configured to, when an object file is stored, obtain object feature information of the object file; the target characteristic information at least comprises file name information and file size information; a memory 1009, configured to store a target file identifier of the target file in a target folder if the target feature information matches first feature information of a first file; the first file is stored in a first folder, and the target folder is different from the first folder; wherein the target file identification is associated with a storage path of the first file.
In this way, in the embodiment of the present application, when the electronic device stores the target file, first, target feature information such as file name information and file size information of the target file is acquired, so as to match the acquired target feature information with feature information of a file already stored in the electronic device. And if the target characteristic information is matched with the first characteristic information of the stored first file, the electronic equipment is considered to store the first file which is the same as the target file. Further, based on the target folder currently used for storing the target file, a target file identification indicating the target file is stored in the target folder. The target file identification is a soft link file and a non-entity file, and the occupied storage space is small. When the user operates the target file identifier, the target file identifier is associated with the storage path of the first file successfully matched with the target file identifier, so that the first file can be opened based on the associated storage path of the first file, and the first file can be displayed as the target file. Therefore, when the electronic device stores files, the electronic device can span different folders to detect whether the files are repeated, and only one file identifier occupying a small space is stored under the condition that the files are detected to be repeated, so that the same files are prevented from being repeatedly stored, and the repeated files are prevented from occupying a large storage space.
Optionally, the processor 1010 is further configured to output a target prompt message if the target characteristic information matches the first characteristic information of the first file; the target prompting message is used for prompting that the target characteristic information is matched with first characteristic information of a first file; a user input unit 1007, configured to receive a first input to a first control in the target prompt message; a memory 1009 for storing the target file in the target folder in response to the first input; a user input unit 1007, further configured to receive a second input to a second control in the target prompt message; a processor 1010 further configured to terminate storing the target file in the target folder in response to the second input.
Optionally, the processor 1010 is further configured to terminate storing the target file in the target folder if the target characteristic information matches the first characteristic information of the first file.
Optionally, the target folder is a preset folder; and/or; the target folder and the first folder are both preset folders; and/or; the target folder is positioned under a file storage directory corresponding to a preset application program; and/or; the target folder and the first folder are both located under a file storage directory corresponding to a preset application program; and/or; the target file and the first file both belong to preset file types; and/or; the target file and the first file both meet a preset file size.
Optionally, the user input unit 1007 is further configured to receive a third input for the target file identifier; the processor 1010 is further configured to determine, in response to the third input, that the file content of the first file is the file content of the target file, and display the file content of the target file; a user input unit 1007, further configured to receive a fourth input for the file content of the target file; the fourth input is used for updating the file content of the target file; a memory 1009 is further configured to store the target file after updating the file content in the target folder in response to the fourth input.
Optionally, in a case where the first file is stored in a first folder, the user input unit 1007 is further configured to receive a fifth input for the first file; a processor 1010, further responsive to the fifth input, for hiding the first file in the first folder if the storage path of the first file is associated with at least one file identification.
In summary, in the embodiments of the present application, in view of the shortcomings of the background art, the present application can avoid the duplicate storage of the same file, save the usage space of the user, avoid the pain of the user in subsequently cleaning the file, and the user does not need to worry about the file being mistaken. In addition, the method and the device do not increase any cost, avoid frequent writing of repeated data by the application, and monitor the data writing amount of the application.
It should be understood that in the embodiment of the present application, the input Unit 1004 may include a Graphics Processing Unit (GPU) 10041 and a microphone 10042, and the Graphics Processing Unit 10041 processes image data of still pictures or videos obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 may include two parts, a touch detection device and a touch controller. Other input devices 10072 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. The memory 1009 may be used to store software programs as well as various data, including but not limited to application programs and operating systems. Processor 1010 may integrate an application processor that handles primarily operating systems, user interfaces, applications, etc. and a modem processor that handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1010.
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 file storage 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 the like.
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 execute a program or an instruction to implement each process of the above file storage method embodiment, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
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 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, an air conditioner, 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 method of file storage, the method comprising:
when storing a target file, acquiring target characteristic information of the target file; the target characteristic information at least comprises file name information and file size information;
under the condition that the target characteristic information is matched with the first characteristic information of the first file, storing a target file identifier of the target file in a target folder; the first file is stored in a first folder, and the target folder is different from the first folder;
wherein the target file identification is associated with a storage path of the first file.
2. The method according to claim 1, wherein after obtaining the target feature information of the target file, the method further comprises:
under the condition that the target characteristic information is matched with the first characteristic information of the first file, outputting a target prompt message; the target prompting message is used for prompting that the target characteristic information is matched with first characteristic information of a first file;
receiving a first input to a first control in the target prompt message;
storing the target file in the target folder in response to the first input; or,
receiving a second input to a second control in the target alert message;
terminating storing the target file in the target folder in response to the second input.
3. The method of claim 1, wherein the target folder is a preset folder; and/or;
the target folder and the first folder are both preset folders; and/or;
the target folder is positioned under a file storage directory corresponding to a preset application program; and/or;
the target folder and the first folder are both located under a file storage directory corresponding to a preset application program; and/or;
the target file and the first file both belong to preset file types; and/or;
the target file and the first file both meet a preset file size.
4. The method of claim 1, wherein after storing the target file identification of the target file in the target folder, further comprising:
receiving a third input to the target file identification;
responding to the third input, determining that the file content of the first file is the file content of the target file, and displaying the file content of the target file;
receiving a fourth input to the file content of the target file; the fourth input is used for updating the file content of the target file;
in response to the fourth input, storing the target file after updating the file content in the target folder.
5. The method of claim 1, wherein in the case where the first file is stored in a first folder, further comprising:
receiving a fifth input to the first file;
in response to the fifth input, hiding the first file in the first folder if the storage path of the first file is associated with at least one file identification.
6. A file storage apparatus, the apparatus comprising:
the acquisition module is used for acquiring target characteristic information of a target file when the target file is stored; the target characteristic information at least comprises file name information and file size information;
the storage module is used for storing the target file identifier of the target file in a target folder under the condition that the target characteristic information is matched with the first characteristic information of the first file; the first file is stored in a first folder, and the target folder is different from the first folder;
wherein the target file identification is associated with a storage path of the first file.
7. The apparatus of claim 6, further comprising:
the output module is used for outputting a target prompt message under the condition that the target characteristic information is matched with the first characteristic information of the first file; the target prompting message is used for prompting that the target characteristic information is matched with first characteristic information of a first file;
the first input receiving module is used for receiving first input of a first control in the target prompt message;
a first input response module for storing the target file in the target folder in response to the first input; or,
the second input receiving module is used for receiving second input of a second control in the target prompt message;
a second input response module to terminate storing the target file in the target folder in response to the second input.
8. The apparatus of claim 6, wherein the target folder is a preset folder; and/or;
the target folder and the first folder are both preset folders; and/or;
the target folder is positioned under a file storage directory corresponding to a preset application program; and/or;
the target folder and the first folder are both located under a file storage directory corresponding to a preset application program; and/or;
the target file and the first file both belong to preset file types; and/or;
the target file and the first file both meet a preset file size.
9. The apparatus of claim 6, further comprising:
the third input receiving module is used for receiving third input of the target file identifier;
a third input response module, configured to determine, in response to the third input, that the file content of the first file is the file content of the target file, and display the file content of the target file;
the fourth input receiving module is used for receiving fourth input of the file content of the target file; the fourth input is used for updating the file content of the target file;
and the fourth input response module is used for responding to the fourth input and storing the target file after the file content is updated in the target folder.
10. The apparatus of claim 6, further comprising:
a fifth input receiving module, configured to receive a fifth input to the first file;
a fifth input response module, configured to hide the first file in the first folder in response to the fifth input, if a storage path of the first file is associated with at least one file identifier.
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 storage method of any of claims 1-5.
12. A readable storage medium, on which a program or instructions are stored, which, when executed by the processor, implement the steps of the file storage method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110264774.5A CN112988663A (en) | 2021-03-11 | 2021-03-11 | File storage method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110264774.5A CN112988663A (en) | 2021-03-11 | 2021-03-11 | File storage method and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112988663A true CN112988663A (en) | 2021-06-18 |
Family
ID=76335017
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110264774.5A Pending CN112988663A (en) | 2021-03-11 | 2021-03-11 | File storage method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112988663A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113590532A (en) * | 2021-07-30 | 2021-11-02 | 维沃移动通信(杭州)有限公司 | File processing method and device, electronic equipment and readable storage medium |
CN115002537A (en) * | 2021-12-23 | 2022-09-02 | 荣耀终端有限公司 | Video sharing method, electronic device, storage medium, and program product |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006107375A (en) * | 2004-10-08 | 2006-04-20 | Canon Inc | System and method for document management, program, and storage medium |
CN103077214A (en) * | 2012-12-28 | 2013-05-01 | 华为技术有限公司 | File storage method and device |
CN103841170A (en) * | 2012-11-27 | 2014-06-04 | 联想(北京)有限公司 | Cloud storage method and server |
CN104268092A (en) * | 2014-09-19 | 2015-01-07 | 深圳市心讯网络科技有限公司 | File storage system and file storage method |
CN109324998A (en) * | 2018-09-18 | 2019-02-12 | 郑州云海信息技术有限公司 | A kind of document handling method, apparatus and system |
CN110287145A (en) * | 2019-06-19 | 2019-09-27 | 深圳龙图腾创新设计有限公司 | A kind of instant inspection method of file, device, computer equipment and storage medium |
CN110888842A (en) * | 2019-12-02 | 2020-03-17 | 中国银行股份有限公司 | File storage method, file query method, file storage device, file query device and file query equipment |
CN112003893A (en) * | 2020-07-17 | 2020-11-27 | 北京达佳互联信息技术有限公司 | Resource downloading method and device |
-
2021
- 2021-03-11 CN CN202110264774.5A patent/CN112988663A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006107375A (en) * | 2004-10-08 | 2006-04-20 | Canon Inc | System and method for document management, program, and storage medium |
CN103841170A (en) * | 2012-11-27 | 2014-06-04 | 联想(北京)有限公司 | Cloud storage method and server |
CN103077214A (en) * | 2012-12-28 | 2013-05-01 | 华为技术有限公司 | File storage method and device |
CN104268092A (en) * | 2014-09-19 | 2015-01-07 | 深圳市心讯网络科技有限公司 | File storage system and file storage method |
CN109324998A (en) * | 2018-09-18 | 2019-02-12 | 郑州云海信息技术有限公司 | A kind of document handling method, apparatus and system |
CN110287145A (en) * | 2019-06-19 | 2019-09-27 | 深圳龙图腾创新设计有限公司 | A kind of instant inspection method of file, device, computer equipment and storage medium |
CN110888842A (en) * | 2019-12-02 | 2020-03-17 | 中国银行股份有限公司 | File storage method, file query method, file storage device, file query device and file query equipment |
CN112003893A (en) * | 2020-07-17 | 2020-11-27 | 北京达佳互联信息技术有限公司 | Resource downloading method and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113590532A (en) * | 2021-07-30 | 2021-11-02 | 维沃移动通信(杭州)有限公司 | File processing method and device, electronic equipment and readable storage medium |
CN115002537A (en) * | 2021-12-23 | 2022-09-02 | 荣耀终端有限公司 | Video sharing method, electronic device, storage medium, and program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA2742110C (en) | Isolating received information on a locked device | |
CN103823813B (en) | Electric terminal historical operation records processing method and processing device | |
WO2022194004A1 (en) | Application icon arrangement method and apparatus, and electronic device | |
CN107408242B (en) | Providing interactive previews of content within communications | |
CN113835580A (en) | Application icon display method and device, electronic equipment and storage medium | |
CN112948844B (en) | Control method and device and electronic equipment | |
CN113849092A (en) | Content sharing method and device and electronic equipment | |
CN112765104A (en) | File saving method, device, equipment and storage medium | |
CN105426049B (en) | A kind of delet method and terminal | |
CN112988663A (en) | File storage method and electronic equipment | |
CN112925456A (en) | Display method and device and electronic equipment | |
WO2023005835A1 (en) | Icon control method, apparatus, electronic device, and readable storage medium | |
CN112684963A (en) | Screenshot method and device and electronic equipment | |
CN114116098B (en) | Application icon management method and device, electronic equipment and storage medium | |
CN113282546B (en) | File processing method and device | |
CN112269523B (en) | Object editing processing method and device and electronic equipment | |
CN112698762B (en) | Icon display method and device and electronic equipment | |
CN112035026B (en) | Information display method and device, electronic equipment and storage medium | |
CN115061601A (en) | Electronic document processing method and device, terminal and storage medium | |
CN113037618B (en) | Image sharing method and device | |
WO2022242641A1 (en) | Task implementation method and apparatus, and electronic device | |
CN111796733B (en) | Image display method, image display device and electronic equipment | |
CN114443567A (en) | Multimedia file management method, device, electronic equipment and medium | |
CN114679546A (en) | Display method and device, electronic equipment and readable storage medium | |
CN113468121A (en) | Folder management method and device |
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 |