CN113378524B - Method, device, equipment and storage medium for updating storage information of document - Google Patents
Method, device, equipment and storage medium for updating storage information of document Download PDFInfo
- Publication number
- CN113378524B CN113378524B CN202110634924.7A CN202110634924A CN113378524B CN 113378524 B CN113378524 B CN 113378524B CN 202110634924 A CN202110634924 A CN 202110634924A CN 113378524 B CN113378524 B CN 113378524B
- Authority
- CN
- China
- Prior art keywords
- document
- information
- annotation
- identifier
- updating
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000004044 response Effects 0.000 claims abstract description 18
- 230000004048 modification Effects 0.000 claims description 16
- 238000012986 modification Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 12
- 238000010586 diagram Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 9
- 238000013507 mapping Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000002372 labelling Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/38—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/381—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using identifiers, e.g. barcodes, RFIDs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/38—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/383—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention discloses a method, a device, equipment and a storage medium for updating storage information of a document, relates to the technical field of computers, in particular to the technical field of cloud storage and the technical field of cloud platforms, and can be applied to a collaborative editing scene of the document. The specific implementation scheme of the method for updating the storage information of the document is as follows: generating a first object for the annotation to be added based on the first annotation update information in response to the first annotation update information for the annotation to be added in the document; taking a first identifier in the first annotation update information as a value of a target attribute of the first object; and incorporating the first object into the stored information of the document.
Description
Technical Field
The disclosure relates to the technical field of computers, in particular to the technical field of cloud storage and the technical field of cloud platforms, and can be applied to a collaborative editing scene of a document.
Background
With the development of computer technology and internet technology, the scene requirement of online collaborative editing of files is becoming wider and wider. In a document stored in the form of objects (objects), when updating an already existing annotation in the document, it is necessary to locate the object in the stored content in which the annotation to be updated is stored.
Disclosure of Invention
A method, apparatus, device and storage medium for updating stored information of a husband are provided, which improve update efficiency and editing convenience.
According to one aspect of the present disclosure, there is provided a method of updating stored information of a document, including: generating a first object for the annotation to be added based on the first annotation update information in response to the first annotation update information for the annotation to be added in the document; taking a first identifier in the first annotation update information as a value of a target attribute of the first object; and incorporating the first object into the stored information of the document.
According to another aspect of the present disclosure, there is provided an apparatus for updating stored information of a document, including: the object generation module is used for responding to first annotation update information for adding the annotations in the document and generating a first object aiming at the annotations to be added based on the first annotation update information; the attribute value obtaining module is used for taking the first identifier in the first annotation update information as the value of the target attribute of the first object; and the information merging module is used for merging the first object into the stored information of the document.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of updating stored information of a document provided by the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of updating stored information of a document provided by the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of updating stored information of a document provided by the present disclosure.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic view of an application scenario of a method, apparatus, device and storage medium for updating stored information of a document according to an embodiment of the present disclosure;
FIG. 2 is a flow diagram of a method of updating stored information of a document according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of determining a second object for a annotation to be modified in stored information of a document according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of stored information of an update document according to another embodiment of the present disclosure;
FIG. 5 is a block diagram of an apparatus for updating stored information of a document according to an embodiment of the present disclosure; and
FIG. 6 is a block diagram of an electronic device for implementing a method of updating stored information of a document according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The present disclosure provides a method of updating stored information of a document, the method including an object generation stage, an attribute value acquisition stage, and an information merging stage. In the object generation stage, in response to first annotation update information for adding annotations in a document, a first object for which annotations are to be added is generated based on the first annotation update information. In the attribute value obtaining stage, a first identifier in the first annotation update information is taken as a value of a target attribute of the first object. In the information merging stage, the first object is merged into the stored information of the document.
An application scenario of the method and apparatus provided by the present disclosure will be described below with reference to fig. 1.
Fig. 1 is an application scenario schematic diagram of a method, an apparatus, a device, and a storage medium for updating stored information of a document according to an embodiment of the present disclosure.
As shown in fig. 1, the application scenario 100 includes one or more terminal devices 111 to 112 and a database server 120, and the one or more terminal devices may communicate with the database server 120 through a network to obtain a document from the database server or store the edited and modified document in the database server 120. Wherein the network may comprise wired or wireless communication links.
The terminal devices 111-112 may be display screen-capable terminal devices capable of document editing, including but not limited to smart phones, tablet computers, laptop and desktop computers, and the like.
The database server 120 may be, for example, a server having a storage function. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
According to embodiments of the present disclosure, one or more users may edit a document via the one or more terminal devices 111-112, for example, may add annotations to the document or modify existing annotations in the document. The one or more terminal devices may render the front-end display page in response to adding the annotation or modifying the existing annotation to display the document with the added annotation or modified the existing annotation to the one or more users. The one or more terminal devices may also send annotation update information to the database server 120 indicating that annotations are added or that existing annotations are modified, such that the database server 120 invokes the installed merge engine 140 to update the stored information of the document, add annotations to the stored information indicating that annotations are added, or perform modifications to the stored information indicated by the annotation update information, thereby obtaining a new document 150. The modification to the existing label may include adding the labeling content of the existing label, modifying the labeling content of the existing label, deleting the existing label, and the like, which is not limited in this disclosure.
In one embodiment, multiple users may collaboratively edit a document online. For example, a first user may add a first annotation 131 to a document via terminal device 111 and a second user may add a second annotation 132 to the document via terminal device 112. The terminal device may send annotation update information indicating that the first annotation is added and annotation update information indicating that the second annotation is added to database server 120. The database server 120 may respectively establish an object for the first annotation and an object for the second annotation based on the received annotation update information by invoking the merge engine 140, and merge the established objects into the storage information of the original document to obtain the storage information of the new document 150, thereby implementing the update of the storage content of the document. Wherein each object has a unique identifier and each object uniquely corresponds to a label. It is to be appreciated that online collaborative editing of documents may be implemented, for example, based on cloud platform technology and cloud storage technology, which is not limiting of the present disclosure.
According to the embodiment of the present disclosure, since the terminal device renders the display page at the front end, the database server 120 has not completed updating the stored information of the document, that is, has not generated the object corresponding to the newly added annotation. Then at the front-end rendering stage, the identifier of the object corresponding to the newly added annotation cannot be obtained. Typically, the terminal device generates a temporary identifier for the newly added label and carries the temporary identifier in the label update information to distinguish between different labels.
When the database server 120 updates the stored information of the document based on the annotation update information indicating that a certain annotation is added, the length required for the update may be long. In a practical scenario, during the updating process, the terminal device may receive an operation of modifying the certain label by the user, and send label update information indicating to modify the certain label to the database server 120. In this case, the database server 120 needs to change the object for a certain annotation based on the annotation update information indicating that the certain annotation is modified after completing the update based on the annotation update information indicating that the certain annotation is added. However, since the label update information indicating modification of the certain label carries a temporary identifier, the database server 120 first needs to solve the problem of how to associate the temporary identifier with the object for the certain label.
To solve the above problem, the above situation can be avoided by means of locking. For example, in a process in which the database server updates the document storage information based on the annotation update information indicating that a certain annotation is added, the document is locked so that the user cannot modify the existing annotation in the document. Or by locking, a user only adding a certain label has the authority to modify the certain label, so that the synchronization of the adding and modifying of the certain label is ensured to be realized at the same terminal. But in the case of editing a document cooperatively by multiple persons, editing efficiency and user experience are reduced to some extent.
In order to solve the above-mentioned problem, when receiving the label update information indicating that a certain label is added, the database server 120 may first establish a mapping relationship between the temporary identifier in the label update information and the identifier of the object for the certain label, so when the database server 120 modifies the label update information of the certain label, the object for the certain label may be located from the mapping relationship based on the temporary identifier in the label update information, thereby modifying the object based on the label update information for modifying the certain label. The method can solve the problems of low editing efficiency and poor user experience, but the complexity of updating the document storage information is increased because the mapping relation needs to be constructed in advance and needs to be read when the labels are modified each time.
In order to solve the above-described problem, a method of updating stored information of a document described below may also be employed, for example, when the database server 120 generates an object for an annotation to be added, the temporary identifier for the annotation to be added generated by the terminal device may be used as a value for a certain attribute in the object for the annotation to be added. So that the database server 120 can provide a basis for subsequently locating the object to be annotated.
It should be noted that, the method for updating the stored information of the document provided by the present disclosure may be performed by the database server 120. Accordingly, the means for updating stored information of a document provided by the present disclosure may be provided in the database server 120.
It should be understood that the number and types of terminal devices and database servers in fig. 1 are merely illustrative. There may be any number and type of terminal devices and database servers as desired for implementation.
The method of updating stored information of a document provided by the present disclosure will be described in detail below with reference to the scenario described in fig. 1, by way of fig. 2 to 4.
FIG. 2 is a flowchart of a method of updating stored information of a document according to an embodiment of the present disclosure.
As shown in fig. 2, the method 200 of updating stored information of a document of this embodiment may include operations S210 to S230.
In operation S210, in response to first annotation update information for adding annotations in a document, a first object for which annotations are to be added is generated based on the first annotation update information.
According to the embodiment of the disclosure, when the first annotation update information is received, if the database server does not update the document, the first object can be generated based on the first annotation update information in time. If the database server is performing an operation to update the stored information of the document, a first object may be generated based on the first annotation update information after the operation is performed.
According to embodiments of the present disclosure, the document may be a document stored in the form of an object, for example, a document in a portable document format (Portable Document Format, PDF), or the like. Wherein each element in the document is stored in the form of an object, and each object has a unique identifier (id value), which is an integer. In a PDF document, the identifier is used to cross-reference the storage location of a table index object.
The labels added in the document can be text box labels, highlight labels, underline labels or strikethrough labels and the like. By generating the first object and combining the first object into the stored information of the original document, the updated stored information can include the added marked information, and the stored information of the document is updated. It will be appreciated that the above-added labels are merely examples to facilitate an understanding of the present disclosure, and the present disclosure is not limited thereto.
According to an embodiment of the present disclosure, the first object is used to record related information of the added label, for example, an id value of the object, a label type, coordinates, color, line width, author information, creation time, modification time, and the like of the label may be recorded. The related information may be embodied in the form of attributes, for example, the first object may have a plurality of attributes that may include a presentation stream (APPEARANCE STREAMS), color, creation time, identifier, annotation Name (Name, NM), indirect referencing object, pop-up box object, default user space, element location coordinates in the annotation, location, type, and subtype of parent node, and so forth. The NM is an optional attribute, and is a string of characters for recording a label name, wherein the label name is unique in a document page to which the label belongs.
When the first object is generated, each piece of information in the first label updating information can be used as the value of each attribute in the first object, and the first label updating information can comprise the related information. It will be appreciated that the merging engine installed in the database server may be invoked to generate the first object, and the method of generating the first object is similar to the related art and will not be described in detail herein. The merging engine may integrate program modules for updating documents stored in the form of objects in the related art, which will not be described in detail herein.
In operation S220, the first identifier in the first annotation update is taken as the value of the target attribute of the first object.
According to embodiments of the present disclosure, the target attribute may be the NM described previously, or any other attribute. The first identifier in the first annotation update information may be a temporary identifier for the annotation to be added generated for the terminal device.
After the first object is generated, the first identifier may be read, for example, from the byte in which the identifier is recorded in the first annotation update information, and the read first identifier may be assigned to the target attribute of the first object. The byte of the record identifier may be determined according to a preset protocol, and the position of the byte is not limited by the present disclosure.
In operation S230, the first object is incorporated into the stored information of the document.
After the first object is obtained and the value of the first object is set, the first object can be added to the original storage information of the document stored in the database memory to form the storage information of a new document. Thereby realizing the updating of the stored information of the document.
The embodiment of the disclosure further assigns the temporary identifier generated by the terminal device to the target attribute of the first object after generating the annotation object for the to-be-added annotation based on the to-be-added annotation. In this way, the attribute of the first object includes both the attribute having the value of the identifier of the first object and the temporary identifier having the value of the identifier for the object to be marked. Thus, the association between the temporary identifier generated by the terminal equipment and the object can be realized without additionally establishing a mapping relation. Therefore, the updating efficiency of the stored information of the document can be improved to a certain extent, and the complexity of a system engine for updating the stored information in the database server is reduced. Moreover, in the embodiment, the association between the temporary identifier generated by the terminal equipment and the identifier of the object can be established by assigning the attribute of the object, so that the technical scheme that the temporary identifier cannot be corresponding to the object is solved without locking, and the file editing efficiency and the user experience can be improved.
By the method for updating the stored information based on the first annotation update information added with the annotation in the document, when the annotation update information for modifying the annotation in the document is received later, the object aiming at the document to be modified can be positioned according to the identifier of the object and the temporary identifier in the target attribute of the object, so that the accurate modification of the annotation is realized. The method of locating the object will be described in detail below in conjunction with fig. 3.
FIG. 3 is a schematic diagram of determining a second object for a annotation to be modified in stored information of a document according to an embodiment of the present disclosure.
According to the embodiment of the disclosure, when the annotation update information received by the database server is second annotation update information for modifying the annotation in the document, the embodiment can firstly determine a second object for the annotation to be modified in the storage information of the document.
In an embodiment, as shown in fig. 3, when determining the second object, the embodiment 300 may first determine the identifier in the second label update information 310 as the second identifier 320. A second object for the annotation to be modified in the stored information of the document is then determined based on the second identifier 320. The document may have, for example, at least one annotation, and accordingly the stored information of the document includes at least one object for the at least one annotation, respectively.
If the document displayed by the terminal device is an updated document obtained from the database server, the terminal device responds to the operation of modifying the annotation by the user, and the identifier carried in the annotation update request sent to the database server is an identifier for the object to be modified. Thus, in this embodiment, when determining the second object based on the second identifier 320, the identifier of at least one object (i.e., the object identifier 340) may be sequentially matched with the second identifier 320 to obtain the first matching result 350. Wherein the identifiers of the objects in the stored information 330 of the document may be traversed, and one identifier obtained by the traversing is matched with the second identifier 320 to determine whether the two are consistent. If the acquired identifiers are consistent, determining the object to which the acquired identifiers belong as a second object. If not, traversing and re-acquiring the other identifier, and matching the other identifier with the second identifier. Until the identifier of the object matching the second identifier is obtained, or the identifiers of all objects in the stored information of all documents are matched with the second identifier. Wherein the first matching result 350 may include having the object identifier matching the second identifier and not having the object identifier matching the second identifier. If the first matching result 350 is that there is a matching object identifier, the object to which the object identifier belongs is regarded as the second object 360.
Illustratively, if the first match result 350 is an identifier that does not have an object that matches the second identifier. It may be caused by the fact that the document displayed by the terminal device is not an updated document obtained from the database server, the terminal device not yet being aware of the identifier for the object to be modified. In this case, the identifier in the label update information sent by the terminal device is a temporary identifier generated by the terminal device for the label. The embodiment may also match the second identifier 320 with the value of the target attribute of the at least one object in case it is determined that the identifiers of the at least one object do not match the second identifier 320. Specifically, the value of the respective target attribute of the at least one object may be determined first. Then, the object to which the value of the target attribute matching the second identifier belongs is determined as the second object.
For example, the value 370 of the target attribute of the at least one object may be sequentially matched with the second identifier to obtain a second matching result 380. The target attribute of at least one object in the stored information of the document may be traversed to obtain a value 370 of the target attribute, and the value of the target attribute obtained by the traversing is matched with the second identifier to determine whether the value of the target attribute and the value of the second identifier are consistent. If so, the object to which the value of the target attribute obtained by the traversal belongs is determined to be the second object 360. If not, traversing and re-acquiring the value of the other target attribute, and matching the value of the other target attribute with the second identifier. Until a value of the target property matching the second identifier is obtained or a value of the target property of at least one object matches the second identifier. Wherein the second match result 380 may include values having target attributes that match the second identifier and values not having target attributes that match the second identifier. If the second matching result is that the value of the target attribute matched with the second identifier is not included, the second label updating information sent by the terminal equipment is possibly wrong, and the second label updating information can be selected to be discarded.
After determining the second object 360 for the annotation to be modified in the stored information of the document, the second object 360 may be modified based on the second annotation update information 310. For example, if the modification to the label to be modified is modification to the color of the label, modifying the value of the color attribute in the attribute of the second object. If the modification to the label to be modified is deleting the label to be modified, the second object can be directly deleted. By modifying the second object, updating of the stored information of the document can be achieved. It will be appreciated that the method of updating the stored information of the document based on the second annotation update information is similar to that of the related art and will not be described in detail herein.
As can be seen from the foregoing, when the second label update information for modifying the label in the document is received, and when the identifier of the object that matches the second identifier is not matched, the embodiment of the disclosure can determine the object for the label to be modified by matching the second identifier with the value of the target attribute of the object, without acquiring the mapping relationship first as in the related art, and then searching the object identifier having the mapping relationship with the second identifier from the mapping relationship based on the second identifier. Therefore, the efficiency of updating the stored information of the document can be effectively improved.
Fig. 4 is a schematic diagram of stored information of an update document according to another embodiment of the present disclosure.
According to the embodiment of the disclosure, when receiving the annotation update information sent by the terminal device, the database server can update the storage information of the document based on the annotation update information in time, for example, in an idle state. The annotation update information may be cached first, and the stored information of the document may be updated periodically based on the cached annotation update information.
Illustratively, the method of updating stored information of a document of this embodiment may cache third annotation update information in response to receiving the third annotation update. And then periodically updating the storage information of the document according to the cached third labeling updating information. The update period may be set according to actual requirements, for example, which is not limited in the present disclosure. It will be appreciated that the stored information of the update document of the previous embodiment is more advantageous in this periodically updated scenario.
According to an embodiment of the present disclosure, when periodically updating the stored information of the document, the embodiment 400 may first obtain the cached third annotation update 420 from the cache space 410. After the cached third annotation update 420 is obtained, the type of the cached third annotation update 420 may be determined. The types include a type of adding a label in the document and a type of modifying a label in the document. The stored information of the document is then updated based on the type of the cached third annotation update 420. It is to be appreciated that modifying annotations in a document can include deleting annotations in the document, adding, deleting, modifying, etc., content of annotations in the document.
For example, an information transfer protocol may be set between the terminal device and the database server, and the information transfer protocol may be defined with a target byte in the information indicating the type of information. This embodiment, in determining the type of the cached third annotation update 420, may determine the type based on the value of the target byte. For example, as shown in FIG. 4, after the cached third annotation update 420 is obtained from the cache space 410, the value 430 of the target byte in the cached third annotation update 420 may be determined. If the value of the target byte is 1, then the type 440 of the cached third annotation update may be determined to be the type of adding annotations to the document. If the value of the target byte is 0, then the type 440 of the cached third annotation update may be determined to be the type of annotation in the modified document. It may be understood that the target byte may be any byte in the third label update information, and the value of the target byte and the correspondence between the value of the target byte and the type of the third label update information are merely used as examples to facilitate understanding of the disclosure, which is not limited by the disclosure.
According to the embodiment of the disclosure, if the determined type 440 of the cached third annotation update information 420 is a type of adding an annotation in the husband, the cached third annotation update information may be used as the first annotation update information described above, and the operation performed in response to the first annotation update information is used to merge the object to be added with the annotation indicated by the third annotation update information into the storage information of the document, so as to complete the update of the storage information of the document.
According to an embodiment of the present disclosure, if the determined type 440 of the cached third annotation update 420 is a type of an annotation in the modification document, the cached third annotation update may be used as the second annotation update described above, and the object to be annotated indicated by the third annotation update is modified by adopting the operation performed in response to the second annotation update, thereby completing the update of the storage information of the document.
It will be appreciated that the above-described operation of determining the type of the cached third annotation update may also be performed before the third annotation update is cached, and the different types of third annotation updates are cached in different cache spaces.
It will be appreciated that the above method for determining the type of the cached third annotation update is merely exemplary to facilitate understanding of the present disclosure, and the present disclosure is not limited thereto. By identifying the type of the cached annotation update information, the stored information of the document can be effectively updated.
Based on the method for updating the stored information of the document, the disclosure also provides a device for updating the stored information of the document. The device will be described in detail below in connection with fig. 5.
Fig. 5 is a block diagram of an apparatus for updating stored information of a document according to an embodiment of the present disclosure.
As shown in fig. 5, the apparatus 500 for updating stored information of a document of this embodiment may include an object generation module 510, an attribute value acquisition module 520, and an information merging module 530.
The object generation module 510 is configured to generate, in response to first annotation update information for adding an annotation in a document, a first object for which an annotation is to be added based on the first annotation update information. In an embodiment, the object generating module 510 may be configured to perform the operation S210 described above, which is not described herein.
The attribute value obtaining module 520 is configured to take the first identifier in the first label update information as a value of the target attribute of the first object. In an embodiment, the attribute value obtaining module 520 may be used to perform the operation S220 described above, which is not described herein.
The information merging module 530 is configured to merge the first object into the stored information of the document. In an embodiment, the information merging module 530 may be configured to perform the operation S230 described above, which is not described herein.
The above-described apparatus 500 for updating stored information of a document may further include an object determination module and an object modification module according to an embodiment of the present disclosure. The object determining module is used for responding to second annotation updating information of the annotations in the modification document and determining a second object aiming at the annotations to be modified in the storage information of the document based on a second identifier in the second annotation updating information. The object modification module is used for modifying the second object based on the second annotation update information to update the storage information of the document.
According to an embodiment of the present disclosure, the document includes at least one label therein; the stored information of the document includes at least one object for at least one annotation. The object determination module may include a matching sub-module, an attribute value determination sub-module, and an object determination sub-module. The matching submodule is used for matching the identifier of at least one object with the second identifier in sequence. The attribute value determination submodule is used for determining the value of the target attribute of each at least one object in response to the fact that the identifiers of the at least one object are not matched with the second identifier. The object determination submodule is used for determining an object to which the value of the target attribute matched with the second identifier belongs as a second object.
According to an embodiment of the present disclosure, the above object determination submodule is further configured to: and determining the object to which the target identifier belongs as the second object in response to the target identifier being matched with the second identifier in the identifiers of the at least one object.
The above-described apparatus 500 for updating stored information of a document may further include an information caching module and an information updating module according to an embodiment of the present disclosure. The information caching module is used for caching the third annotation updating information in response to receiving the third annotation updating information. The information updating module is used for periodically updating the storage information of the document according to the cached third annotation updating information.
According to an embodiment of the present disclosure, the information update module includes an information type determination sub-module and an update sub-module. The information type determining submodule is used for determining the type of the cached third annotation updating information based on the value of the target byte in the cached third annotation updating information. The updating submodule is used for updating the storage information of the document based on the type of the cached third annotation updating information. Wherein the type of the third annotation update includes a type of adding an annotation in the document and a type of modifying an annotation in the document.
According to an embodiment of the present disclosure, the above-described document includes a document in a portable document format.
It should be noted that, in the technical solution of the present disclosure, the acquisition, storage, application, etc. of the related personal information of the user all conform to the rules of the related laws and regulations, and do not violate the popular regulations of the public order.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the respective methods and processes described above, for example, a method of updating stored information of a document. For example, in some embodiments, the method of updating stored information of a document may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method of updating stored information of a document described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the method of updating stored information of a document in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, also referred to as a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of large management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual PRIVATE SERVER" or simply "VPS"). The server may also be a server of a distributed system or a server that incorporates a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (17)
1. A method of updating stored information of a document, comprising:
Generating a first object aiming at a label to be added based on first label updating information of the label added in the document; the first object is used for recording related information of the label to be added, and the related information comprises an identifier of the first object;
taking a first identifier in the first annotation update information as a value of a target attribute of the first object; the first identifier is a temporary identifier for the label to be added; and
And merging the first object into the stored information of the document.
2. The method of claim 1, further comprising:
Responsive to modifying second annotation update information for annotations in the document, determining a second object for the annotations to be modified in stored information of the document based on a second identifier in the second annotation update information; and
And modifying the second object based on the second annotation update information to update the stored information of the document.
3. The method of claim 2, wherein the document includes at least one annotation therein; the stored information of the document comprises at least one object aiming at the at least one label respectively; determining a second object for the label to be modified in the stored information of the document comprises:
sequentially matching the identifier of the at least one object with the second identifier;
Determining a value of a respective target attribute of the at least one object in response to the identifiers of the at least one object each not matching the second identifier; and
And determining an object to which the value of the target attribute matched with the second identifier belongs as the second object.
4. A method according to claim 3, further comprising:
And determining that the object to which the target identifier belongs is the second object in response to the target identifier being matched with the second identifier in the identifiers of the at least one object.
5. The method of any one of claims 1-4, further comprising:
in response to receiving third annotation update information, caching the third annotation update information; and
And periodically updating the storage information of the document according to the cached third annotation updating information.
6. The method of claim 5, wherein periodically updating the stored information of the document comprises periodically performing the following:
determining the type of the cached third annotation update information based on the value of the target byte in the cached third annotation update information; and
Updating the stored information of the document based on the type of the cached third annotation update information,
Wherein the type of the third annotation update information includes a type of adding an annotation in the document and a type of modifying an annotation in the document.
7. The method of any of claims 1-6, wherein the document comprises a portable document format document.
8. An apparatus for updating stored information of a document, comprising:
The object generation module is used for responding to first annotation update information for adding annotations in the document and generating a first object aiming at the annotations to be added based on the first annotation update information; the first object is used for recording related information of the label to be added, and the related information comprises an identifier of the first object;
An attribute value obtaining module, configured to take a first identifier in the first label update information as a value of a target attribute of the first object; the first identifier is a temporary identifier for the label to be added; and
And the information merging module is used for merging the first object into the stored information of the document.
9. The apparatus of claim 8, further comprising:
the object determining module is used for responding to second annotation updating information for modifying the annotations in the document and determining a second object aiming at the annotations to be modified in the storage information of the document based on a second identifier in the second annotation updating information; and
And the object modification module is used for modifying the second object based on the second annotation update information so as to update the storage information of the document.
10. The apparatus of claim 9, wherein the document includes at least one annotation therein; the stored information of the document comprises at least one object aiming at the at least one label respectively; the object determination module includes:
A matching sub-module, configured to match the identifier of the at least one object with the second identifier in sequence;
an attribute value determination submodule for determining the value of the respective target attribute of the at least one object in response to the identifiers of the at least one object not all matching the second identifier; and
And the object determination submodule is used for determining an object to which the value of the target attribute matched with the second identifier belongs as the second object.
11. The apparatus of claim 10, the object determination submodule further to:
And determining that the object to which the target identifier belongs is the second object in response to the target identifier being matched with the second identifier in the identifiers of the at least one object.
12. The apparatus of any one of claims 8-11, further comprising:
The information caching module is used for caching the third annotation updating information in response to receiving the third annotation updating information; and
And the information updating module is used for periodically updating the storage information of the document according to the cached third annotation updating information.
13. The apparatus of claim 12, wherein the information update module comprises:
An information type determining submodule, configured to determine a type of the cached third annotation update information based on a value of a target byte in the cached third annotation update information; and
An updating sub-module, configured to update the storage information of the document based on the type of the cached third annotation update information,
Wherein the type of the third annotation update information includes a type of adding an annotation in the document and a type of modifying an annotation in the document.
14. The apparatus of any of claims 8-13, wherein the document comprises a portable document format document.
15. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.
16. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110634924.7A CN113378524B (en) | 2021-06-07 | 2021-06-07 | Method, device, equipment and storage medium for updating storage information of document |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110634924.7A CN113378524B (en) | 2021-06-07 | 2021-06-07 | Method, device, equipment and storage medium for updating storage information of document |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113378524A CN113378524A (en) | 2021-09-10 |
CN113378524B true CN113378524B (en) | 2024-07-26 |
Family
ID=77576328
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110634924.7A Active CN113378524B (en) | 2021-06-07 | 2021-06-07 | Method, device, equipment and storage medium for updating storage information of document |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113378524B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114398508B (en) * | 2021-11-29 | 2025-01-03 | 中车工业研究院有限公司 | A marking system and method for engineering drawings |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8201079B2 (en) * | 2004-01-15 | 2012-06-12 | International Business Machines Corporation | Maintaining annotations for distributed and versioned files |
US8230326B2 (en) * | 2004-12-17 | 2012-07-24 | International Business Machines Corporation | Method for associating annotations with document families |
US8015482B2 (en) * | 2005-09-14 | 2011-09-06 | Microsoft Corporation | Dynamic anchoring of annotations to editable content |
CN101727674B (en) * | 2008-10-30 | 2012-02-29 | 北大方正集团有限公司 | A Method for Image Annotation and Reproduction Annotation in Documents |
CN101872340A (en) * | 2009-04-23 | 2010-10-27 | 北京大学 | A typesetting method and device based on a layout format template |
CN103257956B (en) * | 2013-04-19 | 2016-06-15 | 小米科技有限责任公司 | The data-updating method of a kind of electronic document and device |
FI20165327A (en) * | 2016-04-15 | 2017-10-16 | Copla Oy | document Automation |
CN107943777B (en) * | 2017-12-14 | 2021-07-06 | 北京久蓉科技有限公司 | Collaborative editing and collaborative processing method, device, equipment and storage medium |
CN110532449B (en) * | 2019-08-30 | 2022-05-31 | 盈盛智创科技(广州)有限公司 | Method, device, equipment and storage medium for processing service document |
CN111695518B (en) * | 2020-06-12 | 2023-09-29 | 北京百度网讯科技有限公司 | Method and device for labeling structured document information and electronic equipment |
CN112417826B (en) * | 2020-11-24 | 2021-07-02 | 济南智学承远信息技术有限公司 | PDF online editing method and device, electronic equipment and readable storage medium |
-
2021
- 2021-06-07 CN CN202110634924.7A patent/CN113378524B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113378524A (en) | 2021-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112860811B (en) | Method and device for determining data blood relationship, electronic equipment and storage medium | |
CN113626223A (en) | Interface calling method and device | |
CN115905322A (en) | Service processing method and device, electronic equipment and storage medium | |
CN113378524B (en) | Method, device, equipment and storage medium for updating storage information of document | |
CN116009847A (en) | Code generation method, device, electronic equipment and storage medium | |
CN112783887A (en) | Data processing method and device based on data warehouse | |
CN113190718B (en) | Data processing method, device, electronic device and storage medium of graph database | |
CN113434595A (en) | Database synchronization method and device, electronic equipment and storage medium | |
CN114168119B (en) | Code file editing method, device, electronic equipment and storage medium | |
CN108196921B (en) | Document development method and device, computer equipment and storage medium | |
CN114281981B (en) | News brief report generation method and device and electronic equipment | |
CN116185389A (en) | Code generation method and device, electronic equipment and medium | |
CN112540958B (en) | File processing method, device, equipment and computer storage medium | |
CN115828864A (en) | Supplementary protocol generation method, device, equipment and storage medium | |
CN114579520B (en) | Mirror image data processing method, mirror image data loading method and device | |
CN113569144B (en) | Method, device, equipment, storage medium and program product for searching promotion content | |
CN114741072B (en) | Page generation method, device, equipment and storage medium | |
CN117407468A (en) | Method and device for displaying generated content, electronic equipment and storage medium | |
CN119066040A (en) | Resource synchronization method, device and equipment between application programs | |
WO2024260103A1 (en) | Code editing method and apparatus, and device and storage medium | |
CN118069131A (en) | Method, device, equipment and medium for generating componentized interface theme | |
CN117453872A (en) | Dialogue information updating method, device, equipment and storage medium based on tree structure | |
CN117951087A (en) | File management method and device, electronic equipment and storage medium | |
CN119047491A (en) | File translation method, device, electronic equipment and storage medium | |
CN117744590A (en) | Presentation generation method and device, electronic 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |