CN114239502A - Method and device for editing file online, computer equipment and storage medium - Google Patents

Method and device for editing file online, computer equipment and storage medium Download PDF

Info

Publication number
CN114239502A
CN114239502A CN202111544094.5A CN202111544094A CN114239502A CN 114239502 A CN114239502 A CN 114239502A CN 202111544094 A CN202111544094 A CN 202111544094A CN 114239502 A CN114239502 A CN 114239502A
Authority
CN
China
Prior art keywords
file
edited
editing
storage
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111544094.5A
Other languages
Chinese (zh)
Inventor
朱金惟
王宁
赵刘琦
黄振林
冯子焰
李洁珊
文星
王朝硕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Super High Transmission Co of China South Electric Net Co Ltd
Original Assignee
Super High Transmission Co of China South Electric Net Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Super High Transmission Co of China South Electric Net Co Ltd filed Critical Super High Transmission Co of China South Electric Net Co Ltd
Priority to CN202111544094.5A priority Critical patent/CN114239502A/en
Publication of CN114239502A publication Critical patent/CN114239502A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30145Instruction analysis, e.g. decoding, instruction word fields

Abstract

The application relates to a method, a device, a computer device and a storage medium for editing files online. The method comprises the following steps: in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space; acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient; acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space; and acquiring the file to be edited in the target storage position to obtain an edited file. By adopting the method, the problems that the file cannot be edited and can be re-edited and the information is lost can be reduced.

Description

Method and device for editing file online, computer equipment and storage medium
Technical Field
The present application relates to the field of file processing technologies, and in particular, to a method and an apparatus for editing a file online, a computer device, and a storage medium.
Background
The online file editing can realize that multiple persons edit the same file at different places and different times, and is an essential working and learning tool in the internet era.
The method comprises the steps that multiple terminals repeatedly edit the same file, a server receives multiple editing instructions of the same file from the multiple terminals, and in the process of editing the file, some invalid editing instructions inevitably exist, and the invalid editing instructions conflict with time of normal editing instructions to cause the problem that the file cannot be edited, re-edited or information is lost.
Disclosure of Invention
In view of the above, it is desirable to provide a method, an apparatus, a computer device, and a storage medium for online editing a file, which can reduce the problems of non-editable, re-editable, and information loss of the file.
In a first aspect, the present application provides a method for editing a file online. The method comprises the following steps:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
In one embodiment, the placing the file to be edited into the storage space in response to the editing instruction received by the file to be edited includes:
responding to an editing instruction received by a file to be edited, and determining the storage-occupation ratio of the file to be edited;
and dividing a storage space for the file to be edited according to the storage ratio, and putting the file to be edited into the storage space.
In one embodiment, the determining a cleaning factor based on the plurality of editing instructions comprises:
if the return value of any editing instruction is not obtained within the first editing duration, taking any editing instruction as an interference instruction;
if the same editing instructions are obtained within the second editing duration and the number of the editing instructions is larger than a preset value, all the editing instructions are used as interference instructions;
a cleaning factor is determined based on all of the disturbance commands.
In one embodiment, the determining the cleaning coefficient based on all the interference instructions includes:
acquiring a request transformation function, an interference word index value and an invalid word index value corresponding to each interference instruction;
and 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.
In one embodiment, the determining a target storage location based on the change information at each time, the cleaning coefficient, and the storage transformation parameter of the storage space includes:
determining the storage position of the file to be edited at each moment according to the change information and the cleaning coefficient at each moment, wherein the change information at each moment comprises: the file page number change degree and the file line number change degree at each moment;
and determining a target storage position based on the storage position of each moment, the file to be edited and the storage transformation parameters of the storage space.
In one embodiment, the storage transformation parameters of the storage space include: a variable value, a transform threshold value and a transform scale factor of the storage space; determining a target storage location based on the storage location of each moment, the file to be edited and the storage transformation parameters of the storage space, including:
acquiring the space variable of the storage position at each moment and the characteristic value of the file to be edited;
and determining a minimum storage position according to the space variable of the storage position at each moment, the characteristic value, the first variable value of the storage space, the transformation threshold value and the transformation scale factor, and taking the minimum storage position as a target storage position.
In a second aspect, the present application further provides an apparatus for editing a file online, the apparatus comprising:
the storage space dividing module is used for responding to an editing instruction received by a file to be edited and placing the file to be edited into a storage space;
the cleaning module is used for acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions and cleaning the editing instructions based on the cleaning coefficient;
the target storage position determining module is used for acquiring the change information of the file to be edited at each moment in the editing process and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and the file editing completion module is used for acquiring a file to be edited in the target storage position to obtain an edited file.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
The method, the device, the computer equipment, the storage medium and the computer program product for editing the file online are characterized in that the file to be edited is placed in the storage space, a plurality of editing instructions are obtained, the cleaning coefficient is determined based on the editing instructions, the editing instructions are cleaned based on the cleaning coefficient, invalid instructions can be cleaned, time conflict between the invalid instructions and normal editing instructions is avoided, the problem that the file cannot be edited and can not be edited is reduced, in the storage space of the file to be edited, a target storage position is determined in the storage space according to the change information of the editing file at each moment in the editing process, the cleaning coefficient and the storage transformation parameters of the storage space, the file to be edited in the target storage position is obtained, the file to be edited is prevented from being obtained at the wrong storage position, resulting in the problem that the acquired file information to be edited is missing.
Drawings
FIG. 1 is a diagram of an application environment for a method of editing a file online in one embodiment;
FIG. 2 is a schematic flow chart diagram illustrating a method for editing a file online in one embodiment;
FIG. 3 is a block diagram of an apparatus for editing a file online in one embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The embodiment of the application provides a method for editing a file online, which can be applied to an application environment as shown in fig. 1. Wherein a plurality of terminals 102 communicate with a server 104 over a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. The plurality of terminals 102 send editing instructions to the server 104, the server 104 responds to the editing instructions, places the file to be edited in a storage space, obtains invalid instructions from the plurality of editing instructions received by the file to be edited, eliminates the invalid instructions, obtains change information of the file to be edited at each moment in the editing process, further determines a target storage position, obtains the file to be edited in the target storage position, and obtains an edited file. The plurality of terminals 102 may be, but are not limited to, various personal computers, notebook 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, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In one embodiment, as shown in fig. 2, a method for editing a file online is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
s101, in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space.
The editing instruction is used for editing the file to be edited, the editing instruction is sent to the server by any terminal, the storage space is a storage space divided in a memory of the server, and the file to be edited is edited in the storage space.
Specifically, the server receives an editing instruction of a file to be edited, divides a storage space for the file to be edited, and puts the file to be edited into the storage space to prepare for subsequent editing. It may be determined that the editing instruction received by the file to be edited in S101 is the first editing instruction received by the file to be edited.
S102, acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient.
The editing instructions may be a plurality of editing instructions received by the file to be edited within a first preset time period. The plurality of editing instructions received within the first preset time period include the first editing instruction received in S101.
Specifically, a plurality of editing instructions received by the file to be edited within a first preset time duration are obtained, and a plurality of interference instructions are determined in the plurality of editing instructions, where the interference instructions are editing instructions in which actual editing operations are not executed within the first editing time duration, or editing instructions repeated for multiple times. And calculating a cleaning coefficient according to the plurality of interference instructions, and cleaning the plurality of editing instructions through a cleaning function and the cleaning coefficient so as to remove invalid instructions in the plurality of editing instructions.
S103, obtaining the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space.
The editing process is a process in which the file to be edited receives the plurality of editing instructions within a first preset time length, and the change information at each moment in the editing process is also the change information at each moment within the first preset time length. And the change information at each moment is used for reflecting the change condition of the content of the file to be edited in the editing process.
Specifically, the storage position of the file to be edited at each moment is determined based on the change information at each moment, then the minimum storage position is determined according to the storage position at each moment, the cleaning coefficient and the storage transformation parameter of the storage space, and the minimum storage position is used as the target storage position. The target storage location is a storage location in a storage space.
And S104, acquiring the file to be edited in the target storage position to obtain an edited file.
Specifically, the edited file is extracted based on the target storage location, and the redundant buffer file is deleted.
The method for editing the file on line comprises the steps of putting the file to be edited into a storage space, acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, cleaning the editing instructions based on the cleaning coefficient, can clear the invalid instruction, avoid the time conflict between the invalid instruction and the normal editing instruction, reduce the problem that the file can not be edited and re-edited, in the storage space of the file to be edited, according to the change information of the edited file at each moment in the editing process, the cleaning coefficient and the storage transformation parameter of the storage space, and determining a target storage position in the storage space, acquiring the file to be edited in the target storage position, and acquiring an edited file, so that the problem that the acquired file information to be edited is lost due to the fact that the file to be edited is acquired at an incorrect storage position is solved.
In one embodiment, S101 includes:
s111, responding to an editing instruction received by the file to be edited, and determining the occupation ratio of the file to be edited.
Specifically, the editing instruction may be triggered when a file to be edited is selected, the file list of the server includes a plurality of files, and 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 occupation ratio of the file to be edited. The file list displays a plurality of file names, any one of the file names is selected, and the file to be edited is determined according to the selected file name. The occupation ratio is the ratio between the memory required by the file to be edited and the memory of the server in the editing process.
Responding to an editing instruction received by a file to be edited, acquiring script editing parameters and type editing parameters of the file to be edited, and acquiring preset script coefficient factors, type coefficient factors and a file editing parameter adjusting threshold; and determining the storage-occupation ratio of the file to be edited according to the script coefficient factor, the type coefficient factor, the file editing parameter adjusting threshold, the script editing parameter, the type editing parameter and a server storage space function. Specifically, the formula (1) is shown.
Figure BDA0003415271780000071
Wherein c is the label of the file to be edited, P (c) the memory ratio of the file c to be edited, AcEditing parameters for the script of the file c to be edited, BcEditing parameters for the type of file c to be edited, a1Is a script coefficient factor, a2Is a type coefficient factor, DLcThe threshold is adjusted for the file edit parameter for the server storage space function, ω.
Weighting the script editing parameters and the type editing parameters of the file to be edited to obtain a comprehensive weighted value of the file to be edited, dividing the comprehensive weighted value by the product of the script editing parameters, the type editing parameters and the file editing parameter adjusting threshold value of the file to be edited, and selecting a server storage space function to carry out space quantization adjustment to obtain the occupation ratio of the file to be edited.
And S112, dividing a storage space for the file to be edited according to the memory ratio, and putting the file to be edited into the storage space.
Specifically, the capacity required by editing the file to be edited is estimated according to the storage ratio of the file to be edited, a storage space is divided for the file to be edited, and the file to be edited is placed in the storage space.
And after dividing the storage space for the file to be edited according to the occupation ratio, if the capacity of the storage space accords with the required capacity of the file to be edited, executing an editing instruction, and if the capacity does not accord with the required capacity of the file to be edited, dividing the storage space for the file to be edited again.
After the file to be edited is placed in the storage space, the editing time for the file to be edited to receive the editing instruction and the IP address corresponding to the editing instruction are obtained, the IP address is used for uniquely representing a terminal sending the editing instruction, an index value is generated according to the editing time and the IP address, and the storage space is marked by the index value.
In one embodiment, a file is edited through recursive editing instructions, the file is edited and transmitted by using a closure, each editing instruction received by a server generates an index value corresponding to the editing instruction, and a plurality of editing instructions received within a first preset time duration are counted according to the index values.
In one embodiment, S102 includes:
s211, if the return value of any editing instruction is not obtained within the first editing duration, taking any editing instruction as an interference instruction; and if the same editing instructions are obtained within the second editing duration and the number of the editing instructions is larger than a preset value, all the editing instructions are used as interference instructions.
Specifically, a return value of each editing instruction is monitored, if any editing instruction does not obtain the return value within the first editing time length, it is determined that actual operation is not executed within the first editing time length by any editing instruction, and then any editing instruction is used as an interference instruction; if the return value of any editing instruction is not obtained within the first editing time length, timing is started when any editing instruction is obtained, and the time length reaches the return value of the first editing time length when any editing instruction is not obtained.
If a plurality of editing instructions are obtained in the second editing time length and the number of the editing instructions is larger than a preset numerical value, the editing instructions are judged to be repeated editing operations for many times, and all the editing instructions are used as interference instructions.
S212, determining a cleaning coefficient based on all interference instructions.
Wherein the cleaning coefficient is used for cleaning invalid instructions in the plurality of editing instructions.
Specifically, a request transformation function, an interference word index value and an invalid word index value corresponding to each interference instruction are obtained, and a cleaning coefficient is determined 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).
Figure BDA0003415271780000081
Wherein, ERiIs the cleaning factor, i is the number of disturbance commands, XiIs the request transformation function corresponding to the interference command, r is the interference vocabulary scale factor, s is the interference vocabulary judgment factor, YiIs the index value of the disturbing word corresponding to the disturbing instruction, ZiIs the invalid word index value corresponding to the disturbing instruction, b1Is a sensitive word adjustment factor, b2Is an invalid word adjustment factor.
In one embodiment, S103 includes:
s311, determining the storage position of the file to be edited at each moment according to the change information at each moment and the cleaning coefficient.
Wherein the change information at each time includes: the degree of change in the page number and the degree of change in the line number of the file at each time. The file page number change degree is used for reflecting the change of the page number position of the file to be edited, and the file line number change degree is used for reflecting the change of the line coordinate of the file to be edited.
Specifically, the storage position of the file to be edited at each moment is determined through the editing classification function, and the transmission paths of the files to be edited with different IP addresses are managed according to the time of sending the editing instruction by the terminal, so that the file to be edited is positioned. Specifically, as shown in formula (3).
Figure BDA0003415271780000091
Wherein C (i, j, k) is the storage location of the file to be edited at each moment, σ is the file buffer factor, j is the page number coordinate of the file to be edited, k is the line coordinate of the file to be edited,
Figure BDA0003415271780000092
is the degree of change of the page number of the document at time t,
Figure BDA0003415271780000093
is the degree of change of the number of lines of the document at time t, eta is a reference coefficient for the degree of change of the page number, mu is a reference coefficient for the degree of change of the number of lines of the document, ERiIs the cleaning factor.
S312, determining a target storage position based on the storage position of each moment, the file to be edited and the transformation parameter of the storage space.
Specifically, the space variable of the storage position at each moment is obtained, and the variable mean value of the storage space is determined according to the space variable of the storage position at each moment; acquiring a characteristic value of the file to be edited, and determining a second variable value of the storage space based on the characteristic value, the transformation threshold value of the storage space and the transformation scale factor; and determining a minimum storage position based on the variable mean value, the first variable value and the second variable value of the storage space, and taking the minimum storage position as a target storage position.
And acquiring a storage space variable corresponding to the storage position at each moment, and determining a variable mean value of the storage space based on the storage space variable corresponding to the storage position at each moment and a first preset time length (the time length for acquiring a plurality of editing instructions). And determining a second variable value of the storage space according to the characteristic value of the file to be edited, the transformation threshold value of the storage space and the transformation scale factor. And (4) determining a minimum storage position based on the variable mean value, the first variable value and the second variable value of the storage space, taking the minimum storage position as a target storage position, and determining the target storage position according to a specific process shown in formula (4).
Figure BDA0003415271780000101
Wherein D is a target storage location, T is a first preset duration,
Figure BDA0003415271780000102
is the memory space variable at memory location m at time t,
Figure BDA0003415271780000103
is the variable mean value of the storage space, V is the first variable value of the storage space, W is the characteristic value of the file to be edited, lambda is the transformation threshold of the storage space, g is the transformation scale factor of the storage space, SillegalIs an extraction factor for invalid edited files.
The method for editing the file on line comprises the steps of putting the file to be edited into a storage space, acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, cleaning the editing instructions based on the cleaning coefficient, can clear the invalid instruction, avoid the time conflict between the invalid instruction and the normal editing instruction, reduce the problem that the file can not be edited and re-edited, in the storage space of the file to be edited, according to the change information of the edited file at each moment in the editing process, the cleaning coefficient and the storage transformation parameter of the storage space, and determining a target storage position in the storage space, acquiring the file to be edited in the target storage position, and acquiring an edited file, so that the problem that the acquired file information to be edited is lost due to the fact that the file to be edited is acquired at an incorrect storage position is solved. In an application scene requiring multi-person collaborative editing of a file, a collaborative editing instruction in a network disk system is called to carry out collaborative editing on the file, so that the collaborative operation of the same file can be carried out by multiple persons, multiple scenes and multiple nodes in the same time in a collaborative mode, the concurrent mode is adopted, the operation of simultaneously editing the same file by multiple persons is solved, the office collaborative time is shortened, and the office efficiency is improved; the method can be applied to scenes of light meetings, paperless meetings are realized, preparation of meeting materials is reduced, meeting convenience is improved, and meeting process contents are enriched.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides an apparatus for editing a file online, which is used for implementing the above-mentioned method for editing a file online. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method, so the specific limitations in the embodiment of the device for editing the file online provided below can refer to the limitations in the method for editing the file online in the above, and are not described herein again.
In one embodiment, as shown in fig. 3, there is provided an apparatus for editing a file online, including:
the storage space dividing module is used for responding to an editing instruction received by a file to be edited and placing the file to be edited into a storage space;
the cleaning module is used for acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions and cleaning the editing instructions based on the cleaning coefficient;
the target storage position determining module is used for acquiring the change information of the file to be edited at each moment in the editing process and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and the file editing completion module is used for acquiring a file to be edited in the target storage position to obtain an edited file.
In one embodiment, the storage space dividing module includes:
the file editing device comprises a duty ratio determining unit, a editing unit and a editing unit, wherein the duty ratio determining unit is used for responding to an editing instruction received by a file to be edited and determining the duty ratio of the file to be edited;
and the storage space dividing unit is used for dividing the storage space for the file to be edited according to the storage ratio and placing the file to be edited into the storage space.
In one embodiment, the cleaning module includes:
the interference instruction determining unit is used for taking any editing instruction as an interference instruction if the return value of any editing instruction is not acquired within the first editing duration; if the same editing instructions are obtained within the second editing duration and the number of the editing instructions is larger than a preset value, all the editing instructions are used as interference instructions;
and a cleaning coefficient determination unit which determines a cleaning coefficient based on all the interference instructions.
In one embodiment, the cleaning coefficient determining unit includes:
the first subunit is used for acquiring a request transformation function, an interference word index value and an invalid word index value corresponding to each interference instruction;
and the second subunit is used for 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.
In one embodiment, the target storage location determination module includes:
a first storage location determining unit, configured to determine, according to the change information at each time and the cleaning coefficient, a storage location of the file to be edited at each time, where the change information at each time includes: the file page number change degree and the file line number change degree at each moment;
and the second storage position determining unit is used for determining a target storage position based on the storage position of each moment, the file to be edited and the storage transformation parameters of the storage space.
In one embodiment, the storage transformation parameters of the storage space comprise: a variable value, a transform threshold value and a transform scale factor of the storage space; the second storage location determining unit includes:
the first acquisition unit is used for acquiring the space variable of the storage position at each moment and the characteristic value of the file to be edited;
and the target storage position determining unit is used for determining a minimum storage position according to the space variable of the storage position at each moment, the characteristic value, the first variable value of the storage space, the transformation threshold value and the transformation scale factor, and taking the minimum storage position as the target storage position.
The modules in the device for editing files online can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the method data for realizing the online editing file. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of editing a file online.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
In one embodiment, the placing the file to be edited into the storage space in response to the editing instruction received by the file to be edited includes:
responding to an editing instruction received by a file to be edited, and determining the storage-occupation ratio of the file to be edited;
and dividing a storage space for the file to be edited according to the storage ratio, and putting the file to be edited into the storage space.
In one embodiment, the determining a cleaning factor based on the plurality of editing instructions comprises:
if the return value of any editing instruction is not obtained within the first editing duration, taking any editing instruction as an interference instruction;
if the same editing instructions are obtained within the second editing duration and the number of the editing instructions is larger than a preset value, all the editing instructions are used as interference instructions;
a cleaning factor is determined based on all of the disturbance commands.
In one embodiment, the determining the cleaning coefficient based on all the interference instructions includes:
acquiring a request transformation function, an interference word index value and an invalid word index value corresponding to each interference instruction;
and 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.
In one embodiment, the determining a target storage location based on the change information at each time, the cleaning coefficient, and the storage transformation parameter of the storage space includes:
determining the storage position of the file to be edited at each moment according to the change information and the cleaning coefficient at each moment, wherein the change information at each moment comprises: the file page number change degree and the file line number change degree at each moment;
and determining a target storage position based on the storage position of each moment, the file to be edited and the storage transformation parameters of the storage space.
In one embodiment, the storage transformation parameters of the storage space include: a variable value, a transform threshold value and a transform scale factor of the storage space; determining a target storage location based on the storage location of each moment, the file to be edited and the storage transformation parameters of the storage space, including:
acquiring the space variable of the storage position at each moment and the characteristic value of the file to be edited;
and determining a minimum storage position according to the space variable of the storage position at each moment, the characteristic value, the first variable value of the storage space, the transformation threshold value and the transformation scale factor, and taking the minimum storage position as a target storage position.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
In one embodiment, the placing the file to be edited into the storage space in response to the editing instruction received by the file to be edited includes:
responding to an editing instruction received by a file to be edited, and determining the storage-occupation ratio of the file to be edited;
and dividing a storage space for the file to be edited according to the storage ratio, and putting the file to be edited into the storage space.
In one embodiment, the determining a cleaning factor based on the plurality of editing instructions comprises:
if the return value of any editing instruction is not obtained within the first editing duration, taking any editing instruction as an interference instruction;
if the same editing instructions are obtained within the second editing duration and the number of the editing instructions is larger than a preset value, all the editing instructions are used as interference instructions;
a cleaning factor is determined based on all of the disturbance commands.
In one embodiment, the determining the cleaning coefficient based on all the interference instructions includes:
acquiring a request transformation function, an interference word index value and an invalid word index value corresponding to each interference instruction;
and 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.
In one embodiment, the determining a target storage location based on the change information at each time, the cleaning coefficient, and the storage transformation parameter of the storage space includes:
determining the storage position of the file to be edited at each moment according to the change information and the cleaning coefficient at each moment, wherein the change information at each moment comprises: the file page number change degree and the file line number change degree at each moment;
and determining a target storage position based on the storage position of each moment, the file to be edited and the storage transformation parameters of the storage space.
In one embodiment, the storage transformation parameters of the storage space include: a variable value, a transform threshold value and a transform scale factor of the storage space; determining a target storage location based on the storage location of each moment, the file to be edited and the storage transformation parameters of the storage space, including:
acquiring the space variable of the storage position at each moment and the characteristic value of the file to be edited;
and determining a minimum storage position according to the space variable of the storage position at each moment, the characteristic value, the first variable value of the storage space, the transformation threshold value and the transformation scale factor, and taking the minimum storage position as a target storage position.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
In one embodiment, the placing the file to be edited into the storage space in response to the editing instruction received by the file to be edited includes:
responding to an editing instruction received by a file to be edited, and determining the storage-occupation ratio of the file to be edited;
and dividing a storage space for the file to be edited according to the storage ratio, and putting the file to be edited into the storage space.
In one embodiment, the determining a cleaning factor based on the plurality of editing instructions comprises:
if the return value of any editing instruction is not obtained within the first editing duration, taking any editing instruction as an interference instruction;
if the same editing instructions are obtained within the second editing duration and the number of the editing instructions is larger than a preset value, all the editing instructions are used as interference instructions;
a cleaning factor is determined based on all of the disturbance commands.
In one embodiment, the determining the cleaning coefficient based on all the interference instructions includes:
acquiring a request transformation function, an interference word index value and an invalid word index value corresponding to each interference instruction;
and 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.
In one embodiment, the determining a target storage location based on the change information at each time, the cleaning coefficient, and the storage transformation parameter of the storage space includes:
determining the storage position of the file to be edited at each moment according to the change information and the cleaning coefficient at each moment, wherein the change information at each moment comprises: the file page number change degree and the file line number change degree at each moment;
and determining a target storage position based on the storage position of each moment, the file to be edited and the storage transformation parameters of the storage space.
In one embodiment, the storage transformation parameters of the storage space include: a variable value, a transform threshold value and a transform scale factor of the storage space; determining a target storage location based on the storage location of each moment, the file to be edited and the storage transformation parameters of the storage space, including:
acquiring the space variable of the storage position at each moment and the characteristic value of the file to be edited;
and determining a minimum storage position according to the space variable of the storage position at each moment, the characteristic value, the first variable value of the storage space, the transformation threshold value and the transformation scale factor, and taking the minimum storage position as a target storage position.
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, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for editing a file online, the method comprising:
in response to an editing instruction received by a file to be edited, putting the file to be edited into a storage space;
acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions, and cleaning the editing instructions based on the cleaning coefficient;
acquiring the change information of the file to be edited at each moment in the editing process, and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and acquiring the file to be edited in the target storage position to obtain an edited file.
2. The method according to claim 1, wherein the placing the file to be edited into the storage space in response to the editing instruction received by the file to be edited comprises:
responding to an editing instruction received by a file to be edited, and determining the storage-occupation ratio of the file to be edited;
and dividing a storage space for the file to be edited according to the storage ratio, and putting the file to be edited into the storage space.
3. The method of claim 1, wherein determining a cleaning factor based on the plurality of editing instructions comprises:
if the return value of any editing instruction is not obtained within the first editing duration, taking any editing instruction as an interference instruction;
if the same editing instructions are obtained within the second editing duration and the number of the editing instructions is larger than a preset value, all the editing instructions are used as interference instructions;
a cleaning factor is determined based on all of the disturbance commands.
4. The method of claim 3, wherein determining a cleaning factor based on all of the perturbation instructions comprises:
acquiring a request transformation function, an interference word index value and an invalid word index value corresponding to each interference instruction;
and 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.
5. The method of claim 1, wherein determining a target storage location based on the change information at each time, the cleaning coefficient, and a storage transformation parameter of the storage space comprises:
determining the storage position of the file to be edited at each moment according to the change information and the cleaning coefficient at each moment, wherein the change information at each moment comprises: the file page number change degree and the file line number change degree at each moment;
and determining a target storage position based on the storage position of each moment, the file to be edited and the storage transformation parameters of the storage space.
6. The method of claim 5, wherein storing the transformation parameters of the storage space comprises: a first variable value, a transform threshold, and a transform scale factor of the storage space; determining a target storage location based on the storage location of each moment, the file to be edited and the storage transformation parameters of the storage space, including:
acquiring the space variable of the storage position at each moment, and determining the variable mean value of the storage space according to the space variable of the storage position at each moment;
acquiring a characteristic value of the file to be edited, and determining a second variable value of the storage space based on the characteristic value, the transformation threshold value of the storage space and the transformation scale factor;
and determining a minimum storage position based on the variable mean value, the first variable value and the second variable value of the storage space, and taking the minimum storage position as a target storage position.
7. An apparatus for editing a file online, the apparatus comprising:
the storage space dividing module is used for responding to an editing instruction received by a file to be edited and placing the file to be edited into a storage space;
the cleaning module is used for acquiring a plurality of editing instructions, determining a cleaning coefficient based on the editing instructions and cleaning the editing instructions based on the cleaning coefficient;
the target storage position determining module is used for acquiring the change information of the file to be edited at each moment in the editing process and determining a target storage position based on the change information at each moment, the cleaning coefficient and the storage transformation parameter of the storage space;
and the file editing completion module is used for acquiring a file to be edited in the target storage position to obtain an edited file.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202111544094.5A 2021-12-16 2021-12-16 Method and device for editing file online, computer equipment and storage medium Pending CN114239502A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111544094.5A CN114239502A (en) 2021-12-16 2021-12-16 Method and device for editing file online, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111544094.5A CN114239502A (en) 2021-12-16 2021-12-16 Method and device for editing file online, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114239502A true CN114239502A (en) 2022-03-25

Family

ID=80757073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111544094.5A Pending CN114239502A (en) 2021-12-16 2021-12-16 Method and device for editing file online, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114239502A (en)

Similar Documents

Publication Publication Date Title
CN107111636A (en) Optimize the volume level redundancy encoding technology of storage device for sequential delivery
CN112070550A (en) Keyword determination method, device and equipment based on search platform and storage medium
CN113901395B (en) Data processing method, data processing device, computer equipment and storage medium
CN114239502A (en) Method and device for editing file online, computer equipment and storage medium
CN115511562A (en) Virtual product recommendation method and device, computer equipment and storage medium
CN114782960A (en) Model training method and device, computer equipment and computer readable storage medium
CN114780368A (en) Table data synchronization tool evaluation method and expression data synchronization method
CN114821140A (en) Image clustering method based on Manhattan distance, terminal device and storage medium
CN114881761A (en) Determination method of similar sample and determination method of credit limit
CN116541454B (en) Event configuration method, device, computer equipment and storage medium
CN117194350B (en) Document storage method and system in engineering construction stage of data center
CN114064935A (en) Information map construction method, device, equipment, storage medium and program product
CN114218898A (en) Online collaborative document editing method and device, computer equipment and storage medium
CN109408278B (en) Data processing method and device
CN116701784A (en) Dot search method, apparatus, device, storage medium, and program product
CN116881450A (en) Information classification method, apparatus, computer device, storage medium, and program product
CN117972674A (en) Method, device, computer equipment and storage medium for determining session expiration duration
CN114036171A (en) Application data management method and device, computer equipment and storage medium
CN116401323A (en) Index data processing method and device and computer equipment
CN116976999A (en) Service evaluation method, device, apparatus, medium, and program product
CN115865857A (en) Response data pushing method and device, computer equipment and storage medium
CN116524300A (en) Predictive training method, device and live broadcast system of face key point detection model
CN117216103A (en) Method, device, computer equipment and storage medium for determining cache failure time
CN116680467A (en) Object recommendation method, device, computer equipment and storage medium
CN116775186A (en) Page data processing method and device, computer equipment and storage medium

Legal Events

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