Method, apparatus, computer device and storage medium for online editing of files
By cleaning up invalid editing instructions and determining the target storage location, the file cannot be edited and information missing caused by invalid instructions in online editing files is solved, and editing efficiency is improved.
Patent Information
- Application Number
- CN202111544094.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-12-16
AI Technical Summary
During the online editing process of file, the existing technology is inefficient in the process of file editing, resulting in the inability to edit, re-edit, or missing information due to invalid editing instructions.
By obtaining multiple editing instructions, determining the cleaning coefficient and cleaning invalid instructions, combining the storage transformation parameters of the storage space and the change information of the editing file, determining the target storage location and obtaining the edited file.
It reduces the problem of files being unable to be edited and re-edited, avoids information loss, and improves the efficiency of online editing of files.
Smart Images

Figure CN114239502B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of document processing, and in particular, to a method, device, computer device, and storage medium for online editing of documents. Background Art
[0002] Online editing of documents enables multiple people to edit the same document at different places and times. In the Internet era, online editing of documents is an essential tool for work and study.
[0003] When multiple terminals repeatedly edit the same document and the server receives multiple editing instructions for the same document from multiple terminals, during the process of editing the document, there will inevitably be some invalid editing instructions. These invalid editing instructions will cause problems such as the inability to edit the document, re-edit it, or information loss due to time conflicts with normal editing instructions. In the prior art, if an error occurs in the online editing of a document due to invalid editing instructions, the document can only be resubmitted and the resubmitted document can be edited online again, resulting in low efficiency of online editing of documents. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a method, device, computer device, and storage medium for online editing of documents that can reduce the problems of inability to edit, re-edit, and information loss of documents.
[0005] In a first aspect, the present application provides a method for online editing of documents. The method includes:
[0006] In response to an editing instruction received by a document to be edited, placing the document to be edited in a storage space;
[0007] Obtaining a plurality of editing instructions, determining a cleaning coefficient based on the plurality of editing instructions, and cleaning the plurality of editing instructions based on the cleaning coefficient;
[0008] Obtaining the change information of the document to be edited at each moment during the editing process, and determining a target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0009] Obtaining the document to be edited in the target storage location to obtain an edited completed document.
[0010] In one embodiment, the step of in response to an editing instruction received by a document to be edited, placing the document to be edited in a storage space includes:
[0011] In response to an editing instruction received by a document to be edited, determining the storage occupation ratio of the document to be edited;
[0012] Divide the storage space for the file to be edited according to the storage occupation ratio, and place the file to be edited into the storage space.
[0013] In one embodiment, determining the cleaning coefficient based on the multiple editing instructions includes:
[0014] If no return value of any editing instruction is obtained within the first editing duration, any editing instruction is regarded as an interference instruction;
[0015] If within the second editing duration, the same several editing instructions are obtained and the number of the several editing instructions is greater than a preset value, the several editing instructions are all regarded as interference instructions;
[0016] Determine the cleaning coefficient based on all the interference instructions.
[0017] In one embodiment, determining the cleaning coefficient based on all the interference instructions includes:
[0018] Obtain the request transformation function, interference word index value, and invalid word index value corresponding to each interference instruction;
[0019] Determine the cleaning coefficient based on the request transformation function, interference word index value, and invalid word index value corresponding to each interference instruction.
[0020] In one embodiment, determining the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space includes:
[0021] Determine the storage location of the file to be edited at each moment according to the change information at each moment and the cleaning coefficient, where the change information at each moment includes: the page number change degree and the line number change degree of the file at each moment;
[0022] Determine the target storage location based on the storage location at each moment, the file to be edited, and the storage transformation parameters of the storage space.
[0023] In one embodiment, the storage transformation parameters of the storage space include: the variable value of the storage space, the transformation threshold, and the transformation scale factor; determining the target storage location based on the storage location at each moment, the file to be edited, and the storage transformation parameters of the storage space includes:
[0024] Obtain the spatial variable of the storage location at each moment, and the characteristic value of the file to be edited;
[0025] Determine the minimum storage location based on the spatial variable of the storage location at each moment, the eigenvalue, the first variable value of the storage space, the transformation threshold, and the transformation scale factor, and use the minimum storage location as the target storage location.
[0026] In a second aspect, the present application further provides an apparatus for online editing of files. The apparatus includes:
[0027] A storage space partitioning module, configured to place the file to be edited into the storage space in response to an edit instruction received for the file to be edited;
[0028] A cleaning module, configured to obtain a plurality of edit instructions, determine a cleaning coefficient based on the plurality of edit instructions, and clean the plurality of edit instructions based on the cleaning coefficient;
[0029] A target storage location determination module, configured to obtain the change information of the file to be edited at each moment during the editing process, and determine the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0030] An editing completed file acquisition module, configured to obtain the file to be edited in the target storage location to obtain an editing completed file.
[0031] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0032] Place the file to be edited into the storage space in response to an edit instruction received for the file to be edited;
[0033] Obtain a plurality of edit instructions, determine a cleaning coefficient based on the plurality of edit instructions, and clean the plurality of edit instructions based on the cleaning coefficient;
[0034] Obtain the change information of the file to be edited at each moment during the editing process, and determine the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0035] Obtain the file to be edited in the target storage location to obtain an editing completed file.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0037] Place the file to be edited into the storage space in response to an edit instruction received for the file to be edited;
[0038] Obtain a plurality of editing instructions, determine a cleaning coefficient based on the plurality of editing instructions, and clean the plurality of editing instructions based on the cleaning coefficient;
[0039] Obtain the change information of the file to be edited at each moment during the editing process, and determine the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0040] Obtain the file to be edited in the target storage location to obtain the edited completed file.
[0041] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0042] In response to an editing instruction received by the file to be edited, place the file to be edited into the storage space;
[0043] Obtain a plurality of editing instructions, determine a cleaning coefficient based on the plurality of editing instructions, and clean the plurality of editing instructions based on the cleaning coefficient;
[0044] Obtain the change information of the file to be edited at each moment during the editing process, and determine the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0045] Obtain the file to be edited in the target storage location to obtain the edited completed file.
[0046] The above online file editing method, device, computer device, storage medium, and computer program product place the file to be edited into the storage space, obtain a plurality of editing instructions, determine a cleaning coefficient based on the plurality of editing instructions, and clean the plurality of editing instructions based on the cleaning coefficient, which can clean invalid instructions, avoid time conflicts between invalid instructions and normal editing instructions, reduce problems such as the file being unable to be edited or re-edited. In the storage space of the file to be edited, according to the change information of the edited file at each moment during the editing process, the cleaning coefficient, and the storage transformation parameters of the storage space, determine the target storage location in the storage space, obtain the file to be edited in the target storage location, and obtain the edited completed file, avoiding the problem of missing information of the file to be edited obtained due to obtaining the file to be edited at the wrong storage location. Description of the Drawings
[0047] Figure 1 It is an application environment diagram of the online file editing method in an embodiment;
[0048] Figure 2Schematic flowchart of a method for online editing of a file in an embodiment;
[0049] Figure 3 Block diagram of the structure of a device for online editing of a file in an embodiment;
[0050] Figure 4 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0051] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] The embodiment of the present application provides a method for online editing of a file, which can be applied to an application environment as Figure 1 shown. Among them, multiple terminals 102 communicate with a server 104 through a network. A data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed in the cloud or other network servers. Multiple terminals 102 send editing instructions to the server 104. The server 104 responds to the editing instructions, puts the file to be edited into the storage space, obtains and eliminates the invalid instructions determined from the multiple editing instructions received by the file to be edited, obtains the change information of the file to be edited at each moment during the editing process, and then determines the target storage location, obtains the file to be edited in the target storage location, and obtains the edited completed file. Among them, the multiple terminals 102 can be but are not limited to various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0053] In one embodiment, as Figure 2 shown, a method for online editing of a file is provided. Taking the method applied to the Figure 1 server as an example, the method includes the following steps:
[0054] S101, in response to an editing instruction received by the file to be edited, put the file to be edited into the storage space.
[0055] Among them, the editing instruction is used to edit the file to be edited. The editing instruction is sent from any terminal to the server. The storage space is a storage space divided in the server memory, and the file to be edited is edited in the storage space.
[0056] Specifically, the server receives an editing instruction for the file to be edited, allocates storage space for the file to be edited, and places the file to be edited into the storage space to prepare for subsequent editing. It can be determined that in S101, the editing instruction received by the file to be edited is the first editing instruction received by the file to be edited.
[0057] S102, obtain multiple editing instructions, determine a cleaning coefficient based on the multiple editing instructions, and clean the multiple editing instructions based on the cleaning coefficient.
[0058] Among them, the multiple editing instructions may be multiple editing instructions received by the file to be edited within a first preset time period. The multiple editing instructions received within the first preset time period include the first editing instruction received in S101.
[0059] Specifically, obtain the multiple editing instructions received by the file to be edited within the first preset time period, determine multiple interfering instructions among the multiple editing instructions. The interfering instruction is an editing instruction that does not perform an actual editing operation within the first editing duration, or an editing instruction that is repeated multiple times. Calculate the cleaning coefficient according to the multiple interfering instructions, and clean the multiple editing instructions through the cleaning function and the cleaning coefficient to eliminate invalid instructions among the multiple editing instructions.
[0060] S103, obtain the change information of the file to be edited at each moment during the editing process, and determine the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space.
[0061] Among them, the editing process is the process in which the file to be edited receives the multiple editing instructions within the first preset time period. The change information at each moment during the editing process is also the change information at each moment within the first preset time period. The change information at each moment is used to reflect the change situation of the content of the file to be edited during the editing process.
[0062] Specifically, determine the storage location of the file to be edited at each moment based on the change information at each moment, and then determine the minimum storage location according to the storage location at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space, and use the minimum storage location as the target storage location. The target storage location is a storage location in the storage space.
[0063] S104, obtain the file to be edited in the target storage location to obtain the edited completed file.
[0064] Specifically, extract the edited completed file based on the target storage location and delete redundant buffer files.
[0065] The above method for online editing of a file places the file to be edited in a storage space, obtains a plurality of editing instructions, determines a cleaning coefficient based on the plurality of editing instructions, and cleans the plurality of editing instructions based on the cleaning coefficient, which can clean invalid instructions, avoid time conflicts between invalid instructions and normal editing instructions, and reduce problems such as the file being unable to be edited or re-edited. In the storage space of the file to be edited, according to the change information of the edited file at each moment during the editing process, the cleaning coefficient, and the storage transformation parameters of the storage space, a target storage location is determined in the storage space, and the file to be edited at the target storage location is obtained to obtain the edited completed file, avoiding the problem of missing information of the file to be edited caused by obtaining the file to be edited at the wrong storage location.
[0066] In one embodiment, S101 includes:
[0067] S111, in response to an editing instruction received by the file to be edited, determines the storage occupation ratio of the file to be edited.
[0068] Specifically, the editing instruction may be triggered when the file to be edited is selected. The file list on the server includes multiple files. When any file is selected by the terminal, the selected file is used as the file to be edited, and the editing instruction is triggered to determine the storage occupation ratio of the file to be edited. The file list displays multiple file names. When any file name is selected, the file to be edited is determined through the selected file name. The storage occupation ratio is the ratio between the estimated memory required for the file to be edited during the editing process and the server memory.
[0069] In response to an editing instruction received by the file to be edited, obtain the script editing parameter and type editing parameter of the file to be edited, and obtain the preset script coefficient factor, type coefficient factor, and file editing parameter adjustment threshold; according to the script coefficient factor, the type coefficient factor, the file editing parameter adjustment threshold, the script editing parameter, the type editing parameter, and the server storage space function, determine the storage occupation ratio of the file to be edited. Specifically, as shown in formula (1).
[0070]
[0071] Among them, c is the label of the file to be edited, P(c) is the storage occupation ratio of the file to be edited c, A c is the script editing parameter of the file to be edited c, B c is the type editing parameter of the file to be edited c, a1 is the script coefficient factor, a2 is the type coefficient factor, DL c is the server storage space function, and ω is the file editing parameter adjustment threshold.
[0072] Weight the script editing parameters and type editing parameters of the file to be edited to obtain the comprehensive weighted value of the file to be edited. Divide the comprehensive weighted value by the product of the script editing parameters, type editing parameters, and file editing parameter adjustment threshold of the file to be edited, and select the server storage space function for spatial quantization adjustment to obtain the storage occupation ratio of the file to be edited.
[0073] S112. Divide the storage space for the file to be edited according to the storage occupation ratio, and place the file to be edited into the storage space.
[0074] Specifically, estimate the capacity required to edit the file to be edited according to the storage occupation ratio of the file to be edited, divide the storage space for the file to be edited, and place the file to be edited into the storage space.
[0075] After dividing the storage space for the file to be edited according to the storage occupation ratio, if the capacity of the storage space meets the required capacity of the file to be edited, execute the edit instruction; if it does not meet the required capacity of the file to be edited, re-divide the storage space for the file to be edited.
[0076] After placing the file to be edited into the storage space, obtain the edit time when the file to be edited receives the edit instruction, and the IP address corresponding to the edit instruction. The IP address is used to uniquely represent the terminal that sends the edit instruction. Generate an index value according to the edit time and the IP address, and use the index value to mark the storage space.
[0077] In one embodiment, the file is edited by a recursive edit instruction, and the closure is used to complete the edit transfer of the file. Each edit instruction received by the server will generate an index value corresponding to the edit instruction, and count multiple edit instructions received within the first preset duration according to the index value.
[0078] In one embodiment, S102 includes:
[0079] S211. If the return value of any edit instruction is not obtained within the first edit duration, regard any edit instruction as an interference instruction; if the same several edit instructions are obtained within the second edit duration, and the number of the several edit instructions is greater than the preset value, regard the several edit instructions as interference instructions.
[0080] Specifically, monitor the return value of each edit instruction. If there is any edit instruction that does not obtain its return value within the first edit duration, it is determined that any edit instruction does not perform an actual operation within the first edit duration, and any edit instruction is regarded as an interference instruction; the statement that if the return value of any edit instruction is not obtained within the first edit duration means that when any edit instruction is obtained, the timing starts, and the return value of any edit instruction is not obtained when the duration reaches the first edit duration.
[0081] Among the multiple editing instructions obtained, if there are several editing instructions obtained within the second editing duration and the number of the several editing instructions is greater than a preset value, it is determined that the several editing instructions are repeated editing operations, and the several editing instructions are all regarded as interference instructions.
[0082] S212. Determine a cleaning coefficient based on all the interference instructions.
[0083] Wherein, the cleaning coefficient is used to clean invalid instructions among the multiple editing instructions.
[0084] Specifically, obtain a request transformation function, an interference word index value, and an invalid word index value corresponding to each interference instruction, and determine the cleaning coefficient based on the request transformation function, the interference word index value, and the invalid word index value corresponding to each interference instruction. Specifically, as shown in formula (2).
[0085]
[0086] Wherein, ER i is the cleaning coefficient, i is the number of interference instructions, X i is the request transformation function corresponding to the interference instruction, r is the interference word scale factor, s is the interference word judgment factor, Y i is the interference word index value corresponding to the interference instruction, Z i is the invalid word index value corresponding to the interference instruction, b1 is the sensitive word adjustment factor, and b2 is the invalid word adjustment factor.
[0087] In one embodiment, S103 includes:
[0088] S311. Determine the storage location of the file to be edited at each moment according to the change information at each moment and the cleaning coefficient.
[0089] Wherein, the change information at each moment includes: the file page number change degree and the file line number change degree at each moment. The file page number change degree is used to reflect the change of the page number position of the file to be edited, and the file line number change degree is used to reflect the change of the line coordinates of the file to be edited.
[0090] Specifically, determine the storage location of the file to be edited at each moment through an editing classification function, and manage the transmission paths of the files to be edited with different IP addresses according to the time when the terminal sends the editing instruction, so as to realize the positioning of the files to be edited. Specifically, as shown in formula (3).
[0091]
[0092] Among them, C(i, j, k) is the storage location of the file to be edited at each moment, σ is the file cache factor, j is the page number coordinate of the file to be edited, and k is the line coordinate of the file to be edited. is the degree of change in the file page number at time t. is the degree of change in the number of lines of the file at time t, η is the reference coefficient of the degree of change in the page number, μ is the reference coefficient of the degree of change in the number of lines of the file, and ER i is the cleaning coefficient.
[0093] S312. Based on the storage location at each moment, the file to be edited, and the transformation parameters of the storage space, determine the target storage location.
[0094] Specifically, obtain the spatial variables of the storage location at each moment, and determine the variable mean value of the storage space according to the spatial variables of the storage location at each moment; obtain the eigenvalue of the file to be edited, and determine the second variable value of the storage space based on the eigenvalue, the transformation threshold of the storage space, and the transformation scale factor; based on the variable mean value, the first variable value, and the second variable value of the storage space, determine the minimum storage location, and use the minimum storage location as the target storage location.
[0095] Obtain the storage space variables corresponding to the storage location at each moment, and determine the variable mean value of the storage space based on the storage space variables corresponding to the storage location at each moment and the first preset duration (the duration for obtaining multiple editing instructions). Determine the second variable value of the storage space according to the eigenvalue of the file to be edited, the transformation threshold of the storage space, and the transformation scale factor. Based on the variable mean value, the first variable value, and the second variable value of the storage space, determine the minimum storage location, and use the minimum storage location as the target storage location. The specific process of determining the target storage location is shown in formula (4).
[0096]
[0097] Among them, D is the target storage location, T is the first preset duration, is the storage space variable at the storage location m at time t, is the variable mean value of the storage space, V is the first variable value of the storage space, W is the eigenvalue of the file to be edited, λ is the transformation threshold of the storage space, g is the transformation scale factor of the storage space, and S illegal is the extraction factor of the invalid edited file.
[0098] The above method for online editing of a file places the file to be edited in a storage space, obtains a plurality of editing instructions, determines a cleaning coefficient based on the plurality of editing instructions, and cleans the plurality of editing instructions based on the cleaning coefficient, which can clean invalid instructions, avoid time conflicts between invalid instructions and normal editing instructions, and reduce problems such as the file being unable to be edited or re-edited. In the storage space of the file to be edited, according to the change information of the edited file at each moment during the editing process, the cleaning coefficient, and the storage transformation parameters of the storage space, a target storage location is determined in the storage space, and the file to be edited at the target storage location is obtained to obtain the edited completed file, avoiding the problem of missing information of the file to be edited caused by obtaining the file to be edited at the wrong storage location. In an application scenario where multiple people need to collaborate on editing a file, a collaborative editing instruction in a network disk system is called to perform collaborative editing on the file, enabling multiple personnel, multiple scenarios, and multiple nodes to perform collaborative operations on the same file at the same time. Through this concurrent mode, the operation of multiple people editing the same document simultaneously is solved, shortening the office collaboration time and improving office efficiency; it can be applied to the scenario of a light meeting, realizing a paperless meeting, reducing the preparation of meeting materials, improving the convenience of the meeting, and enriching the content of the meeting process.
[0099] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages, and these steps or stages do not necessarily have to be executed at the same moment, but can be executed at different moments, and the execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0100] Based on the same inventive concept, an embodiment of the present application also provides an apparatus for online editing of a file for implementing the above-mentioned method for online editing of a file. The solution provided by this apparatus for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in the embodiment of the apparatus for online editing of a file provided below can refer to the limitations on the method for online editing of a file in the above text, and will not be repeated here.
[0101] In one embodiment, as Figure 3 shown, an apparatus for online editing of a file is provided, including:
[0102] A storage space division module, configured to place the file to be edited into a storage space in response to an edit instruction received by the file to be edited;
[0103] A cleaning module, configured to obtain a plurality of edit instructions, determine a cleaning coefficient based on the plurality of edit instructions, and clean the plurality of edit instructions based on the cleaning coefficient;
[0104] A target storage location determination module, configured to obtain change information of the file to be edited at each moment during the editing process, and determine a target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0105] A module for obtaining the edited completed file, configured to obtain the file to be edited in the target storage location to obtain the edited completed file.
[0106] In one embodiment, the storage space division module includes:
[0107] A storage occupation ratio determination unit, configured to determine the storage occupation ratio of the file to be edited in response to an edit instruction received by the file to be edited;
[0108] A storage space division unit, configured to divide a storage space for the file to be edited according to the storage occupation ratio, and place the file to be edited into the storage space.
[0109] In one embodiment, the cleaning module includes:
[0110] An interference instruction determination unit, configured to, if no return value of any edit instruction is obtained within a first edit duration, regard any edit instruction as an interference instruction; if within a second edit duration, the same several edit instructions are obtained and the number of the several edit instructions is greater than a preset value, regard the several edit instructions as interference instructions;
[0111] A cleaning coefficient determination unit, configured to determine a cleaning coefficient based on all interference instructions.
[0112] In one embodiment, the cleaning coefficient determination unit includes:
[0113] A first sub-unit, configured to obtain a request transformation function, an interference word index value, and an invalid word index value corresponding to each interference instruction;
[0114] A second sub-unit, configured to determine a cleaning coefficient based on the request transformation function, the interference word index value, and the invalid word index value corresponding to each interference instruction.
[0115] In one embodiment, the target storage location determination module includes:
[0116] A first storage location determination unit, configured to determine the storage location of the file to be edited at each moment according to the change information at each moment and the cleaning coefficient, where the change information at each moment includes: the page number change degree and the line number change degree of the file at each moment;
[0117] A second storage location determination unit, configured to determine a target storage location based on the storage location at each moment, the file to be edited, and the storage transformation parameters of the storage space.
[0118] In one embodiment, the storage transformation parameters of the storage space include: the variable value of the storage space, the transformation threshold, and the transformation scale factor; the second storage location determination unit includes:
[0119] A first acquisition unit, configured to acquire the spatial variable of the storage location at each moment, and the characteristic value of the file to be edited;
[0120] A target storage location determination unit, configured to determine a minimum storage location according to the spatial variable of the storage location at each moment, the characteristic value, the first variable value of the storage space, the transformation threshold, and the transformation scale factor, and use the minimum storage location as the target storage location.
[0121] Each module in the above device for online editing of files can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0122] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 4 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the data for implementing the above method for online editing of files. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a method for online editing of files.
[0123] Those skilled in the art can understand, Figure 4The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0124] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0125] In response to an edit instruction received for a file to be edited, place the file to be edited into the storage space;
[0126] Obtain a plurality of edit instructions, determine a cleaning coefficient based on the plurality of edit instructions, and clean the plurality of edit instructions based on the cleaning coefficient;
[0127] Obtain the change information of the file to be edited at each moment during the editing process, and determine the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0128] Obtain the file to be edited at the target storage location to obtain the edited completed file.
[0129] In one of the embodiments, the step of in response to an edit instruction received for a file to be edited, place the file to be edited into the storage space includes:
[0130] In response to an edit instruction received for a file to be edited, determine the storage occupation ratio of the file to be edited;
[0131] Divide the storage space for the file to be edited according to the storage occupation ratio, and place the file to be edited into the storage space.
[0132] In one of the embodiments, the step of determining a cleaning coefficient based on the plurality of edit instructions includes:
[0133] If no return value of any edit instruction is obtained within the first editing duration, then regard any edit instruction as an interference instruction;
[0134] If within the second editing duration, the same several edit instructions are obtained, and the number of the several edit instructions is greater than a preset value, then regard the several edit instructions as interference instructions;
[0135] Determine a cleaning coefficient based on all the interference instructions.
[0136] In one of the embodiments, the step of determining a cleaning coefficient based on all the interference instructions includes:
[0137] Obtain the request transformation function, interference word index value, and invalid word index value corresponding to each interference instruction;
[0138] Based on the request transformation function, interference word index value, and invalid word index value corresponding to each interference instruction, determine the cleaning coefficient.
[0139] In one embodiment, the determining the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameter of the storage space includes:
[0140] According to the change information at each moment and the cleaning coefficient, determine the storage location of the file to be edited at each moment, where the change information at each moment includes: the page number change degree and the line number change degree of the file at each moment;
[0141] Based on the storage location at each moment, the file to be edited, and the storage transformation parameter of the storage space, determine the target storage location.
[0142] In one embodiment, the storage transformation parameter of the storage space includes: the variable value of the storage space, the transformation threshold, and the transformation scale factor; based on the storage location at each moment, the file to be edited, and the storage transformation parameter of the storage space, determine the target storage location, including:
[0143] Obtain the spatial variable of the storage location at each moment, and the eigenvalue of the file to be edited;
[0144] According to the spatial variable of the storage location at each moment, the eigenvalue, the first variable value of the storage space, the transformation threshold, and the transformation scale factor, determine the minimum storage location, and use the minimum storage location as the target storage location.
[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0146] In response to an edit instruction received by the file to be edited, place the file to be edited into the storage space;
[0147] Obtain a plurality of edit instructions, determine the cleaning coefficient based on the plurality of edit instructions, and clean the plurality of edit instructions based on the cleaning coefficient;
[0148] Obtain the change information at each moment during the editing process of the file to be edited, and determine the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameter of the storage space;
[0149] Obtain the file to be edited in the target storage location to obtain the edited completed file.
[0150] In one embodiment, the step of putting the file to be edited into the storage space in response to the edit instruction received for the file to be edited includes:
[0151] In response to the edit instruction received for the file to be edited, determining the storage occupation ratio of the file to be edited;
[0152] Dividing the storage space for the file to be edited according to the storage occupation ratio, and putting the file to be edited into the storage space.
[0153] In one embodiment, the step of determining the cleaning coefficient based on the multiple edit instructions includes:
[0154] If the return value of any edit instruction is not obtained within the first edit duration, any edit instruction is regarded as an interference instruction;
[0155] If the same several edit instructions are obtained within the second edit duration and the number of the several edit instructions is greater than a preset value, the several edit instructions are all regarded as interference instructions;
[0156] Determining the cleaning coefficient based on all the interference instructions.
[0157] In one embodiment, the step of determining the cleaning coefficient based on all the interference instructions includes:
[0158] Obtaining the request transformation function, interference word index value, and invalid word index value corresponding to each interference instruction;
[0159] Determining the cleaning coefficient based on the request transformation function, interference word index value, and invalid word index value corresponding to each interference instruction.
[0160] In one embodiment, the step of determining the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameter of the storage space includes:
[0161] Determining the storage location of the file to be edited at each moment according to the change information at each moment and the cleaning coefficient, where the change information at each moment includes: the file page number change degree and the file line number change degree at each moment;
[0162] Determining the target storage location based on the storage location at each moment, the file to be edited, and the storage transformation parameter of the storage space.
[0163] In one embodiment, the storage transformation parameters of the storage space include: the variable value of the storage space, the transformation threshold, and the transformation scale factor; determining the target storage location based on the storage location at each moment, the file to be edited, and the storage transformation parameters of the storage space includes:
[0164] Obtaining the spatial variable of the storage location at each moment, and the eigenvalue of the file to be edited;
[0165] Determining the minimum storage location according to the spatial variable of the storage location at each moment, the eigenvalue, the first variable value of the storage space, the transformation threshold, and the transformation scale factor, and taking the minimum storage location as the target storage location.
[0166] In one embodiment, a computer program product is provided, including a computer program, which when executed by a processor implements the following steps:
[0167] In response to an edit instruction received for the file to be edited, putting the file to be edited into the storage space;
[0168] Obtaining a plurality of edit instructions, determining a cleaning coefficient based on the plurality of edit instructions, and cleaning the plurality of edit instructions based on the cleaning coefficient;
[0169] Obtaining the change information of the file to be edited at each moment during the editing process, and determining the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space;
[0170] Obtaining the file to be edited at the target storage location to obtain the edited completed file.
[0171] In one embodiment, the step of in response to an edit instruction received for the file to be edited, putting the file to be edited into the storage space includes:
[0172] In response to an edit instruction received for the file to be edited, determining the storage occupation ratio of the file to be edited;
[0173] Dividing the storage space for the file to be edited according to the storage occupation ratio, and putting the file to be edited into the storage space.
[0174] In one embodiment, the step of determining the cleaning coefficient based on the plurality of edit instructions includes:
[0175] If no return value of any edit instruction is obtained within the first editing duration, then taking any edit instruction as an interference instruction;
[0176] If, within the second editing duration, the same set of editing instructions is obtained and the number of the set of editing instructions is greater than a preset value, then all of the set of editing instructions are regarded as interference instructions;
[0177] Determine a cleaning coefficient based on all the interference instructions.
[0178] In one embodiment, the determining the cleaning coefficient based on all the interference instructions includes:
[0179] Obtain a request transformation function, an interference word index value, and an invalid word index value corresponding to each interference instruction;
[0180] Determine the cleaning coefficient based on the request transformation function, the interference word index value, and the invalid word index value corresponding to each interference instruction.
[0181] In one embodiment, the determining the target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameter of the storage space includes:
[0182] Determine the storage location of the file to be edited at each moment according to the change information at each moment and the cleaning coefficient, where the change information at each moment includes: the file page number change degree and the file line number change degree at each moment;
[0183] Determine the target storage location based on the storage location at each moment, the file to be edited, and the storage transformation parameter of the storage space.
[0184] In one embodiment, the storage transformation parameter of the storage space includes: the variable value of the storage space, the transformation threshold, and the transformation scale factor; the determining the target storage location based on the storage location at each moment, the file to be edited, and the storage transformation parameter of the storage space includes:
[0185] Obtain the spatial variable of the storage location at each moment, and the feature value of the file to be edited;
[0186] Determine the minimum storage location according to the spatial variable of the storage location at each moment, the feature value, the first variable value of the storage space, the transformation threshold, and the transformation scale factor, and regard the minimum storage location as the target storage location.
[0187] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties.
[0188] Those of ordinary skill in the art can understand that all or part of the processes in the above-described method embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the method embodiments as described above. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.
[0189] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0190] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for online editing of a file, characterized in that, The method includes: In response to an edit instruction received for the file to be edited, putting the file to be edited into a storage space; Obtaining a plurality of edit instructions, determining a cleaning coefficient based on the plurality of edit instructions, and cleaning the plurality of edit instructions based on the cleaning coefficient; Obtaining change information of the file to be edited at each moment during the editing process, and determining a target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space; Obtaining the file to be edited in the target storage location to obtain a completed edited file; Among them, determining the cleaning coefficient based on the plurality of edit instructions includes: If no return value of any edit instruction is obtained within the first editing duration, any edit instruction is regarded as an interference instruction; If the same several edit instructions are obtained within the second editing duration and the number of the several edit instructions is greater than a preset value, the several edit instructions are all regarded as interference instructions; Determining a cleaning coefficient based on all interference instructions; Among them, determining the cleaning coefficient based on all interference instructions includes: Obtaining a request transformation function, an interference word index value, and an invalid word index value corresponding to each interference instruction; Determining a cleaning coefficient based on the request transformation function, the interference word index value, and the invalid word index value corresponding to each interference instruction.
2. The method according to claim 1, wherein The step of, in response to an edit instruction received for the file to be edited, putting the file to be edited into a storage space includes: In response to an edit instruction received for the file to be edited, determining the storage occupation ratio of the file to be edited; Dividing a storage space for the file to be edited according to the storage occupation ratio, and putting the file to be edited into the storage space.
3. The method according to claim 1, wherein The step of determining a target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space includes: According to the change information at each moment and the cleaning coefficient, determining the storage location of the file to be edited at each moment, where the change information at each moment includes: the file page number change degree and the file line number change degree at each moment; Based on the storage location at each moment, the file to be edited, and the storage transformation parameters of the storage space, determining the target storage location.
4. The method according to claim 3, wherein The storage transformation parameters of the storage space include: a first variable value of the storage space, a transformation threshold, and a transformation scale factor; based on the storage location at each moment, the file to be edited, and the storage transformation parameters of the storage space, determining the target storage location includes: Obtaining the spatial variable of the storage location at each moment, and determining the variable mean value of the storage space according to the spatial variable of the storage location at each moment; Obtaining the eigenvalue of the file to be edited, and determining a second variable value of the storage space based on the eigenvalue, the transformation threshold, and the transformation scale factor of the storage space; Based on the variable mean value, the first variable value, and the second variable value of the storage space, determining the minimum storage location, and taking the minimum storage location as the target storage location.
5. An apparatus for online editing of a file, characterized in that, The device includes: A storage space division module, configured to, in response to an edit instruction received for the file to be edited, put the file to be edited into a storage space; A cleaning module, configured to obtain a plurality of editing instructions, determine a cleaning coefficient based on the plurality of editing instructions, and clean the plurality of editing instructions based on the cleaning coefficient; A target storage location determination module, configured to obtain change information of the file to be edited at each moment during the editing process, and determine a target storage location based on the change information at each moment, the cleaning coefficient, and the storage transformation parameters of the storage space; An editing completed file acquisition module, configured to obtain the file to be edited in the target storage location to obtain an editing completed file; Wherein, the cleaning module includes: An interference instruction determination unit, configured to, if no return value of any editing instruction is obtained within a first editing duration, use any editing instruction as an interference instruction; if the same plurality of editing instructions are obtained within a second editing duration and the number of the plurality of editing instructions is greater than a preset value, use the plurality of editing instructions as interference instructions; A cleaning coefficient determination unit, configured to determine a cleaning coefficient based on all interference instructions; Wherein, the cleaning coefficient determination unit includes: A first sub-unit, configured to obtain a request transformation function, an interference word index value, and an invalid word index value corresponding to each interference instruction; A second sub-unit, configured to determine a cleaning coefficient based on the request transformation function, the interference word index value, and the invalid word index value corresponding to each interference instruction.
6. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 4 are implemented.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Multimedia data processing system and method
CN101510211A
Online document editing method and device, terminal device and storage medium
CN110196971A