Method, device and electronic device for cancelling document content saving
By creating a blank document during the document saving process and monitoring the cancellation of the save operation, the problem of document loss caused by users accidentally clicking the save button is solved, and the document content is safely retained.
Patent Information
- Application Number
- CN202010512162.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-08
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-06-08
AI Technical Summary
In the existing technology, the original document may be lost if the user mistakenly clicks the save button, and there is a lack of technical means to cancel the save.
When a save operation is received, a blank document is created, and the cancellation of the save operation is monitored during the writing process. If a cancellation operation is received, writing is stopped and the blank document is deleted, leaving the original document.
It effectively avoids the loss of the original document caused by the user accidentally clicking the save button, and retains the original content of the edited document by canceling the save operation.
Smart Images

Figure CN112784544B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of document processing, and in particular to a method, device and electronic device for canceling the preservation of document content. Background Art
[0002] With the rapid development of computer technology, computer applications have penetrated into all aspects of production and life. In modern social life, computers are essential tools for users to work, and electronic document editing application software is frequently used by users in the office.
[0003] In the daily use of electronic documents, the editing and saving of electronic documents are often involved. In addition to adding new data to the electronic document, the editing operation of the electronic document also requires modifying or deleting the original data of the electronic document in most cases. When the electronic document is edited or the user needs to deal with other things, the electronic document can be saved. When the user clicks the Save button, the program saves the edited document content to the source document.
[0004] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:
[0005] In the prior art, after clicking the Save button, when the user realizes that some data that needs to be retained has also been edited, in order to avoid the data that needs to be retained being overwritten by the edited document content, it may be necessary to cancel the saving of the edited document content. However, there is no technical means for canceling the saving in the prior art, so there is a problem of losing the original document due to the user accidentally clicking the Save button. Summary of the invention
[0006] The purpose of the embodiment of the present invention is to provide a method for canceling the saving of document content, so as to avoid the problem of loss of the original document due to the user accidentally clicking the save button. The specific technical solution is as follows:
[0007] An embodiment of the present invention provides a method for canceling the saving of document content, comprising:
[0008] When receiving a save operation for the edited document content, creating a blank document at a preset storage location;
[0009] In the process of writing the edited document content into the blank document, if a cancel save operation for the edited document content is received, stopping writing the edited document content into the blank document;
[0010] The blank document is deleted, and the original document corresponding to the edited document content is retained.
[0011] Further, when a save operation for the edited document content is received, creating a blank document at a preset storage location includes:
[0012] When a save operation for the edited document content is received, obtaining a storage directory of the original document corresponding to the edited document content;
[0013] Create a blank document in the storage directory.
[0014] Furthermore, in the process of writing the edited document content into the blank document, if a cancel save operation for the edited document content is received, stopping writing the edited document content into the blank document includes:
[0015] During the process of writing the edited document content into the blank document, if a trigger operation for the displayed cancel save button is received, the writing of the edited document content into the blank document is stopped.
[0016] Furthermore, the method further comprises:
[0017] During the process of writing the edited document content into the blank document, a cancel save button is displayed.
[0018] Furthermore, the method further comprises:
[0019] In the process of writing the edited document content into the blank document, if no cancel save operation for the edited document content is received, after the edited document content is written into the blank document and the edited document is obtained, the edited document is used to replace the original document corresponding to the edited document content.
[0020] The embodiment of the present invention further provides a device for canceling the saving of document content, the device comprising:
[0021] A creation module, configured to create a blank document at a preset storage location when receiving a save operation for the edited document content;
[0022] a writing control module, configured to stop writing the edited document content into the blank document if a cancel save operation for the edited document content is received during the process of writing the edited document content into the blank document;
[0023] The deletion module is used to delete the blank document and retain the original document corresponding to the edited document content.
[0024] Furthermore, the creation module is specifically configured to, when receiving a save operation for the edited document content, obtain a storage directory of the original document corresponding to the edited document content, and create a blank document under the storage directory.
[0025] Furthermore, the write control module is specifically used to stop writing the edited document content into the blank document if a trigger operation for the displayed cancel save button is received during the process of writing the edited document content into the blank document.
[0026] Furthermore, the writing control module is also used to display a cancel save button during the process of writing the edited document content into the blank document.
[0027] Furthermore, the device also includes:
[0028] A replacement module is used to replace the original document corresponding to the edited document content with the edited document after the edited document content is written into the blank document and the edited document is obtained, if no cancel save operation for the edited document content is received during the process of writing the edited document content into the blank document.
[0029] An embodiment of the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0030] Memory, used to store computer programs;
[0031] The processor is used to implement any of the steps of the above-mentioned method for canceling the saving of document content when executing the program stored in the memory.
[0032] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for canceling the saving of document content are implemented.
[0033] An embodiment of the present invention further provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute any of the above methods for canceling the saving of document content.
[0034] An embodiment of the present invention provides a method, device and electronic device for canceling the saving of document content. In the scheme, when a save operation for edited document content is received, a blank document is created at a preset storage location, and in the process of writing the edited document content to the blank document, if a cancel save operation for the edited document content is received, the writing of the edited document content to the blank document is stopped, and the blank document where the writing of the edited document content is stopped is deleted, and the original document corresponding to the edited document content is retained. Since in the process of saving the edited document content, the original document corresponding to the edited document content can be retained by canceling the save, the problem of loss of the original document caused by the user accidentally clicking the save button is avoided.
[0035] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0037] Figure 1 A flowchart of a method for canceling the saving of document content provided by an embodiment of the present invention;
[0038] Figure 2 A flowchart of a method for canceling the saving of document content provided by another embodiment of the present invention;
[0039] Figure 3 A schematic diagram of the structure of a device for cancelling the saving of document content provided by an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to provide an implementation plan to avoid the problem of original document loss caused by the user accidentally clicking the save button, the embodiment of the present invention provides a method, device and electronic device for canceling the saving of document content. The embodiment of the present invention is described below in conjunction with the accompanying drawings. In addition, the embodiments and features in the embodiments of the present application can be combined with each other if there is no conflict.
[0042] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0043] In one embodiment of the present invention, a method for canceling the saving of document content is provided, such as Figure 1 As shown, the method comprises the following steps:
[0044] S101: When a save operation for edited document content is received, a blank document is created at a preset storage location.
[0045] In this step, when a save operation for the edited document content is received, a blank document can be created at a preset storage location. In one embodiment, in order to facilitate the user to save the edited document content, a save button can be created in the editing interface. When the user triggers the save button, the saving of the currently edited document content begins. In one embodiment, the user's trigger operation for the save button may be different depending on the human-computer interaction mode of different devices. For example, on a desktop computer or laptop computer, the user can click the save button with an external mouse, and on a mobile terminal, the user can click the save button by touch.
[0046] In order to ensure the data integrity of the original document corresponding to the edited document content, a blank document may be created at a preset storage location, wherein the preset storage location may be determined by a person skilled in the art according to actual needs.
[0047] It will be understood by those skilled in the art that after the above-mentioned blank document is created, the edited document content can be written into the blank document. Due to the limitation of the machine reading and writing speed, it takes a certain amount of writing time to write all the edited document content into the blank document. During this writing time of writing the edited document content into the blank document, step S102 can be executed.
[0048] Since in the actual writing process, there is a problem that the data size of the edited document content is too small, resulting in its writing time being too short, so that the user cannot operate the writing process within the writing time. Therefore, in one embodiment, the writing time of the edited document content with a data size less than a certain threshold can be delayed. Exemplarily, this can be achieved by limiting the machine reading and writing speed or intermittently writing the edited document content.
[0049] S102: During the process of writing the edited document content into the blank document, if a cancel save operation for the edited document content is received, stop writing the edited document content into the blank document.
[0050] In this step, during the process of writing the edited document content into the blank document, if a cancel save operation for the edited document content is received, writing the edited document content into the blank document may be stopped.
[0051] In one embodiment, the cancel save operation may be triggered by a pre-agreed user action. For example, for a mobile smart device, the pre-agreed user action may be a double-click of the user's finger or a long press of the finger. For a desktop computer or a notebook, the pre-agreed user action may be a double-click of the mouse. Exemplarily, during the process of writing the edited document content to a blank document, if a double-click of the user is detected, writing the edited document content to the blank document is stopped.
[0052] S103: Deleting the blank document and retaining the original document corresponding to the edited document content.
[0053] In this step, after stopping writing the edited document content into the blank document, the blank document may be deleted, and the original document corresponding to the edited document content may also be retained.
[0054] The method for canceling the saving of document content provided by an embodiment of the present invention creates a blank document at a preset storage location when a save operation for the edited document content is received, and in the process of writing the edited document content to the blank document, if a cancel save operation for the edited document content is received, the writing of the edited document content to the blank document is stopped, and the blank document where the writing of the edited document content is stopped is deleted, and the original document corresponding to the edited document content is retained. Since the original document corresponding to the edited document content can be retained by canceling the save during the process of saving the edited document content, the problem of loss of the original document caused by the user accidentally clicking the save button is avoided.
[0055] In another embodiment of the present invention, a method for canceling the saving of document content is also provided. Figure 2 As shown, the method comprises the following steps:
[0056] S201: When a save operation for edited document content is received, a storage directory of an original document corresponding to the edited document content is obtained.
[0057] In this step, when a save operation for the edited document content is received, the storage directory of the original document corresponding to the edited document content can be obtained, wherein the storage directory of the original document corresponding to the edited document content may have been pre-stored in a specified data table. In this step, the storage directory of the original document can be obtained by reading the data table, or it can be obtained by reading the original document through existing storage directory acquisition technical means. The embodiment of the present invention does not make specific limitations here.
[0058] S202: Create a blank document in the storage directory.
[0059] In this step, after determining the storage directory of the original document corresponding to the edited document content in step S201, a blank document can be created under the storage directory. It should be noted that the name of the blank document and the name of the original document can be different at this time. For example, a specific identification suffix can be added to the document name of the original document.
[0060] S203: During the process of writing the edited document content into the blank document, monitoring whether a cancel save operation is received.
[0061] In this step, during the process of writing the edited document content into a blank document, it can be monitored whether a cancel save operation is received. If it is monitored that a cancel save operation is received, step S204 is executed. If it is not monitored that a cancel save operation is received, step S206 is executed. In one embodiment, the cancel save operation can be a trigger operation for the displayed cancel save button.
[0062] S204: During the process of writing the edited document content into the blank document, if a trigger operation for the displayed cancel save button is received, stop writing the edited document content into the blank document.
[0063] In this step, the displayed cancel save button may be created and displayed during the process of writing the edited document content into a blank document, or may be always displayed on the document page.
[0064] In one embodiment, during the process of writing the edited document content into the blank document, if a trigger operation for a displayed cancel save button is received, writing the edited document content into the blank document can be stopped. The trigger operation for the displayed cancel save button can be a click operation of the user using a mouse, or a click operation of the user using a finger on a touch screen.
[0065] S205: Delete the blank document and retain the original document corresponding to the edited document content.
[0066] In this step, the method described in the above step S103 can be specifically used for execution, and will not be described in detail here.
[0067] S206: During the process of writing the edited document content into a blank document, if a cancel save operation for the edited document content is not received, after the edited document content is written into the blank document and the edited document is obtained, the edited document is used to replace the original document corresponding to the edited document content.
[0068] In this step, during the process of writing the edited document content into a blank document, if no cancel save operation is received for the edited document content, then after the edited document content is written into the blank document and the edited document is obtained, the edited document can be used to replace the original document corresponding to the edited document content.
[0069] In one embodiment, if the edited document and the original document are not in the same directory, after the edited document content is written to the blank document, the original document corresponding to the edited document content can be deleted, and the document name of the edited document can be modified to the document name of the original document corresponding to the edited document content, and the edited document with the document name modified can be moved to the storage location of the deleted original document to complete the entire replacement process.
[0070] In one embodiment, if the edited document and the original document are in the same directory, after the edited document content is written to the blank document, the original document corresponding to the edited document content can be deleted, and the document name of the edited document can be modified to the document name of the original document corresponding to the edited document content to complete the entire replacement process.
[0071] The above-mentioned method for canceling the saving of document content provided by an embodiment of the present invention, when receiving a save operation for the edited document content, obtains the storage directory of the original document corresponding to the edited document content, and creates a blank document under the storage directory, and in the process of writing the edited document content to the blank document, if a trigger operation for the displayed cancel save button is received, stops writing the edited document content to the blank document, deletes the blank document, and retains the original document corresponding to the edited document content. Since in the process of saving the edited document content, the original document corresponding to the edited document content can be retained by canceling the save, the problem of loss of the original document caused by the user accidentally clicking the save button is avoided.
[0072] Based on the same inventive concept, according to the method for canceling the preservation of document content provided by the embodiment of the present invention, the embodiment of the present invention also provides a device for canceling the preservation of document content, such as Figure 3 As shown, the device comprises:
[0073] A creation module 301, configured to create a blank document at a preset storage location when receiving a save operation for the edited document content;
[0074] A writing control module 302 is used to stop writing the edited document content into the blank document if a cancel save operation for the edited document content is received during the process of writing the edited document content into the blank document;
[0075] The deletion module 303 is used to delete the blank document and retain the original document corresponding to the edited document content.
[0076] Furthermore, the creation module is specifically used to obtain the storage directory of the original document corresponding to the edited document content when receiving a save operation for the edited document content, and create a blank document under the storage directory.
[0077] Furthermore, the writing control module is specifically used to stop writing the edited document content into the blank document if a trigger operation for the displayed cancel save button is received during the process of writing the edited document content into the blank document.
[0078] Furthermore, the writing control module is also used to display a cancel save button during the process of writing the edited document content into the blank document.
[0079] Furthermore, the device also includes:
[0080] A replacement module is used to replace the original document corresponding to the edited document content with the edited document after writing the edited document content into a blank document and obtaining the edited document if no cancel save operation is received for the edited document content during the process of writing the edited document content into a blank document and obtaining the edited document.
[0081] The above-mentioned device for canceling the saving of document content provided by an embodiment of the present invention, when receiving a save operation for the edited document content, obtains the storage directory of the original document corresponding to the edited document content, and creates a blank document under the storage directory, and in the process of writing the edited document content to the blank document, if a trigger operation for the displayed cancel save button is received, stops writing the edited document content to the blank document, deletes the blank document, and retains the original document corresponding to the edited document content. Since in the process of saving the edited document content, the original document corresponding to the edited document content can be retained by canceling the save, the problem of loss of the original document caused by the user accidentally clicking the save button is avoided.
[0082] The embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0083] Memory 403, used for storing computer programs;
[0084] The processor 401 is used to execute the program stored in the memory 403 to implement the following steps:
[0085] When receiving a save operation for the edited document content, creating a blank document at a preset storage location;
[0086] In the process of writing the edited document content into the blank document, if a cancel save operation for the edited document content is received, stopping writing the edited document content into the blank document;
[0087] The blank document is deleted, and the original document corresponding to the edited document content is retained.
[0088] The electronic device provided by the embodiment of the present invention, when receiving a save operation for edited document content, obtains the storage directory of the original document corresponding to the edited document content, and creates a blank document under the storage directory, and in the process of writing the edited document content to the blank document, if a trigger operation for the displayed cancel save button is received, stops writing the edited document content to the blank document, deletes the blank document, and retains the original document corresponding to the edited document content. Since in the process of saving the edited document content, the original document corresponding to the edited document content can be retained by canceling the save, the problem of loss of the original document caused by the user accidentally clicking the save button is avoided.
[0089] It should be noted that other embodiments of the method for canceling the saving of document content implemented by the above electronic device are the same as the filtering method mentioned in the aforementioned method embodiment part, and will not be described in detail here.
[0090] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0091] The communication interface is used for communication between the above electronic device and other devices.
[0092] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0093] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0094] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods for canceling the saving of document content are implemented.
[0095] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any method of canceling the saving of document content in the above embodiments.
[0096] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0097] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0098] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for devices, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for cancelling the saving of document content, characterized in that: include: When receiving a save operation for the edited document content, creating a blank document at a preset storage location; In the process of writing the edited document content into the blank document, if a cancel save operation for the edited document content is received, stopping writing the edited document content into the blank document; Deleting the blank document and retaining the original document corresponding to the edited document content; Wherein, in the process of writing the edited document content into the blank document, when the data volume of the edited document content is less than a preset threshold, the writing time of the edited document content whose data volume is less than the preset threshold is delayed; When receiving a cancel save operation for the edited document content, the writing of the edited document content into the blank document is stopped.
2. The method according to claim 1, characterized in that When receiving a save operation for the edited document content, creating a blank document at a preset storage location includes: When a save operation for the edited document content is received, obtaining a storage directory of the original document corresponding to the edited document content; Create a blank document in the storage directory.
3. The method according to claim 1, characterized in that: In the process of writing the edited document content into the blank document, if a cancel save operation for the edited document content is received, stopping writing the edited document content into the blank document includes: During the process of writing the edited document content into the blank document, if a trigger operation for the displayed cancel save button is received, the writing of the edited document content into the blank document is stopped.
4. The method according to claim 3, characterized in that The method further comprises: During the process of writing the edited document content into the blank document, a cancel save button is displayed.
5. The method according to claim 1, characterized in that The method further comprises: In the process of writing the edited document content into the blank document, if no cancel save operation for the edited document content is received, after the edited document content is written into the blank document and the edited document is obtained, the edited document is used to replace the original document corresponding to the edited document content.
6. A device for cancelling the saving of document content, characterized in that: include: A creation module, configured to create a blank document at a preset storage location when receiving a save operation for the edited document content; a writing control module, configured to stop writing the edited document content into the blank document if a cancel save operation for the edited document content is received during the process of writing the edited document content into the blank document; A deletion module, used to delete the blank document and retain the original document corresponding to the edited document content; The writing control module is further configured to delay the writing time of the edited document content whose data volume is less than a preset threshold value during the process of writing the edited document content into the blank document, when the data volume of the edited document content is less than a preset threshold value; When receiving a cancel save operation for the edited document content, the writing of the edited document content into the blank document is stopped.
7. The device according to claim 6, characterized in that The creation module is specifically used to obtain the storage directory of the original document corresponding to the edited document content when receiving a save operation for the edited document content, and create a blank document under the storage directory.
8. The device according to claim 6, characterized in that The write control module is specifically configured to stop writing the edited document content into the blank document if a trigger operation for a displayed cancel save button is received during the process of writing the edited document content into the blank document.
9. The device according to claim 8, characterized in that The writing control module is further used to display a cancel save button during the process of writing the edited document content into the blank document.
10. The device according to claim 6, characterized in that The device also includes: A replacement module is used to replace the original document corresponding to the edited document content with the edited document after the edited document content is written into the blank document and the edited document is obtained, if no cancel save operation for the edited document content is received during the process of writing the edited document content into the blank document.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.
