Format document online coprocessing method and device
By separating the rendering image layer and text layer, online collaborative processing of layout documents is realized, which solves the complexity and security problems of traditional processing methods, improves collaboration efficiency and security, and adapts to multi-device environments.
Patent Information
- Application Number
- CN202410666901.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-10
AI Technical Summary
The traditional layout document processing method relies on specific software and plug-ins, which is complex to operate, limits the efficiency of online collaborative work, and has high performance bottlenecks and security risks when processing massive documents and sensitive information.
By extracting the layout data of the layout document, the image layer and the text layer are separated and rendered. The visual level of the text layer is higher than the image layer. Users can annotate on the text layer to achieve real-time sharing and synchronization of annotation content.
It simplifies user operations, improves the speed and security of online collaboration of layout documents, adapts to multi-device and multi-operating system environments, and ensures visual consistency and user experience of documents.
Smart Images

Figure CN118627478A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for online collaborative processing of layout documents. Background Art
[0002] With the development of Internet digital technology, online collaborative work has become one of the important ways of modern office. Layout documents, with their consistency in format and easy storage and transmission, have become an indispensable tool in online collaborative work.
[0003] However, the traditional way of processing layout documents is often bound by specific software and plug-ins, and the complexity of its operation hinders the improvement of online collaborative work efficiency. Therefore, how to conveniently and accurately realize online collaborative processing of layout documents has become the key to improving the efficiency of online collaborative work. Summary of the invention
[0004] In view of the above problems, the present invention provides a method and device for online collaborative processing of formatted documents that overcomes the above problems or at least partially solves the above problems. The technical solution is as follows:
[0005] A method for online collaborative processing of layout documents, comprising:
[0006] Obtain the layout data of the target page in the layout document;
[0007] Rendering an image layer and a text layer of the target page using the layout data, wherein the visual level of the text layer is higher than that of the image layer, the image layer displays page content after spatial rendering of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed by the text layer is aligned with the text in the image layer;
[0008] In response to an annotation operation performed by a user on the text layer, rendering an annotation component in the text layer, wherein the annotation component is used for inputting annotation content;
[0009] In the text layer of the target page displayed by a terminal device subscribing to the layout document, the annotation component and the annotation content in the annotation component are synchronously displayed.
[0010] Optionally, in response to the annotation operation performed by the user on the text layer, rendering an annotation component in the text layer, wherein the annotation component is used for inputting annotation content, includes:
[0011] In response to a text selection and annotation operation performed by a user on the text layer, a selection effect is rendered on the text layer for the target text selected by the user, and an annotation entry component is rendered, wherein the annotation entry component is used for entering annotation content.
[0012] Optionally, performing selection effect rendering on the target text selected by the user in the text layer and rendering an annotation entry component includes:
[0013] Obtaining text position information of the target text selected by the user;
[0014] Retrieving a tag position corresponding to the target text in the text layer by using the text position information;
[0015] Using the tag position, obtaining a target tag in the first tag wrapping the target text;
[0016] Rendering an annotation entry component in the text layer using the vertical axis coordinate of the target tag and the horizontal axis coordinate of the right border of the target page;
[0017] The first tag is replaced with a second tag with a selection effect demonstration, so as to render the target text with a selection effect in the text layer.
[0018] Optionally, synchronously displaying the annotation component and the annotation content in the annotation component in the text layer of the target page displayed by a terminal device subscribing to the layout document includes:
[0019] In the text layer of the target page displayed by the terminal device subscribing to the layout document, the annotation entry component, the annotation content in the annotation entry component and the target text after the selected effect rendering are synchronously displayed.
[0020] Optionally, in response to the annotation operation performed by the user on the text layer, rendering an annotation component in the text layer, wherein the annotation component is used for inputting annotation content, includes:
[0021] In response to the hand-drawn annotation operation performed by the user on the text layer, an annotation drawing component is rendered on the text layer, wherein the annotation drawing component is used for drawing annotation content.
[0022] Optionally, rendering the annotation drawing component on the text layer includes:
[0023] Obtaining the spatial coordinates of the hand-drawn annotation performed by the user on the text layer;
[0024] Rendering an annotation drawing component in the text layer using the hand-drawn annotation space coordinates;
[0025] When the annotation content is drawn in the annotation drawing component, the annotation drawing component is set to an unselectable state.
[0026] Optionally, obtaining the layout data of the target page in the layout document includes:
[0027] Obtaining binary layout data of the layout content of the target page in the layout document;
[0028] The binary layout data is parsed using multi-threading technology to obtain structured layout data.
[0029] Optionally, the method further includes:
[0030] Convert all annotation contents of the target page into an annotation page object;
[0031] Converting the annotation page object into binary annotation data;
[0032] Inserting the binary annotation data into the binary layout data to obtain binary page data;
[0033] The binary page data is converted into a file-like object.
[0034] Optionally, the method further includes:
[0035] Watermark information is added to the image layer, and the watermark information is in an unselectable state.
[0036] A layout document online collaborative processing device comprises: a layout data acquisition unit, a target page rendering unit, an annotation component rendering unit and an annotation synchronization unit.
[0037] The layout data obtaining unit is used to obtain the layout data of the target page in the layout document;
[0038] The target page rendering unit is used to render an image layer and a text layer of the target page using the layout data, wherein the visual level of the text layer is higher than that of the image layer, the image layer displays page content after spatial rendering of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed by the text layer is aligned with the text in the image layer;
[0039] The annotation component rendering unit is used to render an annotation component in the text layer in response to an annotation operation performed by a user on the text layer, wherein the annotation component is used for annotation content input;
[0040] The annotation synchronization unit is used to synchronously display the annotation component and the annotation content in the annotation component in the text layer of the target page displayed by the terminal device subscribing to the layout document.
[0041] By means of the above technical scheme, the present invention provides a method and device for online collaborative processing of layout documents, which obtains the layout data of the target page in the layout document; uses the layout data to render the image layer and text layer of the target page, wherein the visual level of the text layer is higher than the image layer, the image layer displays the page content after the target page is spatially drawn, the page content is in an unselectable state, the page content includes text, and the text displayed in the text layer is aligned with the text in the image layer; in response to the annotation operation performed by the user on the text layer, an annotation component is rendered in the text layer, wherein the annotation component is used for annotation content input; in the text layer of the target page displayed by the terminal device subscribing to the layout document, the annotation component and the annotation content in the annotation component are synchronously displayed. The present invention directly renders the layout document and adopts a separate rendering design of the text layer and the image layer. While maintaining the visual effect of the original layout document in the image layer, an interactively operable annotation component is provided in the text layer, and the annotation content in the annotation component is synchronously displayed, so as to realize real-time sharing of the annotation content, thereby accelerating the online collaboration speed of the layout document and improving the efficiency of online collaborative work.
[0042] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0044] Figure 1 A schematic diagram showing a flow chart of an implementation of a method for online collaborative processing of layout documents provided by an embodiment of the present invention;
[0045] Figure 2 A flow chart showing another implementation of the online collaborative processing method for layout documents provided by an embodiment of the present invention;
[0046] Figure 3 A flowchart showing a specific implementation of step S310 in the online collaborative processing method for layout documents provided by an embodiment of the present invention is shown;
[0047] Figure 4 A flow chart showing another implementation of the online collaborative processing method for layout documents provided by an embodiment of the present invention;
[0048] Figure 5 A flowchart showing a specific implementation of step S320 in the online collaborative processing method for layout documents provided in an embodiment of the present invention is shown;
[0049] Figure 6 A flowchart showing a specific implementation of step S100 in the online collaborative processing method for layout documents provided in an embodiment of the present invention;
[0050] Figure 7 A flow chart showing another implementation of the online collaborative processing method for layout documents provided by an embodiment of the present invention;
[0051] Figure 8 A schematic diagram showing the structure of an online collaborative processing device for layout documents provided by an embodiment of the present invention is shown;
[0052] Fig. 9 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0053] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0054] A formatted document is a document designed in a specific format and layout. It contains multiple elements such as text, images, tables, charts, etc., and the position, size, style, etc. of these elements in the document are carefully arranged. Formatted documents usually have a consistent visual style and structure to ensure the professionalism and readability of the document.
[0055] Due to the consistency of the format and the ease of storage and transmission of layout documents, they have become an indispensable tool in modern online collaborative work. Currently, some solutions use browser plug-in technology to embed the parsing and rendering process of layout documents into the user's browsing experience, thereby achieving instant preview and interactive annotation of documents on web pages. Other solutions adopt the strategy of server-side rendering, handing over the document parsing task to a powerful server cluster, and then presenting the rendered document on the user's screen to optimize the user experience.
[0056] However, in actual applications, the reliance on specific software and plug-ins not only increases the user's learning cost, but also limits the popularity of the solution in a multi-device, multi-operating system environment. Secondly, when faced with the need to process massive amounts of documents, the performance bottlenecks of existing solutions gradually emerge, affecting user work efficiency and experience. Finally, when processing documents containing sensitive information, the security protection measures of existing solutions may not be sufficient to resist potential leakage risks, which becomes a major hidden danger in protecting user privacy and data security.
[0057] Therefore, in order to overcome these obstacles and promote the further development of online collaborative work technology, a more efficient, secure and compatible online processing solution for layout documents is needed to simplify user operations, improve the performance of processing layout documents, and strengthen the protection of sensitive information.
[0058] Based on this, in an embodiment of the present invention, a method for online collaborative processing of layout documents is provided, which can extract layout data of a specific page layout from a layout document, and generate independent image layers and text layers accordingly. In this process, the text layer is placed above the image layer, allowing the text layer to maintain visibility and priority. The image layer presents the visual elements of the page, but these elements cannot be selected to ensure that the content of the text layer can be highlighted and accurately aligned with the text in the image layer below it. In addition, users can annotate directly on the text layer, and the system will generate an annotation component in the same text layer to input and display the annotation content. These annotation contents are then updated and synchronized in real time on all devices that have subscribed to the layout document, ensuring that other users can see the latest annotation content, thereby promoting effective collaboration.
[0059] like Figure 1 As shown, a flow chart of an implementation of a method for online collaborative processing of layout documents provided by an embodiment of the present invention is provided. The method may include:
[0060] S100: Obtain layout data of a target page in a layout document.
[0061] The layout data refers to the data that defines the layout and style of the layout document, and includes all the information used to guide how the document is formatted and displayed. Optionally, the layout data may include page dimensions, page margins, font style, font size, color scheme, text alignment, text line spacing, paragraph style, image layout, graphic layout, table design, and special visual effects.
[0062] Specifically, the embodiment of the present invention parses the binary layout data of the layout content of each page of the layout document in units of pages, and converts the binary layout data of the target page into structured layout data that can be used for rendering processing.
[0063] S200. Rendering an image layer and a text layer of the target page using the layout data, wherein the visual level of the text layer is higher than that of the image layer, the image layer displays the page content after spatial drawing of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed in the text layer is aligned with the text in the image layer.
[0064] Rendering refers to the process of converting data or models into visual images or animations. The embodiment of the present invention can render the target page into two levels of content: an image layer and a text layer according to the layout data.
[0065] Among them, the image layer is the bottom layer, which is used for spatial rendering of the text, pictures, forms and other non-interactive elements in the target page. Spatial rendering refers to the process of accurately presenting the page content including graphic elements, text, and images on the target page on the screen according to their properties such as position, size, shape, and color in two-dimensional or three-dimensional space. In layout rendering, the page content of the image layer is set to an unselectable state, which means that users cannot select or copy the page content on the image layer through regular mouse operations, so as to keep the content stable and prevent it from "running away from the page".
[0066] Among them, the text layer is the top layer, which is a layer superimposed on the bottom layer and is used to handle user interaction and dynamic effects. In layout rendering, the text in the text layer is completely aligned with the text in the image layer in size and position, but the text in the text layer is selectable, so that users can select, accurately search and locate text at the text level on the text layer. It also helps users add interactive elements such as rendering annotations, highlights, and tags on the text layer. These elements are displayed when users interact with the document, but will not change the original state of the underlying content.
[0067] The embodiment of the present invention uses a layered rendering method to render the target page into an image layer and a text layer, ensuring the accurate parsing and rendering effect of the layout document, and can effectively guarantee the visual consistency of the document, so that the user can accurately select and annotate the text and graphics in the document, thereby realizing efficient content search and text-level positioning annotation, which greatly improves the accuracy and convenience of user operations.
[0068] S300. In response to an annotation operation performed by a user on a text layer, an annotation component is rendered in the text layer, wherein the annotation component is used for inputting annotation content.
[0069] The annotation component is a UI (User Interface) component with annotation function.
[0070] The annotation operation refers to the act of adding comments, comments, marks or explanations to the document content. The embodiment of the present invention can respond to the annotation operation performed by the user through the mouse or touch, support the user to select text through the browser default operation such as single-click drag or double-click, realize the text selection annotation function or hand-drawn annotation function, and render the corresponding annotation component in the text layer for the user to input the annotation content.
[0071] It should be noted that the term "in response to" in the present invention is used to indicate the conditions or states on which the execution of an operation depends, and one or more operations can be executed when certain conditions or states are met. These operations can be real-time or have a certain delay.
[0072] S400: Synchronously displaying the annotation component and the annotation content in the annotation component in the text layer of the target page displayed by the terminal device subscribing to the layout document.
[0073] Specifically, an embodiment of the present invention can record the annotation information of this round of annotation operations, synchronize the annotation information to the server through relevant interfaces, and the server broadcasts it to the terminal device that subscribes to the layout document according to business needs. The terminal device synchronously renders the corresponding annotation component and the annotation content in the annotation component at the same position of the text layer of the target page it displays based on the annotation information.
[0074] The annotation information may include the type, content, page number, time, operator, and the start and end character positions of the text selection or the coordinates of the hand-drawn annotation.
[0075] The embodiment of the present invention improves work efficiency and the quality of teamwork by providing a function for multiple people to perform online collaborative annotations on the same document at the same time. Through this mechanism, team members can share and exchange annotation information in real time, thereby enhancing the collaborative effect and improving overall work efficiency.
[0076] The embodiment of the present invention provides users with the convenience of directly parsing and rendering layout documents in the browser without installing any plug-ins, thereby improving user experience and convenience of use. Whether the user is on a personal computer or a mobile device, the document can be easily previewed and annotation information can be added. This improves the efficiency of online collaborative work.
[0077] The invention provides a method for online collaborative processing of layout documents, which obtains layout data of a target page in a layout document; uses the layout data to render an image layer and a text layer of the target page, wherein the visual level of the text layer is higher than that of the image layer, the image layer displays the page content after spatial drawing of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed by the text layer is aligned with the text in the image layer; in response to the annotation operation performed by the user on the text layer, an annotation component is rendered in the text layer, wherein the annotation component is used for inputting the annotation content; in the text layer of the target page displayed by a terminal device subscribing to the layout document, the annotation component and the annotation content in the annotation component are synchronously displayed. The invention directly renders the layout document, adopts a separate rendering design of the text layer and the image layer, can maintain the visual effect of the original layout document in the image layer, provide an interactively operable annotation component in the text layer, and synchronously display the annotation content in the annotation component, realize real-time sharing of the annotation content, thereby accelerating the online collaboration speed of the layout document and improving the efficiency of online collaborative work.
[0078] Optional, based on Figure 1 The method shown, such as Figure 2 As shown, a flowchart of another implementation of the online collaborative processing method for layout documents provided by an embodiment of the present invention is shown, and step S300 may include:
[0079] S310. In response to a text selection and annotation operation performed by a user on a text layer, a selection effect is rendered on the text layer for the target text selected by the user, and an annotation entry component is rendered, wherein the annotation entry component is used for entering annotation content.
[0080] Specifically, the embodiment of the present invention can obtain the position of the target text selected by the user in the full text, and then determine the relevant tag position according to the position. Then, using the tag position, a comment entry component for entering the comment content is rendered on the page, and then a new tag with a highlighted display effect is used to replace the original tag, so as to intuitively mark the part selected by the user on the text for annotation.
[0081] The embodiments of the present invention respond to the user's text selection operation in real time and immediately render the selection effect, so that the user can intuitively see their selection being recognized by the system, thereby enhancing the user's operation feedback and improving the interactive experience. At the same time, through the instant rendering of the annotation entry component, the user can complete the annotation task efficiently without switching between different interfaces or tools.
[0082] Optional, based on Figure 2 The method shown, such as Figure 3As shown, a flowchart of a specific implementation of step S310 in the online collaborative processing method for layout documents provided by an embodiment of the present invention is shown, and step S310 may include:
[0083] S311. Obtain text position information of the target text selected by the user.
[0084] The text position information may be the text start and end character positions of the target text in the full text of the target page.
[0085] S312: Using the text position information, retrieve the tag position corresponding to the target text in the text layer.
[0086] According to HTML (Hyper Text Markup Language), every visible text is wrapped in a tag. For example: text , which is wrapped by a span tag. Therefore, the embodiment of the present invention can perform full-text search at the text layer according to the start and end character positions of the text to determine the tag position corresponding to the target text.
[0087] S313: Using the tag position, obtain the target tag in the first tag that wraps the target text.
[0088] Specifically, in the embodiment of the present invention, the first tag at the character termination position in the first tag wrapping the target text may be selected as the target tag.
[0089] S314. Render an annotation entry component in the text layer using the vertical axis coordinate of the target tag and the horizontal axis coordinate of the right border of the target page.
[0090] Specifically, the embodiment of the present invention can use the vertical axis coordinate of the target tag and the horizontal axis coordinate of the right border of the target page to confirm the rendering reference point of the annotation entry component, and obtain the vertical axis coordinate of the target tag as the top position (Top property) and the horizontal axis coordinate of the right border of the target page as the right margin (Right property), set the rendering position of the annotation entry component, and then adjust the width and height according to the actual needs of entering the annotation content, and then apply the rendering position and size to the annotation entry component, and finally render the annotation entry component to the corresponding position of the text layer.
[0091] S315: Use a second tag with a selection effect demonstration to replace the first tag, so as to render the selection effect on the target text in the text layer.
[0092] Specifically, the embodiment of the present invention can pre-define the style attributes of the selection effect. The style attributes can include the background color, text color and border of the selection effect. First, remove the first tag that wraps the target text in the text layer, then create a second tag based on the pre-defined style attributes of the selection effect, and use the second tag with the selection effect demonstration to wrap the target text to render the selection effect.
[0093] When a user selects text, the embodiment of the present invention can immediately retrieve the corresponding tag position and render the annotation entry component, and replace the first tag with a second tag with a selection effect. Through precise text positioning and dynamic tag replacement, the user can easily annotate and highlight the document content.
[0094] Optional, in the above Figure 3 On the basis of one or more corresponding embodiments, another optional embodiment provided by the embodiment of the present invention, in the text layer of the target page displayed by the terminal device subscribing to the layout document, synchronously displaying the annotation component and the annotation content in the annotation component may specifically include:
[0095] In the text layer of the target page displayed on the terminal device that subscribes to the layout document, the annotation entry component, the annotation content in the annotation entry component and the target text after the selected effect rendering are displayed synchronously.
[0096] Specifically, an embodiment of the present invention can synchronize the annotation information related to the annotation entry component, the annotation content in the annotation entry component, and the target text after the selected effect is rendered to the server through a relevant interface, and the server broadcasts it to the terminal device that subscribes to the layout document according to business needs. The terminal device synchronously renders the corresponding annotation entry component, the annotation content in the annotation entry component, and the target text after the selected effect is rendered at the same position of the text layer of the target page it displays based on the annotation information.
[0097] The embodiment of the present invention synchronously displays the annotation entry component, the annotation content in the annotation entry component and the target text after the selected effect is rendered, so that users of other terminal devices can clearly identify the target text with annotations and view the annotation content of the target text in real time, thereby realizing real-time sharing of the annotation content.
[0098] Optional, based on Figure 1 The method shown, such as Figure 4 As shown, a flowchart of another implementation of the online collaborative processing method for layout documents provided by an embodiment of the present invention is shown, and step S300 may include:
[0099] S320: In response to a hand-drawn annotation operation performed by the user on the text layer, an annotation drawing component is rendered on the text layer, wherein the annotation drawing component is used for drawing annotation content.
[0100] Specifically, the embodiment of the present invention can record the spatial coordinates of the user's hand-drawn annotation on the text layer, and the hand-drawn annotation spatial coordinates are used to define the position and shape of the hand-drawn annotation. Based on the hand-drawn annotation spatial coordinates, an annotation drawing component is rendered on the text layer to display the user's hand-drawn annotation.
[0101] The embodiments of the present invention help users express their ideas and opinions in a more intuitive and personalized way by responding to the user's hand-drawn annotation operation and rendering the annotation drawing component on the text layer. Compared with traditional text input, hand-drawn annotations can better convey complex concepts. Hand-drawn annotations can also add visual elements to the document, making the document more vivid and interesting, thereby improving the readability and attractiveness of the document, and providing users with a richer and more efficient document editing and reading environment.
[0102] Optional, based on Figure 4 The method shown, such as Figure 5 As shown, a flowchart of a specific implementation of step S320 in the online collaborative processing method for layout documents provided by an embodiment of the present invention is shown, and step S320 may include:
[0103] S321. Obtain the spatial coordinates of the hand-drawn annotation performed by the user on the text layer.
[0104] Specifically, when a user makes hand-drawn annotations on a text layer, the embodiment of the present invention can capture in real time the movement trajectory of the user's hand-drawn tool (eg, a stylus, a mouse, or a finger) on the text layer. It can be understood that these movement trajectories are composed of a series of spatial coordinate points.
[0105] S322. Render an annotation drawing component in the text layer using the hand-drawn annotation space coordinates.
[0106] The annotation drawing component may specifically be a canvas.
[0107] Specifically, the embodiment of the present invention can record the captured spatial coordinate points in chronological order to form a coordinate sequence. The coordinate sequence reflects the path of the user's hand-drawn annotation. According to the coordinate sequence, an annotation drawing component is created in the text layer and rendered to a corresponding position on the text layer, which can be determined by the starting coordinate point of the hand-drawn annotation. During rendering, a graphic matching the user's hand-drawn annotation is drawn according to the coordinate sequence.
[0108] S323. When the annotation content is drawn in the annotation drawing component, the annotation drawing component is set to an unselectable state.
[0109] Specifically, after the user completes drawing the annotation content in the annotation drawing component, the annotation drawing component is set to an unselectable state to prevent accidental modification or deletion that may occur later.
[0110] The embodiment of the present invention can ensure that the user's annotations accurately correspond to their intentions by capturing the spatial coordinates of hand-drawn annotations, thereby ensuring the accuracy and relevance of the annotation content. Drawing the annotation content in the annotation drawing component and setting it to an unselectable state can prevent users from accidentally changing or deleting important annotations in subsequent operations, improve the stability of the document and the persistence of the annotations, and help provide users with a more efficient, intuitive and secure annotation experience.
[0111] Optional, in the above Figure 5 On the basis of one or more corresponding embodiments, another optional embodiment provided by the embodiment of the present invention, in the text layer of the target page displayed by the terminal device subscribing to the layout document, synchronously displaying the annotation component and the annotation content in the annotation component may specifically include:
[0112] In the text layer of the target page displayed by the terminal device subscribing to the layout document, the annotation drawing component and the annotation content in the annotation drawing component are synchronously displayed.
[0113] Specifically, an embodiment of the present invention can synchronize the annotation information related to the annotation drawing component and the annotation content in the annotation drawing component to the server through a relevant interface, and the server broadcasts it to the terminal device that subscribes to the layout document according to business needs. The terminal device synchronously renders the corresponding annotation drawing component and the annotation content in the annotation drawing component at the same position of the text layer of the target page it displays based on the annotation information.
[0114] The embodiment of the present invention synchronously displays the annotation drawing component and the annotation content in the annotation drawing component, so that users of other terminal devices can intuitively perceive the feedback and ideas of others, promote users to more actively participate in the discussion and editing of documents, and thus speed up online collaboration.
[0115] Optional, based on Figure 1 The method shown, such as Figure 6 As shown, a flowchart of a specific implementation of step S100 in the online collaborative processing method for layout documents provided by an embodiment of the present invention is shown, and step S100 may include:
[0116] S110: Obtain binary layout data of the layout content of the target page in the layout document.
[0117] S120. parse the binary layout data using multithreading technology to obtain structured layout data.
[0118] Specifically, the embodiment of the present invention can obtain binary layout data of a layout document, and then use terminal computing resources and multi-threading technology to parse the binary layout data of the layout document in units of pages, and convert the binary layout data of the layout content of the target page into structured layout data that can be used for layout rendering.
[0119] The embodiment of the present invention utilizes multi-threading technology to parse binary layout data to obtain structured layout data, can process multiple pages of data in a layout document in parallel, can improve the overall responsiveness of layout document rendering, and is more suitable for online collaborative layout document parsing tasks.
[0120] The present invention adopts terminal resource reuse and layered rendering technology, which significantly improves the rendering speed and processing efficiency of documents, thereby effectively avoiding the performance bottleneck problem that may be encountered when processing large-scale document collections, thereby bringing users a smoother and more efficient usage experience.
[0121] Optional, based on Figure 1 The method shown, such as Figure 7 As shown, a flow chart of another implementation of the online collaborative processing method for layout documents provided by an embodiment of the present invention is provided. The method may further include:
[0122] S500: Convert all annotation contents of the target page into an annotation page object.
[0123] The annotation page object refers to a specific area on a page of a layout document, which is used to display comments, annotations or additional information related to the page content.
[0124] Specifically, the embodiment of the present invention can group pages, sort and organize the annotation contents of each page in the order of smaller and closer to the front of the text starting point, and convert all the annotation contents of each page into annotation page objects with specific format standards.
[0125] Optionally, the specific format standard can be the PDF (Portable Document Format) format standard. Annotation page objects under the PDF format standard are stored in the structure of the PDF file, usually listed in the 'Annots' array of the PDF document, which is associated with the page object ('Page' object). Each annotation has properties such as position, size, type, content, etc.
[0126] S600: Convert the annotation page object into binary annotation data.
[0127] S700: Insert binary annotation data into binary layout data to obtain binary page data.
[0128] Specifically, the embodiment of the present invention may insert the binary annotation data before the end mark ">>" of the binary layout data of the target page.
[0129] S800: Convert binary page data into a file-like object.
[0130] The file-like object may be a binary file object Blob (Binary Large Object), which may be used to process data in an unrecognizable format.
[0131] The embodiment of the present invention can effectively integrate the annotation information scattered in the document by converting the annotation content into annotation page objects and converting these objects into binary data, which is convenient for management and processing. Converting the binary page data into a file-like object (Blob) can ensure that the data has good compatibility between different systems and platforms, which is conducive to the upload and export and download of files.
[0132] Optional, in the above Figure 1 On the basis of one or more corresponding embodiments, another optional embodiment provided by the embodiment of the present invention may further include:
[0133] Add watermark information to the image layer. The watermark information is not selectable.
[0134] The watermark information may be a blind watermark (Blind Watermarking). Blind watermarking is a special type of digital watermarking technology used to embed information in digital media such as images, audio or video. The "blindness" of this watermark is reflected in the fact that the original unmarked media file is not required when detecting the existence of the watermark or extracting the watermark content. In other words, the existence of the watermark can be proved even without comparing the original file. By adding a blind watermark to the image layer, the embodiment of the present invention can enhance the security of the layout document information without affecting the visual quality of the layout document.
[0135] In the image layer rendering process, the embodiment of the present invention adds watermark information and sets the watermark information in an unselectable state, thereby achieving a document traceability effect, effectively preventing the leakage of document content, and enhancing the security of document information.
[0136] Although operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0137] It should be understood that the various steps described in the method embodiments of the present invention 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 invention is not limited in this respect.
[0138] Corresponding to the above method embodiment, the embodiment of the present invention also provides a layout document online collaborative processing device, whose structure is as follows: Figure 8 As shown, it may include: a layout data obtaining unit 100 , a target page rendering unit 200 , an annotation component rendering unit 300 and an annotation synchronization unit 400 .
[0139] The layout data obtaining unit 100 is used to obtain the layout data of the target page in the layout document.
[0140] The target page rendering unit 200 is used to use the layout data to render the image layer and text layer of the target page, wherein the visual level of the text layer is higher than the image layer, the image layer displays the page content after spatial drawing of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed in the text layer is aligned with the text in the image layer.
[0141] The annotation component rendering unit 300 is used to render an annotation component in the text layer in response to an annotation operation performed by a user on the text layer, wherein the annotation component is used for annotation content input.
[0142] The annotation synchronization unit 400 is used to synchronously display the annotation component and the annotation content in the annotation component in the text layer of the target page displayed by the terminal device subscribing to the layout document.
[0143] Optionally, the annotation component rendering unit 300 can be specifically used to respond to the text selection and annotation operation performed by the user on the text layer, render the selection effect on the target text selected by the user on the text layer, and render an annotation entry component, wherein the annotation entry component is used for entering annotation content.
[0144] Optionally, the annotation component rendering unit 300 may include: a text position information obtaining subunit, a tag position searching subunit, a target tag obtaining subunit, an annotation entry component rendering subunit and a selected effect rendering subunit.
[0145] The text position information obtaining subunit is used to obtain the text position information of the target text selected by the user.
[0146] The tag position retrieval subunit is used to retrieve the tag position corresponding to the target text at the text layer using the text position information.
[0147] The target tag obtaining subunit is used to obtain the target tag in the first tag that wraps the target text by using the tag position.
[0148] The annotation entry component rendering subunit is used to render the annotation entry component on the text layer using the vertical axis coordinate of the target tag and the horizontal axis coordinate of the right border of the target page.
[0149] The selection effect rendering subunit is used to replace the first label with a second label with a selection effect demonstration, so as to perform selection effect rendering on the target text in the text layer.
[0150] Optionally, the annotation synchronization unit 400 can be specifically used to synchronously display the annotation entry component, the annotation content in the annotation entry component and the target text after the selected effect rendering in the text layer of the target page displayed by the terminal device subscribing to the layout document.
[0151] Optionally, the annotation component rendering unit 300 may be specifically configured to render an annotation drawing component on the text layer in response to a hand-drawn annotation operation performed by a user on the text layer, wherein the annotation drawing component is used for drawing annotation content.
[0152] Optionally, the annotation component rendering unit 300 may include: a hand-drawn annotation space coordinate obtaining subunit, an annotation drawing component rendering subunit and an annotation drawing component state setting subunit.
[0153] The hand-drawn annotation space coordinate obtaining subunit is used to obtain the hand-drawn annotation space coordinates of the user's hand-drawn annotation operation on the text layer.
[0154] The annotation drawing component rendering subunit is used to render the annotation drawing component in the text layer using the hand-drawn annotation space coordinates.
[0155] The annotation drawing component state setting subunit is used to set the annotation drawing component to a non-selectable state when the annotation content is drawn in the annotation drawing component.
[0156] Optionally, the layout data obtaining unit 100 may include: a binary layout data obtaining subunit and a structured layout data obtaining subunit.
[0157] The binary layout data acquisition subunit is used to obtain the binary layout data of the layout content of the target page in the layout document.
[0158] The structured layout data acquisition subunit is used to parse the binary layout data using multi-threading technology to obtain the structured layout data.
[0159] Optionally, the online collaborative processing device for layout documents may further include: an annotation page object conversion unit, a binary annotation data conversion unit, a binary page data acquisition unit and a class file object conversion unit.
[0160] The annotation page object conversion unit is used to convert all annotation contents of the target page into an annotation page object.
[0161] The binary annotation data conversion unit is used to convert the annotation page object into binary annotation data.
[0162] The binary page data obtaining unit is used for inserting the binary annotation data into the binary layout data to obtain the binary page data.
[0163] The file-like object conversion unit is used to convert binary page data into a file-like object.
[0164] Optionally, the online collaborative processing device for layout documents may further include: a watermark adding unit.
[0165] The watermark adding unit is used to add watermark information in the image layer, and the watermark information is in an unselectable state.
[0166] The invention provides an online collaborative processing device for layout documents, which obtains layout data of a target page in a layout document; uses the layout data to render an image layer and a text layer of the target page, wherein the visual level of the text layer is higher than that of the image layer, the image layer displays the page content after spatial drawing of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed in the text layer is aligned with the text in the image layer; in response to the annotation operation performed by the user on the text layer, an annotation component is rendered in the text layer, wherein the annotation component is used for annotation content input; in the text layer of the target page displayed by a terminal device subscribing to the layout document, the annotation component and the annotation content in the annotation component are synchronously displayed. The invention directly renders the layout document and adopts a separate rendering design of the text layer and the image layer, which can provide an interactively operable annotation component in the text layer while maintaining the visual effect of the original layout document in the image layer, and synchronously display the annotation content in the annotation component, so as to realize real-time sharing of the annotation content, thereby accelerating the online collaboration speed of the layout document and improving the efficiency of online collaborative work.
[0167] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0168] The online collaborative processing device for layout documents includes a processor and a memory. The above-mentioned layout data acquisition unit 100, target page rendering unit 200, annotation component rendering unit 300 and annotation synchronization unit 400 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0169] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the separate rendering design of the text layer and the image layer can be adopted by adjusting the kernel parameters. While maintaining the visual effect of the original layout document in the image layer, an interactive annotation component can be provided in the text layer, and the annotation content in the annotation component can be displayed synchronously, so as to realize the real-time sharing of the annotation content, thereby improving the efficiency of online collaborative work.
[0170] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the online collaborative processing method for layout documents is implemented.
[0171] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the online collaborative processing method for layout documents when it is running.
[0172] like Fig. 9 As shown, an embodiment of the present invention provides an electronic device 1000, which includes at least one processor 1001, at least one memory 1002 connected to the processor 1001, and a bus 1003; wherein the processor 1001 and the memory 1002 communicate with each other through the bus 1003; the processor 1001 is used to call the program instructions in the memory 1002 to execute the above-mentioned online collaborative processing method of layout documents. The electronic device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0173] The present invention also provides a computer program product, which, when executed on an electronic device, is suitable for executing a program for initializing the steps of the online collaborative processing method for formatted documents.
[0174] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatuses, electronic devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0175] In a typical configuration, an electronic device includes one or more processors (CPU), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, and the like.
[0176] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
[0177] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0178] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0179] In the description of the present invention, it should be understood that the terms "up", "down", "front", "back", "left" and "right" etc. indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description. They do not indicate or imply that the positions or elements referred to must have specific directions, be constructed and operate in specific directions. Therefore, they should not be understood as limitations of the present invention.
[0180] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0181] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0182] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for online collaborative processing of layout documents, characterized in that: include: Obtain the layout data of the target page in the layout document; Rendering an image layer and a text layer of the target page using the layout data, wherein the visual level of the text layer is higher than that of the image layer, the image layer displays page content after spatial rendering of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed by the text layer is aligned with the text in the image layer; In response to an annotation operation performed by a user on the text layer, rendering an annotation component in the text layer, wherein the annotation component is used for inputting annotation content; In the text layer of the target page displayed by a terminal device subscribing to the layout document, the annotation component and the annotation content in the annotation component are synchronously displayed.
2. The method according to claim 1, characterized in that In response to the annotation operation performed by the user on the text layer, rendering an annotation component in the text layer, wherein the annotation component is used for inputting annotation content, comprises: In response to a text selection and annotation operation performed by a user on the text layer, a selection effect is rendered on the text layer for the target text selected by the user, and an annotation entry component is rendered, wherein the annotation entry component is used for entering annotation content.
3. The method according to claim 2, characterized in that The step of rendering the target text selected by the user in the text layer with a selection effect and rendering an annotation entry component includes: Obtaining text position information of the target text selected by the user; Retrieving a tag position corresponding to the target text in the text layer by using the text position information; Using the tag position, obtaining a target tag in the first tag wrapping the target text; Rendering an annotation entry component in the text layer using the vertical axis coordinate of the target tag and the horizontal axis coordinate of the right border of the target page; The first tag is replaced with a second tag with a selection effect demonstration, so as to render the target text with a selection effect in the text layer.
4. The method according to claim 3, characterized in that The step of synchronously displaying the annotation component and the annotation content in the annotation component in the text layer of the target page displayed by the terminal device subscribing to the layout document comprises: In the text layer of the target page displayed by the terminal device subscribing to the layout document, the annotation entry component, the annotation content in the annotation entry component and the target text after the selected effect rendering are synchronously displayed.
5. The method according to claim 1, characterized in that In response to the annotation operation performed by the user on the text layer, rendering an annotation component in the text layer, wherein the annotation component is used for inputting annotation content, comprises: In response to the hand-drawn annotation operation performed by the user on the text layer, an annotation drawing component is rendered on the text layer, wherein the annotation drawing component is used for drawing annotation content.
6. The method according to claim 5, characterized in that Rendering the annotation drawing component in the text layer includes: Obtaining the spatial coordinates of the hand-drawn annotation performed by the user on the text layer; Rendering an annotation drawing component in the text layer using the hand-drawn annotation space coordinates; When the annotation content is drawn in the annotation drawing component, the annotation drawing component is set to an unselectable state.
7. The method according to claim 1, characterized in that The step of obtaining the layout data of the target page in the layout document includes: Obtaining binary layout data of the layout content of the target page in the layout document; The binary layout data is parsed using multi-threading technology to obtain structured layout data.
8. The method according to claim 7, characterized in that Also includes: Convert all annotation contents of the target page into an annotation page object; Converting the annotation page object into binary annotation data; Inserting the binary annotation data into the binary layout data to obtain binary page data; The binary page data is converted into a file-like object.
9. The method according to any one of claims 1 to 8, characterized in that Also includes: Watermark information is added to the image layer, and the watermark information is in an unselectable state.
10. A layout document online collaborative processing device, characterized in that: include: Layout data acquisition unit, target page rendering unit, annotation component rendering unit and annotation synchronization unit, The layout data obtaining unit is used to obtain the layout data of the target page in the layout document; The target page rendering unit is used to render an image layer and a text layer of the target page using the layout data, wherein the visual level of the text layer is higher than that of the image layer, the image layer displays page content after spatial rendering of the target page, the page content is in an unselectable state, the page content includes text, and the text displayed by the text layer is aligned with the text in the image layer; The annotation component rendering unit is used to render an annotation component in the text layer in response to an annotation operation performed by a user on the text layer, wherein the annotation component is used for annotation content input; The annotation synchronization unit is used to synchronously display the annotation component and the annotation content in the annotation component in the text layer of the target page displayed by the terminal device subscribing to the layout document.
