[go: up one dir, main page]

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

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

Info

Publication number
CN112036133A
CN112036133A CN202010907159.7A CN202010907159A CN112036133A CN 112036133 A CN112036133 A CN 112036133A CN 202010907159 A CN202010907159 A CN 202010907159A CN 112036133 A CN112036133 A CN 112036133A
Authority
CN
China
Prior art keywords
file
editing operation
saving
original file
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010907159.7A
Other languages
Chinese (zh)
Other versions
CN112036133B (en
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Baoqu Technology Co Ltd
Original Assignee
Zhuhai Baoqu 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 Zhuhai Baoqu Technology Co Ltd filed Critical Zhuhai Baoqu Technology Co Ltd
Priority to CN202010907159.7A priority Critical patent/CN112036133B/en
Publication of CN112036133A publication Critical patent/CN112036133A/en
Application granted granted Critical
Publication of CN112036133B publication Critical patent/CN112036133B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a file saving method and device, electronic equipment and a storage medium, relates to the technical field of computers, and can effectively improve the saving efficiency of files. The method comprises the following steps: responding to a file saving instruction, and acquiring editing operation of an original file; determining a storage mode corresponding to the editing operation according to the editing operation; and updating and saving the original file based on the determined saving mode. The invention can be used for file saving.

Description

File saving method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a file saving method and apparatus, an electronic device, and a storage medium.
Background
After the file is edited, the file on the storage medium needs to be updated through a file saving operation. A common way of saving a file is to rewrite the entire file on a storage medium, however, when the file is large, rewriting the file takes tens of seconds or even longer, and the operation efficiency is low.
In order to solve the problem, there is also a file incremental saving method, that is, modified contents of a file are additionally recorded on the basis of keeping the original file contents unchanged. However, the incremental storage method makes the file larger and larger, and is tedious and tedious, so that the effective content ratio of the file is reduced.
For files with large volumes, which way should be adopted for storage, no effective solution is available in the related technical field.
Disclosure of Invention
In view of this, embodiments of the present invention provide a file saving method and apparatus, an electronic device, and a storage medium, which can effectively improve the saving efficiency after editing a file.
In a first aspect, an embodiment of the present invention provides a file saving method, including:
responding to a file saving instruction, and acquiring editing operation of an original file;
determining a storage mode corresponding to the editing operation according to the editing operation;
and updating and saving the original file based on the determined saving mode.
Optionally, before the step of obtaining the editing operation undergone by the original file in response to the file saving instruction, the method further includes:
marking the adopted editing operation when editing the file to form an operation record;
the editing operation undergone by the acquisition of the original file comprises:
and acquiring the editing operation of the original file by inquiring the operation record.
Optionally, the determining, according to the editing operation, a saving manner corresponding to the editing operation includes:
if the editing operation comprises a preset operation, determining that a storage mode corresponding to the editing operation is rewriting storage;
the updating and saving the original file based on the determined saving mode comprises the following steps: replacing the original file write-in storage address with the first file formed after the editing operation;
if the editing operation does not comprise the preset operation, determining that a storage mode corresponding to the editing operation is incremental storage;
the updating and saving the original file based on the determined saving mode comprises the following steps: reserving the content of the original file in the storage address, and adding the operation content corresponding to the editing operation to the original file to form a second file;
wherein the preset operation comprises at least one of: adding password operation, removing password operation and deleting operation.
Optionally, the determining, according to the editing operation, a storage manner corresponding to the editing operation includes:
if the editing operation comprises a preset operation, determining that a storage mode corresponding to the editing operation is rewriting storage; the updating and saving the original file based on the determined saving mode comprises the following steps: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
if the editing operation does not comprise the preset operation, determining a storage mode corresponding to the editing operation according to a comparison result of the file size of the original file and a preset threshold value; the updating and saving the original file based on the determined saving mode comprises the following steps: replacing the original file write-in storage address with the first file formed after the editing operation; or the content of the original file is reserved in the storage address, and the operation content corresponding to the editing operation is added to the original file to form a second file;
the preset operation comprises a password adding operation and/or a password removing operation.
Optionally, the determining, according to a comparison result between the file size of the original file and a preset threshold, a storage manner corresponding to the editing operation includes:
if the file size of the original file is smaller than or equal to the preset threshold, determining that the storage mode corresponding to the editing operation is rewriting storage;
and if the file size of the original file is larger than the preset threshold value, determining that the storage mode corresponding to the editing operation is incremental storage.
Optionally, the determining, according to the editing operation, a storage manner corresponding to the editing operation includes:
if the editing operation is a page deleting operation, determining that a storage mode corresponding to the editing operation is rewriting storage; the updating and saving the original file based on the determined saving mode comprises the following steps: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
if the editing operation is the operation of deleting the non-page, determining that the storage mode corresponding to the editing operation is incremental storage; the updating and saving the original file based on the determined saving mode comprises the following steps: and reserving the content of the original file in the saving address, and adding the operation content corresponding to the editing operation to the original file to form a second new file.
In a second aspect, an embodiment of the present invention further provides a file saving apparatus, including:
an acquisition unit configured to acquire an editing operation undergone by an original file in response to a file saving instruction;
a determining unit, configured to determine, according to the editing operation, a saving mode corresponding to the editing operation;
and the saving unit is used for updating and saving the original file based on the determined saving mode.
Optionally, the apparatus further includes a recording unit, configured to mark, when the file is edited, the editing operation that is used before the editing operation that the original file undergoes is acquired in response to the file saving instruction, so as to form an operation record;
the obtaining unit is specifically configured to obtain, by querying the operation record, an editing operation that the original file undergoes.
Optionally, the determining unit is specifically configured to determine, if the editing operation includes a preset operation, that a storage manner corresponding to the editing operation is rewrite storage; the saving unit is specifically configured to replace the original file with the whole first file formed after the editing operation, and write the original file into a saving address;
or
The determining unit is specifically configured to determine that a storage manner corresponding to the editing operation is incremental storage if the editing operation does not include the preset operation; the saving unit is specifically configured to save the content of the original file in the saving address, and add the operation content corresponding to the editing operation to the original file to form a second new file;
wherein the preset operation comprises at least one of: adding password operation, removing password operation and deleting operation.
Optionally, the determining unit includes a first determining module, configured to determine, if the editing operation includes a preset operation, that a storage manner corresponding to the editing operation is rewrite storage; the saving unit is specifically configured to: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
or
The determining unit comprises a second determining module, configured to determine, if the editing operation does not include a preset operation, a storage manner corresponding to the editing operation according to a comparison result between the file size of the original file and a preset threshold; the storage unit is specifically configured to: replacing the original file write-in storage address with the first file formed after the editing operation; or the content of the original file is reserved in the storage address, and the operation content corresponding to the editing operation is added to the original file to form a second file;
the preset operation comprises a password adding operation and/or a password removing operation.
Optionally, the second determining module is specifically configured to:
if the file size of the original file is smaller than or equal to the preset threshold, determining that the storage mode corresponding to the editing operation is rewriting storage;
and if the file size of the original file is larger than the preset threshold value, determining that the storage mode corresponding to the editing operation is incremental storage.
Optionally, the determining unit is specifically configured to: if the editing operation is a page deleting operation, determining that a storage mode corresponding to the editing operation is rewriting storage; the storage unit is specifically configured to: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
or
The determining unit is specifically configured to: if the editing operation is the operation of deleting the non-page, determining that the storage mode corresponding to the editing operation is incremental storage; the storage unit is specifically configured to: and reserving the content of the original file in the saving address, and adding the operation content corresponding to the editing operation to the original file to form a second new file.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing any one of the file saving methods provided by the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement any one of the file saving methods provided by the embodiments of the present invention.
According to the file saving method, the file saving device, the electronic equipment and the storage medium provided by the embodiment of the invention, after the file saving instruction is received, the editing operation of the original file can be obtained in response to the instruction, and the original file is updated and saved in different saving modes according to different editing operations. Therefore, the files can be stored in an adaptive mode according to different editing operations of the original files, and resources consumed for storing the files are minimized on the basis of ensuring the correct contents of the files, so that the file storage efficiency is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a file saving method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a file saving apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In a first aspect, embodiments of the present invention provide a file saving method, which can effectively improve saving efficiency after editing a file.
As shown in fig. 1, a file saving method provided in an embodiment of the present invention may include:
s11, responding to the file saving instruction, and acquiring the editing operation of the original file;
after the user opens the file, the user may perform various editing operations on the file, such as entering text, modifying format, adding comments, and the like. In the embodiment of the invention, when the file is saved by clicking the save button or automatically saving the system, the save operation is not directly executed, but the editing operation of the original file is acquired before the save operation is executed. That is, it is obtained what editing operation the user has performed on the file between the save this time and the save last time.
The files for which the file saving instruction is directed may include various files supporting incremental saving and overwrite saving, such as PDF files.
Alternatively, the editing operation undergone by the original file may include one or more types, wherein the number of times of execution of each editing operation may be one or more.
S12, determining a storage mode corresponding to the editing operation according to the editing operation;
in this step, different saving manners may be adopted for saving the file according to different editing operations experienced by the original file, that is, the specific saving manners of the file may be different if the same original file undergoes different editing operations, and the most favorable file saving manner may be selected for saving the file.
And S13, updating and saving the original file based on the determined saving mode.
After the storage method corresponding to the editing operation is determined, the original file can be stored by using the storage method, and the stored content can be written into the storage medium.
According to the file saving method provided by the embodiment of the invention, after the file saving instruction is received, the editing operation of the original file can be acquired in response to the instruction, the saving mode corresponding to the editing operation is determined according to the difference of the editing operation, and the original file is updated and saved by adopting different saving modes. Therefore, the files can be stored in an adaptive mode according to different editing operations of the original files, and resources consumed for storing the files are minimized on the basis of ensuring the correct contents of the files, so that the file storage efficiency is effectively improved.
Specifically, in an embodiment of the present invention, before the step S11, in response to the file saving instruction, acquiring the editing operation undergone by the original file, the file saving method provided in an embodiment of the present invention may further include: marking the adopted editing operation when editing the file to form an operation record; accordingly, the editing operation performed on the original file acquired in step S11 may specifically include: and acquiring the editing operation of the original file by inquiring the operation record.
The specific form of marking the editing operation is not limited, and various editing operations undergone by the original file may be sequentially recorded in a single file or data structure, or an operation mark may be marked on the identifier of the corresponding editing operation.
It should be noted that, in the embodiment of the present invention, it is not necessary to know the execution time and the sequence of each editing operation, nor to know the specific number of times each editing operation is executed, but only to know whether the editing operation has been executed, so that the data size is small, and the data maintenance and the query are very convenient.
After the editing operation performed on the original file is acquired, in step S12, a saving mode corresponding to the editing operation may be determined according to the editing operation.
Optionally, in the embodiment of the present invention, there are many kinds of editing operations, and how to form a corresponding relationship between the editing operation and the saving manner is to improve the file saving efficiency, and there may be a variety of solutions. For example, different saving modes may be selected depending on whether or not some specific operation is included in the editing operation.
Specifically, in an embodiment of the present invention, the step S12, according to the editing operation, determining a saving manner corresponding to the editing operation may include:
if the editing operation comprises a preset operation, determining that a storage mode corresponding to the editing operation is rewriting storage; based on this, in step S13, the updating and saving the original file based on the determined saving mode includes: under the condition that the editing operation comprises a preset operation, the original file is entirely replaced by a first new file formed after the editing operation, and the original file is written into a storage address;
if the editing operation does not comprise the preset operation, determining that a storage mode corresponding to the editing operation is incremental storage; based on this, the updating and saving the original file based on the determined saving manner in step S13 may specifically include: under the condition that the editing operation does not comprise the preset operation, reserving the content of the original file in the storage address, and adding the operation content corresponding to the editing operation to the original file to form a second new file;
wherein the preset operation comprises at least one of: adding password operation, removing password operation and deleting operation.
The operation of adding the password can mean encrypting the content of the file, and the password needs to be input when the file is reopened next time. The delete password operation may refer to decrypting the encrypted file content without entering a password the next time the file is reopened. A delete operation may refer to deleting any content in the file, such as deleting pages, text, pictures, annotations, and so forth.
That is, in this embodiment, if the editing operation that the original file undergoes includes any one or more of the operation of adding a password, the operation of removing a password, and the operation of deleting a password, a rewrite saving mode is adopted when the file is saved, and the original file is entirely replaced by the first new file formed after the editing operation and written into the saving address. If the original file does not include the operations of adding the password, removing the password and deleting the password in the editing operation, an incremental saving mode can be adopted, the content of the original file is reserved in the saving address, and the operation content corresponding to the editing operation is added to the original file to form a second new file.
The rewriting storage mode can recode the content of the file so as to realize the password adding operation or the password removing operation, and after the file is deleted, the content of the file is relatively reduced, so that the workload of rewriting storage is reduced.
Except for password adding operation, password releasing operation and deleting operation, the file can be saved in an incremental saving mode after other editing operations. The incremental storage mode is only to attach the newly added change after the original file content, and the incremental storage speed is higher because the newly added storage content is usually smaller.
In the above embodiment, the preset operation includes a password adding operation, a password releasing operation, and a deleting operation. Embodiments of the present invention are not limited thereto, and in other embodiments of the present invention, the preset operation may include more or less editing operations.
For example, in an embodiment of the present invention, the determining, according to the editing operation in step S12, a saving manner corresponding to the editing operation may include:
if the editing operation comprises a preset operation, determining that a storage mode corresponding to the editing operation is rewriting storage; based on this, the updating and saving the original file based on the determined saving manner in step S13 may include: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
if the editing operation does not comprise the preset operation, determining a storage mode corresponding to the editing operation according to a comparison result of the file size of the original file and a preset threshold value; based on this, the updating and saving the original file based on the determined saving manner in step S13 may include: replacing the original file write-in storage address with the first file formed after the editing operation; or the content of the original file is reserved in the storage address, and the operation content corresponding to the editing operation is added to the original file to form a second file;
the preset operation comprises a password adding operation and/or a password removing operation.
That is to say, in this embodiment, the preset operation only includes a password adding operation and/or a password removing operation, if the editing operation that the original file undergoes includes the password adding operation and/or the password removing operation, the file is saved in a rewriting saving manner, and if the editing operation that the original file undergoes does not include the password adding operation and/or the password removing operation, what saving manner to take may be further determined according to the size of the file.
Specifically, in an embodiment of the present invention, determining, according to a comparison result between the file size of the original file and a preset threshold, a saving manner corresponding to the editing operation may specifically include:
if the file size of the original file is smaller than or equal to the preset threshold, determining that the storage mode corresponding to the editing operation is rewriting storage;
and if the file size of the original file is larger than the preset threshold value, determining that the storage mode corresponding to the editing operation is incremental storage.
That is, if the original file size is smaller than or equal to the preset threshold, the file data size is small, and it does not take too long to save the file by rewriting once. If the file size of the original file is larger than the preset threshold value, the file data volume is large, and when rewriting is more costly, an incremental storage mode can be selected for file storage, so that the file content is ensured to be correct, meanwhile, the balance is carried out between the file size and the time spent in file storage, and the file storage efficiency is effectively improved.
In the above embodiments, when selecting the file saving mode, it is detected whether the editing operation performed on the original file includes a preset operation, but the embodiments of the present invention are not limited thereto. In other embodiments of the present invention, different manners of saving may be performed according to whether the editing operation is one of the operations.
For example, in an embodiment of the present invention, the determining, according to the editing operation in step S12, a saving manner corresponding to the editing operation may specifically include:
if the editing operation is a page deleting operation, determining that a storage mode corresponding to the editing operation is rewriting storage; based on this, the updating and saving the original file based on the determined saving mode in step S13 includes: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
if the editing operation is the operation of deleting the non-page, determining that the storage mode corresponding to the editing operation is incremental storage; based on this, the updating and saving the original file based on the determined saving mode in step S13 includes: and reserving the content of the original file in the saving address, and adding the operation content corresponding to the editing operation to the original file to form a second new file.
In this embodiment, if the editing operation only includes a page deletion operation, the file content of the original file is greatly reduced after the page is deleted, so that a large amount of storage space is saved, and therefore, the file can be saved in a rewriting saving manner. On the contrary, if the editing operation only includes the operation of deleting the non-page, the operation of deleting the non-page only can reduce the file content of the original file by a small amount, and the saved storage space is limited, so that the file can be saved in an incremental saving mode, so as to save more file saving time.
Of course, in other embodiments of the present invention, resources such as time and space consumed for saving a file may be balanced according to various factors such as the size of the file and the editing operation, for example, a product of a space saving rate and a time saving rate may be used as an index to select a file saving mode with the highest efficiency.
Correspondingly, in a second aspect, an embodiment of the present invention further provides a file saving device, which can effectively improve the saving efficiency after editing a file.
As shown in fig. 2, an embodiment of the present invention provides a file saving apparatus, which may include:
an acquisition unit 31 configured to acquire an editing operation undergone by an original file in response to a file saving instruction;
a determining unit 32 configured to determine, according to the editing operation, a saving mode corresponding to the editing operation;
and a saving unit 33, configured to update and save the original file based on the determined saving manner.
According to the file saving device provided by the embodiment of the invention, after the file saving instruction is received, the editing operation of the original file can be acquired in response to the instruction, the saving mode corresponding to the editing operation is determined according to the difference of the editing operation, and the original file is updated and saved by adopting different saving modes. Therefore, the files can be stored in an adaptive mode according to different editing operations of the original files, and resources consumed for storing the files are minimized on the basis of ensuring the correct contents of the files, so that the file storage efficiency is effectively improved.
Optionally, the file saving apparatus may further include a recording unit, configured to mark, when the file is edited, the adopted editing operation before the editing operation undergone by the original file is acquired in response to the file saving instruction, so as to form an operation record;
accordingly, the obtaining unit 31 may be specifically configured to obtain, by querying the operation record, an editing operation that the original file undergoes.
Optionally, the determining unit 32 is specifically configured to determine, if the editing operation includes a preset operation, that the storage mode corresponding to the editing operation is rewrite storage; a saving unit 33, configured to write a saving address in which the original file is replaced with the entire first file formed after the editing operation;
or
A determining unit 32, configured to determine, if the editing operation does not include the preset operation, that a storage manner corresponding to the editing operation is incremental storage; a saving unit 33, configured to specifically reserve the content of the original file in the saving address, and add the operation content corresponding to the editing operation to the original file to form a second new file;
wherein the preset operation comprises at least one of: adding password operation, removing password operation and deleting operation.
Optionally, the determining unit 32 includes a first determining module, configured to determine, if the editing operation includes a preset operation, that the storage mode corresponding to the editing operation is rewrite storage; the saving unit 33 is specifically configured to: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
or
The determining unit 32 includes a second determining module, configured to determine, if the editing operation does not include a preset operation, a storage manner corresponding to the editing operation according to a comparison result between the file size of the original file and a preset threshold; the saving unit 33 is specifically configured to: replacing the original file write-in storage address with the first file formed after the editing operation; or the content of the original file is reserved in the storage address, and the operation content corresponding to the editing operation is added to the original file to form a second file;
the preset operation comprises a password adding operation and/or a password removing operation.
Optionally, the second determining module is specifically configured to:
if the file size of the original file is smaller than or equal to the preset threshold, determining that the storage mode corresponding to the editing operation is rewriting storage;
and if the file size of the original file is larger than the preset threshold value, determining that the storage mode corresponding to the editing operation is incremental storage.
Optionally, the determining unit 32 is specifically configured to: if the editing operation is a page deleting operation, determining that a storage mode corresponding to the editing operation is rewriting storage; the saving unit 33 is specifically configured to: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
or
The determining unit 32 is specifically configured to: if the editing operation is the operation of deleting the non-page, determining that the storage mode corresponding to the editing operation is incremental storage; the saving unit 33 is specifically configured to: the updating and saving the original file based on the determined saving mode comprises the following steps: and reserving the content of the original file in the saving address, and adding the operation content corresponding to the editing operation to the original file to form a second new file.
In a third aspect, embodiments of the present invention provide an electronic device, which can effectively improve saving efficiency after editing a file.
As shown in fig. 3, an electronic device provided in an embodiment of the present invention may include: the device comprises a shell 51, a processor 52, a memory 53, a circuit board 54 and a power circuit 55, wherein the circuit board 54 is arranged inside a space enclosed by the shell 51, and the processor 52 and the memory 53 are arranged on the circuit board 54; a power supply circuit 55 for supplying power to each circuit or device of the electronic apparatus; the memory 53 is used to store executable program code; the processor 52 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 53, for executing the file saving method provided by any one of the foregoing embodiments.
For specific execution processes of the above steps by the processor 52 and further steps executed by the processor 52 by running the executable program code, reference may be made to the description of the foregoing embodiments, and details are not described herein again.
The above electronic devices exist in a variety of forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. This type of device comprises: audio, video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(5) And other electronic equipment with data interaction function.
Accordingly, in a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs can be executed by one or more processors to implement any one of the file saving methods provided in the foregoing embodiments, so that corresponding technical effects can also be achieved, which have been described in detail above and are not described herein again.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
For convenience of description, the above devices are described separately in terms of functional division into various units/modules. Of course, the functionality of the units/modules may be implemented in one or more software and/or hardware implementations of the invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A file saving method, comprising:
responding to a file saving instruction, and acquiring editing operation of an original file;
determining a storage mode corresponding to the editing operation according to the editing operation;
and updating and saving the original file based on the determined saving mode.
2. The method according to claim 1, wherein before the editing operation undergone by the original file being obtained in response to the file saving instruction, the method further comprises:
marking the adopted editing operation when editing the file to form an operation record;
the editing operation undergone by the acquisition of the original file comprises:
and acquiring the editing operation of the original file by inquiring the operation record.
3. The method according to claim 1 or 2, wherein the determining, according to the editing operation, a saving manner corresponding to the editing operation includes:
if the editing operation comprises a preset operation, determining that a storage mode corresponding to the editing operation is rewriting storage;
the updating and saving the original file based on the determined saving mode comprises the following steps: replacing the original file write-in storage address with the first file formed after the editing operation;
if the editing operation does not comprise the preset operation, determining that a storage mode corresponding to the editing operation is incremental storage;
the updating and saving the original file based on the determined saving mode comprises the following steps: reserving the content of the original file in the storage address, and adding the operation content corresponding to the editing operation to the original file to form a second file;
wherein the preset operation comprises at least one of: adding password operation, removing password operation and deleting operation.
4. The method according to claim 1 or 2, wherein the determining, according to the editing operation, a saving mode corresponding to the editing operation comprises:
if the editing operation comprises a preset operation, determining that a storage mode corresponding to the editing operation is rewriting storage;
the updating and saving the original file based on the determined saving mode comprises the following steps:
replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
if the editing operation does not comprise the preset operation, determining a storage mode corresponding to the editing operation according to a comparison result of the file size of the original file and a preset threshold value;
the updating and saving the original file based on the determined saving mode comprises the following steps:
replacing the original file write-in storage address with the first file formed after the editing operation; or the content of the original file is reserved in the storage address, and the operation content corresponding to the editing operation is added to the original file to form a second file;
the preset operation comprises a password adding operation and/or a password removing operation.
5. The method according to claim 4, wherein the determining, according to the comparison result between the file size of the original file and a preset threshold, the saving mode corresponding to the editing operation comprises:
if the file size of the original file is smaller than or equal to the preset threshold, determining that the storage mode corresponding to the editing operation is rewriting storage;
and if the file size of the original file is larger than the preset threshold value, determining that the storage mode corresponding to the editing operation is incremental storage.
6. The method according to claim 1 or 2, wherein the determining, according to the editing operation, a saving mode corresponding to the editing operation comprises:
if the editing operation is a page deleting operation, determining that a storage mode corresponding to the editing operation is rewriting storage;
the updating and saving the original file based on the determined saving mode comprises the following steps:
replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
if the editing operation is the operation of deleting the non-page, determining that the storage mode corresponding to the editing operation is incremental storage;
the updating and saving the original file based on the determined saving mode comprises the following steps: and reserving the content of the original file in the saving address, and adding the operation content corresponding to the editing operation to the original file to form a second new file.
7. A file saving apparatus, comprising:
an acquisition unit configured to acquire an editing operation undergone by an original file in response to a file saving instruction;
a determining unit, configured to determine, according to the editing operation, a saving mode corresponding to the editing operation;
and the saving unit is used for updating and saving the original file based on the determined saving mode.
8. The apparatus according to claim 7, further comprising a recording unit configured to mark, before the editing operation undergone by the original file is acquired in response to the file saving instruction, the editing operation employed when editing the file, forming an operation record;
the obtaining unit is specifically configured to obtain, by querying the operation record, an editing operation that the original file undergoes.
9. The apparatus according to claim 7 or 8,
the determining unit is specifically configured to determine that a storage mode corresponding to the editing operation is rewrite storage if the editing operation includes a preset operation; the saving unit is specifically configured to replace the original file with the whole first file formed after the editing operation, and write the original file into a saving address;
or
The determining unit is specifically configured to determine that a storage manner corresponding to the editing operation is incremental storage if the editing operation does not include the preset operation; the saving unit is specifically configured to save the content of the original file in the saving address, and add the operation content corresponding to the editing operation to the original file to form a second new file;
wherein the preset operation comprises at least one of: adding password operation, removing password operation and deleting operation.
10. The apparatus according to claim 7 or 8, wherein the determining unit includes a first determining module, configured to determine, if the editing operation includes a preset operation, that a storage manner corresponding to the editing operation is an overwrite storage; the saving unit is specifically configured to: replacing the original file with a first new file formed after the editing operation to write the original file into the storage address;
or
The determining unit comprises a second determining module, configured to determine, if the editing operation does not include a preset operation, a storage manner corresponding to the editing operation according to a comparison result between the file size of the original file and a preset threshold; the storage unit is specifically configured to: replacing the original file write-in storage address with the first file formed after the editing operation; or the content of the original file is reserved in the storage address, and the operation content corresponding to the editing operation is added to the original file to form a second file;
the preset operation comprises a password adding operation and/or a password removing operation.
CN202010907159.7A 2020-09-01 2020-09-01 File storage method and device, electronic equipment and storage medium Active CN112036133B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010907159.7A CN112036133B (en) 2020-09-01 2020-09-01 File storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010907159.7A CN112036133B (en) 2020-09-01 2020-09-01 File storage method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112036133A true CN112036133A (en) 2020-12-04
CN112036133B CN112036133B (en) 2024-03-26

Family

ID=73591000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010907159.7A Active CN112036133B (en) 2020-09-01 2020-09-01 File storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112036133B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114626349A (en) * 2022-05-16 2022-06-14 西安芯瞳半导体技术有限公司 Non-invasive file editing method, device and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040210608A1 (en) * 2003-04-18 2004-10-21 Lee Howard F. Method and apparatus for automatically archiving a file system
CN101122906A (en) * 2006-08-09 2008-02-13 北京北大方正电子有限公司 Method and system for document storage
US20090063949A1 (en) * 2007-08-29 2009-03-05 Oracle International Corporation Delta-saving in xml-based documents
US20130232110A1 (en) * 2012-03-02 2013-09-05 Beijing Founder Apabi Technology Ltd. Method and apparatus for saving a document
CN107885807A (en) * 2017-11-03 2018-04-06 广州视源电子科技股份有限公司 File saving method and device, intelligent tablet and storage medium
CN111563065A (en) * 2020-07-09 2020-08-21 北京联想协同科技有限公司 Document storage method and device and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040210608A1 (en) * 2003-04-18 2004-10-21 Lee Howard F. Method and apparatus for automatically archiving a file system
CN101122906A (en) * 2006-08-09 2008-02-13 北京北大方正电子有限公司 Method and system for document storage
US20090063949A1 (en) * 2007-08-29 2009-03-05 Oracle International Corporation Delta-saving in xml-based documents
US20130232110A1 (en) * 2012-03-02 2013-09-05 Beijing Founder Apabi Technology Ltd. Method and apparatus for saving a document
CN103294658A (en) * 2012-03-02 2013-09-11 北大方正集团有限公司 Document storage method and device
CN107885807A (en) * 2017-11-03 2018-04-06 广州视源电子科技股份有限公司 File saving method and device, intelligent tablet and storage medium
CN111563065A (en) * 2020-07-09 2020-08-21 北京联想协同科技有限公司 Document storage method and device and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谭政: "SaaS平台下知识库构建及文档版本控制与管理", 《中国优秀硕士学位论文全文数据库信息科技辑》, no. 8, pages 138 - 251 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114626349A (en) * 2022-05-16 2022-06-14 西安芯瞳半导体技术有限公司 Non-invasive file editing method, device and medium

Also Published As

Publication number Publication date
CN112036133B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
US10664443B2 (en) Method and apparatus for presenting to-be-cleaned data, and electronic device
CN105447115A (en) Method and device for cleaning junk files and electronic equipment
CN108875046A (en) A kind of storage system access method, device and electronic equipment
CN105279236A (en) File cleaning method and device and electronic equipment
CN111803917A (en) Resource processing method and device
CN107562372B (en) An electronic device, data management method thereof, and computer-readable storage medium
CN109710286A (en) System upgrade method, apparatus, device and storage medium
CN105868625B (en) Method and device for intercepting restart deletion of file
CN111880896B (en) A method and device for quickly restoring container and operating state data
CN114238161A (en) Intelligent disk fragment sorting method and device and electronic equipment
CN110222046B (en) List data processing method, device, server and storage medium
CN109597707A (en) Clone volume data copying method, device and computer readable storage medium
CN106484779B (en) File operation method and device
CN112036133B (en) File storage method and device, electronic equipment and storage medium
CN112287658A (en) Business data processing method and device, electronic equipment and medium
CN112036149A (en) File editing method and device, electronic equipment and storage medium
CN112035676A (en) User operation behavior knowledge graph construction method and device
CN106980685B (en) Data processing method and data processing device
CN112402955B (en) Game log recording method and system
CN112000971B (en) A file permission recording method, system and related device
CN107436918A (en) Database implementation method, device and equipment
CN112784253A (en) Information acquisition method and device of file system, electronic equipment and storage medium
CN113051336B (en) Visual data operation method, system, equipment and medium
CN116795803A (en) A file data storage method, device, equipment and storage medium
CN112632266B (en) Data writing method and device, computer equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant