CN-116501702-B - Online reading method and device for OFD (optical fiber digital) file
Abstract
The application discloses an online reading method and device for an OFD file. The method comprises the steps of obtaining an OFD file index, wherein the OFD file index comprises size and document number information of each page in the OFD file, a first type of link aiming at a public file in the OFD file and a second type of download link corresponding to a page file of each page respectively, rendering a virtual page based on the page number information and the size information of each page in the OFD file, downloading the public file, downloading the page file of each page later, obtaining the page number of a virtual page currently displayed by a user as a target page number, immediately downloading the page file corresponding to the target page number through the corresponding second type of download link if the page file corresponding to the target page number does not exist locally at a user side, and filling the virtual page based on the page file corresponding to the target page number and the public file. And then the files necessary for display are downloaded preferentially, and the files corresponding to the target page numbers are corresponding preferentially according to the requirement, so that the quick high-definition display of the user reading interface is realized.
Inventors
- ZHANG MINGHU
Assignees
- 北京天威诚信电子商务服务有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230428
Claims (8)
- 1. The online OFD file reading method is characterized by being applied to a user side and comprising the following steps of: the method comprises the steps of obtaining an OFD file index provided by a remote server, wherein the OFD file index is generated by the remote server based on an OFD file, and comprises size and document number information of each page in the OFD file, a first type of link aiming at a public file in the OFD file and a second type of download link respectively corresponding to page files of each page; based on page number information and size information of each page in the OFD file, pre-rendering a virtual page consistent with the layout of a real page in a front-end page, wherein the virtual page is a space-occupying frame without actual page content; downloading the public file based on the first type of links, and then downloading the page file of each page in turn based on the second type of download links; If the user terminal does not have the page file corresponding to the target page number locally, immediately interrupting or suspending the currently-ongoing downloading task, and immediately downloading the page file corresponding to the target page number through a corresponding second-type downloading link; filling page contents into the space occupying frames corresponding to the virtual pages based on the page files corresponding to the target page numbers and the public files so as to complete visual display of the pages; the first type of links comprise download links of a main entry file of the OFD, download links of a document root node description file, download links of a common resource index file, download links of a document resource index file and download links of a resource file; the page files comprise page resource files and page document description files.
- 2. The OFD file online reading method according to claim 1, further comprising: Estimating the page number of the virtual page to be displayed as a preferred page number; when the downloading of the page file corresponding to the target page number is not performed, the page file corresponding to the preferred page number is preferentially downloaded.
- 3. The OFD file online reading method according to claim 1, wherein predicting the page number of the virtual page to be displayed as the preferred page number comprises: the n pages after the target page are determined to be the preferred page, or, The first m page numbers of the respective documents in the OFD file are determined to be the preferred page numbers, or, Determining the first k page numbers of each chapter of the document where the target page number is located as preferred page numbers; wherein n is a positive integer, m is a positive integer, and k is a positive integer.
- 4. An OFD file online reading device, which is characterized in that the device is applied to a user terminal and comprises: The system comprises a remote server, a first acquisition module, a second acquisition module and a first storage module, wherein the remote server is used for providing an OFD file index provided by the remote server, the OFD file index is generated by the remote server based on the OFD file, and the OFD file index comprises the size and document number information of each page in the OFD file, a first type of links aiming at public files in the OFD file and a second type of download links respectively corresponding to page files of each page; The rendering module is used for pre-rendering a virtual page consistent with the layout of the real page in the front-end page based on the page number information and the size information of each page in the OFD file, wherein the virtual page is a space frame without actual page content; The downloading module is used for downloading the public files based on the first type of links and then downloading the page files of each page in turn based on the second type of download links; if the user terminal does not have the page file corresponding to the target page number locally, immediately interrupting or suspending the currently-ongoing downloading task, and immediately downloading the page file corresponding to the target page number through a corresponding second-type downloading link; The filling module is used for filling page contents into the space occupying frames corresponding to the virtual pages based on the page files corresponding to the target page numbers and the public files so as to complete visual display of the pages; the first type of links comprise download links of a main entry file of the OFD, download links of a document root node description file, download links of a common resource index file, download links of a document resource index file and download links of a resource file; the page files comprise page resource files and page document description files.
- 5. The online OFD file reading method is characterized by being applied to a remote server and comprising the following steps of: acquiring an OFD file after decompression; Generating an OFD file index based on the decompressed OFD file, wherein the OFD file index comprises the size and document number information of each page in the OFD file, a first type of link aiming at a public file in the OFD file and a second type of download link respectively corresponding to the page file of each page; The OFD file index is sent to a user; The method comprises the steps of storing the size and document number information of each page in an OFD file, wherein the size and document number information of each page in the OFD file are used for assisting a user side in rendering a virtual page on a front-end page, a first type of links are used for assisting the user side in downloading a public file, a second type of download links are used for assisting the user side in preferentially downloading a page file corresponding to the page which is being displayed by the virtual page, and the user side fills the virtual page based on the page file and the public file; Wherein the remote server communicates and interacts with a user end executing the OFD file online reading method of any one of claims 1 to 3.
- 6. The OFD file online reading method according to claim 5, further comprising, before sending the OFD file index to the user terminal: And encrypting the OFD file index.
- 7. The OFD file online reading method according to claim 5, wherein obtaining the decompressed OFD file comprises: and obtaining an original OFD file, decompressing the original OFD file, and obtaining the decompressed OFD file.
- 8. An OFD file online reading device, which is characterized in that the device is applied to a remote server, and comprises: The second acquisition module is used for acquiring the decompressed OFD file; The generation module is used for generating an OFD file index based on the decompressed OFD file, wherein the OFD file index comprises the size and document number information of each page in the OFD file, a first type of link aiming at a public file in the OFD file and a second type of download link respectively corresponding to the page file of each page; The sending module is used for sending the OFD file index to the user terminal; the method comprises the steps of storing the size and document number information of each page in an OFD file, wherein the size and document number information of each page in the OFD file are used for assisting a user side in rendering a virtual page on a front-end page, a first type of link aiming at a public file in the OFD file is used for assisting the user side in downloading the public file, a download link corresponding to the page file of each page is used for assisting the user side in preferentially downloading a page file corresponding to the page which is being displayed by the virtual page, and the user side is used for filling the virtual page based on the page file and the public file; Wherein the remote server communicates and interacts with a user end executing the OFD file online reading method of any one of claims 1 to 3.
Description
Online reading method and device for OFD (optical fiber digital) file Technical Field The application relates to the technical field of document display, in particular to an online reading method and device for an OFD file. Background An OFD (Open Fixed-layout Document) Document is an Open electronic Document format. The format is fixed without running, and the storage, reading and editing of the electronic document can be conveniently carried out. Some electronic contracts and electronic files, etc. are typically stored in the remote server in the form of OFD files. When the user side uses the contracts or files, the stored OFD files can be read on line by remotely accessing a remote server. However, in the existing online reading mode, the reading time is long, and the content of the OFD file cannot be displayed quickly and high-definition. Disclosure of Invention The application aims to provide an online reading method and device for an OFD file, which are used for solving the problem that the content of the OFD file cannot be displayed quickly and high-definition in an online reading mode for a long time. The application aims at realizing the following technical scheme: Based on the first aspect of the application, an online reading method of an OFD file is provided, which is applied to a user terminal and comprises the following steps: the method comprises the steps of obtaining an OFD file index provided by a remote server, wherein the OFD file index is generated by the remote server based on an OFD file, and comprises size and document number information of each page in the OFD file, a first type of link aiming at a public file in the OFD file and a second type of download link respectively corresponding to page files of each page; rendering a virtual page on a front page based on page number information and size information of each page in the OFD file; Downloading the public file based on the first type of links, and then downloading the page file of each page based on the second type of download links; If the user terminal does not locally have the page file corresponding to the target page number, immediately downloading the page file corresponding to the target page number through a corresponding second type download link; And filling the virtual page based on the page file corresponding to the target page number and the public file. In some embodiments, the first type of links includes download links for the main entry file of the OFD, download links for the document root node description file, download links for the common resource index file, download links for the document resource index file, and download links for the resource file. In some embodiments, the page files include a page resource file and a page document description file. In some embodiments, further comprising: Estimating the page number of the virtual page to be displayed as a preferred page number; when the downloading of the page file corresponding to the target page number is not performed, the page file corresponding to the preferred page number is preferentially downloaded. In some embodiments, predicting the page number of the virtual page to be displayed as the preferred page number includes: the n pages after the target page are determined to be the preferred page, or, The first m page numbers of the respective documents in the OFD file are determined to be the preferred page numbers, or, Determining the first k page numbers of each chapter of the document where the target page number is located as preferred page numbers; wherein n is a positive integer, m is a positive integer, and k is a positive integer. Based on a second aspect of the present application, there is provided an OFD file online reading device, applied to a user terminal, including: The system comprises a remote server, a first acquisition module, a second acquisition module and a first storage module, wherein the remote server is used for providing an OFD file index provided by the remote server, the OFD file index is generated by the remote server based on the OFD file, and the OFD file index comprises the size and document number information of each page in the OFD file, a first type of links aiming at public files in the OFD file and a second type of download links respectively corresponding to page files of each page; The rendering module is used for rendering a virtual page on the front page based on the page number information and the size information of each page in the OFD file; The downloading module is used for downloading the public files based on the first type of links and then downloading the page files of each page based on the second type of download links, acquiring the page number of the virtual page currently displayed by the user as a target page number, and immediately downloading the page files corresponding to the target page number through the corresponding second type of download links if the page files corresponding to the t