Document storage capacity updating method and device, electronic equipment, storage medium and program product

By obtaining and updating the change set of documents, the accuracy and stability of document storage capacity calculation is solved, and the accuracy and stability of storage capacity information is ensured, which is suitable for document editing and storage media changes.

CN119106661APending Publication Date: 2024-12-10BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411223627.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The prior art cannot guarantee the accuracy and stability of document storage capacity calculation results at the same time, especially when document editing and storage media change, resulting in storage capacity calculation deviations and instability.

Method used

By obtaining the change set of the target document, the storage capacity change information is determined, and the document storage capacity is updated based on this information, ensuring that the calculation is decoupled from the changes in the storage medium, reducing deviations, and improving accuracy and stability.

Benefits of technology

It realizes the stability and accuracy of document storage capacity information when document editing and storage media changes, reduces calculation deviations and improves storage space management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106661A_ABST
    Figure CN119106661A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a document storage capacity updating method and device, electronic equipment, a storage medium and a program product. The method comprises the steps of obtaining at least one change set of a target document, wherein the change set comprises editing information corresponding to at least one editing operation; determining storage capacity change information of the target document based on the at least one change set; and updating the document storage capacity information of the target document according to the storage capacity change information. By means of the technical scheme, the accuracy of the determined document storage capacity information can be improved on the premise that the stability of the document storage capacity information is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, electronic device, storage medium, and program product for updating document storage capacity. Background Art

[0002] As the content of a document is edited, the storage capacity occupied by the document information is constantly changing. How to effectively calculate and manage the storage capacity of a document becomes an important issue. However, the calculation schemes for document storage capacity in the prior art either have poor accuracy or poor stability in the calculation results of the document storage capacity, and cannot guarantee both the accuracy and stability of the calculation results of the document storage capacity. Summary of the invention

[0003] The embodiments of the present disclosure provide a method, device, electronic device, storage medium and program product for updating document storage capacity, so as to improve the accuracy of document storage capacity calculation results while ensuring the stability of the document storage capacity calculation results.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for updating document storage capacity, comprising:

[0005] Obtaining at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation;

[0006] Determining storage capacity change information of the target document based on the at least one changeset;

[0007] The document storage capacity information of the target document is updated according to the storage capacity change information.

[0008] In a second aspect, the embodiment of the present disclosure further provides a device for updating document storage capacity, including:

[0009] A changeset acquisition module, used to acquire at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation;

[0010] A capacity determination module, configured to determine storage capacity change information of the target document based on the at least one change set;

[0011] The capacity updating module is used to update the document storage capacity information of the target document according to the storage capacity change information.

[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:

[0013] one or more processors;

[0014] a memory for storing one or more programs,

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for updating the document storage capacity as described in the embodiment of the present disclosure.

[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for updating the document storage capacity as described in the embodiment of the present disclosure.

[0017] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product. When the computer program product is executed by a computer, the computer implements the method for updating the document storage capacity as described in the embodiments of the present disclosure.

[0018] The document storage capacity updating method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure can update the storage capacity information of the target document based on the change set of the target document, and can decouple the calculation of the document storage capacity information from the processing of the target document before and after storage and the storage medium of the target document, thereby ensuring that the processing of the target document before and after storage and the changes in the storage medium of the target document will not affect the storage capacity information of the target document, thereby ensuring the stability of the document storage capacity information; at the same time, compared with the technical solution of determining the storage capacity of the target document based on the number of characters in the text content of the target document, it can also reduce the deviation between the calculated document capacity information of the target document and the actual storage capacity information of the document information of the target document, thereby improving the accuracy of the document storage capacity information. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0020] Figure 1 A flowchart of a method for updating document storage capacity provided by an embodiment of the present disclosure;

[0021] Figure 2 A schematic diagram of the content of a change set provided in an embodiment of the present disclosure;

[0022] Figure 3 A schematic diagram of the contents of another change set provided in an embodiment of the present disclosure;

[0023] Figure 4 A flowchart of another method for updating document storage capacity provided by an embodiment of the present disclosure;

[0024] Figure 5 A schematic diagram of calculating the storage capacity of a document by time window aggregation provided by an embodiment of the present disclosure;

[0025] Figure 6 A structural block diagram of a device for updating document storage capacity provided by an embodiment of the present disclosure;

[0026] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0029] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0033] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0034] Figure 1 A flowchart of a method for updating the storage capacity of a document provided in an embodiment of the present disclosure. The method can be executed by a device for updating the storage capacity of a document, wherein the device can be implemented by software and / or hardware and can be configured in an electronic device, typically, in a computer. The method for updating the storage capacity of a document provided in an embodiment of the present disclosure is applicable to scenarios of updating the storage capacity of a document, such as scenarios of updating the storage capacity of an online document based on a change set.

[0035] As the content of documents is constantly changing, how to effectively calculate and manage the size of the document body becomes an important issue. When users edit documents, the storage capacity of the document will change; and no matter what type of document it is, the server will eventually need to save it to a storage medium such as a database (DB), cache, and various file systems, and before and after storage, it will also involve one or more processes such as data encoding and decoding, encryption and decryption, decompression, cooling and / or preheating. Changes in storage media and / or document processing will also directly or indirectly cause changes in the storage capacity occupied by the document, making it difficult to cover the calculation of document storage capacity with a set of universally applicable standards.

[0036] At present, the storage capacity of a document is generally determined and displayed to the user directly based on the number of characters in the document's body content. However, since in addition to the document's body content, the stored document information also includes format information, metadata, revision history and other information, and, for version control and history tracking, records of each change to the document are also saved, the actual storage space occupied by the document information is generally much larger than the storage capacity calculated based on the number of characters in the document's body content. The method of determining the storage capacity of a document based on the number of characters in the document's body content cannot accurately reflect the storage requirements of the document information, and has significant limitations in a document editing environment, especially in a document collaborative editing environment.

[0037] In addition, in some platforms, the actual storage capacity occupied by the document information in the storage medium after storage is used as the storage capacity of the document, that is, the actual storage capacity after the document information is stored is directly displayed to the user. However, this method of determining the document storage capacity is overly dependent on the underlying implementation details. When the document information is encoded and decoded and / or encrypted and decrypted before and after storage, or when the storage medium changes, the document storage capacity displayed to the user will change, making the stability of the document storage capacity displayed to the user poor.

[0038] There is no solution in the prior art for determining the document storage capacity that can take into account both the stability and accuracy of the displayed document storage capacity.

[0039] In view of this, an embodiment of the present disclosure provides a method for updating document storage capacity, which calculates and updates the storage capacity of a document based on a change set of the document, so as to improve the accuracy of the calculation results of the document storage capacity while ensuring the stability of the calculation results of the document storage capacity, thereby more effectively managing storage space.

[0040] like Figure 1 As shown, the method for updating the document storage capacity provided in this embodiment may include:

[0041] S101. Obtain at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation.

[0042] The target document may be understood as a document whose storage capacity information is currently determined. The target document may be a local document or an online document, which is not limited in this embodiment. Optionally, the target document may be an online document, which is described below using this case as an example. The document type of the target document is not limited, for example, the target document may be a text-type document, a slide-type document, a table-type document, and the like.

[0043] The change set (Change Set) of the target document can be a collection of editing information corresponding to at least one editing operation on the target document. For example, the front end (such as the client and / or the web page) can aggregate the editing information of at least one editing operation on the target document into a change set of the target document according to a preset rule, and transmit the editing information of the target document to the server in the form of a change set to reduce the number of data transmissions between the server and the server. This editing information can be understood as information about the content edited by the editing operation, such as the location information of the edited content and the specific content information of the edited content.

[0044] Taking the collaborative editing scenario of online documents as an example, a document can be represented as a series of changesets applied to an empty document in sequence. For example, the changeset can be presented in text form, which contains enough information to be applied to the old document version to generate a new document version, and can also be used to resolve editing conflicts and other issues.

[0045] To improve efficiency and reduce the burden on the server, the front end can aggregate a series of editing operations into a change set. This means that the editing information of a series of editing operations by the user may be aggregated into a change set and sent to the server. For example, a series of quick and continuous editing operations by the user, such as typing, deleting and / or formatting, may be merged into a single change set and then sent to the server.

[0046] A text-type or slide-type document can be composed of multiple data blocks. A change set can contain change information of one or more data blocks. The size of the change set is positively correlated with the number of corresponding data blocks and the change information of each data block (including one or more editing operations).

[0047] Figure 2 A schematic diagram of the contents of a change set provided in an embodiment of the present disclosure. Figure 2 As shown, the change set of the target document of the text type may include the basic information of the change set and the data block information of the data block operated by the change set. The basic information of the change set may include, for example, information such as the identifier of the change set. The data block information of the data block operated by the change set may be understood as the data block information of the data block involved in the change set. The data block information of a data block may include basic information such as the identifier of the data block and the operation information of the data block. The operation information of the data block may be understood as the editing information of the editing operation performed on the data block in the change set.

[0048] Similar to text-type and / or slide-type documents, the size of the storage space occupied by the change set of a table-type document may be related to the editing information of the editing operation contained in the change set, depending on the type of editing operation and the content input by the user.

[0049] Figure 3 A schematic diagram of another change set provided in an embodiment of the present disclosure. Figure 3 As shown, the change set of the target document of the table type may include basic information such as the change set identifier and editing operation information. This editing operation information can be understood as information related to document editing contained in the change set, such as information of at least one editing operation. The information of a certain editing operation may include basic information such as the operation identifier and / or operation type of this editing operation; it may also include editing information of this editing operation. The editing information of the editing operation may include, for example, the row value, column value of the cell operated by this editing operation and / or the editing value of this editing operation.

[0050] In addition, the changeset may also include system attribute information, such as version information (such as version number, etc.) of the target document, author information and / or change source, etc., to maintain the integrity and traceability of the changeset. It is known that the changeset may correspond to the corresponding version of the target document. For example, when the server receives a changeset of the target document, it increases the version number of the target document by 1. The changeset may update the corresponding version of the target document based on the corresponding version number of the target document.

[0051] In this embodiment, at least one change set of the target document may be obtained to update the document storage capacity information of the target document based on the at least one change set.

[0052] In some implementations, a change set of a target document sent by a front end may be received, and upon receiving the change set, the document storage capacity information of the target document may be updated based on the received change set to improve the timeliness of updating the document storage capacity information.

[0053] In other embodiments, the document storage capacity information of the target document may be updated periodically to reduce the resources occupied by updating the document storage capacity information of the target document. For example, after receiving the change set of the target document sent by the front end, the change set may be stored. And when the update cycle of the document storage capacity information of the target document is reached, the document storage capacity information of the target document is updated based on the change set of the target document received in the current update cycle.

[0054] S102: Determine storage capacity change information of the target document based on the at least one change set.

[0055] The target document storage capacity change information can be understood as the target document storage capacity change information. Exemplarily, the target document storage capacity change information can be the target document storage capacity change value compared to the last update, such as the target document storage capacity change number of bytes.

[0056] In this embodiment, after obtaining at least one change set of the target document, the storage capacity change information of the target document this time may be determined based on the obtained at least one change set.

[0057] As an optional implementation, when determining the storage capacity change information of the target document based on at least one acquired change set, the information contained in each change set can be obtained, the information contained in each change set can be serialized, and the total length of the information contained in each change set after serialization can be obtained as the storage capacity change information of the target document this time.

[0058] Serialization can be understood as the process of converting corresponding information into a format that can be stored. When serializing certain information (such as information included in a change set), the information can be converted into a format that can be written into a file or database. Correspondingly, the length of the information after serialization can be understood as the length of the information after serialization, such as the number of bytes after serialization.

[0059] S103: Update the document storage capacity information of the target document according to the storage capacity change information.

[0060] The document storage capacity of the target document can be understood as the total storage capacity of the document information of the target document, and the document storage capacity of the target document can be used to display to users who view and / or edit the target document. In other words, the document storage capacity of the target document can be understood as the storage capacity information of the target document displayed to the relevant users of the target document. It can be the same as or different from the actual total storage capacity information when the document information of the target document is stored in the storage medium. The storage capacity can be understood as the capacity occupied in the storage space, that is, the size of the occupied storage space.

[0061] Exemplarily, after the storage capacity change information of the target document is acquired, the document storage capacity information of the target document may be updated based on the storage capacity change information.

[0062] Taking the storage capacity change information as the number of bytes of storage capacity change, and the document storage capacity information as the number of bytes occupied by the document information of the target document in the storage space as an example, the storage capacity information of the target document before this update can be added to the storage capacity change information of the target document to obtain the document storage capacity information of the target document after the update.

[0063] After obtaining the updated document storage capacity information of the target document, the updated document storage capacity information may be sent to the front end for display, so as to facilitate viewing by users who view and / or edit the target document through the front end.

[0064] In some implementations, the document storage capacity information of the target document may be updated periodically to reduce computational overhead. In this case, optionally, the at least one change set is a change set of the target document in the current update cycle, and the determining the storage capacity change information of the target document based on the at least one change set includes: determining the storage capacity change information of the target document in the current update cycle based on the at least one change set; and updating the document storage capacity information of the target document according to the storage capacity change information includes: updating the document storage capacity information of the target document in the previous update cycle according to the storage capacity change information of the target document in the current update cycle to obtain the document storage capacity information of the target document in the current update cycle.

[0065] Exemplarily, when the update cycle of the target document is reached, such as at the end of the current update cycle, the change sets of the target document in the current update cycle can be obtained; based on the change sets of the target document in the current update cycle, the storage capacity change information of the target document in the current update cycle is determined; and based on the document storage capacity information of the target document in the previous update cycle and the storage capacity change information of the target document in the current update cycle, the current document storage capacity information of the target document in the current update cycle is determined, and the document storage capacity information of the target document is updated to this current document storage capacity information.

[0066] The current update cycle can be understood as the current update cycle. The length of the update cycle can be flexibly set, for example, the length of the update cycle can be set to a time length of 1 minute, 5 minutes or 10 minutes. The previous update cycle can be understood as the update cycle before the current update cycle.

[0067] Exemplarily, the document storage capacity information of the target document in the last update cycle may be the document storage capacity information of the target document at the end of the last update cycle, that is, the document storage capacity information of the target document at the beginning of the current update cycle.

[0068] In the above implementation, before determining the document storage capacity information of the target document in the current update cycle according to the storage capacity change information of the target document, the document storage capacity information of the target document in the previous update cycle can be obtained. The method for obtaining the document storage capacity information of the target document in the previous update cycle is not limited. Optionally, the document storage capacity information of the target document in the previous update cycle is updated based on the storage capacity change information of the target document in the previous update cycle; or, the document storage capacity information of the target document in the previous update cycle is determined based on the document snapshot of the target document in the previous update cycle.

[0069] For example, if the current update cycle is the first update cycle of the target document, the document storage capacity information of the target document at the beginning of the current update cycle can be determined based on the document snapshot of the target document at the beginning of the current update cycle, as the document storage capacity information of the target document in the previous update cycle; if the current update cycle is not the first update cycle of the target document, the document storage capacity information of the target document after being updated in the previous update cycle can be obtained, as the storage capacity information of the target document in the previous update cycle.

[0070] The snapshot of the target document at a certain moment (such as the beginning of the current update cycle) can be a complete backup copy of the target document at that moment. The method of generating the document snapshot of the target document at the beginning of the current update cycle is not limited. For example, the entire document state of the target document can be completely copied at the beginning of the current update cycle to obtain a snapshot of the target document at the beginning of the current update cycle. Taking the current update cycle as the first update cycle of the target document as an example, the initial version of the target document (such as a blank target document) can be completely copied to obtain a snapshot of the initial version of the target document.

[0071] After obtaining the document snapshot of the target document at the beginning of the current update cycle, the document storage capacity information of the target document at the beginning of the current update cycle can be determined based on the document snapshot. For example, the data blocks of the document snapshot can be traversed to obtain the data of each data block; the obtained data of each data block is serialized, and the sum of the lengths of the serialized data of each data block is calculated as the document storage capacity information of the target document at the beginning of the current update cycle. The data block of the document snapshot may include the metadata of the document snapshot and its content. In the collaborative editing scenario, this content may be the content processed by the collaborative editing algorithm.

[0072] The document storage capacity updating method provided in this embodiment obtains at least one change set of the target document, wherein the change set contains editing information corresponding to at least one editing operation; determines the storage capacity change information of the target document based on the at least one change set; and updates the document storage capacity information of the target document according to the storage capacity change information. This embodiment utilizes the above technical solution to update the document storage capacity information of the target document based on the change set of the target document, and can decouple the calculation of the document storage capacity information from the processing of the target document before and after storage and the storage medium of the target document, ensuring that the processing of the target document before and after storage and the change of the storage medium of the target document will not affect the storage capacity information of the target document, thereby ensuring the stability of the document storage capacity information; at the same time, compared with the technical solution of determining the storage capacity of the target document based on the number of characters of the text content of the target document, it can also reduce the deviation between the calculated document capacity information of the target document and the actual storage capacity information of the document information of the target document, thereby improving the accuracy of the document storage capacity information.

[0073] Figure 4 A flowchart of another method for updating the storage capacity of a document provided in an embodiment of the present disclosure. The solution in this embodiment can be combined with one or more optional solutions in the above embodiments. Optionally, the method of determining the storage capacity change information of the target document based on the at least one change set includes: obtaining the storage capacity information of each change set in the at least one change set; and determining the total storage capacity information of the at least one change set based on the storage capacity information of each change set as the storage capacity change information of the target document.

[0074] Correspondingly, such as Figure 4 As shown, the method for updating the document storage capacity provided in this embodiment may include:

[0075] S201. Obtain at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation.

[0076] S202: Obtain storage capacity information of each change set in the at least one change set.

[0077] Specifically, after obtaining at least one update set of the target document, the storage capacity information of each update set in the at least one update set may be obtained. The storage capacity information of each update set may be obtained in any manner.

[0078] In some implementations, the storage capacity information of the changeset may be determined based on the serialization length of all information included in the changeset. For example, when obtaining the storage capacity information of a changeset, all information included in the changeset may be obtained, all information included in the changeset may be serialized, and the total information length of all information included in the changeset after serialization may be obtained as the storage capacity information of the changeset.

[0079] In some implementations, the storage capacity information of the change set may be determined based on the information length of the edit information contained in the change set. In this case, optionally, the obtaining the storage capacity information of each change set in the at least one change set includes: for each change set in the at least one change set, obtaining the information length value of the edit information corresponding to each edit operation in the change set; calculating the total information length value of the edit information corresponding to the at least one edit operation according to the information length value; and determining the storage capacity information of the change set based on the total information length value.

[0080] Exemplarily, a change set may include editing information corresponding to at least one editing operation. When obtaining the storage capacity information of a change set, each editing information included in the change set may be obtained; for each editing information included in the change set, the editing information may be serialized and the information length value of the serialized editing information may be obtained; after obtaining the information length value of each editing information in the change set, each information length value may be added to obtain the total information length value of each editing information in the change set, and the storage capacity information of the change set may be determined based on the total information length value.

[0081] As some optional implementation methods, after obtaining the total information length value of each edit information in the change set, the total information length value can be used as the storage capacity information of the change set to further reduce the amount of calculation required for updating the document storage capacity information of the target document. At this time, optionally, determining the storage capacity information of the change set based on the total information length value includes: using the total information length value as the storage capacity information of the change set.

[0082] As some optional implementation methods, considering that in addition to the editing information, the change set also stores some other information, such as the basic information of the change set, and / or, when actually storing the change set, factors such as file system metadata, indexes, and storage allocation strategies will cause the actual storage capacity information of the change set to be greater than the total information length value of the editing information in the change set. Therefore, after obtaining the total information length value of each editing information in the change set, the product between this total information length value and the preset capacity coefficient can be calculated as the storage capacity information of this change set to further improve the accuracy of the document storage capacity information of the target document. At this time, optionally, determining the storage capacity information of the change set based on the total information length value includes: multiplying the total information length value by the preset capacity coefficient to obtain the total storage amount information of the change set.

[0083] The preset capacity coefficient may be preset, such as being obtained in advance through experiments. For example, the preset capacity coefficient is greater than 1, and the specific value of the preset capacity coefficient is not limited. The preset capacity coefficients used by documents in different businesses when updating the document storage capacity information may be the same or different, and may be flexibly set as needed.

[0084] S203: Determine total storage capacity information of the at least one change set according to the storage capacity information of each change set as storage capacity change information of the target document.

[0085] After obtaining the storage capacity information of each change set in the at least one change set, the total storage capacity information of the at least one change set can be calculated as the storage capacity change information of the target document. Taking the total storage capacity information of the change set as an example, when the information length is used to represent the total storage capacity information of the change set, after obtaining the information length of each change set, the information lengths of the change sets can be added together to obtain the total information length of the change sets as the storage capacity change information of the target document.

[0086] S204: Update the document storage capacity information of the target document according to the storage capacity change information.

[0087] After the storage capacity change information of the target document is acquired, the document storage capacity information of the target document may be updated based on the storage capacity change information.

[0088] The document storage capacity updating method provided in this embodiment can improve the accuracy and stability of the determined document storage capacity information of the target document.

[0089] In some optional embodiments, taking the collaborative editing scenario as an example, when performing capacity calculation, the text capacity (i.e., document storage capacity information) of a document (such as a target document) can be closely associated with each edit of the target document, and the text capacity of the document can be determined by accumulating the size of each edit. Specifically, the size of each edit change can be continuously accumulated on the basis of the initial version to obtain the current text capacity of the document. In addition, in order to be closer to the actual storage capacity of the document, it can also be fitted through an expansion coefficient (i.e., a preset capacity coefficient).

[0090] In the above optional embodiment, the calculation process of the document storage capacity can be described as follows:

[0091] A1. Get the initial size of the document.

[0092] The initial size refers to the size of the snapshot of the initial version of the document. The snapshot of a document can be understood as a complete copy of the entire document state at a certain point in time. The snapshot of the initial document is the complete state of the document when it is created, including all content, metadata, format information, etc. In addition, after the document has been modified to a certain extent, if you need to calculate the snapshot size of the copy created, you can use a similar method to obtain the latest snapshot size of the document as the initial size of the document copy.

[0093] A2. Calculate the size of the document's changeset.

[0094] In this embodiment, calculating the size of the changeset of a document (i.e., the storage capacity information of the changeset) can be understood as calculating the number of bytes occupied by the changeset when it is stored and / or transmitted. The size of the changeset can be calculated using the following formula:

[0095]

[0096] Where C represents the size of the changeset, which is obtained by adding the size of the edit information of each edit operation in the changeset. o Indicates the size of the edit information of the oth edit operation. The size of the edit information of each edit operation depends on the specific content of the edit operation, such as metadata related to the edit operation, the operation type, and the data of the operation.

[0097] The above optional embodiment provides a general method for calculating the size of a change set, and its size can reflect the size of the newly added part of the document caused by the user's editing operation. It can be understood that, taking the deletion operation as an example, although the deletion operation intuitively seems to reduce the size of the document body, due to the need to retain historical records for future rollback operations, these operations actually increase the size of the document.

[0098] In addition, in order to be closer to the actual storage capacity of the document, the actual capacity size of the document can be approximately simulated by adding an expansion coefficient, thereby improving the accuracy of the calculated document size and enhancing the interpretability of the capacity size to users.

[0099] C′=E·C

[0100] Where E represents the expansion factor, which is used to simulate the increase in storage capacity due to factors such as file system metadata, indexes, and storage allocation strategies; C′ represents the size of a single changeset after taking the expansion factor into account.

[0101] A3. Aggregate and calculate document size.

[0102] The document size is the storage capacity of the document, for example, the number of bytes of storage space occupied by the document information. The key to document size tracking is to detect the specific impact of each change set submission on the document size. Specifically, these impacts can be quantified by cumulatively calculating the size of the change sets generated by the edit operations. In order to improve efficiency and reduce computational overhead, the document size can be updated instead of being updated immediately after each change set submission. Instead, it can be aggregated at a specific aggregation point.

[0103] Editing operations are very frequent, and real-time calculation of document size may consume a lot of computing resources. In actual production environments, considering the performance and overhead of computing, you can accumulate change sets for a certain period of time and then perform a centralized calculation.

[0104] For example, assuming that within a certain time window (ie, update period), the version number of a document is updated from m to n, taking into account the expansion coefficient E, the following formula can be defined to calculate the document size:

[0105]

[0106] Among them, D n Represents the size of the document at the end of the current time window. m Represents the document size at the beginning of the current time window (that is, at the end of the previous time window). Represents the total capacity of mn change sets generated within the time window.

[0107] In some implementations, considering that the document body calculation does not have high requirements for real-time performance and a certain period of delay is acceptable, in order to optimize performance and reduce computing overhead, you can choose to aggregate editing operations within a fixed time window, and then perform an overall calculation at the end of the window, that is, use a fixed window algorithm.

[0108] Figure 5 A schematic diagram of calculating the storage capacity of a document according to a time window aggregation provided by an embodiment of the present disclosure. Figure 5 As shown in the figure, assuming that the aggregation of edit operations is performed every x seconds, a window function ω can be defined to collect all change sets within each x-second time window and calculate their total size. Taking into account the expansion factor, the formula for the storage capacity size of the document at the end of the k-th time window can be expressed as:

[0109]

[0110] in, Represents the size of the aggregated document at the end of the k-th time window. Indicates the size of the aggregated document at the end of the k-1th window (that is, at the beginning of the kth window). represents the set of all changesets in the kth time window, where t k -t k-1 =x, representing the length of the time window.

[0111] Thus, efficiency can be improved. Moreover, since document information includes not only text but also other forms of content, when multiple people collaborate to edit, the impact of editing operations on the document size can be reflected in a timely manner, including comments, historical records and / or historical versions, etc., so that the document size can be accurately calculated; and, a unified method for determining the document size can be provided for various types of documents, processing solutions and storage media, ensuring the consistency of calculation methods for different document types, different processing solutions and / or different storage media. Moreover, since it does not rely too much on the underlying implementation details, the consistency of the calculated document size can also be improved, so that users can clearly view the size of the document, and the business party can also manage the storage space according to the document size; since the expansion coefficient is taken into account, the calculated document size can also be made closer to the actual storage capacity of the document, ensuring that the calculation result is accurate and reliable.

[0112] Figure 6 This is a structural block diagram of a document storage capacity update device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and can be configured in an electronic device, typically, in a computer, and can calculate the storage capacity of a document by executing a document storage capacity update method, such as updating the storage capacity of an online document based on a change set. Figure 6 As shown, the document storage capacity updating device provided in this embodiment may include: a change set acquisition module 601, a capacity determination module 602 and a capacity update module 603, wherein:

[0113] A changeset acquisition module 601 is used to acquire at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation;

[0114] A capacity determination module 602, configured to determine storage capacity change information of the target document based on the at least one change set;

[0115] The capacity updating module 603 is used to update the document storage capacity information of the target document according to the storage capacity change information.

[0116] The document storage capacity updating device provided in this embodiment obtains at least one change set of the target document through a change set acquisition module, and the change set contains editing information corresponding to at least one editing operation; determines the storage capacity change information of the target document based on the at least one change set through a capacity determination module; and updates the document storage capacity information of the target document according to the storage capacity change information through a capacity update module. This embodiment utilizes the above technical solution to update the storage capacity information of the target document based on the change set of the target document, and can decouple the calculation of the document storage capacity information from the processing of the target document before and after storage and the storage medium of the target document, ensuring that the processing of the target document before and after storage and the change of the storage medium of the target document will not affect the storage capacity information of the target document, thereby ensuring the stability of the document storage capacity information; at the same time, compared with the technical solution of determining the storage capacity of the target document based on the number of characters of the text content of the target document, it can also reduce the deviation between the calculated document capacity information of the target document and the actual storage capacity information of the document information of the target document, thereby improving the accuracy of the document storage capacity information.

[0117] Optionally, the capacity determination module 602 includes: a capacity acquisition unit, used to acquire the storage capacity information of each change set in the at least one change set; a capacity determination unit, used to determine the total storage capacity information of the at least one change set based on the storage capacity information of each change set as the storage capacity change information of the target document.

[0118] Optionally, the capacity acquisition unit includes: a length value acquisition subunit, used to obtain, for each change set in the at least one change set, an information length value of the editing information corresponding to each editing operation in the change set; a length value calculation subunit, used to calculate the total information length value of the editing information corresponding to the at least one editing operation based on the information length value; and a capacity determination subunit, used to determine the storage capacity information of the change set based on the total information length value.

[0119] Optionally, the capacity determination subunit is specifically used to: use the total information length value as the storage capacity information of the change set; or multiply the total information length value by a preset capacity coefficient to obtain the total storage amount information of the change set.

[0120] Optionally, the at least one change set is a change set of the target document in the current update cycle, and the capacity determination module 602 can be specifically used to: determine the storage capacity change information of the target document in the current update cycle based on the at least one change set; the capacity update module 603 can be specifically used to: update the document storage capacity information of the target document in the previous update cycle according to the storage capacity change information of the target document in the current update cycle, so as to obtain the document storage capacity information of the target document in the current update cycle.

[0121] Optionally, the document storage capacity information of the target document in the last update cycle is updated based on the storage capacity change information of the target document in the last update cycle; or, the document storage capacity information of the target document in the last update cycle is determined based on the document snapshot of the target document in the last update cycle.

[0122] The document storage capacity updating device provided in the embodiment of the present disclosure can execute the document storage capacity updating method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the document storage capacity updating method. For technical details not fully described in this embodiment, please refer to the document storage capacity updating method provided in any embodiment of the present disclosure.

[0123] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device (e.g., a server) 700 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0124] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0125] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0126] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0127] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0128] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0129] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0130] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains at least one change set of the target document, and the change set contains editing information corresponding to at least one editing operation; determines the storage capacity change information of the target document based on the at least one change set; and updates the document storage capacity information of the target document according to the storage capacity change information.

[0131] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0133] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, constitute a limitation on the unit itself.

[0134] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0135] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0136] According to one or more embodiments of the present disclosure, Example 1 provides a method for updating document storage capacity, including:

[0137] Obtaining at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation;

[0138] Determining storage capacity change information of the target document based on the at least one changeset;

[0139] The document storage capacity information of the target document is updated according to the storage capacity change information.

[0140] According to one or more embodiments of the present disclosure, Example 2 is the method according to Example 1, wherein determining the storage capacity change information of the target document based on the at least one change set includes:

[0141] Obtaining storage capacity information of each changeset in the at least one changeset;

[0142] The total storage capacity information of the at least one change set is determined according to the storage capacity information of each change set as the storage capacity change information of the target document.

[0143] According to one or more embodiments of the present disclosure, Example 3, according to the method of Example 2, obtaining storage capacity information of each change set in the at least one change set includes:

[0144] For each change set in the at least one change set, obtaining an information length value of the editing information corresponding to each editing operation in the change set;

[0145] Calculate the total information length value of the editing information corresponding to the at least one editing operation according to the information length value;

[0146] The storage capacity information of the changeset is determined based on the total information length value.

[0147] According to one or more embodiments of the present disclosure, Example 4 is the method according to Example 3, wherein determining the storage capacity information of the change set based on the total information length value includes:

[0148] Using the total information length value as the storage capacity information of the change set; or

[0149] The total information length value is multiplied by a preset capacity coefficient to obtain the total storage amount information of the change set.

[0150] According to one or more embodiments of the present disclosure, Example 5 is a method according to any one of Examples 1 to 4, wherein the at least one change set is a change set of the target document in a current update cycle, and determining the storage capacity change information of the target document based on the at least one change set includes:

[0151] Determining storage capacity change information of the target document in a current update cycle based on the at least one change set;

[0152] The updating of the document storage capacity information of the target document according to the storage capacity change information includes:

[0153] The document storage capacity information of the target document in the previous update cycle is updated according to the storage capacity change information of the target document in the current update cycle to obtain the document storage capacity information of the target document in the current update cycle.

[0154] According to one or more embodiments of the present disclosure, Example 6 is based on the method described in Example 5, wherein the document storage capacity information of the target document in the previous update cycle is updated based on the storage capacity change information of the target document in the previous update cycle; or

[0155] The document storage capacity information of the target document in the last update cycle is determined based on the document snapshot of the target document in the last update cycle.

[0156] According to one or more embodiments of the present disclosure, Example 7 provides a device for updating document storage capacity, including:

[0157] A changeset acquisition module, used to acquire at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation;

[0158] A capacity determination module, configured to determine storage capacity change information of the target document based on the at least one change set;

[0159] The capacity updating module is used to update the document storage capacity information of the target document according to the storage capacity change information.

[0160] According to one or more embodiments of the present disclosure, Example 8 provides an electronic device, including:

[0161] one or more processors;

[0162] a memory for storing one or more programs,

[0163] When the one or more programs are executed by the one or more processors, the one or more processors implement the document storage capacity updating method as described in any one of Examples 1-6.

[0164] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for updating the document storage capacity as described in any one of Examples 1-6.

[0165] According to one or more embodiments of the present disclosure, Example 10 provides a computer program product. When the computer program product is executed by a computer, the computer implements the method for updating the document storage capacity as described in any one of Examples 1-6.

[0166] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0167] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0168] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for updating document storage capacity, characterized in that: include: Obtaining at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation; Determining storage capacity change information of the target document based on the at least one changeset; The document storage capacity information of the target document is updated according to the storage capacity change information.

2. The method according to claim 1, characterized in that: The determining the storage capacity change information of the target document based on the at least one change set includes: Obtaining storage capacity information of each changeset in the at least one changeset; The total storage capacity information of the at least one change set is determined according to the storage capacity information of each change set as the storage capacity change information of the target document.

3. The method according to claim 2, characterized in that The obtaining storage capacity information of each change set in the at least one change set includes: For each change set in the at least one change set, obtaining an information length value of the editing information corresponding to each editing operation in the change set; Calculate the total information length value of the editing information corresponding to the at least one editing operation according to the information length value; The storage capacity information of the changeset is determined based on the total information length value.

4. The method according to claim 3, characterized in that The determining the storage capacity information of the change set based on the total information length value includes: Using the total information length value as the storage capacity information of the change set; or The total information length value is multiplied by a preset capacity coefficient to obtain the total storage amount information of the change set.

5. The method according to any one of claims 1 to 4, characterized in that: The at least one changeset is a changeset of the target document in a current update cycle, and determining the storage capacity change information of the target document based on the at least one changeset includes: Determining storage capacity change information of the target document in a current update cycle based on the at least one change set; The updating of the document storage capacity information of the target document according to the storage capacity change information includes: The document storage capacity information of the target document in the previous update cycle is updated according to the storage capacity change information of the target document in the current update cycle to obtain the document storage capacity information of the target document in the current update cycle.

6. The method according to claim 5, characterized in that The document storage capacity information of the target document in the last update cycle is updated based on the storage capacity change information of the target document in the last update cycle; or The document storage capacity information of the target document in the last update cycle is determined based on the document snapshot of the target document in the last update cycle.

7. A device for updating document storage capacity, characterized in that: include: A changeset acquisition module, used to acquire at least one changeset of a target document, wherein the changeset includes editing information corresponding to at least one editing operation; A capacity determination module, configured to determine storage capacity change information of the target document based on the at least one change set; The capacity updating module is used to update the document storage capacity information of the target document according to the storage capacity change information.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the document storage capacity updating method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the document storage capacity updating method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method for updating the document storage capacity according to any one of claims 1 to 6 is implemented.