Document display method and device and computer equipment
By generating and comparing the initial layout diagram and the standard layout diagram of the document, and optimizing the layout based on the difference data, the problem of inconsistent document display under different terminal devices is solved, and the consistency and accuracy of the document display effect are achieved.
Patent Information
- Application Number
- CN202410658521.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-08-23
AI Technical Summary
Existing document display methods may cause unclear or inaccurate document content on different terminal devices. Especially on devices with smaller screens, how to ensure the consistency and accuracy of document display becomes a challenge.
By generating difference data between the initial layout diagram and the standard layout diagram, the document is optimized for layout based on these difference data to ensure the consistency and accuracy of the display effect in different terminal environments.
It achieves consistency and accuracy of document display on different terminal devices and improves user experience, especially in multi-user collaboration and cross-platform editing scenarios.
Smart Images

Figure CN118536474A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a document display method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of computer technology and Internet technology, collaborative office is becoming more and more common. In the field of collaborative office, users have a strong demand for completing document compilation by using online documents. Online documents are a technology that supports multi-user collaborative document processing that can be created and edited anytime and anywhere. With the support of online document technology, users can edit and share the same document on multiple platforms. Users can also edit and share online documents on multiple devices such as mobile phones and tablets. Online documents can also support multiple people to view and edit at the same time. Online documents are a document processing method based on network technology. The emergence of online documents has greatly expanded the ability of communication and collaboration between users.
[0003] However, in the current document display method, when different user terminal devices open the same document, the displayed document content may be unclear or inaccurate. For example, when the screen of the terminal device used by the user is small, the document content displayed on the screen may be unclear. Therefore, how to effectively ensure the consistency of document display effects in different terminal model environments while effectively improving the accuracy of document display has become a problem that needs to be urgently solved. Summary of the invention
[0004] Based on this, it is necessary to provide a document display method, device, computer equipment, computer readable storage medium and computer program product to address the above technical problems, which can effectively improve the accuracy of document display and effectively ensure the consistency of document display effects in different terminal model environments.
[0005] In a first aspect, the present application provides a document display method. The method comprises: in response to a document display operation, generating an initial layout diagram of a document specified by the document display operation; obtaining difference data between a standard layout diagram of the document and the initial layout diagram; re-layouting the document based on the difference data to obtain an optimized layout diagram of the document; and displaying the optimized layout diagram of the document.
[0006] In a second aspect, the present application also provides a document display device. The device includes: a generation module, which is used to generate an initial layout diagram of a document specified by the document display operation in response to a document display operation; an acquisition module, which is used to obtain difference data between the standard layout diagram of the document and the initial layout diagram; a layout module, which is used to re-layout the document based on the difference data to obtain an optimized layout diagram of the document; and a display module, which is used to display the optimized layout diagram of the document.
[0007] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: in response to a document display operation, generating an initial layout diagram of a document specified by the document display operation; obtaining difference data between a standard layout diagram of the document and the initial layout diagram; re-layouting the document based on the difference data to obtain an optimized layout diagram of the document; and displaying the optimized layout diagram of the document.
[0008] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented: in response to a document display operation, generating an initial layout diagram of a document specified by the document display operation; obtaining difference data between a standard layout diagram of the document and the initial layout diagram; re-layouting the document based on the difference data to obtain an optimized layout diagram of the document; and displaying the optimized layout diagram of the document.
[0009] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, which implements the following steps when executed by a processor: in response to a document display operation, generates an initial layout diagram of a document specified by the document display operation; obtains difference data between a standard layout diagram of the document and the initial layout diagram; re-layouts the document based on the difference data to obtain an optimized layout diagram of the document; and displays the optimized layout diagram of the document.
[0010] The document display method, device, computer equipment, storage medium and computer program product generate an initial layout diagram of the document specified by the document display operation in response to the document display operation, and obtain the difference data between the standard layout diagram of the document and the initial layout diagram; re-layout the document based on the difference data to obtain the optimized layout diagram of the document, and display the optimized layout diagram of the document. Since the initial layout diagram of the document is generated in real time by each terminal in response to the document display operation, when the terminal obtains the difference data between the standard layout diagram of the document and the initial layout diagram, the terminal can re-layout the initial layout diagram of the document based on the obtained targeted difference data, and obtain a more accurate optimized layout diagram of the document, that is, by comparing the initial layout diagram generated by different terminal devices with the standard layout diagram, and re-layout according to the compared difference data, so as to ensure the consistency and accuracy of the document display effect in different terminal model environments, the accuracy of the document display is effectively improved, and the consistency of the document display effect in different terminal model environments is effectively guaranteed.
[0011] In a sixth aspect, the present application provides a document display method. The method includes: when receiving a data acquisition request sent by a terminal, acquiring an initial layout diagram of a document to be displayed at the terminal based on a document identifier in the data acquisition request; acquiring a standard layout diagram of the document according to the document identifier; determining difference data between the standard layout diagram and the initial layout diagram; returning the difference data to the terminal, so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0012] In the seventh aspect, the present application also provides a document display device. The device includes: an acquisition module, which is used to acquire the initial layout diagram of the document to be displayed on the terminal based on the document identifier in the data acquisition request when receiving a data acquisition request sent by the terminal; acquire the standard layout diagram of the document according to the document identifier; a determination module, which is used to determine the difference data between the standard layout diagram and the initial layout diagram; and a sending module, which is used to return the difference data to the terminal, so that the terminal re-layouts the document based on the difference data, obtains the optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0013] In an eighth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: when receiving a data acquisition request sent by a terminal, based on the document identifier in the data acquisition request, an initial layout diagram of the document to be displayed at the terminal is acquired; based on the document identifier, a standard layout diagram of the document is acquired; difference data between the standard layout diagram and the initial layout diagram is determined; the difference data is returned to the terminal, so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0014] In a ninth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented: when a data acquisition request sent by a terminal is received, an initial layout diagram of a document to be displayed at the terminal is acquired based on a document identifier in the data acquisition request; a standard layout diagram of the document is acquired based on the document identifier; difference data between the standard layout diagram and the initial layout diagram is determined; the difference data is returned to the terminal, so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0015] In a tenth aspect, the present application also provides a computer program product. The computer program product includes a computer program, which implements the following steps when executed by a processor: when receiving a data acquisition request sent by a terminal, acquiring an initial layout diagram of a document to be displayed at the terminal based on a document identifier in the data acquisition request; acquiring a standard layout diagram of the document according to the document identifier; determining difference data between the standard layout diagram and the initial layout diagram; returning the difference data to the terminal, so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0016] The above-mentioned document display method, device, computer equipment, storage medium and computer program product, when receiving a data acquisition request sent by a terminal, obtains the initial layout diagram of the document to be displayed on the terminal based on the document identifier in the data acquisition request, and obtains the standard layout diagram of the document according to the document identifier; determines the difference data between the standard layout diagram and the initial layout diagram; returns the difference data to the terminal, so that the terminal re-layouts the document based on the difference data, obtains the optimized layout diagram of the document, and displays the optimized layout diagram of the document. Since the difference data is determined based on the initial layout and standard layout of the document to be displayed on each terminal, after the server returns the real-time difference data to the terminal, the terminal can re-layout the initial layout of the document based on the targeted difference data, and obtain a more accurate and consistent optimized layout of the document, that is, by comparing the initial layout generated by different terminal devices with the standard layout, and re-layout according to the compared difference data, to ensure the consistency and accuracy of the document display effects in different terminal model environments, thereby achieving the technical effect of effectively improving the accuracy of document display while effectively ensuring the consistency of document display effects in different terminal model environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 An application environment diagram of a document display method in an embodiment;
[0018] Figure 2 A schematic diagram of a flow chart of a document display method in an embodiment;
[0019] Figure 3 A schematic diagram showing a comparison between a standard layout diagram of a document and a layout diagram on a terminal side in one embodiment;
[0020] Figure 4 is a schematic diagram of the display effect on the product side in one embodiment;
[0021] Figure 5 A schematic diagram of the overall process of a document display method provided in an embodiment;
[0022] Figure 6 A schematic diagram showing a deviation in text display effect in an embodiment;
[0023] Figure 7 It is a schematic diagram of the display effect of a document containing complex emojis in one embodiment;
[0024] Figure 8 A schematic diagram of a process for optimizing a terminal display effect in one embodiment;
[0025] Fig. 9 A schematic diagram of a flow chart of a document display method in another embodiment;
[0026] Fig.10 A schematic diagram of a conventional method in one embodiment;
[0027] Fig.11 is a structural block diagram of a document display device in an embodiment;
[0028] Fig.12 is a structural block diagram of a document display device in another embodiment;
[0029] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0032] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0033] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0034] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, Internet of Vehicles, automatic driving, smart transportation, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0035] It should be noted that in the following description, the terms "first, second and third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first, second and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0036] The document display method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. In response to the document display operation, the terminal 102 generates an initial layout diagram of the document specified by the document display operation; further, the terminal 102 can obtain the difference data between the standard layout diagram and the initial layout diagram of the document from the server 104, and re-layout the document based on the difference data to obtain an optimized layout diagram of the document; the terminal 102 displays the optimized layout diagram of the document.
[0037] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an IoT device, and a portable wearable device. The IoT device may be a smart speaker, a smart TV, a smart air conditioner, and a smart vehicle-mounted device, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc.
[0038] The server 104 may be an independent physical server or a service node in a blockchain system. A peer-to-peer network is formed between the service nodes in the blockchain system. The peer-to-peer protocol is an application layer protocol running on the transmission control protocol (TCP).
[0039] In addition, server 104 can also be a server cluster composed of multiple physical servers, and can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN, Content Delivery NetworkCDN), as well as big data and artificial intelligence platforms.
[0040] The terminal 102 and the server 104 may be connected via Bluetooth, USB (Universal Serial Bus) or a network or other communication connection method, and this application does not impose any limitation thereto.
[0041] In one embodiment, Figure 2 As shown, a document display method is provided, which can be executed by a server or a terminal alone, or by a server and a terminal together. Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:
[0042] Step 202: In response to a document display operation, generate an initial layout diagram of the document specified by the document display operation.
[0043] Among them, the document display operation refers to the display operation for a specific document triggered by the user, which is used to open the specific content contained in a document for display. For example, the document display operation in this application can be a user's trigger operation, and the user's trigger operation can trigger a trigger event in the terminal, namely a screen input event (Input event). Trigger events may include single-click events (click events), touch events (touch events), touch events (tap events), sliding events (swipe events), etc., that is, users can perform different trigger operations on terminal devices. For example, the document display operation in this application may include trigger operations such as click operations, sliding operations, long press operations, input operations, and drag operations. The document display operation in this application may also be an online editing operation, which refers to an operation triggered by a user to jump to an editing page for a document. It can be understood that in some cases, the document display operation in this application can also be a document selection operation, which is not specifically limited here.
[0044] The document specified by the document display operation refers to the specific document targeted by the display operation triggered by the user, such as Figure 3 As shown in the figure, it is a schematic diagram of the comparison between the standard layout diagram of the document and the layout diagram on the terminal side. The document specified by the document display operation in this application can be as follows Figure 3 The specific document or file named "Experiment Three" is shown in the figure.
[0045] The initial layout image refers to the layout image generated by the terminal device currently used by the user. For example, the initial layout image in this application can be generated by the mobile terminal (mobile phone) currently used by user A. Figure 3 The layout diagram shown in (1).
[0046] Specifically, when a user wants to view or edit a document, the user can open the cloud platform application (Application, APP) on the terminal through a trigger operation, and enter the management page of the cloud platform through a selection operation, that is, the user can log in to the cloud platform application through a trigger operation. Further, the user can enter the document list page through a trigger operation in the main interface displayed by the cloud platform application. In the document list page displayed by the terminal, the terminal generates an initial layout diagram of the document specified by the document display operation in response to the document display operation (or document selection operation) triggered by the user. Further, the terminal can display the generated initial layout diagram of the document, for example, the terminal automatically generates a document display page, and displays the initial layout diagram of the document in the document display page, so that the user can quickly view the specific content and related information contained in the document.
[0047] In addition, in some cases, in the document display page of the initial layout diagram of the document displayed by the terminal, the user can also trigger a content modification operation for the displayed document. The backend of the cloud platform application (i.e., the cloud server) responds to the content modification operation triggered by the user and makes corresponding modifications to the content contained in the document to obtain the modified document, and saves the modified document in the cloud platform application so that other users can also view it. At the same time, the backend of the cloud platform application (i.e., the cloud server) can also return the modified document to the terminal so that the terminal obtains the modified document and saves the modified document locally.
[0048] It can be understood that the terminal in this application can be used as the front end to display the page corresponding to the relevant operation, and the server in the cloud platform application, namely the cloud server, can be used as the back end to actually process the background data and return the processed data to the front end (terminal) for display.
[0049] For example, the terminal is a mobile terminal. Figure 3 As shown in FIG. 1 , it is a schematic diagram for comparing the standard layout diagram of a document with the layout diagram on the terminal side. Assuming that user A triggers a document display operation for the document “Experiment 3” in the document list page displayed on the mobile terminal, the mobile terminal generates the following in response to the document display operation for the document “Experiment 3” triggered by user A: Figure 3 The document shown in (1) shows the initial layout of the document "Experiment 3" specified by the operation.
[0050] Step 204, obtaining difference data between the standard layout diagram and the initial layout diagram of the document.
[0051] The standard layout diagram refers to the layout diagram corresponding to the document specified by the document display operation in a standard environment. For example, the standard layout diagram in this application may refer to: the layout diagram displayed by the document in the office application environment on the desktop computer. For example, the standard layout diagram for the document "Experiment 3" may be as follows: Figure 3 The corresponding layout diagram under the standard environment shown in (2).
[0052] Difference data refers to data used to reflect the difference between the standard layout and the initial layout, such as Figure 3 The initial layout shown in (1) is similar to Figure 3 The difference between the standard layout shown in (2) is: Figure 3 The initial layout shown in (1) has the additional content shown in the dotted box: "III. Pre-study questions (fill in the form)", that is, Figure 3 The standard layout shown in (2) does not show: "3. Pre-study questions (fill in the form)".
[0053] Specifically, after the terminal generates the initial layout diagram of the document specified by the document display operation (or document selection operation) in response to the document display operation triggered by the user, the terminal can obtain the difference data between the standard layout diagram of the document and the initial layout diagram from the background server. For example, the terminal can send a data acquisition request to the background server and receive the difference data returned by the background server in response to the data acquisition request. The difference data is the difference data between the standard layout diagram of the document and the initial layout diagram determined by the background server. For another example, in some cases, the terminal can also obtain the standard layout diagram of the document, and adjust the scaling ratio of the standard layout diagram based on the scaling ratio of the initial layout diagram to obtain the adjusted standard layout diagram, and compare the adjusted standard layout diagram with the initial layout diagram to obtain the difference data, thereby reducing the number of interactions between the terminal and the background server.
[0054] For example, the terminal is a mobile terminal. Figure 3 As shown in FIG. 1 , it is a schematic diagram for comparing the standard layout diagram of a document with the layout diagram on the terminal side. Assume that in the document list page displayed on the mobile terminal, user A triggers a document display operation for the document “Experiment 3”. In response to the document display operation for the document “Experiment 3” triggered by user A, the mobile terminal generates the following Figure 3After the document display operation specifies the initial layout of the document "Experiment 3" as shown in (1), the mobile terminal can send a data acquisition request to the backend server and receive the difference data A returned by the backend server in response to the data acquisition request. The difference data A is the result of the backend server's response based on the following example: Figure 3 The standard layout diagram of the document shown in (2) is different from Figure 3 The difference data is obtained by comparing the difference between the initial layout images shown in (1).
[0055] Step 206: re-layout the document based on the difference data to obtain an optimized layout diagram of the document.
[0056] The optimized layout diagram refers to a layout diagram obtained by re-layouting the initial layout diagram generated by the terminal device currently used by the user, for example, Figure 3 (1) shows the initial layout of the document “Experiment 3” generated in user terminal A. Figure 3 (2) shows the standard layout of the document "Experiment 3". Figure 4 As shown, it is a schematic diagram of the display effect on the product side. The optimized layout diagram in this application can be as follows Figure 4 The layout diagram obtained by re-layouting the initial layout diagram generated by the user terminal A shown in Figure 4 The optimized layout diagram shown does not show: "Three, preview questions (fill in the form)", which can be compared with Figure 3 The display effect of the standard layout diagram of the document "Experiment 3" shown in (2) remains consistent.
[0057] Step 208, displaying the optimized layout of the document.
[0058] Specifically, after the terminal obtains the difference data between the standard layout diagram and the initial layout diagram of the document, the terminal can re-layout the document based on the obtained difference data to obtain the optimized layout diagram of the document, and display the optimized layout diagram of the document on the page. It can be understood that in some cases, after the terminal re-layouts the document based on the obtained difference data to obtain the optimized layout diagram of the document, the terminal can also compare the obtained optimized layout diagram with the standard layout diagram of the document again to obtain a comparison result; when the comparison result indicates that there is no difference data between the standard layout diagram and the optimized layout diagram of the document, the terminal can display the optimized layout diagram of the document after this re-layout on the page for the user to view. When the comparison result indicates that there is difference data between the standard layout image and the optimized layout image of the document, the terminal can use the optimized layout image as the initial layout image, re-execute the steps of obtaining the difference data between the standard layout image and the initial layout image of the document, and re-layout the document based on the difference data to obtain the optimized layout image of the document, until the maximum number of executions of the cloud control (preset execution number threshold) is reached, or until there is no difference data between the standard layout image and the optimized layout image of the document.
[0059] For example, let's take a mobile terminal as an example. Assume that in the document list page displayed on the mobile terminal, user A triggers a document display operation for the document "Experiment 3". In response to the document display operation triggered by user A for the document "Experiment 3", the mobile terminal generates the following Figure 3 The document shown in (1) shows the initial layout of the document "Experiment 3" specified by the operation, and obtains the following information from the backend server: Figure 3 The standard layout diagram of the document shown in (2) is different from Figure 3 After obtaining the difference data A between the initial layout diagrams shown in (1), the mobile terminal can perform the following operations based on the obtained difference data A: Figure 3 Re-layout the initial layout of the document "Experiment 3" shown in (1) to obtain the following Figure 4 The optimized layout diagram of the document "Experiment 3" shown in Figure 4 The optimized layout diagram of the document "Experiment 3" shown in the figure is displayed on the page.
[0060] In this embodiment, by responding to the document display operation, an initial layout diagram of the document specified by the document display operation is generated, and the difference data between the standard layout diagram of the document and the initial layout diagram is obtained; the document is re-layouted based on the difference data to obtain the optimized layout diagram of the document, and the optimized layout diagram of the document is displayed. Since the initial layout diagram of the document is generated in real time by each terminal in response to the document display operation, when the terminal obtains the difference data between the standard layout diagram of the document and the initial layout diagram, the terminal can re-layout the initial layout diagram of the document based on the obtained targeted difference data, and a more accurate optimized layout diagram of the document can be obtained, that is, by comparing the initial layout diagram generated by different terminal devices with the standard layout diagram, and re-layouting according to the compared difference data, so as to ensure the consistency and accuracy of the document display effect in different terminal model environments, the accuracy of the document display is effectively improved, and the consistency of the document display effect in different terminal model environments is effectively guaranteed.
[0061] In one embodiment, the step of obtaining difference data between the standard layout diagram and the initial layout diagram of the document includes:
[0062] Send a data acquisition request to the server;
[0063] Receiving difference data returned by the server in response to the data acquisition request; the difference data is difference data between the standard layout diagram and the initial layout diagram of the document;
[0064] The step of re-layouting the document based on the difference data to obtain an optimized layout diagram of the document includes:
[0065] In response to the optimization operation triggered in the document display page, the document is rearranged based on the difference data to obtain an optimized layout diagram of the document.
[0066] The optimization operation refers to the optimization operation triggered by the user for the layout of the displayed document. In some cases, the optimization operation in this application can also be called a beautification operation. For example, the optimization operation in this application can be that the user clicks on Figure 3 It is triggered by the "one-click beautification" icon shown in .
[0067] Specifically, the interaction between the terminal and the server is taken as an example for explanation. Figure 5 As shown in FIG. 1 , it is a schematic diagram of the overall process of the document display method provided by the present application. Assume that in the document list page displayed on the terminal, user A triggers a document display operation for the document "Experiment 3". In response to the document display operation for the document "Experiment 3" triggered by user A, the terminal generates the following Figure 3After the document display operation shown in (1) specifies the initial layout diagram of the document "Experiment Three" (i.e., the terminal long diagram), the terminal can send a data acquisition request to the server, so that the server compares the standard layout diagram of the document "Experiment Three" (i.e., the server-side long diagram) with the initial layout diagram (i.e., the terminal long diagram), obtains difference data A, and returns the difference data A to the terminal. That is, when the terminal receives the difference data A returned by the server in response to the data acquisition request, or when the terminal receives the difference data A automatically sent by the server, the terminal can automatically re-layout the initial layout diagram of the document "Experiment Three" based on the obtained difference data A, and obtain the following. Figure 4 The optimized layout diagram of the document "Experiment 3" shown in FIG. Among them, the difference data A is based on the server side Figure 3 The standard layout diagram of the document shown in (2) is different from Figure 3 The difference data is obtained by comparing the difference between the initial layout images shown in (1).
[0068] Alternatively, in some cases, when the terminal receives the difference data A returned by the server in response to the data acquisition request, or when the terminal receives the difference data A automatically sent by the server, the terminal will not automatically re-layout the initial layout diagram of the document "Experiment 3" based on the obtained difference data A, but needs to wait for the user-triggered instruction. For example, when user A clicks on Figure 3 When the "one-key beautification" icon shown in FIG. 1 is clicked, the terminal responds to user A in the following manner: Figure 3 In the optimization operation ("one-click beautification") triggered in the document display page shown, the terminal re-layouts the initial layout of the document "Experiment Three" based on the obtained difference data A to obtain the optimized layout of the document "Experiment Three". As a result, based on the differences in the display of documents in different terminal devices, the document display effects generated in real time by different terminal devices are compared with the standard opening effects of the document to generate corresponding difference values, and the attributes of each element are dynamically adjusted according to the difference values to ensure that the display effects in different terminal model environments are aligned with the standard office presentation form, so that the display effects of users opening the same document on different devices are basically consistent, which increases user stickiness and will also greatly help attract new users and increase product activity.
[0069] In one embodiment, after generating an initial layout diagram of a document specified by a document display operation, the method further includes:
[0070] Get the standard layout of the document;
[0071] Adjusting the scaling ratio of the standard layout diagram based on the scaling ratio of the initial layout diagram to obtain an adjusted standard layout diagram;
[0072] The step of obtaining difference data between the standard layout diagram of the document and the initial layout diagram includes:
[0073] The adjusted standard layout diagram is compared with the initial layout diagram to obtain difference data.
[0074] The scaling ratio of the initial layout diagram refers to: the display scaling ratio of the initial layout diagram. For example, in the terminal device used by the current user, the terminal displays the initial layout diagram of the document "Experiment 3" at a display scaling ratio of 100%.
[0075] Specifically, the document display method provided by the present application is described by taking the terminal alone as an example. Assuming that user A triggers a document display operation for the document "Experiment 3", the front end of the terminal responds to the document display operation for the document "Experiment 3" triggered by user A and sends a request to the back end, so that the back end generates the following Figure 3 After the initial layout diagram (i.e., the terminal length diagram) of the document "Experiment 3" specified by the document display operation shown in (1) is obtained, the backend of the terminal can obtain the standard layout diagram of the document "Experiment 3", and adjust the scaling ratio of the standard layout diagram based on the scaling ratio of the initial layout diagram, so that the scaling ratio of the adjusted standard layout diagram is consistent with the scaling ratio of the initial layout diagram; further, the backend of the terminal compares the adjusted standard layout diagram with the initial layout diagram to obtain the difference data between the standard layout diagram and the initial layout diagram of the document "Experiment 3". As a result, by comparing the initial layout diagram generated by different terminal devices with the standard layout diagram, and re-layouting according to the compared difference data, the consistency and accuracy of the document display effect in different terminal model environments is ensured, which achieves the technical effect of effectively improving the accuracy of the document display effect while effectively ensuring the consistency of the document display effect in different terminal model environments.
[0076] In one embodiment, the difference data includes a text difference value; and the step of comparing the adjusted standard layout image with the initial layout image to obtain the difference data includes:
[0077] Compare the adjusted standard layout image with the initial layout image to obtain difference pixels;
[0078] According to the difference pixels, find the original position corresponding to the text where the text deviation first appears;
[0079] Get the font properties of the text;
[0080] Based on the original position and font attributes, a text difference value is determined.
[0081] The difference pixel points refer to the points where the pixels in the adjusted standard layout image are inconsistent with those in the initial layout image, for example Figure 3 The adjusted standard layout shown in (2) does not have the line "III. Preview Questions (Fill in the form)" in the lower left corner, while the terminal side generates Figure 3 In the lower left corner of the initial layout shown in (1), there is a line of text "III. Pre-study questions (fill in the form)", so the difference pixels will appear in this area in the lower left corner.
[0082] Text refers to the symbols of the recorded language contained in the document. For example, the text in this application may include text corresponding to different languages, such as Chinese characters and English letters.
[0083] Specifically, the document display method provided by the present application is described by taking the terminal alone as an example. Assuming that user A triggers a document display operation for the document "Experiment 3", the front end of the terminal responds to the document display operation for the document "Experiment 3" triggered by user A and sends a request to the back end, so that the back end generates the following Figure 3 After the initial layout image (i.e., the terminal length image) of the document "Experiment 3" specified by the document display operation shown in (1) is displayed, the back end of the terminal can obtain the standard layout image of the document "Experiment 3", and adjust the scaling ratio of the standard layout image to 100% based on the scaling ratio (100%) of the initial layout image, so that the scaling ratio of the adjusted standard layout image is consistent with the scaling ratio of the initial layout image; further, the back end of the terminal compares the adjusted standard layout image with the initial layout image, that is, searches for difference pixels pixel by pixel, and further searches for the original position corresponding to the text where the text deviation first appears based on the found difference pixels; the back end of the terminal can obtain the font attribute of the text where the text deviation first appears, and determine the text difference value between the adjusted standard layout image and the initial layout image based on the font attribute and original position of the text where the text deviation first appears. In this way, the problem of inconsistent display effects when users open documents on different terminals can be effectively solved, so as to ensure the consistency of the display effect after the user edits the document on other terminals and the effect of opening it in the office.
[0084] In one embodiment, the step of determining the text difference value based on the original position and the font attributes includes:
[0085] In the initial typesetting diagram, the original position is used as a starting point to search for the target text with the font attribute;
[0086] When a target text with font attributes is found and the characters at the positions adjacent to the target text meet the preset character conditions, adjust the width scaling value of the characters at the positions adjacent to the target text, and use the adjusted width scaling value as the text difference value;
[0087] When no target text with font attributes is found, adjust the width value of the text corresponding to the original position, and use the adjusted width value as the text difference value.
[0088] Among them, the target text refers to the text with the same font attributes as the text with a deviation from the first occurrence of the text. For example, if the font attribute of the text A with the first occurrence of the text deviation is A, assuming that the font attribute of the text B is also A and the position of the text B is before the text A, then the text B can be used as the target text.
[0089] The characters at the positions adjacent to the target text can refer to: the characters at the front and back positions of the target text. For example, in the initial layout diagram shown in (1) below, assuming that the target text is the character "预" in the line of text "三、预习题(填写表格)", then the characters at the positions adjacent to the target text "预" refer to the characters at the front and back positions of "预". It can be understood that the characters at the positions adjacent to the target text in this application can be characters with hidden attributes or characters with display attributes. Figure 3 In the initial layout diagram shown in (1) below, assuming that the target text is the character "预" in the line of text "三、预习题(填写表格)", then the characters at the positions adjacent to the target text "预" refer to the characters at the front and back positions of "预". It can be understood that the characters at the positions adjacent to the target text in this application can be characters with hidden attributes or characters with display attributes.
[0090] The preset character condition refers to a preset character condition. For example, the preset character condition in this application can be: the adjacent position character is a special symbol such as tab or serial number, that is, when the character at the position adjacent to the target text is a special symbol such as tab or serial number, it means that the preset character condition is met.
[0091] Specifically, taking the terminal executing the document display method provided by this application alone as an example for illustration. Assume that user A triggers a document display operation for the document "Experiment Three". The front end of the terminal responds to the document display operation for the document "Experiment Three" triggered by user A and sends a request to the back end, so that the back end generates the initial layout diagram (i.e., the terminal long diagram) of the document "Experiment Three" specified by this document display operation as shown in (1) below. After that, the back end of the terminal can obtain the standard layout diagram of the document "Experiment Three" and adjust the scaling ratio of the standard layout diagram to 100% based on the scaling ratio (100%) of the initial layout diagram, so that the scaling ratio of the adjusted standard layout diagram is consistent with the scaling ratio of the initial layout diagram; further, the back end of the terminal will use the adjusted standard layout diagram shown in (2) below and Figure 3 In the initial layout diagram shown in (1) below, assume that user A triggers a document display operation for the document "Experiment Three". The front end of the terminal responds to the document display operation for the document "Experiment Three" triggered by user A and sends a request to the back end, so that the back end generates the initial layout diagram (i.e., the terminal long diagram) of the document "Experiment Three" specified by this document display operation as shown in (1) below. After that, the back end of the terminal can obtain the standard layout diagram of the document "Experiment Three" and adjust the scaling ratio of the standard layout diagram to 100% based on the scaling ratio (100%) of the initial layout diagram, so that the scaling ratio of the adjusted standard layout diagram is consistent with the scaling ratio of the initial layout diagram; further, the back end of the terminal will use the adjusted standard layout diagram shown in (2) below and Figure 3 In the adjusted standard layout diagram shown in (2) below and Figure 3Compare with the initial layout diagram shown in (1) in the Chinese text, that is, search for different pixel points pixel by pixel, and based on the found different pixel points, further search for the original position corresponding to the text where the text deviation first appears. Assume that the back end of the terminal finds that the original position of the text ("three") where the text deviation first appears in the initial layout diagram shown in Figure 3 (1) in the Chinese text is A. Then the back end of the terminal can further obtain that the font attribute of the text ("three") where the text deviation first appears is B, and in the initial layout diagram shown in Figure 3 (1) in the Chinese text, using the original position A of the text ("three") where the text deviation first appears as the starting point, search forward for the target text with this font attribute B. Assume that after the back end of the terminal finds that the target text with this font attribute B is the "three" in the title of the first line, the back end of the terminal can further determine whether the characters in the adjacent positions of the target text "three" meet the preset character conditions, that is, determine whether the characters before and after the target text "three" are special characters such as tab (indentation), serial number, etc. If the characters before and after the target text "three" are special characters such as tab (indentation), serial number, etc., then the back end of the terminal adjusts the width scaling values of the characters before and after the target text "three", and uses the adjusted width scaling values as the text difference values between the standard layout diagram and the initial layout diagram.
[0092] Alternatively, when the back end of the terminal does not find the target text with this font attribute B, then the back end of the terminal directly adjusts the width value of the text ("three") where the text deviation first appears corresponding to the original position, and uses the adjusted width value as the text difference value between the standard layout diagram and the initial layout diagram.
[0093] In this embodiment, by comparing the display effects generated in real time by different types of terminals with the standard opening effects of actual office documents, corresponding difference values are generated, and the attributes of each element are dynamically fine-tuned according to the difference values to ensure that the display effects in different terminal model environments are aligned with the presentation forms of office, which can make the display effects of the document opened on different ends basically consistent, so as to ensure the consistency between the display effects after the user edits the document on other ends and the opening effects in office.
[0094] In one embodiment, the difference data includes the line height difference value; compare the adjusted standard layout diagram with the initial layout diagram to obtain difference data, including:
[0095] Compare the adjusted standard layout diagram with the initial layout diagram to obtain abnormal pixel points;
[0096] According to the abnormal pixel points, search for the paragraph position corresponding to the different line where the deviation first appears;
[0097] Based on the paragraph positions corresponding to the difference lines, the line height difference value is determined.
[0098] The difference lines refer to the lines that are found to have deviations in the initial layout diagram according to the adjusted standard layout diagram. Figure 3 The adjusted standard layout shown in (2) does not have the line “III. Preview Questions (Fill in the form)” in the lower left corner, while the one generated by the terminal is as follows: Figure 3 In the lower left corner of the initial layout shown in (1), there is a line “III. Pre-study questions (fill in the form)”, so Figure 3 The row “3. Pre-study questions (fill in the form)” in the lower left corner of the initial layout shown in (1) can be used as a difference row.
[0099] Specifically, the document display method provided by the present application is described by taking the terminal alone as an example. Assuming that user A triggers a document display operation for the document "Experiment 3", the front end of the terminal responds to the document display operation for the document "Experiment 3" triggered by user A and sends a request to the back end, so that the back end generates the following Figure 3 After the document display operation specified in (1) of the document "Experiment 3" displays the initial layout image (i.e., the terminal length image), the backend of the terminal can obtain the standard layout image of the document "Experiment 3", and adjust the scaling ratio of the standard layout image to 100% based on the scaling ratio of the initial layout image (100%), so that the scaling ratio of the adjusted standard layout image is consistent with the scaling ratio of the initial layout image; further, the backend of the terminal will Figure 3 The adjusted standard layout shown in (2) is similar to Figure 3 The initial layout diagram shown in (1) is compared, that is, the difference pixels are searched pixel by pixel, and based on the difference pixels found, the difference row where the deviation first occurs is further searched. Figure 3 The paragraph position corresponding to the line "III. Pre-study questions (fill in the form)" in the lower left corner of the initial layout diagram shown in (1) is determined, and based on the paragraph position corresponding to the difference line, the line height difference value between the standard layout diagram and the initial layout diagram is determined. As a result, by comparing the initial layout diagram generated by different terminal devices with the standard layout diagram, and re-layout according to the compared difference data, the consistency and accuracy of the document display effect in different terminal model environments is ensured, which effectively improves the accuracy of document display while effectively ensuring the consistency of document display effect in different terminal model environments.
[0100] In one embodiment, the step of determining the line height difference value based on the paragraph positions corresponding to the difference lines includes:
[0101] When the paragraph position corresponding to the difference line is located in the target line, the paragraph offset value of the initial layout image is adjusted, and the adjusted paragraph offset value is used as the line height difference value;
[0102] When the paragraph position corresponding to the difference line is located in a non-target line, the target difference text in the difference line is searched, and the text height of the target difference text is adjusted, and the adjusted text height is used as the line height difference value.
[0103] The target line refers to a specific line. For example, the target line in the present application may be the first line, that is, the first line in each paragraph is used as the target line.
[0104] Specifically, the document display method provided by the present application is described by taking the terminal alone as an example. Assuming that user A triggers a document display operation for the document "Experiment 3", the front end of the terminal responds to the document display operation for the document "Experiment 3" triggered by user A and sends a request to the back end, so that the back end generates the following Figure 3 After the document display operation specified in (1) displays the initial layout image (i.e., the terminal length image) of the document "Experiment Three", the backend of the terminal can obtain the standard layout image of the document "Experiment Three" and adjust the scaling ratio of the standard layout image to 100% based on the scaling ratio of the initial layout image (100%), so that the scaling ratio of the adjusted standard layout image is consistent with the scaling ratio of the initial layout image.
[0105] Furthermore, the backend of the terminal will be Figure 3 The adjusted standard layout shown in (2) is similar to Figure 3 The initial layout diagram shown in (1) is compared, that is, the difference pixels are searched pixel by pixel, and based on the difference pixels found, the difference row where the deviation first occurs is further searched. Figure 3 The paragraph position corresponding to the line "III. Preview Questions (Fill in the form)" in the lower left corner of the initial layout diagram shown in (1) is the first line. That is, when the paragraph position corresponding to the difference line is located in the target line (the first line), the back end of the terminal can directly adjust as follows: Figure 3 The paragraph offset value of the initial layout diagram shown in (1) is used, and the adjusted paragraph offset value is used as the line height difference value between the standard layout diagram and the initial layout diagram.
[0106] In addition, in some cases, when the paragraph position corresponding to the difference line is located in a non-target line (i.e., not the first line), the back end of the terminal can further search for the target difference text in the difference line, adjust the text height of the target difference text, and use the adjusted text height as the line height difference value between the standard typesetting diagram and the initial typesetting diagram. That is, the terminal needs to find the text that affects the line height of the difference line, and fine-tune the actual height of the text in combination with the actual display effect. For example, the back end of the terminal can further search for the text corresponding to the largest font size in the font attributes of each text in the difference line, and use the text corresponding to the largest font size as the target difference text. As a result, by comparing the initial typesetting diagram generated by different terminal devices with the standard typesetting diagram, and re-typesetting according to the compared difference data, to ensure the consistency and accuracy of the document display effect in different terminal model environments, the technical effect of effectively improving the accuracy of the document display effect and effectively ensuring the consistency of the document display effect in different terminal model environments is achieved.
[0107] In one embodiment, the step of adjusting the text height of the target difference text and using the adjusted text height as the line height difference value includes:
[0108] Get the row height of the difference row in the adjusted standard layout diagram;
[0109] Based on the line height, line attribute data of the difference line and the fine-tuning coefficient, the text height of the target difference text is adjusted, and the adjusted text height is used as the line height difference value.
[0110] Specifically, the document display method provided by the present application is described by taking the terminal alone as an example. Assuming that when the paragraph position corresponding to the difference line is located in a non-target line (i.e., not the first line), the back end of the terminal can further search for the target difference text in the difference line and adjust the text height of the target difference text, that is, the back end of the terminal can obtain the difference line in the following manner: Figure 3The line height corresponding to the adjusted standard layout diagram shown in (2) is calculated based on the line height, the line attribute data of the difference line (line height multiple) and the fine-tuning coefficient to obtain the actual text height. The back end of the terminal can adjust the text height of the target difference text based on the actual text height, and use the adjusted text height as the line height difference value between the standard layout diagram and the initial layout diagram. For example, the calculation method of the actual text height in the embodiment of the present application can be: actual text height = actual height (line height) ÷ (fine-tuning coefficient * line height multiple). As a result, by comparing the initial layout diagram generated by different terminal devices with the standard layout diagram, and re-layout according to the compared difference data, the consistency and accuracy of the document display effect in different terminal model environments is ensured. While effectively improving the accuracy of document display, the consistency of document display effects in different terminal model environments is also effectively ensured. Technical effects.
[0111] In one embodiment, the difference data includes a text display difference diagram; the step of comparing the adjusted standard layout diagram with the initial layout diagram to obtain the difference data includes:
[0112] Based on the adjusted standard layout diagram and the initial layout diagram, find the original position corresponding to the element where the text display effect deviation first appears;
[0113] When the display effect corresponding to the element is garbled characters, a target document containing the element is generated based on the target display effect of the element;
[0114] Based on the target document, a target display diagram of the element is generated, and the target display diagram is used as a text display difference diagram.
[0115] The text display difference diagram refers to the standard display diagram corresponding to the text with a deviation in display effect found in the initial layout diagram according to the adjusted standard layout diagram. Figure 6 As shown, it is a schematic diagram of a deviation in text display effect. Assume that the effect of an element displayed in the initial layout diagram of the terminal in this application is as follows Figure 6 As shown in (1) in the standard layout diagram (or standard display effect diagram) of the document, the standard display effect of this element should be as follows Figure 6 As shown in (2), the standard display effect of this element is: 3D text effect rendering.
[0116] Elements refer to the different types of elements contained in a document. For example, the elements contained in a document include: text (single element) and emoticons (combined elements).
[0117] Display effect refers to the screen display effect corresponding to each element, such as Figure 6The display effect of the element shown in (2) is: 3D text effect rendering, such as Figure 6 The display effect of the element shown in (1) is: rendering without 3D text effect.
[0118] Garbled characters refer to the situation where the document contains unsupported display content in the initial layout of the current terminal, so it is displayed as garbled characters. For example, take emoji as an example. Figure 7 As shown in the figure, it is a schematic diagram of the display effect of a document containing complex emojis. Figure 7 The standard display effect of the complex emoji (spotted face) shown in (2) requires the combination of two different Unicode characters. However, some terminal devices do not have the corresponding available fonts, so they cannot be displayed. Figure 7 The standard display effect of the complex emoji (spotted face) shown in (2) may result in garbled characters, which means that the terminal does not have a corresponding available font library.
[0119] The target display effect refers to the standard display effect corresponding to each element in the document, for example Figure 7 The standard display effect of the complex emoji (blob face) shown in should be: Figure 7 The effect shown in (2).
[0120] The target document refers to a generated document that only contains a certain element (such as the element that displays an error effect). It can be understood that the target document in this application is mainly used to generate a target effect diagram corresponding to a certain element (specific element).
[0121] The target display image refers to the standard display effect image corresponding to each element in the document, for example Figure 7 The standard display effect of the complex emoji (blob face) shown in should be: Figure 7 The effect shown in (2) is shown in the figure.
[0122] Specifically, the document display method provided by the present application is described by taking the terminal alone as an example. Assuming that user A triggers a document display operation for the document "Experiment 3", the front end of the terminal responds to the document display operation for the document "Experiment 3" triggered by user A and sends a request to the back end, so that the back end generates the following Figure 3After the document display operation specified in (1) of the document "Experiment 3" (i.e., the terminal long image) is displayed, the backend of the terminal can obtain the standard layout image of the document "Experiment 3", and adjust the scaling ratio of the standard layout image to 100% based on the scaling ratio of the initial layout image (100%), so that the scaling ratio of the adjusted standard layout image is consistent with the scaling ratio of the initial layout image; further, the backend of the terminal compares the adjusted standard layout image with the initial layout image, that is, searches for the difference pixel points pixel by pixel, and further searches for the first appearance of the standard layout image based on the found difference pixel points. The original position corresponding to the element (i.e. text or complex emoji) with the deviation in text display effect; the back end of the terminal can determine whether the display effect corresponding to the element (i.e. text or complex emoji) is garbled characters based on the original position corresponding to the element (i.e. text or complex emoji). When it is determined that the display effect corresponding to the element (i.e. text or complex emoji) is garbled characters, the terminal can generate a target document containing the element based on the target display effect of the element, and based on the target document, generate a target display map of the element, and use the target display map as the text display difference map. For example, when the terminal determines that the display effect corresponding to a text element is garbled characters, the terminal can generate a target document containing the text element based on the target display effect of the text element, and based on the target document, generate the following Figure 6 The target display image of the text element shown in (2) is used as the text display difference image (replaced in the form of an image) to replace the display effect of the text element at the original position of the initial layout image. This can effectively solve the problem of inconsistent display effects when users open documents on different terminals, so as to ensure that the display effect after users edit the document on other terminals is consistent with the effect of opening it in the office.
[0123] In one embodiment, after finding the original position corresponding to the element where the text display effect deviation first appears based on the adjusted standard layout diagram and the initial layout diagram, the method further includes:
[0124] Get the standard display effect diagram of the document;
[0125] Determine the display area corresponding to the element based on the original position corresponding to the element;
[0126] According to the pixels of the display area and the pixels of the standard display effect diagram, it is determined that the display effect corresponding to the element is garbled characters.
[0127] Among them, the standard display effect diagram refers to the display effect diagram corresponding to the document specified by the document display operation in a standard environment. It can be understood that in some cases, the standard display effect diagram in this application can also be called a standard layout diagram.
[0128] Specifically, the document display method provided by the present application is described by taking the terminal alone as an example. Assuming that user A triggers a document display operation for the document "Experiment 3", the front end of the terminal responds to the document display operation for the document "Experiment 3" triggered by user A and sends a request to the back end, so that the back end generates the following Figure 3 After the document display operation specified in (1) displays the initial layout image (i.e., the terminal long image) of the document "Experiment 3", the backend of the terminal can obtain the standard layout image of the document "Experiment 3", and adjust the scaling ratio of the standard layout image to 100% based on the scaling ratio of the initial layout image (100%), so that the scaling ratio of the adjusted standard layout image is consistent with the scaling ratio of the initial layout image; further, the backend of the terminal compares the adjusted standard layout image with the initial layout image, that is, searches for the difference pixel points pixel by pixel, and finds the element A (i.e., text or complex emoji) where the text display effect deviation first appears based on the found difference pixel points. After the corresponding original position, assuming that the standard display effect diagram and the standard layout diagram of the document "Experiment Three" are two pictures, the back end of the terminal can obtain the standard display effect diagram of the document "Experiment Three", and determine the display area corresponding to element A based on the original position corresponding to element A; further, the back end of the terminal can match the pixels of the display area corresponding to element A with the pixels of the standard display effect diagram, that is, the back end of the terminal can match the pixels of the display area corresponding to element A with the pixels of the standard display effect diagram one by one to obtain a matching result. When the matching result indicates that the pixels are inconsistent, the back end of the terminal can determine that the display effect corresponding to element A is garbled characters.
[0129] like Figure 8 As shown in FIG. 1 , it is a flow chart of optimizing the display effect of the terminal. It can be understood that in the embodiment of the present application, the method for determining whether the display effect corresponding to the element (i.e., text or complex emoji) is garbled characters includes but is not limited to the above method, and can also be as follows Figure 8 As shown in , the standard display image corresponding to the garbled characters is obtained from the cloud (cloud database), and the display effect corresponding to the element (i.e. text or complex emoji) is matched with the standard display image of the common garbled characters stored in the cloud to quickly determine whether the display effect corresponding to each element (i.e. text or complex emoji) is garbled characters. As a result, the terminal can re-layout the initial layout image of the document based on the targeted difference data, and obtain a more accurate and consistent optimized layout image of the document. At the same time, the processing speed of the terminal's optimized layout is effectively improved, so that the user side will not perceive this series of optimization processing operations, and the user side can still ensure a quick response.
[0130] In one embodiment, the step of obtaining difference data between the standard layout diagram and the initial layout diagram of the document includes:
[0131] Parse the attributes of each element in the original description file of the document;
[0132] When the attribute of an element is not supported by the current device, get the display attribute of the unsupported element;
[0133] Based on the display attributes, a target display map of the unsupported element is generated and used as difference data.
[0134] The original description file refers to the original code file corresponding to the document, that is, the original description file is used to describe the specific content and display effect contained in the document. For example, the original description file of the document in this application can be an XML file.
[0135] The attributes of an element refer to the attributes of each element contained in a document. For example, the attributes of an element include display attributes, and the display attributes may include sub-display attributes. For example, a sub-display attribute is: 3D text effect rendering.
[0136] Display attributes refer to a property of an element contained in a document.
[0137] Specifically, after the terminal generates the initial layout diagram of the document specified by the document display operation in response to the document display operation (or document selection operation) triggered by the user, the terminal can obtain the difference data between the standard layout diagram and the initial layout diagram of the document from the background server. For example, the terminal can send a data acquisition request to the background server, and receive the difference data returned by the background server in response to the data acquisition request. The difference data is the difference data between the standard layout diagram and the initial layout diagram of the document determined by the background server. For another example, in some cases, the terminal can also obtain the original description file of the document, that is, the xml file, and parse the attributes of each element in the original description file of the document; when the attributes of an element A are not supported by the current terminal device, the terminal can obtain the display attributes of the unsupported element A, and based on the display attributes of the element A, generate a target document containing only the element A; further, the terminal can generate the following based on the element A contained in the target document: Figure 7 The target display diagram of the element A shown in (2) is used as the difference data so that the terminal can Figure 7 The target display diagram of the element A shown in (2) is used to re-layout the document to obtain an optimized layout diagram of the document, that is, the terminal can use Figure 7The target display image of element A shown in (2) replaces the erroneous display effect image at the original position corresponding to element A in the initial layout image, and the optimized layout image of the document can be obtained. This makes it possible to quickly and accurately replace the content that is not displayed or supported by the terminal, so as to ensure the consistency and accuracy of the document display effect in different terminal model environments.
[0138] In one embodiment, after re-layouting the document based on the difference data to obtain an optimized layout diagram of the document, the method further includes:
[0139] Compare the standard layout diagram of the document with the optimized layout diagram to obtain a comparison result;
[0140] The optimized layout diagram showing the document includes:
[0141] When the comparison result indicates that there is no difference data between the standard layout diagram and the optimized layout diagram of the document, the optimized layout diagram of the document is displayed.
[0142] Specifically, after the terminal re-layouts the document based on the acquired difference data and obtains the optimized layout diagram of the document, the terminal can also compare the obtained optimized layout diagram with the standard layout diagram of the document again to obtain a comparison result; when the comparison result indicates that there is no difference data between the standard layout diagram of the document and the optimized layout diagram, the terminal can display the optimized layout diagram of the document after this re-layout on the page for the user to view. When the comparison result indicates that there is difference data between the standard layout diagram of the document and the optimized layout diagram, the terminal can use the optimized layout diagram obtained by this processing as the initial layout diagram, re-execute the steps of obtaining the difference data between the standard layout diagram of the document and the initial layout diagram, and re-layout the document based on the difference data to obtain the optimized layout diagram of the document, until the maximum number of executions of the cloud control (preset execution number threshold) is reached, or until there is no difference data between the standard layout diagram of the document and the optimized layout diagram. As a result, by comparing the initial layout images generated by different terminal devices with the standard layout images, and re-layouting based on the compared difference data, the consistency and accuracy of the document display effects in different terminal model environments can be ensured. While effectively improving the accuracy of document display, it also effectively ensures the consistency of document display effects in different terminal model environments.
[0143] In one embodiment, Fig. 9 As shown, another document display method is provided, which can be executed by a server or a terminal alone, or by a server and a terminal together. Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0144] Step 902: when a data acquisition request sent by a terminal is received, an initial layout diagram of the document to be displayed on the terminal is acquired based on the document identifier in the data acquisition request.
[0145] The data acquisition request may refer to a request for acquiring difference data between an initial layout diagram and a standard layout diagram of a document to be displayed on a terminal side.
[0146] Document identifiers are used to identify unique documents, such as Figure 3 The document shown in is identified by the document ID "Document 001".
[0147] Step 904, obtaining a standard layout diagram of the document according to the document identifier.
[0148] Step 906, determining the difference data between the standard layout diagram and the initial layout diagram.
[0149] Step 908, returning the difference data to the terminal, so that the terminal can rearrange the document based on the difference data, obtain an optimized layout diagram of the document, and display the optimized layout diagram of the document.
[0150] Specifically, after the terminal generates the initial layout of the document specified by the document display operation in response to the document display operation (or document selection operation) triggered by the user, the terminal can send a data acquisition request to the background server. When the background server receives the data acquisition request sent by the terminal, the background server can obtain the initial layout of the document to be displayed on the terminal side based on the document identifier in the data acquisition request, and obtain the standard layout of the document according to the document identifier; further, the background server can determine the difference data between the standard layout and the initial layout, and return the difference data to the terminal, so that the terminal can re-layout the document based on the difference data, obtain the optimized layout of the document, and display the optimized layout of the document.
[0151] In this embodiment, when a data acquisition request sent by a terminal is received, an initial layout diagram of a document to be displayed on the terminal is acquired based on a document identifier in the data acquisition request, and a standard layout diagram of the document is acquired based on the document identifier; difference data between the standard layout diagram and the initial layout diagram is determined; the difference data is returned to the terminal, so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document. Since the difference data is determined based on the initial layout diagram and the standard layout diagram of the document to be displayed on each terminal, after the server returns the difference data obtained in real time to the terminal, the terminal can re-layout the initial layout diagram of the document based on the targeted difference data, and obtain a more accurate and consistent optimized layout diagram of the document, that is, by comparing the initial layout diagram generated by different terminal devices with the standard layout diagram, and re-layouting according to the compared difference data, so as to ensure the consistency and accuracy of the document display effect in different terminal model environments, the accuracy of the document display is effectively improved, and the consistency of the document display effect in different terminal model environments is effectively guaranteed. Technical effect.
[0152] In one embodiment, determining difference data between the standard layout diagram and the initial layout diagram includes:
[0153] Adjusting the scaling ratio of the standard layout diagram based on the scaling ratio of the initial layout diagram to obtain an adjusted standard layout diagram;
[0154] The adjusted standard layout diagram is compared with the initial layout diagram to obtain difference data.
[0155] Specifically, when the backend server receives a data acquisition request sent by a terminal, the backend server may acquire an initial layout diagram of the document to be displayed on the terminal side based on the document identifier in the data acquisition request. Figure 3 As shown in (1), the standard layout diagram of the document is obtained according to the document identifier. Figure 3 As shown in (2); further, the backend server can be based on Figure 3The scaling ratio (100%) of the initial layout image shown in (1) adjusts the scaling ratio of the standard layout image to 100% so that the scaling ratio of the adjusted standard layout image is consistent with the scaling ratio of the initial layout image; further, the background server can compare the adjusted standard layout image with the initial layout image to obtain the difference data between the standard layout image and the initial layout image of the document "Experiment 3". As a result, by comparing the initial layout image generated by different terminal devices with the standard layout image, and re-layout according to the compared difference data, the consistency and accuracy of the document display effect in different terminal model environments is guaranteed. While effectively improving the accuracy of document display, the consistency of document display effect in different terminal model environments is also effectively guaranteed.
[0156] In one embodiment, the difference data includes a text difference value; and the step of comparing the adjusted standard layout diagram with the initial layout diagram to obtain the difference data includes:
[0157] Compare the adjusted standard layout image with the initial layout image to obtain difference pixels;
[0158] According to the difference pixels, find the original position corresponding to the text where the text deviation first appears;
[0159] Get the font properties of the text;
[0160] Determine text difference value based on original position and font attributes;
[0161] The returning the difference data to the terminal so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document, including:
[0162] The text difference value is sent to the terminal, so that the terminal re-layouts the document based on the text difference value, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0163] Specifically, the document display method provided by the present application is described by taking the interaction between the terminal and the backend server as an example. Assume that user A triggers a document display operation for the document "Experiment 3". In response to the document display operation for the document "Experiment 3" triggered by user A, the terminal generates the following Figure 3After the initial layout diagram (i.e., the terminal length diagram) of the document "Experiment Three" specified by the document display operation shown in (1) is displayed, the terminal can send a data acquisition request to the background server. When the background server receives the data acquisition request sent by the terminal, the background server can obtain the initial layout diagram of the document "Experiment Three" to be displayed on the terminal side based on the document identifier in the data acquisition request, obtain the standard layout diagram of the document "Experiment Three" according to the document identifier, and adjust the scaling ratio of the standard layout diagram to 100% based on the scaling ratio of the initial layout diagram (100%), so that the scaling ratio of the adjusted standard layout diagram is consistent with the scaling ratio of the initial layout diagram.
[0164] Furthermore, the background server can compare the adjusted standard layout diagram with the initial layout diagram, that is, search for the difference pixel points pixel by pixel, and further search for the original position corresponding to the text where the text deviation first appears based on the found difference pixel points; the background server can obtain the font attributes of the text where the text deviation first appears, and determine the text difference value between the adjusted standard layout diagram and the initial layout diagram based on the font attributes and original position of the text where the text deviation first appears. Furthermore, the background server can send the obtained text difference value to the terminal, so that the terminal re-layouts the document based on the text difference value, obtains the optimized layout diagram of the document, and displays the optimized layout diagram of the document. As a result, while effectively improving the accuracy of document display, it also effectively ensures the consistency of document display effects in different terminal model environments.
[0165] In one embodiment, the step of determining the text difference value based on the original position and the font attributes includes:
[0166] In the initial typesetting diagram, the original position is used as a starting point to search for the target text with the font attribute;
[0167] When a target text with font attributes is found and a character adjacent to the target text meets a preset character condition, a width scaling value of the character adjacent to the target text is adjusted, and the adjusted width scaling value is used as a text difference value;
[0168] When the target text with the font attribute is not found, the width value of the text corresponding to the original position is adjusted, and the adjusted width value is used as the text difference value.
[0169] Specifically, the document display method provided by the present application is described by taking the interaction between the terminal and the backend server as an example. Assume that user A triggers a document display operation for the document "Experiment 3". In response to the document display operation for the document "Experiment 3" triggered by user A, the terminal generates the following Figure 3After the terminal displays the initial layout diagram (i.e., the long terminal diagram) of the document "Experiment Three" specified by the operation shown in (1) of the document, the terminal can send a data acquisition request to the background server. When the background server receives the data acquisition request sent by the terminal, the background server can obtain the initial layout diagram of the document "Experiment Three" to be displayed on the terminal side based on the document identifier in the data acquisition request, obtain the standard layout diagram of the document "Experiment Three" according to the document identifier, and adjust the scaling ratio of the standard layout diagram to 100% based on the scaling ratio (100%) of the initial layout diagram, so that the scaling ratio of the adjusted standard layout diagram is consistent with the scaling ratio of the initial layout diagram.
[0170] Further, the background server can compare the adjusted standard layout diagram with the initial layout diagram, that is, search for different pixel points pixel by pixel, and based on the found different pixel points, further search for the original position corresponding to the text where the text deviation first appears. Suppose the background server finds that the original position of the text ("Three") where the text deviation first appears in the initial layout diagram shown in (1) of the figure is A. Then the background server can further obtain that the font attribute of the text ("Three") where the text deviation first appears is B, and in the initial layout diagram shown in (1) of the figure, use the original position A of the text ("Three") where the text deviation first appears as the starting point and search forward for the target text with this font attribute B. Suppose after the background server finds that the target text with this font attribute B is "Three" in the title of the first line, the background server can further determine whether the characters in the adjacent positions of the target text "Three" meet the preset character conditions, that is, determine whether the characters before and after the target text "Three" are special characters such as tab (indentation), serial number, etc. If the characters before and after the target text "Three" are special characters such as tab (indentation), serial number, etc., the background server adjusts the width scaling values of the characters before and after the target text "Three", and uses the adjusted width scaling values as the text difference value between the standard layout diagram and the initial layout diagram; Further, the background server can send the obtained text difference value to the terminal, so that the terminal re-typesets the document based on the text difference value, obtains the optimized layout diagram of the document, and displays the optimized layout diagram of the document. Figure 3 If the original position of the text ("Three") where the text deviation first appears in the initial layout diagram shown in (1) of the figure is A, then the background server can further obtain that the font attribute of the text ("Three") where the text deviation first appears is B, and in the initial layout diagram shown in (1) of the figure, use the original position A of the text ("Three") where the text deviation first appears as the starting point and search forward for the target text with this font attribute B. Figure 3 Suppose after the background server finds that the target text with this font attribute B is "Three" in the title of the first line, the background server can further determine whether the characters in the adjacent positions of the target text "Three" meet the preset character conditions, that is, determine whether the characters before and after the target text "Three" are special characters such as tab (indentation), serial number, etc. If the characters before and after the target text "Three" are special characters such as tab (indentation), serial number, etc., the background server adjusts the width scaling values of the characters before and after the target text "Three", and uses the adjusted width scaling values as the text difference value between the standard layout diagram and the initial layout diagram; Further, the background server can send the obtained text difference value to the terminal, so that the terminal re-typesets the document based on the text difference value, obtains the optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0171] Or, when the background server does not find the target text with this font attribute B, the background server directly adjusts the width value of the text ("Three") where the text deviation first appears corresponding to the original position, and uses the adjusted width value as the text difference value between the standard layout diagram and the initial layout diagram; Further, the background server can send the obtained text difference value to the terminal, so that the terminal re-typesets the document based on the text difference value, obtains the optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0172] In this embodiment, based on the differences in the display of documents in different terminal devices, the document display effects generated in real time by different terminal devices are compared with the standard opening effects of the document to generate corresponding difference values, and the attributes of each element are dynamically adjusted according to the difference values to ensure that the display effects in different terminal model environments are aligned with the presentation form of Office, so that the display effects of users opening the same document on different terminals are basically consistent, which increases user stickiness and will also greatly help attract new users and increase activity of the product.
[0173] In one embodiment, the difference data includes a row height difference value; and the step of comparing the adjusted standard layout diagram with the initial layout diagram to obtain the difference data includes:
[0174] Compare the adjusted standard layout image with the initial layout image to obtain difference pixels;
[0175] According to the difference pixel points, find the paragraph position corresponding to the difference line where the deviation first occurs;
[0176] Determine the line height difference value based on the paragraph positions corresponding to the difference lines;
[0177] The returning the difference data to the terminal so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document, including:
[0178] The line height difference value is sent to the terminal, so that the terminal re-layouts the document based on the line height difference value, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0179] Specifically, the document display method provided by the present application is described by taking the interaction between the terminal and the backend server as an example. Assume that user A triggers a document display operation for the document "Experiment 3". In response to the document display operation for the document "Experiment 3" triggered by user A, the terminal generates the following Figure 3 After the initial layout diagram (i.e., the terminal length diagram) of the document "Experiment Three" specified by the document display operation shown in (1) is displayed, the terminal can send a data acquisition request to the background server. When the background server receives the data acquisition request sent by the terminal, the background server can obtain the initial layout diagram of the document "Experiment Three" to be displayed on the terminal side based on the document identifier in the data acquisition request, obtain the standard layout diagram of the document "Experiment Three" according to the document identifier, and adjust the scaling ratio of the standard layout diagram to 100% based on the scaling ratio of the initial layout diagram (100%), so that the scaling ratio of the adjusted standard layout diagram is consistent with the scaling ratio of the initial layout diagram.
[0180] Furthermore, the backend server can compare the adjusted standard layout diagram with the initial layout diagram, that is, find the difference pixel points pixel by pixel, and further find the paragraph position corresponding to the difference line where the deviation first occurs based on the found difference pixel points; the backend server can determine the line height difference value based on the paragraph position corresponding to the difference line, and send the line height difference value to the terminal, so that the terminal can re-layout the document based on the line height difference value, obtain the optimized layout diagram of the document, and display the optimized layout diagram of the document. In this way, the problem of inconsistent display effects when users open documents on different terminals can be effectively solved, so as to ensure the consistency of the display effect after users edit documents on other terminals and the effect of opening in office.
[0181] In one embodiment, the step of determining the line height difference value based on the paragraph positions corresponding to the difference lines includes:
[0182] When the paragraph position corresponding to the difference line is located in the target line, the paragraph offset value of the initial layout image is adjusted, and the adjusted paragraph offset value is used as the line height difference value;
[0183] When the paragraph position corresponding to the difference line is located in a non-target line, the target difference text in the difference line is searched, and the text height of the target difference text is adjusted, and the adjusted text height is used as the line height difference value.
[0184] Specifically, the document display method provided by the present application is described by taking the interaction between the terminal and the backend server as an example. Assume that user A triggers a document display operation for the document "Experiment 3". In response to the document display operation for the document "Experiment 3" triggered by user A, the terminal generates the following Figure 3 After the initial layout diagram (i.e., the terminal length diagram) of the document "Experiment Three" specified by the document display operation shown in (1) is displayed, the terminal can send a data acquisition request to the background server. When the background server receives the data acquisition request sent by the terminal, the background server can obtain the initial layout diagram of the document "Experiment Three" to be displayed on the terminal side based on the document identifier in the data acquisition request, obtain the standard layout diagram of the document "Experiment Three" according to the document identifier, and adjust the scaling ratio of the standard layout diagram to 100% based on the scaling ratio of the initial layout diagram (100%), so that the scaling ratio of the adjusted standard layout diagram is consistent with the scaling ratio of the initial layout diagram.
[0185] Furthermore, the backend server can Figure 3 The adjusted standard layout shown in (2) is similar to Figure 3 The initial layout diagram shown in (1) is compared, that is, the difference pixels are searched pixel by pixel, and based on the difference pixels found, the difference row where the deviation first occurs is further searched. Figure 3The paragraph position corresponding to the line "III. Preview Questions (Fill in the form)" in the lower left corner of the initial layout shown in (1) is the first line. That is, when the paragraph position corresponding to the difference line is located in the target line (the first line), the backend server can directly adjust the paragraph position as follows: Figure 3 The paragraph offset value of the initial layout diagram shown in (1) is used, and the adjusted paragraph offset value is used as the line height difference value between the standard layout diagram and the initial layout diagram.
[0186] In addition, in some cases, when the paragraph position corresponding to the difference line is located in a non-target line (i.e., not the first line), the backend server can further search for the target difference text in the difference line, adjust the text height of the target difference text, and use the adjusted text height as the line height difference value between the standard layout diagram and the initial layout diagram. That is, the backend server needs to find the text that affects the line height of the difference line, and fine-tune the actual height of the text in combination with the actual display effect. For example, the backend server can further search for the text corresponding to the largest font size in the font attributes of each text in the difference line, and use the text corresponding to the largest font size as the target difference text. This effectively solves the problem of inconsistent display effects when users open documents on different terminals, so as to ensure that the display effect after users edit documents on other terminals is consistent with the opening effect in office.
[0187] In one embodiment, the step of adjusting the text height of the target difference text and using the adjusted text height as the line height difference value includes:
[0188] Get the row height of the difference row in the adjusted standard layout diagram;
[0189] Based on the line height, line attribute data of the difference line and the fine-tuning coefficient, the text height of the target difference text is adjusted, and the adjusted text height is used as the line height difference value.
[0190] Specifically, the document display method provided by the present application is described by taking the interaction between the terminal and the backend server as an example. Assuming that when the paragraph position corresponding to the difference line is located in a non-target line (i.e., not the first line), the backend server can further search for the target difference text in the difference line and adjust the text height of the target difference text, i.e., the backend server can obtain the difference line in the following manner: Figure 3The row height corresponding to the adjusted standard layout diagram shown in (2) is calculated based on the row height, the row attribute data of the difference row (row height multiple) and the fine-tuning coefficient to obtain the actual text height. The text height of the target difference text is adjusted based on the actual text height, and the adjusted text height is used as the row height difference value between the standard layout diagram and the initial layout diagram. For example, the calculation method of the actual text height in the embodiment of the present application can be: actual text height = actual height (row height) ÷ (fine-tuning coefficient * row height multiple). This can effectively solve the problem of inconsistent display effects when users open documents on different terminals, so as to ensure that the display effect after the user edits the document on other terminals is consistent with the opening effect in office.
[0191] In one of the embodiments, after the terminal re-layouts the document based on the acquired difference data and obtains the optimized layout diagram of the document, the terminal can also send the obtained optimized layout diagram to the background server, so that the background server compares the optimized layout diagram with the standard layout diagram of the document again to obtain a comparison result; when the comparison result indicates that there is no difference data between the standard layout diagram and the optimized layout diagram of the document, the background server ends the current processing flow and returns the comparison result to the terminal, so that the terminal displays the optimized layout diagram of the document based on the comparison result (i.e., the comparison result indicating that there is no difference data between the standard layout diagram and the optimized layout diagram of the document).
[0192] Alternatively, when the comparison result indicates that there is difference data between the standard layout diagram and the optimized layout diagram of the document, the backend server returns the comparison result and the updated difference data to the terminal, so that the terminal re-layouts the document based on the updated difference data to obtain the second optimized layout diagram of the document. Thus, by comparing the display effects generated in real time by different types of terminals with the standard opening effects of the actual office document, a corresponding difference value is generated, and the attributes of each element are dynamically fine-tuned according to the difference value to ensure that the display effects in different terminal model environments are aligned with the presentation form of office, so that the display effects of users opening documents on different terminals are basically consistent, so as to ensure that the display effects after users edit documents on other terminals are consistent with the opening effects in office.
[0193] In one embodiment, the present application further provides an application scenario, and the application scenario applies the above-mentioned document display method. Specifically, the application of the document display method in the application scenario is as follows:
[0194] When a user wants to view or edit a document, the above document display method can be used. The method provided by the present application can be applied to a document management platform or a document application. The terminal generates an initial layout diagram of the document specified by the document display operation in response to the document display operation triggered by the user, and obtains the difference data between the standard layout diagram of the document and the initial layout diagram from the document management platform or the document application (i.e., the backend server); further, the terminal can re-layout the document based on the difference data, obtain the optimized layout diagram of the document, and display the optimized layout diagram of the document. Compared with the traditional method, the present application provides a method for optimizing the layout of mobile office based on the background, that is, the background server compares the display effect generated in real time on the terminal side with the standard effect of the actual office document opening, generates a corresponding difference value, and dynamically adjusts the attributes of each element according to the difference value to ensure that the display effect of the document in different terminal model environments is aligned with the expression form of office, which can effectively improve the accuracy of the document display effect while effectively ensuring the consistency of the document display effect in different terminal model environments.
[0195] The method provided in the embodiment of the present application can be applied to various scenarios where a document is displayed for the first time or opened for editing again. The document display method provided in the embodiment of the present application is described below using the scenario applied to a mobile terminal as an example.
[0196] like Fig.10 As shown in the figure, it is a schematic diagram of the traditional method. The beautification function in the traditional method is mainly to display the effect for the convenience of mobile terminal viewing, that is, to re-enlarge the layout content for display. If the terminal is a PC or other platform, there will be no similar beautification effect. Fig.10 As shown in , in the traditional solution technology, only the display optimization is performed for the mobile terminal, which is mainly to solve the problem that the content display may not be very clear when the screen is small. That is, when different user terminal devices open the same document, the displayed document content may not be clear or the displayed document content may be inaccurate. Therefore, how to effectively ensure the consistency of the document display effect in different terminal model environments while effectively improving the accuracy of the document display effect has become a problem that needs to be solved urgently.
[0197] Therefore, in order to solve the above problems, the present application provides a solution, that is, the present application proposes a method for optimizing the layout of mobile office based on the background, which can effectively solve the problem of inconsistent display effects when users open documents (such as office documents) on different terminals, so as to ensure that the display effect after the user edits the document on other terminals is consistent with the opening effect in the office, that is, while effectively improving the accuracy of the document display effect, it also effectively ensures the consistency of the document display effect in different terminal model environments.
[0198] On the product side, the method provided in this application can be applied to various scenarios of mobile product interaction. Figure 3 As shown in the figure, it is a comparison diagram between the standard layout of the document and the layout on the terminal side. Taking the mobile terminal product interaction as an example, this application solution is not limited to the mobile terminal, but can also be extended to other terminals such as PC and tablet. Figure 4 As shown, it is a schematic diagram of the display effect on the product side, that is, the display effect on the final product side can be as follows Figure 4 The optimized layout shown in .
[0199] On the technical side, Figure 5 As shown in FIG. , it is a schematic diagram of the overall process of the document display method provided by this application. Figure 5 The overall process shown in can be divided into three stages: first layout at the terminal → difference effect given by the server → optimized layout at the terminal. The detailed flow chart is as follows Figure 5 as shown in .
[0200] Here we will focus on explaining the difference calculation logic on the server side (taking fine-tuning text and line height as examples):
[0201] Fine-tune text logic:
[0202] 1. Compare the image scaled by the backend server with the long image on the terminal, and the backend server finds the place where the text position is displayed with deviation at the beginning;
[0203] 2. The backend server obtains the font attributes of the different texts based on the original file, and searches forward for texts with the same attributes;
[0204] 3. In step 2, if there is text with the same attribute in front, the text width under this attribute should be fine, that is, there is no need to fine-tune the text with this attribute. At this time, the backend server needs to check whether the characters before and after the text are tabs, serial numbers, etc., because the attributes of these special symbols will also affect the layout position of subsequent text. If the backend server finds the corresponding tab (indent), serial number and other special characters in the characters before and after the text, the backend server will fine-tune the width scaling value corresponding to the characters before and after the text, complete this data adjustment, and send the adjusted data to the terminal to trigger the terminal to re-layout;
[0205] 4. In step 2, if there is no text with the same attribute, the background server will fine-tune the width of the text with the attribute relative to the width that should be modified when displayed in the office, and notify the terminal to trigger the reflow;
[0206] 5. After the terminal is completely rearranged, compare it with the image with medium ratio zoom in the background again, execute step 1 and repeat it multiple times (the maximum number of executions can be controlled by the cloud);
[0207] 6. The final display effect is basically aligned with the display effect in Office.
[0208] Fine-tune row height logic:
[0209] 1. Compare the image scaled proportionally by the background with the long image on the terminal, and the background server finds the row that is initially displayed with deviation;
[0210] 2. Judge according to various situations:
[0211] a) There is a paragraph spacing before the paragraph;
[0212] b) Paragraph line height grid alignment;
[0213] c) The text attributes of the row are not exactly the same;
[0214] 3. Each of the above 2 situations needs to be judged separately. If the difference line is the first line of a paragraph, the above a and b situations may have an impact, and the backend server may need to fine-tune the paragraph offset value. If the difference line is an ordinary line, the backend server needs to find the highest text that affects the line height of the difference line, and fine-tune the actual height of the text based on the actual display effect;
[0215] The calculation method of the line height of the text display height after fine-tuning can be shown in the following formula (1):
[0216] Text height * fine-tuning factor * line height multiple (office line attribute) = actual height (line height)
[0217] 4. After updating to the terminal, the terminal will re-layout and compare it with the image with medium-scale zoom in the background again. Execute step 1 and repeat it multiple times (the maximum number of executions can be controlled by the cloud);
[0218] 5. The final display effect is basically aligned with the display effect in Office.
[0219] like Figure 8 As shown, it is a flowchart for optimizing the terminal display effect, and fine-tuning (replacing) the logic of the terminal not displaying or supporting the content:
[0220] 1. Compare the image scaled proportionally by the background with the long image on the terminal, and the background server finds the element that is displayed differently at the beginning;
[0221] 2. If the element is not supported or garbled characters are displayed due to font problems, the terminal can draw the target display effect diagram in the form of a picture at the actual drawing position of the element to be replaced;
[0222] 3. Case 1: garbled characters. This indicates that the terminal does not have a corresponding available font library. For example, Figure 7 Take the emoji shown in as an example. In this case, the backend server needs to directly extract the emoji element to be displayed, generate a new document, and export the intercepted target display image. The backend server can directly send the target display image to the terminal so that the terminal replaces the original garbled display effect by drawing a picture.
[0223] Case 2: The attribute is not supported, such as 3D text effect rendering:
[0224] In this case, the backend server can directly extract the 3D elements to be displayed, generate a new document, and export the captured target display image. The backend server can directly send the target display image to the terminal so that the terminal replaces the original garbled display effect by drawing an image.
[0225] 4. The size of the target display image can be larger and does not need to be consistent with the size of the terminal (the aspect ratio needs to be consistent), because the terminal will display it in a tiled manner;
[0226] 5. The replacement display is a picture, so editing is not supported. Relatively speaking, there will be no network delay problem, the processing speed is fast, the response speed is also fast, and the editing experience will be better.
[0227] It can be understood that in some cases, the solution provided in the embodiments of the present application can also support editing. When editing is supported, the original data of the terminal needs to be modified, then synchronized to the background server to update a new target image, and then the terminal is replaced. Relatively speaking, there is a problem of network delay, and the editing experience will be worse.
[0228] It can be understood that the method provided in the present application can also be processed by extracting characteristic values, such as the display height and line height performance values of different fonts on the office and the display height and line height performance values of the same font on the terminal. That is, the solution provided in the present application can also calculate a series of optimal tuning parameters through a big data model to fine-tune the text, line height, and other elements that affect the layout, including but not limited to the accuracy of page width and height, line borders, etc. That is, by using a large model to calculate a series of optimal tuning parameters, and sending the fine-tuning results (tuning parameters) through the background, or the terminal itself runs to obtain the fine-tuning results, and ultimately fine-tuning is used to achieve the display effect aligned with the display effect in the office.
[0229] The beneficial effects of the technical solution of this application include:
[0230] The technical solution provided in the embodiments of the present application optimizes the differences in the display of office files in different terminal devices, and can maximize the display effects of different platforms without affecting the display effects of users opening documents on different terminal devices. It not only increases user stickiness, but also greatly helps to attract new users and increase activity of the product.
[0231] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0232] Based on the same inventive concept, the embodiment of the present application also provides a document display device for implementing the document display method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more document display device embodiments provided below can refer to the limitations on the document display method above, and will not be repeated here.
[0233] In one embodiment, Fig.11 As shown, a document display device is provided, including: a generation module 1102, an acquisition module 1104, a typesetting module 1106 and a display module 1108, wherein:
[0234] The generating module 1102 is used to generate an initial layout diagram of the document specified by the document display operation in response to the document display operation.
[0235] The acquisition module 1104 is used to acquire the difference data between the standard layout diagram of the document and the initial layout diagram.
[0236] The layout module 1106 is used to re-layout the document based on the difference data to obtain an optimized layout diagram of the document.
[0237] The display module 1108 is used to display the optimized layout of the document.
[0238] In one embodiment, the device also includes: a sending module for sending a data acquisition request to a server; a receiving module for receiving difference data returned by the server in response to the data acquisition request; the difference data is the difference data between the standard layout diagram of the document and the initial layout diagram; the layout module is also used to respond to the optimization operation triggered in the document display page, and re-layout the document based on the difference data to obtain the optimized layout diagram of the document.
[0239] In one embodiment, the acquisition module is also used to obtain the standard layout diagram of the document; the device also includes: an adjustment module, used to adjust the scaling ratio of the standard layout diagram based on the scaling ratio of the initial layout diagram to obtain the adjusted standard layout diagram; a comparison module, used to compare the adjusted standard layout diagram with the initial layout diagram to obtain difference data.
[0240] In one embodiment, the difference data includes text difference values; the comparison module is also used to compare the adjusted standard typesetting diagram with the initial typesetting diagram to obtain difference pixel points; the device also includes: a search module, which is used to find the original position corresponding to the text where the text deviation first appears according to the difference pixel points; the acquisition module is also used to obtain the font attributes of the text; the device also includes: a determination module, which is used to determine the text difference value based on the original position and the font attributes.
[0241] In one embodiment, the search module is also used to search for target text with the font attributes in the initial typeset diagram using the original position as a starting point; the adjustment module is also used to adjust the width scaling value of the character adjacent to the target text when the target text with the font attributes is found and the character adjacent to the target text meets a preset character condition, and use the adjusted width scaling value as the text difference value; when the target text with the font attributes is not found, adjust the width value of the text corresponding to the original position, and use the adjusted width value as the text difference value.
[0242] In one embodiment, the difference data includes a line height difference value; the comparison module is also used to compare the adjusted standard layout image with the initial layout image to obtain difference pixel points; the device also includes: a search module, which is used to find the paragraph position corresponding to the difference line where the deviation first occurs according to the difference pixel points; a determination module, which is used to determine the line height difference value based on the paragraph position corresponding to the difference line.
[0243] In one embodiment, the adjustment module is also used to adjust the paragraph offset value of the initial layout image when the paragraph position corresponding to the difference line is located in the target line, and use the adjusted paragraph offset value as the line height difference value; the search module is also used to search for the target difference text in the difference line when the paragraph position corresponding to the difference line is located in a non-target line; the adjustment module is also used to adjust the text height of the target difference text, and use the adjusted text height as the line height difference value.
[0244] In one embodiment, the acquisition module is also used to obtain the line height of the difference line corresponding to the adjusted standard layout diagram; the adjustment module is also used to adjust the text height of the target difference text based on the line height, the line attribute data of the difference line and the fine-tuning coefficient, and use the adjusted text height as the line height difference value.
[0245] In one embodiment, the difference data includes a text display difference map; the device also includes: a search module, used to find the original position corresponding to the element where the text display effect deviation first appears based on the adjusted standard typesetting map and the initial typesetting map; the generation module is also used to generate a target document containing the element based on the target display effect of the element when the display effect corresponding to the element is garbled characters; based on the target document, generate a target display map of the element, and use the target display map as the text display difference map.
[0246] In one embodiment, the device also includes: a parsing module, used to parse the attributes of each element in the original description file of the document; the acquisition module is also used to obtain the display attributes of the unsupported elements when the attributes of the elements are not supported by the current device; the generation module is also used to generate a target display image of the unsupported elements based on the display attributes, and use the target display image as the difference data.
[0247] In one embodiment, the device also includes: a comparison module, which is used to compare the standard typesetting diagram of the document with the optimized typesetting diagram to obtain a comparison result; the display module is also used to display the optimized typesetting diagram of the document when the comparison result indicates that there is no difference data between the standard typesetting diagram of the document and the optimized typesetting diagram.
[0248] In one embodiment, Fig.12 As shown, another document display device is provided, including: an acquisition module 1202, a determination module 1204 and a sending module 1206, wherein:
[0249] The acquisition module 1202 is used to acquire the initial layout of the document to be displayed on the terminal based on the document identifier in the data acquisition request when receiving the data acquisition request sent by the terminal; and acquire the standard layout of the document according to the document identifier.
[0250] The determination module 1204 is used to determine the difference data between the standard layout diagram and the initial layout diagram.
[0251] The sending module 1206 is used to return the difference data to the terminal, so that the terminal can rearrange the document based on the difference data, obtain the optimized layout diagram of the document, and display the optimized layout diagram of the document.
[0252] In one embodiment, the device also includes: an adjustment module, used to adjust the scaling ratio of the standard layout image based on the scaling ratio of the initial layout image to obtain the adjusted standard layout image; a comparison module, used to compare the adjusted standard layout image with the initial layout image to obtain difference data.
[0253] In one embodiment, the difference data includes text difference values; the comparison module is also used to compare the adjusted standard layout image with the initial layout image to obtain difference pixels; the device also includes: a search module, used to find the original position corresponding to the text where the text deviation first appears according to the difference pixels; the acquisition module is also used to obtain the font attributes of the text; the determination module is also used to determine the text difference value based on the original position and the font attributes; the sending module is also used to send the text difference value to the terminal, so that the terminal re-layouts the document based on the text difference value, obtains the optimized layout image of the document, and displays the optimized layout image of the document.
[0254] In one embodiment, the difference data includes a line height difference value; the comparison module is also used to compare the adjusted standard layout diagram with the initial layout diagram to obtain difference pixels; the device also includes: a search module, used to find the paragraph position corresponding to the difference line where the deviation first occurs according to the difference pixels; the determination module is also used to determine the line height difference value based on the paragraph position corresponding to the difference line; the sending module is also used to send the line height difference value to the terminal, so that the terminal re-layouts the document based on the line height difference value, obtains the optimized layout diagram of the document, and displays the optimized layout diagram of the document.
[0255] Each module in the document display device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0256] In one embodiment, a computer device is provided. The computer device may be a terminal or a server. In this embodiment, the computer device is described as a terminal. The internal structure diagram thereof may be as follows: Fig.13 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a document display method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0257] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0258] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0259] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0260] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0261] 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 this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0262] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0263] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0264] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A document display method, characterized in that: The method comprises: In response to a document display operation, generating an initial layout diagram of the document specified by the document display operation; Obtaining difference data between the standard layout diagram of the document and the initial layout diagram; Re-layout the document based on the difference data to obtain an optimized layout diagram of the document; A diagram showing an optimized layout of the document.
2. The method according to claim 1, characterized in that The step of obtaining difference data between the standard layout diagram of the document and the initial layout diagram includes: Send a data acquisition request to the server; Receiving difference data returned by the server in response to the data acquisition request; the difference data is difference data between the standard layout diagram of the document and the initial layout diagram; The step of re-layouting the document based on the difference data to obtain an optimized layout diagram of the document includes: In response to the optimization operation triggered in the document display page, the document is rearranged based on the difference data to obtain an optimized layout diagram of the document.
3. The method according to claim 1, characterized in that After generating the initial layout diagram of the document specified by the document display operation, the method further includes: Obtaining a standard layout diagram of the document; Adjusting the scaling ratio of the standard layout diagram based on the scaling ratio of the initial layout diagram to obtain the adjusted standard layout diagram; The step of obtaining difference data between the standard layout diagram of the document and the initial layout diagram includes: The adjusted standard layout diagram is compared with the initial layout diagram to obtain difference data.
4. The method according to claim 3, characterized in that The difference data includes a text difference value; the difference data is obtained by comparing the adjusted standard layout diagram with the initial layout diagram, including: Comparing the adjusted standard layout image with the initial layout image to obtain difference pixels; According to the difference pixel points, searching for the original position corresponding to the text where the text deviation first appears; Get the font properties of the text; The text difference value is determined based on the original position and the font attributes.
5. The method according to claim 4, characterized in that The determining the text difference value based on the original position and the font attribute includes: In the initial layout diagram, using the original position as a starting point to search for a target text having the font attribute; When a target text having the font attribute is found and a character adjacent to the target text satisfies a preset character condition, a width scaling value of the character adjacent to the target text is adjusted, and the adjusted width scaling value is used as the text difference value; When the target text with the font attribute is not found, the width value of the text corresponding to the original position is adjusted, and the adjusted width value is used as the text difference value.
6. The method according to claim 3, characterized in that The difference data includes a row height difference value; the difference data is obtained by comparing the adjusted standard layout diagram with the initial layout diagram, including: Comparing the adjusted standard layout image with the initial layout image to obtain difference pixels; According to the difference pixel points, searching for the paragraph position corresponding to the difference line where the deviation first occurs; The line height difference value is determined based on the paragraph positions corresponding to the difference lines.
7. The method according to claim 6, characterized in that The determining the line height difference value based on the paragraph position corresponding to the difference line includes: When the paragraph position corresponding to the difference line is located at the target line, adjusting the paragraph offset value of the initial layout image, and using the adjusted paragraph offset value as the line height difference value; When the paragraph position corresponding to the difference line is located in a non-target line, the target difference text in the difference line is searched, and the text height of the target difference text is adjusted, and the adjusted text height is used as the line height difference value.
8. The method according to claim 7, characterized in that The step of adjusting the text height of the target difference text and using the adjusted text height as the line height difference value includes: Obtaining the row height of the difference row corresponding to the adjusted standard layout diagram; Based on the line height, the line attribute data of the difference line and the fine-tuning coefficient, the character height of the target difference character is adjusted, and the adjusted character height is used as the line height difference value.
9. The method according to claim 3, characterized in that: The difference data includes a text display difference diagram; the difference data is obtained by comparing the adjusted standard layout diagram with the initial layout diagram, including: Based on the adjusted standard layout diagram and the initial layout diagram, searching for the original position corresponding to the element where the text display effect deviation first appears; When the display effect corresponding to the element is garbled characters, generating a target document containing the element based on the target display effect of the element; Based on the target document, a target display diagram of the element is generated, and the target display diagram is used as the text display difference diagram.
10. The method according to claim 1, characterized in that The step of obtaining difference data between the standard layout diagram of the document and the initial layout diagram includes: Parsing the attributes of each element in the original description file of the document; When the attribute of the element is not supported by the current device, obtaining the display attribute of the unsupported element; Based on the display attributes, a target display map of the unsupported element is generated, and the target display map is used as the difference data.
11. The method according to claim 1, characterized in that: After the document is re-layouted based on the difference data to obtain an optimized layout diagram of the document, the method further includes: Comparing the standard layout diagram of the document with the optimized layout diagram to obtain a comparison result; The optimized layout diagram showing the document includes: When the comparison result indicates that there is no difference data between the standard layout diagram of the document and the optimized layout diagram, the optimized layout diagram of the document is displayed.
12. A document display method, characterized in that: The method comprises: When receiving a data acquisition request sent by a terminal, acquiring an initial layout diagram of the document to be displayed on the terminal based on the document identifier in the data acquisition request; Acquire a standard layout diagram of the document according to the document identifier; Determine the difference data between the standard layout diagram and the initial layout diagram; The difference data is returned to the terminal, so that the terminal rearranges the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
13. The method according to claim 12, characterized in that The determining of difference data between the standard layout diagram and the initial layout diagram includes: Adjusting the scaling ratio of the standard layout diagram based on the scaling ratio of the initial layout diagram to obtain the adjusted standard layout diagram; The adjusted standard layout diagram is compared with the initial layout diagram to obtain difference data.
14. The method according to claim 13, characterized in that The difference data includes a text difference value; the difference data is obtained by comparing the adjusted standard layout diagram with the initial layout diagram, including: Comparing the adjusted standard layout image with the initial layout image to obtain difference pixels; According to the difference pixel points, searching for the original position corresponding to the text where the text deviation first appears; Get the font properties of the text; Determining the text difference value based on the original position and the font attribute; The returning the difference data to the terminal so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document, including: The text difference value is sent to the terminal, so that the terminal re-layouts the document based on the text difference value, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
15. The method according to claim 13, characterized in that The difference data includes a row height difference value; the difference data is obtained by comparing the adjusted standard layout diagram with the initial layout diagram, including: Comparing the adjusted standard layout image with the initial layout image to obtain difference pixels; According to the difference pixel points, searching for the paragraph position corresponding to the difference line where the deviation first occurs; Determining the line height difference value based on the paragraph positions corresponding to the difference lines; The returning the difference data to the terminal so that the terminal re-layouts the document based on the difference data, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document, including: The line height difference value is sent to the terminal, so that the terminal re-layouts the document based on the line height difference value, obtains an optimized layout diagram of the document, and displays the optimized layout diagram of the document.
16. A document display device, characterized in that: The device comprises: A generating module, configured to generate, in response to a document display operation, an initial layout diagram of a document specified by the document display operation; An acquisition module, used for acquiring difference data between the standard layout diagram of the document and the initial layout diagram; A layout module, used for re-layouting the document based on the difference data to obtain an optimized layout diagram of the document; The display module is used to display the optimized layout diagram of the document.
17. A document display device, characterized in that: The device comprises: An acquisition module, configured to, when receiving a data acquisition request sent by a terminal, acquire an initial layout of a document to be displayed on the terminal based on a document identifier in the data acquisition request; and acquire a standard layout of the document based on the document identifier; A determination module, used to determine the difference data between the standard layout diagram and the initial layout diagram; The sending module is used to return the difference data to the terminal, so that the terminal can rearrange the document based on the difference data, obtain the optimized layout diagram of the document, and display the optimized layout diagram of the document.
18. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 or 12 to 15 are implemented.
19. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 or 12 to 15 are implemented.
20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 or 12 to 15 are implemented.
