Information display method and device, electronic equipment and readable medium
The document display tool is provided through the server, and document data that meets the specified document format is displayed directly in the browser, solving the problem of browser plug-in installation and resource utilization, and achieving convenient and efficient document display.
Patent Information
- Application Number
- CN202410211038.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-26
- Publication Date
- 2025-08-26
AI Technical Summary
In the prior art, browser plug-ins require users to manually install, occupy terminal processing resources, and affect response speed and user experience.
The document display tool is provided through the server, and document data that meets the specified document format is displayed directly in the browser, avoiding the installation of plug-ins in the terminal, and the terminal does not need to process document data.
It improves the convenience of the information display system, reduces the operating pressure of the user terminal, and improves the response speed and user experience of the client.
Smart Images

Figure CN120541044A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information display method, device, electronic device, and readable medium. Background Art
[0002] With the continuous development of Internet technology, various electronic files are constantly emerging online. With the increasing number of electronic files, online documents are playing an increasingly important role in daily office work. File preview technology allows users to view files directly on their devices.
[0003] In the related art, users can view document content in a specific format in a browser through a specific browser plug-in.
[0004] However, such plug-ins usually require users to manually install them in the browser of the user terminal, which is less convenient. In addition, the browser plug-in processing files requires the processing resources of the user terminal, which increases the operating pressure of the user terminal, reduces the response speed of the client, and affects the user experience. Summary of the Invention
[0005] Based on the above technical problems, the present application provides an information display method, device, electronic device and readable medium to reduce the operating pressure of the user terminal, improve the response speed of the client and the user experience.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.
[0007] According to one aspect of an embodiment of the present application, there is provided an information display method, including:
[0008] Acquire a target document to be processed and a target document format of the target document;
[0009] In response to an information display request for the target document, sending a document display tool corresponding to the target document to the client, wherein the document display tool is used to display document data that conforms to a specified document format;
[0010] According to the target document format, converting the document data in the target document into document data to be displayed that conforms to the specified document format;
[0011] The document data to be displayed is displayed in the client through the document display tool.
[0012] According to one aspect of an embodiment of the present application, there is provided an information display device, comprising:
[0013] a request acquisition module configured to acquire a target document to be processed and a target document format of the target document;
[0014] a tool acquisition module configured to send a document display tool corresponding to the target document to the client in response to an information display request for the target document, wherein the document display tool is used to display document data that conforms to a specified document format;
[0015] a data conversion module configured to convert the document data in the target document into document data to be displayed that complies with the specified document format according to the target document format;
[0016] The data display module is configured to display the document data to be displayed in the client through the document display tool.
[0017] In some embodiments of the present application, based on the above technical solution, the information display request is a request triggered by the document display page in the client during the display process; the data display module is specifically configured to: generate response data for the information display request based on the document data to be displayed; set the data type in the response data to a specified format identifier corresponding to the specified document format; parse the response data in the client through the document display tool to display the document data to be displayed in the document display page according to the display control corresponding to the specified format identifier.
[0018] In some embodiments of the present application, based on the above technical solution, the data display module is specifically configured as follows: if it is detected through the document display tool that the document display page supports the display of the document data to be displayed, the display mode in the response data is set to the page display mode; according to the page display mode, the document data to be displayed is loaded in the client through the display control in the document display page of the document display tool.
[0019] In some embodiments of the present application, based on the above technical solution, the data display module is specifically configured to: obtain the specified size information in the response data according to the page display mode; load the display control that meets the specified size information in the document display page of the client according to the specified size information; and load the document data to be displayed in the display control.
[0020] In some embodiments of the present application, based on the above technical solution, the data display module is specifically configured to: retrieve the document page corresponding to the page number information in the document data to be displayed according to the page number information in the response data; load the document data to be displayed in the display control and display the document page in the display control.
[0021] In some embodiments of the present application, based on the above technical solution, the data display module is specifically configured as follows: if the document display page does not support the display of the document data to be displayed, the display mode in the response data is set to the page download mode; according to the page download mode, the document to be displayed containing the specified document format is sent through the document display page, and the document to be displayed contains the document data to be displayed.
[0022] In some embodiments of the present application, based on the above technical solution, the data display module is further configured to: if the document display page does not support the display of the document data to be displayed, call the document parsing tool through the document display tool; load the display control corresponding to the specified format identifier in the document display page through the document parsing tool; and load the document data to be displayed in the display control.
[0023] In some embodiments of the present application, based on the above technical solution, the data display module is further configured to: if loading the display control in the client fails, obtain alternative display information from the document display tool; and display the alternative display information in the document display page through the document display tool.
[0024] In some embodiments of the present application, based on the above technical solution, the data conversion module is specifically configured as follows: if the target document format does not match the specified document format, then according to the target document format, a data conversion tool corresponding to the target document format and the specified document format is obtained; through the data conversion tool, the target document is converted into a specified document in the specified document format; and the document data in the specified document is obtained as the document data to be displayed.
[0025] In some embodiments of the present application, based on the above technical solution, the data conversion module is specifically configured as follows: if the target document format does not match the specified document format, then according to the target document format, a data conversion tool corresponding to the target document format and the specified document format is obtained; through the data conversion tool, the document data of the target document is converted into document data to be displayed that conforms to the specified document format.
[0026] In some embodiments of the present application, based on the above technical solution, the request acquisition module is specifically configured to: obtain the information display request triggered by the client, the information display request includes the document identifier of the target document; according to the document identifier, retrieve the document upload record corresponding to the document identifier, the document upload record includes the target document format and document storage address of the target document; according to the document storage address of the target document, obtain the target document.
[0027] According to one aspect of an embodiment of the present application, an electronic device is provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the information display method in the above technical solution by executing the executable instructions.
[0028] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the information display method in the above technical solution is implemented.
[0029] According to one aspect of an embodiment of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the information display methods provided in the various optional implementations described above.
[0030] In an embodiment of the present application, during the process of displaying document data, a document display tool corresponding to the target document is obtained. The document display tool is used to display document data that conforms to a specified document format, and converts the document data of the target document into document data to be displayed that conforms to the specified document format according to the target document format, and then displays the document data to be displayed through the document display tool. Through the above-mentioned method, the display system itself obtains the document display tool and provides it to the browser. The user does not need to install a plug-in separately in the browser, and the main operations on the document data are completed by the server, without occupying the processing resources of the user terminal, thereby increasing the convenience of the information display system, reducing the operating pressure of the user terminal, and improving the response speed of the client and the user's experience.
[0031] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0033] Figure 1 This is a system architecture applied to an information display solution according to an embodiment of the present application.
[0034] Figure 2This is a schematic diagram of the basic process of online document information display in an embodiment of this application.
[0035] Figure 3 This is a schematic flow chart of an information display method in an embodiment of the present application.
[0036] Figure 4 This is a schematic flow chart of an information display method in an embodiment of the present application.
[0037] Figure 5 This is a schematic flow chart of an information display method in an embodiment of the present application.
[0038] Figure 6 This is a schematic diagram of the overall process of displaying online document information in an embodiment of the present application.
[0039] Figure 7 The following schematically shows a block diagram of the composition of the information display device in an embodiment of the present application.
[0040] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0041] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0042] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0043] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0044] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0045] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0046] It should be understood that the solution of the present application can be applied to the field of online office work, and specifically in the scenario of online document preview. Taking online office work as an example, in this scenario, by making documents online, users can view documents directly online in a browser, without having to first download the file and then open it in the corresponding application for browsing. For example, a user can view a link to the file they want to browse on a browser page and click on the document link to browse the document content directly on the page. This process can be called a preview of the file. These documents are generally uploaded to a server by other users in advance. Users can view the file links of these uploaded files on the browser page. When the user clicks the file link on the page, a control or plug-in for file preview is loaded on the page, and the file content is displayed in the control. Different browsers may support different types of document previews. Therefore, to support online browsing of different types of documents, the browser needs to install plug-ins corresponding to each type of document. These plug-ins usually need to be actively installed by the user on the user terminal used. Different types of terminals and browsers may also require different plug-ins to be installed. The plug-in selection and installation process can be difficult for some users, and the independent installation process also makes online browsing less convenient. In addition, plug-ins installed in browsers usually cache the files to be previewed locally, and then the plug-ins perform format parsing and transcoding on the cached files before displaying them on the browser page. The plug-in's local processing of cached files also consumes the computing resources of the local device, which increases the computing pressure of the local computing device, thereby slowing down the response speed of the browser, client or user terminal, and bringing a poor user experience.
[0047] Based on this, the technical solution of the embodiment of this application proposes an information display solution. Specifically, Figure 1As shown, the system architecture 100 applied to the information display solution according to the embodiment of the present application may include a terminal device 110, a network 120 and a server 130. The terminal device 110 may include a smart phone, a tablet computer, a laptop computer, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, and the like. The server 130 may be a server that provides various services. It may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The network 120 may be a communication medium of various connection types that can provide a communication link between the terminal device 110 and the server 130, for example, it may be a wired communication link or a wireless communication link.
[0048] Depending on the implementation requirements, the system architecture in the embodiments of the present application can have any number of terminal devices, networks, and servers. For example, server 130 can be a server group consisting of multiple server devices. In addition, the technical solutions provided in the embodiments of the present application can be implemented jointly by terminal device 110 and server 130.
[0049] In one embodiment of the present application, the server 130 is a document online server that provides a document online preview service to the terminal on the terminal device 110 through the network 120 .
[0050] The user browses the web page provided by the server 130 through a terminal such as a browser on the terminal device 110. The web page contains a link to an online document. When the user clicks on the document link, an information display request for the document is triggered. The server 130 obtains the information display request from the terminal device 110, and the information display request contains the document identifier of the document. In response to the information display request, the server 130 obtains a document display tool corresponding to the document, and the document display tool is used to display document data that conforms to a specified document format. The server 130 obtains the document corresponding to the document identifier and the document format of the document based on the document identifier. The server 130 converts the document data in the target document into document data to be displayed that conforms to the specified document format based on the target document format. The server 130 provides the number of documents to be displayed to the terminal device 110 via the network 120. The terminal device 110 then displays the document data to be displayed on the browser page.
[0051] The following describes the basic process of displaying information in online documents in this application. Figure 2 , Figure 2This is a schematic diagram of the basic process of displaying online document information in the embodiment of this application. Figure 2 In the process shown, the browser requests a document preview and passes the document ID parameter to the server. Upon receiving the request, the server parses the request parameters and obtains the document ID. The server then searches for the document using the document ID. If the document does not exist, the server returns an error message stating "Document does not exist." If the document does exist, the server reads the document content, sets the response header parameters in the response data, and returns the document data to the browser. The browser then displays the received document data, indicating a preview.
[0052] The following is a detailed description of the technical solution provided by this application in conjunction with specific implementation methods. For ease of introduction, please refer to Figure 3 , Figure 3 This is a schematic flow chart of an information display method in an embodiment of the present application. In this embodiment of the present application, a system for online document processing is introduced as an execution subject. The system includes a server and a terminal. The information display method may include the following steps S310 to S340:
[0053] Step S310: Acquire a target document to be processed and a target document format of the target document.
[0054] In the present application, the target document to be processed is a document to be displayed in the document display page of the client. The document display page of the client will display the document access link of the target document. The user previews the content in the target document by clicking on the document access link. The server will obtain the target document to be processed based on the link bar of the target document that the user wants to preview. The target document format of the target document refers to the document storage format of the target document. The server can contain various types of document formats, and these documents can all be displayed in the document display page. It can be understood that in some embodiments, the server can directly retrieve the document that may need to be displayed based on one or more document access links displayed on the page when loading the document display page, so that it can be directly processed when the user clicks on a document access link.
[0055] Step S320 : In response to the information display request for the target document, a document display tool corresponding to the target document is sent to the client, where the document display tool is used to display document data that conforms to a specified document format.
[0056] An information display request is triggered when a user wants to preview a target document, for example, by clicking a document link for the target document on a document display page. This information display request triggers the loading of the target document's content on the document display page. During this process, the document display page requests the server to load the document display tool required to display the document. An example of a document display tool may be a document display function written in a specific programming language. It will be appreciated that the document display function can be written based on functional components or toolkits pre-installed on the server. The server then sends the document display tool corresponding to the target document to the client. The server contains the document display tool for displaying the target document in its target document format. For example, the server can directly determine the document display tool for displaying the target document based on the document display page, or it can determine the corresponding document display tool based on the target document's target document format. A document display tool is used to display document data that conforms to a specified document format. It should be noted that the specified document format displayed by the document display tool may not necessarily be the same as the target document's target document format. For example, the target document may be in text format, while the document display tool may be in image format. The server may include information about which document display tool to use for a specific document format. Typically, a document display tool may be used to display multiple document formats, such as text format, markup language text format, or authoring document format.
[0057] Step S330 : According to the target document format, convert the document data in the target document into document data to be displayed that complies with the specified document format.
[0058] The server converts the target document's target document format and the document data within it into document data to be displayed that conforms to the specified document format. Specifically, if the target document's target document format does not conform to the specified document format of the document display tool, the server will convert the document data within the target document into document data to be displayed that conforms to the specified document format. The document data is the binary data read from the target document. The server converts the data format within the binary data stream into document binary data that can be directly processed by the document display tool.
[0059] Step S340: displaying the document data to be displayed in the client through the document display tool.
[0060] The server will display the document data to be displayed on the client through the document display tool. Specifically, the server will provide the document data to the client, and the client will use the received document display tool to load a window or page element on the client's page for displaying the document data, and provide the document data to the document display tool to load and display it in the window or page element.
[0061] In an embodiment of the present application, during the process of displaying document data, a document display tool corresponding to the target document is obtained. The document display tool is used to display document data that conforms to a specified document format, and converts the document data of the target document into document data to be displayed that conforms to the specified document format according to the target document format, and then displays the document data to be displayed through the document display tool. Through the above-mentioned method, the display system itself obtains the document display tool and provides it to the browser. The user does not need to install a plug-in separately in the browser, and the main operations on the document data are completed by the server, without occupying the processing resources of the user terminal, thereby increasing the convenience of the information display system, reducing the operating pressure of the user terminal, and improving the response speed of the client and the user's experience.
[0062] In some embodiments of the present application, based on the technical solution of the present application, during the process of converting the document data in the target document into document data to be displayed that conforms to the specified document format according to the target document format, if the target document format does not match the specified document format, the server obtains a data conversion tool corresponding to the target document format and the specified document format according to the target document format, and then uses the data conversion tool to convert the document data in the target document into document data to be displayed that conforms to the specified document format. In this embodiment, when the target document format does not match the specified document format, the server converts the document data. Specifically, the server obtains a data conversion tool corresponding to the target document format and the specified document format. The data conversion tool is used to convert data in the target document format into data in the specified document format. The tool can be, for example, software or a functional module with corresponding conversion functions. Subsequently, the server uses the data conversion tool to convert the document data in the target document into document data to be displayed that conforms to the specified document format. By directly converting the document data of the target document through data conversion tools, the document data can be directly processed on the server side into a form that can be directly displayed on the client, without the client having to perform additional conversion or transcoding on the document data. This is beneficial to reducing the client's computing resource consumption and improving the client's response speed.
[0063] In some embodiments of the present application, based on the technical solutions of the present application, during the process of converting the document data in the target document into document data to be displayed that conforms to the specified document format according to the target document format, if the target document format does not match the specified document format, the server, based on the target document format, obtains a data conversion tool corresponding to both the target document format and the specified document format. The data conversion tool then converts the target document into a designated document in the specified document format, and then obtains the document data from the designated document as the document data to be displayed. In an embodiment of the present application, the server uses the data conversion tool to convert the entire target document into the designated document, and then obtains the document data from the designated document. Specifically, the data conversion tool can be software or a functional module installed on the server, and the data conversion tool is used to convert data in the target document format into data in the specified document format. The server invokes the data conversion tool to process the target document and generate the designated document. The designated document is a document that conforms to the specified document format. For example, if the target document is in plain text format and the specified document format is portable text format, the server can invoke the data conversion tool using a specific conversion instruction, passing the address of the target document and the specified document generation address as parameters to the conversion instruction. The data conversion tool reads the target document, converts it, and generates a designated document at the specified document generation address. The server can then read the designated document to obtain the document data to be displayed. In this embodiment, the server converts the target document into the designated document. The generated designated document serves as a physical file on the server and can be read and used repeatedly. This avoids repeated document conversion when displaying the same document, thereby reducing server resource consumption.
[0064] In some embodiments of the present application, based on the technical solutions of the present application, during the process of obtaining a target document to be processed and its target document format, the server receives an information display request triggered by the client. The information display request includes the document identifier of the target document. Based on the document identifier, the server then retrieves the document upload record corresponding to the document identifier. The document upload record includes the target document's target document format and document storage address. Finally, the server retrieves the target document based on the target document's document storage address. In this embodiment, the target document is a document previously uploaded to the server. Upon receiving the uploaded document, the server records the document upload record for each document. After receiving the information display request triggered by the client, the server retrieves the document upload record corresponding to the document identifier based on the document identifier of the target document included in the display request. The document upload record includes at least the target document format and document storage address of the target document. It is understood that the document upload record naturally includes the document identifier. In some embodiments, it also includes the target document's name, uploader information, and upload time. Based on the target document's document storage address, the server can retrieve the target document. Depending on the target document's type, the method for retrieving the target document can vary. For example, for a text document, the target document might be loaded into server memory as binary data, while for an image document, the document content might be retrieved by recognizing the text within the image. Retrieving the document's upload record using the document identifier and then reading the document based on the storage address in the upload record can reduce the amount of processing required during the retrieval process compared to directly retrieving the target document based on the document identifier, thereby improving retrieval efficiency.
[0065] In the embodiments of the present application, it is also proposed to Figure 3 Other embodiments that refine the technical solution of the embodiment shown are as follows Figure 4 As shown, in an information display method according to an embodiment of the present application, the information display request is a request triggered by a document display page in a client during the display process. The information display method may include the following steps:
[0066] Step S410: obtaining a target document to be processed and a target document format of the target document.
[0067] Optionally, the implementation details of step S410 are the same as Figure 3 The step S310 shown in FIG is the same as that in FIG, and will not be repeated here.
[0068] Step S420 : In response to the information display request for the target document, a document display tool corresponding to the target document is sent to the client, where the document display tool is used to display document data that conforms to a specified document format.
[0069] Optionally, the implementation details of step S420 are the same as Figure 3 The step S320 shown in FIG is the same as that in FIG, and will not be repeated here.
[0070] Step S430 : According to the target document format, the document data in the target document is converted into document data to be displayed that complies with the specified document format.
[0071] Optionally, the implementation details of step S430 are the same as Figure 3 The step S340 shown in FIG is consistent with the step S340 shown in FIG, and will not be repeated here.
[0072] Step S440: generating response data for the information display request based on the document data to be displayed;
[0073] Step S450, setting the data type in the response data to a designated format identifier corresponding to the designated document format;
[0074] Step S460: parsing the response data by the document display tool in the client, and displaying the document data to be displayed in the document display page according to the display control corresponding to the specified format identifier.
[0075] In this embodiment, after converting the document data in the target document into document data to be displayed that conforms to the specified document format, the server will further generate response data for the information display request based on the document data to be displayed. The information display request is a request triggered by the document display page in the client during the display process, and the response data is a request response provided to the client containing the document data to be displayed. The response data contains data format information of the document data to be displayed, which is usually contained in the response header. The server will set the data type in the response header to the specified format identifier corresponding to the specified document format. For example, for a portable text format, the corresponding specified format identifier can be set to application / pdf. The server will provide the response data to the client and parse the response data through the document display tool in the client. The client will display the document data to be displayed on the document display page according to the display control corresponding to the specified format identifier. Specifically, the client will first load the display control corresponding to the specified format identifier on the document display page, and then load the document data to be displayed in the response data into the display control, thereby displaying the content of the target document. In this embodiment, an information display request is triggered in the document display page of the client, and the server provides the document data to be displayed to the client through the response data of the information display request, so as to be displayed in the document display page of the client. The request triggering and document display are both completed directly in the document display page, so that there is no need to jump or switch windows when displaying the document data, which reduces the intermediate links in the document display process and is conducive to improving the convenience of the document display process.
[0076] In an embodiment of the present application, during the process of displaying document data, a document display tool corresponding to the target document is obtained. The document display tool is used to display document data that conforms to a specified document format, and converts the document data of the target document into document data to be displayed that conforms to the specified document format according to the target document format, and then displays the document data to be displayed through the document display tool. Through the above-mentioned method, the display system itself obtains the document display tool and provides it to the browser. The user does not need to install a plug-in separately in the browser, and the main operations on the document data are completed by the server, without occupying the processing resources of the user terminal, thereby increasing the convenience of the information display system, reducing the operating pressure of the user terminal, and improving the response speed of the client and the user's experience.
[0077] In an optional embodiment of the present application, based on the above-mentioned technical solution, during the process of parsing the response data by the document display tool in the client, if the document display tool detects that the document display page supports the display of the document data to be displayed, the server sets the display mode in the response data to the page display mode. According to the page display mode, the client will load the document data to be displayed in the client through the display control in the document display page of the document display tool. In this embodiment, the server will first detect whether the document display page supports the display of the document data to be displayed through the document display tool. If supported, the client directly loads the document data to be displayed through the display control in the document display page of the document display tool. By pre-detecting the supportability of the document display page, it is possible to avoid forced display resulting in errors when the browser does not support the display of the document data to be displayed, which is conducive to improving the stability of the solution.
[0078] In an optional embodiment of the present application, based on the above-mentioned technical solution, in the process of loading the document data to be displayed into the display control on the document display page through the document display tool according to the page display mode, the client will obtain the specified size information in the response data according to the page display mode, and then load the display control that meets the specified size information into the document display page of the client according to the specified size information, and then load the document data to be displayed into the display control. In this embodiment, the server will specify the size of the display control in the response data, and the client will load the display control into the document display page according to the specified size information in the response data, thereby allowing the display format of the document data to be displayed to be adjusted, which is conducive to improving the flexibility of the solution.
[0079] In an optional embodiment of the present application, based on the above-mentioned technical aspects, during the process of loading the document data to be displayed in the display control, the client retrieves the document page corresponding to the page number information in the document data to be displayed based on the page number information in the response data, and then loads the document data to be displayed in the display control and displays the document page in the display control. In this embodiment, the server can specify the page number to be displayed in the response data, and when displaying, the client will retrieve the corresponding document page based on the page number information in the response data, and then directly display the document page in the display control, thereby allowing the server to adjust the specific content of the display, which is conducive to directly displaying the key content in the target document without the user having to manually scroll to the page, thereby improving the efficiency of information display.
[0080] In an optional embodiment of the present application, based on the above-mentioned technical solution, in the process of parsing the response data through the document display tool in the client, if the document display page does not support the display of the document data to be displayed, the server sets the display mode in the response data to the page download mode. According to the page download mode, the client sends the document to be displayed containing the specified document format through the document display page, and the document to be displayed contains the document data to be displayed. In this embodiment, if the document display page does not support the display of the document data to be displayed, the client will directly download the document to be displayed in the specified document format through the document display page in the page download mode so that the user can browse it, thereby being able to adopt an alternative file download solution when the document display page is displayed. Compared with forcing the display to be displayed and reporting an error or prompting the user that the display cannot be displayed and the user needs to download it separately when the document display page does not support the display of the document data to be displayed, directly downloading the document to be displayed through the document display page can reduce the user's operation amount, thereby helping to improve the efficiency of information transmission and display, as well as improving user experience.
[0081] In the embodiments of the present application, it is also proposed to Figure 4 Other embodiments that refine the technical solution of the embodiment shown are as follows Figure 5 As shown, in an information display method according to an embodiment of the present application, the information display request is a request triggered by a document display page in a client during the display process. The information display method may include the following steps:
[0082] Step S510: Acquire a target document to be processed and a target document format of the target document.
[0083] Optionally, the implementation details of step S510 are the same as Figure 3 The step S310 shown in FIG is the same as that in FIG, and will not be repeated here.
[0084] Step S520 : In response to the information display request for the target document, a document display tool corresponding to the target document is sent to the client, where the document display tool is used to display document data that conforms to a specified document format.
[0085] Optionally, the implementation details of step S520 are the same as Figure 3 The step S320 shown in FIG is the same as that in FIG, and will not be repeated here.
[0086] Step S530 : According to the target document format, the document data in the target document is converted into document data to be displayed that complies with the specified document format.
[0087] Optionally, the implementation details of step S530 are the same as Figure 3The step S340 shown in FIG is consistent with the step S340 shown in FIG, and will not be repeated here.
[0088] Step S540: Generate response data for the information display request based on the document data to be displayed.
[0089] Optionally, the implementation details of step S540 are the same as Figure 4 The step S340 shown in FIG is consistent with the step S340 shown in FIG, and will not be repeated here.
[0090] Step S550: Set the data type in the response data to a designated format identifier corresponding to the designated document format.
[0091] Optionally, the implementation details of step S550 are the same as Figure 4 The step S450 shown in FIG is the same as that in FIG, and will not be repeated here.
[0092] After receiving the response data, the client determines whether the document display page supports displaying the document data to be displayed. If supported, step S560 is executed; otherwise, steps S570 to S590 are executed.
[0093] Step S560: parsing the response data by the document display tool in the client, and displaying the document data to be displayed in the document display page according to the display control corresponding to the specified format identifier.
[0094] Optionally, the implementation details of step S560 are the same as Figure 4 The step S460 shown in FIG is the same as that in FIG, and will not be repeated here.
[0095] Step S570: calling the document parsing tool through the document display tool;
[0096] Step S580: Loading the display control corresponding to the specified format identifier into the document display page through the document parsing tool;
[0097] Step S590: Load the document data to be displayed into the display control.
[0098] In an embodiment of the present application, if the document display page does not support the display of the document data to be displayed, the client will further call the document parsing tool through the document display tool to perform the display. Specifically, the document display tool itself does not add an additional plug-in to the client's browser, but instead uses the browser's own display function for files in a specified document format. If the document display page does not support the display of the document data to be displayed, it means that the client's server does not support previewing of this type of document, and the client will use the document parsing tool to add a preview function module to the browser. The document parsing tool's acquisition address will be specified in the calling instruction or code of the document display tool. The client will obtain the entity content of the document parsing tool from the server according to the acquisition address, and then the document display tool will provide the document data to be displayed to the document parsing tool. The document parsing tool will then load the display control corresponding to the specified format identifier into the document display page. It can be understood that the display control is a control directly added to the document display page by the document parsing tool. Subsequently, the document parsing tool loads the document data to be displayed into the display control to perform document display. In this embodiment, when the client browser does not support the preview function for the specified document format, the display control loaded in the document display page by the document parsing tool can improve the compatibility of the solution with various display environments and improve the environmental adaptability of the solution.
[0099] In an embodiment of the present application, during the process of displaying document data, a document display tool corresponding to the target document is obtained. The document display tool is used to display document data that conforms to a specified document format, and converts the document data of the target document into document data to be displayed that conforms to the specified document format according to the target document format, and then displays the document data to be displayed through the document display tool. Through the above-mentioned method, the display system itself obtains the document display tool and provides it to the browser. The user does not need to install a plug-in separately in the browser, and the main operations on the document data are completed by the server, without occupying the processing resources of the user terminal, thereby increasing the convenience of the information display system, reducing the operating pressure of the user terminal, and improving the response speed of the client and the user's experience.
[0100] In an optional embodiment of the present application, based on the above-mentioned technical solution, if the display control fails to be loaded in the client, alternative display information is obtained from the document display tool, and then the alternative display information is displayed in the document display page through the document display tool. Specifically, the document display tool will include preset alternative display information. The alternative display information can be a sentence or another page address, and usually includes prompt information that the document display failed. Usually, when the client fails to load the display module, the reason for the failure and the saved information will be displayed on the page. This information usually contains a certain degree of information that is not suitable for public disclosure. At the same time, such information requires specific support to understand. Letting the user directly see the error message will affect the user's browsing experience. If the client finds that the display module cannot be loaded in the document display page through the document parsing tool, the document display tool will display the alternative display information instead of the error message in the document display page as a result of the display process, thereby prompting the user that the document display failed. By displaying alternative display information on the document display page when loading the display control fails, it is possible to avoid direct errors on the page when the display fails, making the page display process more controllable. At the same time, it prevents users from being exposed to underlying error messages that are difficult to understand, which is beneficial to improving the user experience.
[0101] The following describes the overall process of displaying information in online documents in this application. Figure 6 , Figure 6 This is a schematic diagram of the overall process of displaying online document information in the embodiment of this application. Figure 6 In the illustrated process, when a browser initiates a document preview request, it passes in the document ID parameter: fileId=123. The server accepts the request, parses the request parameters to obtain the fileId, and queries the database using the fileId. If the document exists, the server obtains the document type (fileType) and the document's storage address (fileUrl). The file module (fs) reads the document data, obtaining the document binary data (docxData). If the document type is a DOCX document, transcoding is performed using a conversion function provided by a pre-defined conversion library to convert the document binary data (docxData) into PDF binary data. The server then uses the KOA framework's API to set the response data type to application / pdf. Specifically, the server sets the response header type to pdf format and the response header to inline mode. The server then returns the document binary data in the response body. The browser receives the response data and renders the document. If the document does not exist, the server displays a message indicating that the document does not exist. In this embodiment, the server has separate processing procedures for other document types, such as using separate conversion tools for transcoding. Therefore, if the document is not in the DOCX format, the process will proceed to the processing procedures for other documents.
[0102] It should be noted that although the steps of the method of the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0103] The following introduces the device implementation of the present application, which can be used to execute the information display method in the above embodiments of the present application. Figure 7 The block diagram of the information display device in the embodiment of the present application is schematically shown. Figure 7 As shown, the information display device 700 may mainly include:
[0104] A request acquisition module 710 is configured to acquire a target document to be processed and a target document format of the target document;
[0105] A tool acquisition module 720 is configured to send a document display tool corresponding to the target document to the client in response to an information display request for the target document, wherein the document display tool is used to display document data that conforms to a specified document format;
[0106] The data conversion module 730 is configured to convert the document data in the target document into document data to be displayed that conforms to the specified document format according to the target document format;
[0107] The data display module 740 is configured to display the document data to be displayed in the client through the document display tool.
[0108] In some embodiments of the present application, based on the above technical solution, the information display request is a request triggered by the document display page in the client during the display process; the data display module 740 is specifically configured to: generate response data for the information display request based on the document data to be displayed; set the data type in the response data to a specified format identifier corresponding to the specified document format; parse the response data through the document display tool in the client to display the document data to be displayed in the document display page according to the display control corresponding to the specified format identifier.
[0109] In some embodiments of the present application, based on the above technical solution, the data display module 740 is specifically configured as follows: if it is detected through the document display tool that the document display page supports the display of the document data to be displayed, the display mode in the response data is set to the page display mode; according to the page display mode, the document data to be displayed is loaded in the client through the display control in the document display page of the document display tool.
[0110] In some embodiments of the present application, based on the above technical solution, the data display module 740 is specifically configured to: obtain the specified size information in the response data according to the page display mode; load the display control that meets the specified size information in the document display page of the client according to the specified size information; and load the document data to be displayed in the display control.
[0111] In some embodiments of the present application, based on the above technical solution, the data display module 740 is specifically configured to: retrieve the document page corresponding to the page number information in the document data to be displayed according to the page number information in the response data; load the document data to be displayed in the display control and display the document page in the display control.
[0112] In some embodiments of the present application, based on the above technical solution, the data display module 740 is specifically configured as follows: if the document display page does not support the display of the document data to be displayed, the display mode in the response data is set to the page download mode; according to the page download mode, the document to be displayed containing the specified document format is sent through the document display page, and the document to be displayed contains the document data to be displayed.
[0113] In some embodiments of the present application, based on the above technical solution, the data display module 740 is also configured to: if the document display page does not support the display of the document data to be displayed, call the document parsing tool through the document display tool; load the display control corresponding to the specified format identifier in the document display page through the document parsing tool; and load the document data to be displayed in the display control.
[0114] In some embodiments of the present application, based on the above technical solution, the data display module 740 is further configured to: if loading the display control in the client fails, obtain alternative display information from the document display tool; and display the alternative display information in the document display page through the document display tool.
[0115] In some embodiments of the present application, based on the above technical solution, the data conversion module 730 is specifically configured as follows: if the target document format does not match the specified document format, then according to the target document format, a data conversion tool corresponding to the target document format and the specified document format is obtained; through the data conversion tool, the target document is converted into a specified document in the specified document format; and the document data in the specified document is obtained as the document data to be displayed.
[0116] In some embodiments of the present application, based on the above technical solution, the data conversion module 730 is specifically configured as follows: if the target document format does not match the specified document format, then according to the target document format, a data conversion tool corresponding to the target document format and the specified document format is obtained; through the data conversion tool, the document data of the target document is converted into document data to be displayed that conforms to the specified document format.
[0117] In some embodiments of the present application, based on the above technical solution, the request acquisition module 710 is specifically configured to: obtain the information display request triggered by the client, the information display request containing the document identifier of the target document; according to the document identifier, retrieve the document upload record corresponding to the document identifier, the document upload record containing the target document format and document storage address of the target document; according to the document storage address of the target document, obtain the target document.
[0118] It should be noted that the apparatus provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0119] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown.
[0120] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0121] like Figure 8As shown, computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage 808 into random access memory (RAM) 803. RAM 803 also stores various programs and data required for system operation. CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to bus 804.
[0122] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, and the like; an output section 807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. Removable media 811, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 810 as needed, so that computer programs read therefrom can be installed into the storage section 808 as needed.
[0123] In particular, according to an embodiment of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from a removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the various functions defined in the system of the present application are executed.
[0124] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0127] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0128] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.
[0129] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. An information display method, characterized in that: include: Acquire a target document to be processed and a target document format of the target document; In response to an information display request for the target document, sending a document display tool corresponding to the target document to the client, wherein the document display tool is used to display document data that conforms to a specified document format; According to the target document format, converting the document data in the target document into document data to be displayed that conforms to the specified document format; The document data to be displayed is displayed in the client through the document display tool.
2. The method according to claim 1, characterized in that The information display request is a request triggered by a document display page in a client during a display process; the displaying of the document data to be displayed by the document display tool in the client includes: generating response data for the information display request based on the document data to be displayed; Setting the data type in the response data to a specified format identifier corresponding to the specified document format; The response data is parsed by the document display tool in the client, so as to display the document data to be displayed in the document display page according to the display control corresponding to the specified format identifier.
3. The method according to claim 2, characterized in that The parsing of the response data by the document presentation tool in the client includes: If it is detected by the document display tool that the document display page supports displaying the document data to be displayed, the display mode in the response data is set to page display mode; According to the page display mode, the document data to be displayed is loaded in the client through the display control of the document display page by the document display tool.
4. The method according to claim 3, characterized in that The step of loading the document data to be displayed by the document display tool in a display control on the document display page according to the page display mode includes: According to the page display mode, obtaining the specified size information in the response data; According to the specified size information, loading a display control that conforms to the specified size information on the document display page of the client; The document data to be displayed is loaded into the display control.
5. The method according to claim 4, characterized in that The step of loading the document data to be displayed in the display control includes: According to the page number information in the response data, searching the document data to be displayed for the document page corresponding to the page number information; The document data to be displayed is loaded into the display control and the document page is displayed in the display control.
6. The method according to claim 2, characterized in that The parsing of the response data by the document presentation tool in the client includes: If the document display page does not support displaying the document data to be displayed, setting the display mode in the response data to page download mode; According to the page download mode, the document to be displayed in the specified document format is sent through the document display page, and the document to be displayed includes the document data to be displayed.
7. The method according to claim 2, characterized in that The method further comprises: If the document display page does not support displaying the document data to be displayed, calling a document parsing tool through the document display tool; Loading the display control corresponding to the specified format identifier in the document display page by the document parsing tool; The document data to be displayed is loaded into the display control.
8. The method according to claim 7, characterized in that The method further comprises: If loading of the presentation control in the client fails, obtaining alternative presentation information from the document presentation tool; The alternative display information is displayed on the document display page by the document display tool.
9. The method according to claim 1, characterized in that The step of converting the document data in the target document into document data to be displayed that conforms to the specified document format according to the target document format includes: If the target document format does not match the specified document format, obtaining a data conversion tool corresponding to the target document format and the specified document format according to the target document format; Converting the target document into a designated document in the designated document format using the data conversion tool; The document data in the specified document is obtained as the document data to be displayed.
10. The method according to claim 1, wherein The step of converting the document data in the target document into document data to be displayed that conforms to the specified document format according to the target document format includes: If the target document format does not match the specified document format, obtaining a data conversion tool corresponding to the target document format and the specified document format according to the target document format; The data conversion tool is used to convert the document data of the target document into document data to be displayed that complies with the specified document format.
11. The method according to any one of claims 1 to 10, characterized in that The step of obtaining a target document to be processed and a target document format of the target document includes: Obtaining an information display request triggered by the client, wherein the information display request includes a document identifier of the target document; According to the document identifier, a document upload record corresponding to the document identifier is retrieved, wherein the document upload record includes a target document format and a document storage address of the target document; The target document is acquired according to the document storage address of the target document.
12. An information display device, characterized in that: include: a request acquisition module configured to acquire a target document to be processed and a target document format of the target document; a tool acquisition module configured to send a document display tool corresponding to the target document to the client in response to an information display request for the target document, wherein the document display tool is used to display document data that conforms to a specified document format; a data conversion module configured to convert the document data in the target document into document data to be displayed that complies with the specified document format according to the target document format; The data display module is configured to display the document data to be displayed in the client through the document display tool.
13. An electronic device, characterized in that: include: processor; a memory for storing executable instructions of the processor; The processor is configured to execute the information display method according to any one of claims 1 to 11 by executing the executable instructions.
14. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the information display method according to any one of claims 1 to 11 is implemented.
15. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The processor of the electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the information presentation method according to any one of claims 1 to 11.