Document preview method and device, computer equipment and storage medium

By dynamically loading page rendering configurations and separating rendering logic from data processing logic, combined with layered rendering and page-by-page loading strategies, the problem of flexible adaptation of PDF file preview systems in financial and insurance businesses has been solved. This has enabled efficient and stable document preview under diverse input methods, thus improving the user experience.

CN121144263APending Publication Date: 2025-12-16CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511202749.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

In the financial and insurance business, existing PDF file preview systems are difficult to adapt flexibly to diverse input methods, resulting in complex system integration and high development costs. When processing PDF files, existing solutions rely too much on a single input method, making it difficult to achieve efficient and stable document preview in older browsers, especially performing poorly on low-performance devices.

Method used

By dynamically loading page rendering configurations, separating rendering logic from data processing logic, identifying the rendering logic of PDF files, identifying resource packages that match the rendering logic and data processing logic, combining layered rendering and page-by-page loading strategies, adapting to resolution based on device browser version, and adjusting caching strategies in real time, stable output is achieved.

Benefits of technology

It improves the flexibility and stability of document preview, adapts to rendering performance on various devices and in complex network environments, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144263A_ABST
    Figure CN121144263A_ABST
Patent Text Reader

Abstract

The invention discloses a document previewing method and device, computer equipment and a storage medium, belongs to the technical field of research and development management, and is applied to document previewing of a financial insurance service system. The method comprises the following steps: firstly, dynamically loading page rendering configuration from a document pre-compiling library based on the type and version number of a client previewing device, so as to effectively avoid rendering failure or performance reduction caused by compatibility difference of the device; and secondly, the system can flexibly identify the data source type of the file and unify the format to carry out standardized analysis to generate a document object. And then, the rendering logic and the data processing logic of the document object are separated, and a proper resource bundle is matched, so that the content of the complex document is finely controlled. Layered rendering and page-by-page loading strategies are combined, and meanwhile, a resolution adaptation strategy is dynamically adjusted according to the version of a device browser. Finally, the system intelligently adjusts a cache mechanism by extracting display parameters in real time and analyzing network conditions, and a stable, smooth and low-delay document preview effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of R & D management, and specifically relates to a document preview method, device, computer device, and storage medium. Background Art

[0002] In financial insurance business, document processing is a core link, directly affecting business efficiency and user experience. As an important way of information interaction, PDF file preview is widely used in scenarios such as contract display and claim settlement review. Its performance and compatibility are crucial for system stability. However, existing solutions have significant defects in practical applications. Many systems rely too much on a single input method when processing PDF files and are difficult to flexibly adapt to the diverse requirements of local upload and interface acquisition, resulting in complex system docking and high development costs. In addition, the loading speed of existing solutions in old browsers is slow, and the font resource package is bloated, further exacerbating the performance bottleneck, especially on low-performance devices. These limitations make it difficult for business systems to achieve efficient and stable document preview in multi-scenario applications.

[0003] In this context, the core challenge is how to balance flexible data input processing and efficient file output rendering. The diversity of data input methods requires the system to be able to dynamically select processing technologies according to the source. For example, local upload relies on client parsing, while interface acquisition requires an efficient network transmission and parsing mechanism. However, the differences in input methods directly affect the judgment and conversion efficiency of data types. If not properly processed, it will lead to file parsing failure or delay. For example, in the insurance claim settlement scenario, the PDF contracts uploaded by users may not be able to be quickly previewed due to inconsistent formats, affecting the review progress. More complexly, PDF rendering depends on third-party libraries, whose code is often not optimized for the financial insurance scenario, and the font resource package is too large, increasing the loading burden of old browsers. This makes it difficult for the system to achieve the streamlining and rapid loading of dependent packages while maintaining modular design and performance optimization.

[0004] Therefore, how to streamline the font resource package to adapt to old browsers on the basis of supporting diverse input methods and efficient data processing has become the key issue in current research. Summary of the Invention

[0005] The purpose of the embodiments of this application is to propose a document preview method, device, computer device, and storage medium to solve the problem of streamlining the font resource package to adapt to old browsers on the basis of achieving diverse input methods and efficient data processing during document preview.

[0006] To solve the above technical problems, the embodiments of this application provide a document preview method, which adopts the following technical solutions:

[0007] A document preview method includes:

[0008] Determine the preview device and dynamically load the page rendering configuration from the preset document pre-compilation library based on the preview device's version number;

[0009] Obtain the file data stream, parse the file data stream using preset parsing rules, and obtain the document object;

[0010] Separate the rendering logic and data processing logic from the document object, and obtain the resource package that matches the rendering logic and data processing logic;

[0011] Based on the page rendering configuration and resource package, the document content is loaded page by page in the preview device through layered rendering to obtain a preliminary rendered document preview view;

[0012] Identify the browser version of the preview device, and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view;

[0013] The display parameters are extracted from the final optimized document preview view, and the view caching strategy is adjusted based on the display parameters and network transmission data to obtain a stable output document preview result.

[0014] To address the aforementioned technical problems, this application also provides a document preview device, which employs the following technical solution:

[0015] A document preview device, comprising:

[0016] The rendering configuration module is used to determine the preview device and dynamically load the page rendering configuration from the preset document pre-compilation library according to the preview device's version number;

[0017] The data stream parsing module is used to acquire file data streams, parse the file data streams using preset parsing rules, and obtain document objects;

[0018] The resource package acquisition module is used to separate the rendering logic and data processing logic from the document object and acquire the resource package that matches the rendering logic and data processing logic.

[0019] The initial rendering module is used to load the document content page by page in the preview device through layered rendering based on the page rendering configuration and resource package to obtain the initial rendered document preview view;

[0020] The browser adaptation module is used to identify the browser version of the preview device and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view.

[0021] The view caching module is used to extract display parameters from the final optimized document preview view, adjust the view caching strategy based on the display parameters and network transmission data, and obtain a stable output document preview result.

[0022] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:

[0023] A computer device includes a memory and a processor, the memory storing computer-readable instructions, the processor executing the computer-readable instructions to implement the steps of the document preview method as described in any of the preceding claims.

[0024] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:

[0025] A computer-readable storage medium storing computer-readable instructions that, when executed by a processor, implement the steps of the document preview method as described in any one of the preceding descriptions.

[0026] Compared with the prior art, the embodiments of this application have the following main advantages:

[0027] This application discloses a document preview method, apparatus, computer device, and storage medium, belonging to the field of R&D management technology, and applied to document preview in financial and insurance business systems. First, based on the type and version number of the client preview device, the most suitable page rendering configuration is dynamically loaded from a pre-compiled document library, effectively avoiding rendering failures or performance degradation caused by device compatibility differences. Second, the system can flexibly identify the data source type of the file and perform standardized parsing using a unified format, thereby generating stable and clearly structured document objects. Next, by separating the rendering logic of the document object from the data processing logic and matching appropriate resource packages, fine-grained control over complex document content is achieved. Combining layered rendering and page-by-page loading strategies ensures efficient content loading and gradual presentation, while dynamically adjusting the resolution adaptation strategy according to the device's browser version. Finally, the system intelligently adjusts the caching mechanism by extracting display parameters and analyzing network conditions in real time, achieving a stable, smooth, and low-latency document preview effect. This application significantly improves the rendering performance and user experience of documents on various devices and in complex network environments by constructing a highly modular and dynamically adaptable document preview system. Attached Figure Description

[0028] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 An exemplary system architecture diagram is shown, in which this application can be applied;

[0030] Figure 2 A flowchart of one embodiment of the document preview method according to this application is shown;

[0031] Figure 3 It shows Figure 2 A flowchart of one embodiment of step S201;

[0032] Figure 4 A schematic diagram of the structure of one embodiment of the document preview device according to this application is shown;

[0033] Figure 5 It shows Figure 4 A schematic diagram of the structure of an embodiment of the rendering configuration module 401;

[0034] Figure 6 A schematic diagram of the structure of one embodiment of a computer device according to this application is shown. Detailed Implementation

[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0036] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0037] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0038] like Figure 1 As shown, system architecture 100 may include terminal device 101, network 102, and server 103. Terminal device 101 may be a laptop 1011, tablet 1012, or mobile phone 1013. Network 102 is used as a medium to provide a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables.

[0039] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send messages, etc. Various communication client applications can be installed on terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0040] Terminal device 101 can be various electronic devices with a display screen and support web browsing. In addition to laptops 1011, tablets 1012, or mobile phones 1013, terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, and a desktop computer, etc.

[0041] Server 103 can be a server that provides various services, such as a backend server that provides support for the pages displayed on terminal device 101.

[0042] It should be noted that the document preview method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the document preview device is generally set in the server / terminal device.

[0043] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative; the system can have any number of terminal devices, networks, and servers depending on implementation needs.

[0044] Continue to refer to Figure 2 A flowchart of an embodiment of a document preview method according to this application is shown. The document preview method includes the following steps:

[0045] S201, determine the preview device, and dynamically load the page rendering configuration from the preset document pre-compilation library according to the preview device's version number;

[0046] Preferably, the document preview method of this application is applied to the preview of PDF documents. Specifically, the identification of the preview device is usually achieved by parsing the browser's User-Agent string, and classifying it in combination with device information (such as operating system type, CPU architecture, memory capacity, browser manufacturer and version, etc.) to determine the appropriate PDF rendering strategy based on its hardware and software environment. To improve compatibility and performance, this method pre-builds multiple document pre-compiled rendering configuration versions (including different rendering engines, font processing methods, calling strategies, etc.) to support environments where mainstream and older devices coexist. In this step, the adapted document pre-compiled build package and configuration script are dynamically loaded through the JS runtime environment, instead of statically binding resources, avoiding loading unnecessary code modules on low-performance devices. Technically, Webpack can be used to build multiple version packages, utilizing lazy loading and browser feature judgment to select and load the most suitable combination of modules.

[0047] Simultaneously, this step can integrate runtime performance monitoring logic (such as frame rate and memory usage) for secondary verification, improving loading accuracy. This allows for better customizability of the rendering configuration, meeting the needs of a variety of devices, from low-end mobile devices to high-performance PCs.

[0048] S202, Obtain the file data stream, parse the file data stream using preset parsing rules, and obtain the document object;

[0049] Specifically, PDF file data streams can be acquired in various ways depending on the actual business environment, such as local upload, Base64 string returned by a backend interface, Blob object or Air Buffer type, or directly loaded via URL. Regardless of the source, the core task is to uniformly parse these formatted data into document objects that can be recognized by standard PDF.js. In this process, the data type must first be determined and necessary conversions performed.

[0050] For example, Base64 encoded data needs to be decoded into Uint8Ar ray first, and Blob type data can be converted to Ar rayBuffer. Parsing rules refer to the standardization processing of input data by the core parsing module in the document pre-compilation library, which identifies information such as object structure, cross-reference tables (xref), font embeddings, and image resources in the PDF.

[0051] This process relies on a document retrieval API in a document pre-compilation library, which accepts document loading parameters and returns a proxy object containing the PDF structure. Furthermore, asynchronous loading and error handling mechanisms must be considered to ensure graceful degradation or retrying even if data parsing is interrupted due to network jitter or data errors. Pre-defined parsing rules can define data validation logic and abnormal format tolerance mechanisms for business scenarios (such as insurance contracts and claims documents) to enhance system stability.

[0052] S203, Separate the rendering logic and data processing logic from the document object, and obtain the resource package that matches the rendering logic and data processing logic;

[0053] Specifically, the document pre-compilation and rendering process involves two main logic components: first, page rendering logic, responsible for visualizing the PDF page using technologies such as Canvas or SVG; and second, data processing logic, handling information such as text, images, annotations, links, and encryption permissions. Separating these two logic components in this step helps to load functional modules on demand on resource-constrained devices, improving efficiency. For example, if only a pure browsing function of the PDF page is required, the loading of annotation, highlighting, and editing modules can be skipped. Technically, modular building tools can be used during the development phase to divide the document pre-compilation source code into functional module packages, such as font processing packages, image decoding packages, and annotation parsers.

[0054] At runtime, the system dynamically selects which resource packages to load based on the complexity of the parsed PDF document object (e.g., whether it contains an encryption layer, embedded complex fonts, or multimedia objects). This design can also be combined with service worker threads to cache resource packages, improving loading efficiency for repeated accesses. Furthermore, this step can integrate policy judgment logic, such as network status detection, to determine whether to enable resource degradation mode, further ensuring a better mobile user experience.

[0055] S204, Based on the page rendering configuration and resource package, the document content is loaded page by page in the preview device through layered rendering to obtain a preliminary rendered document preview view;

[0056] Specifically, layered rendering is a rendering strategy that separates PDF page content according to structural features (such as background layers, text layers, image layers, annotation layers, etc.), which helps improve rendering efficiency and supports a more refined interactive experience.

[0057] In this step, the system renders each page of the PDF document on demand, based on the previously dynamically loaded page rendering configuration and functional resource package. Typically, the content of each page is first obtained using a PDF page proxy object and drawn onto a Canvas. The Canvas serves as the underlying rendering container for background and image rendering, while SVG or DOM text layers are overlaid with transparent layers to support text copying, searching, and highlighting. To reduce the initial rendering load, a lazy loading and pagination preloading strategy is employed, rendering only the currently visible area and adjacent pages. Technically, the lazy loading mechanism can be implemented using scroll event listeners.

[0058] Furthermore, for high-resolution pages, a tile rendering strategy can be introduced, dividing a single page into several blocks for on-demand rendering to improve the response speed of large files. Task scheduling throughout the process also needs to consider asynchronous rendering queues and GPU acceleration strategies to ensure stable animation frame rates and enhance the user's visual experience.

[0059] S205, identify the browser version of the preview device, and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view;

[0060] Specifically, browsers support graphics interfaces such as Canvas, SVG, and WebGL to varying degrees across different versions, with compatibility issues particularly prevalent in older browsers. Therefore, this step requires obtaining browser version information through browser identifier resolution or feature detection technology to determine whether a downgrade in preview resolution is necessary.

[0061] For example, in environments that do not support APIs such as canvas transformation or off-screen rendering in the background, high-resolution resources should be avoided to prevent memory overflow or stuttering. Resolution adaptation also needs to take into account the device's physical pixel ratio and screen size, automatically adjusting the Canvas size and rendering ratio to ensure clear display on both high-definition and standard screens.

[0062] Furthermore, to further improve performance, this step can be combined with pre-compiled graphics computing modules to reduce the load on the main thread, while enabling hardware acceleration paths within the browser's support range. For older versions of Internet Explorer or specific kernels, it may be necessary to downgrade to pure image rendering mode, or even pre-generate images on the server side for compatibility display. The key to this step is to automatically adapt the preview rendering quality and performance balance according to the specific browser environment.

[0063] S206: Extract display parameters from the final optimized document preview view, adjust the view caching strategy based on the display parameters and network transmission data, and obtain a stable output document preview result.

[0064] Specifically, the display parameters mainly include page width and height, zoom level, font loading status, current page number, and scroll position, which are used to assess the user's current usage of the PDF document. The system can extract these parameters by listening to DOM events and Canvas drawing completion events during the rendering process, and adjust the rendering and caching strategies in conjunction with network conditions (such as whether it is in a weak network environment).

[0065] For example, if a user is found to have viewed the same few pages multiple times, the rendering results of the corresponding pages (such as Canvas snapshots or PDF page objects) can be cached to avoid repeated loading. If network latency is high, text layers are rendered first, and image and font resources are loaded with deferred loading to ensure that basic content is visible. This process can also utilize request queues and concurrency control algorithms to control the download order of resources based on the priority of "hot zones" in the view, thereby improving the speed of interactive response.

[0066] Furthermore, the system can combine session storage records to track user browsing status, enabling rapid scenario recovery. By extracting and analyzing display parameters from multiple dimensions, it can dynamically adjust view caching and update strategies, achieving a highly stable PDF preview effect.

[0067] Further, please refer to Figure 3 The steps include determining the preview device and dynamically loading the page rendering configuration from the preset document pre-compiled library based on the preview device's version number.

[0068] S301: Obtain the document preview request initiated by the client, and determine the device type and version number by parsing the device identifier field in the request header;

[0069] S302, based on the device type and version number, query the version matching rules in the pre-compiled document library to obtain the corresponding library file index;

[0070] S303, find the appropriate page rendering parameters based on the library file index;

[0071] S304 uses a dynamic loading mechanism to inject page rendering parameters into a preset document rendering engine, completes the rendering configuration, and obtains the page rendering configuration.

[0072] In this embodiment, when the client initiates a document preview request, the system first extracts device-related information, including operating system type, device model, browser type and version number, through the User-Agent field in the HTTP request header or the custom X-Device-Info field. Step S301 uses these fields to accurately determine the performance level and compatibility characteristics of the terminal device. In step S302, the system matches the extracted device parameters with a locally maintained document pre-compiled library version mapping table. This mapping table contains the correspondence between different device conditions and pre-compiled document build versions; for example, lower-version Android devices are adapted to a simplified build with a Canvas backend, while high-performance desktop devices are adapted to build versions with SVG and WebGL optimization modules. After finding the appropriate version index, step S303 reads the corresponding version's page rendering parameters from the configuration center, such as the maximum number of preloaded pages, default scaling ratio, and font caching strategy. In step S304, a dynamic module loading mechanism is used to bind the corresponding parameters to the document's core rendering engine, achieving runtime configuration injection. This mechanism dynamically adjusts rendering behavior by setting configuration entry points in the document pre-compiled library, thereby ensuring a stable and optimized rendering experience for PDFs on various devices.

[0073] Through the above steps, this solution can dynamically adapt document rendering behavior according to differences in terminal devices, ensuring a balance in compatibility, performance, and loading speed.

[0074] Furthermore, through a dynamic loading mechanism, page rendering parameters are injected into a preset document rendering engine to complete the rendering configuration and obtain the page rendering configuration. The specific steps include:

[0075] By using dynamic link library loading technology, page rendering parameters are bound to the core functions of the document rendering engine;

[0076] Based on the injected page rendering parameters, the page rendering configuration is automatically adjusted, including page layout, font size, and rendering precision.

[0077] After the page rendering parameters are injected, the system returns a message indicating that the page rendering configuration was successful, and the page rendering configuration is obtained.

[0078] In this embodiment, the system employs dynamic link library loading technology, decoupling and binding page rendering parameters with the core functional modules of the document rendering engine through runtime module registration and dependency resolution. Specifically, during the preset rendering process initialization phase, the system dynamically injects the parsed page rendering parameters (such as page scaling level, font rendering strategy, pagination logic, Canvas resolution, image anti-aliasing level, etc.) into the core object of the document rendering engine as input. This injection process is implemented through factory functions or strategy patterns to ensure that appropriate rendering strategies are automatically applied to different devices or browser environments. After parameter injection, the system triggers an internal state refresh mechanism to regenerate the rendering engine context environment based on the input parameters, automatically configuring the page layout (such as single-page mode, continuous scrolling, double-page spread), font size (dynamically adjusted according to DPI and screen density), and rendering precision (such as using the scale parameter to control the Canvas scaling ratio). After the injection process is complete, the system returns a rendering configuration success flag to the business layer to trigger the document loading and preview display process, thereby completing the initialization of the entire page rendering configuration.

[0079] Through the above steps, the runtime parameter injection and dynamic configuration generation mechanism of the PDF.js rendering engine were implemented, improving adaptability and rendering flexibility.

[0080] Furthermore, the steps of separating the rendering logic and data processing logic from the document object and obtaining the resource package that matches the rendering logic and data processing logic specifically include:

[0081] The document object is modularized and divided into rendering logic responsible for page rendering and data processing logic responsible for data processing;

[0082] Based on the requirements of the rendering logic, a matching rendering resource package is retrieved from the preset resource package library. The rendering resource package contains fonts, colors, images and videos required for page rendering.

[0083] Based on the requirements of the data processing logic, retrieve matching data processing resource packages from the preset resource package library;

[0084] The rendering resource package and the data processing resource package are packaged and integrated to form a resource package that perfectly matches the document object.

[0085] In this embodiment, to improve the loading efficiency and rendering performance of PDF documents, the system first performs modular parsing on the loaded PDF document object. This document object is typically generated by a document parser and contains complete structural information and a resource reference table. The parsing process divides the document logic into two main parts: one is the rendering logic module, which is mainly responsible for the visual presentation of page elements, such as text layout, image drawing, layer management, and color conversion; the other is the data processing logic module, which covers background operations such as metadata parsing, interactive behavior processing (such as form filling and annotation interaction), encryption verification, and compression format recognition. The system identifies the resource types and dependency paths required by each logical block through Abstract Syntax Tree (AST) analysis and functional dependency graph construction.

[0086] Subsequently, for the rendering logic module, the system accesses local or remote resource package libraries and dynamically retrieves matching rendering resource packages based on the rendering strategy. These resource packages may contain font subsets for specific language environments, color profiles (such as sRGB and CMYK), high-resolution image templates, and even embedded video plugins to meet the visualization needs of complex PDF documents. Simultaneously, the system also searches for matching resource packages for the data processing logic module, such as encryption algorithm libraries, decompression modules, and structured metadata parsing components, ensuring complete support for the document's functionality.

[0087] After resource matching is complete, the system uses a packaging and integration mechanism to merge the two resource packages, forming a unified resource package that is highly adapted to the current PDF document structure and content. This integration process, based on dependency merging strategies and redundant resource removal algorithms, not only improves resource loading efficiency but also significantly reduces package size. Finally, this resource package, along with the document object, is processed by the rendering engine to ensure stable rendering and interactivity for different types of PDF documents with minimal resource overhead.

[0088] Through the above steps, the system achieves precise matching and dynamic loading of resources and logic, improving PDF document rendering efficiency and system resource utilization.

[0089] Furthermore, based on the page rendering configuration and resource package, the document content is loaded page by page in the preview device through layered rendering to obtain a preliminary rendered document preview view. This process specifically includes:

[0090] Initialize the rendering engine based on the page layout, font size, and rendering precision in the page rendering configuration;

[0091] A layered rendering strategy is adopted to divide the content of the document object into several layers, including text layers, image layers, and video layers.

[0092] The corresponding rendering resources are loaded from the resource package in the following order: font files, color configurations, image assets, and video streams.

[0093] The rendering engine synthesizes the loaded rendering resources according to the page layout and rendering precision to generate the initial rendering result of each page of the document.

[0094] The initial rendering results are loaded page by page into the preview device to form a preliminary rendering preview view of the document.

[0095] In this embodiment, after receiving the page rendering configuration and matching resource package, the system first initializes the PDF.js rendering engine according to the configuration parameters, setting the page layout mode (e.g., single-page, scrolling, double-page), font size (based on device DPI and screen scaling factor), and rendering precision (e.g., Canvas rendering magnification, pixel density adjustment, etc.). After initialization, the system adopts a layered rendering strategy, decomposing the PDF document object into multiple independent logical layers, including a text layer (for text content display and search), an image layer (for drawing embedded images and graphics), a video layer (supporting embedded media playback or dynamic animation content), and optional annotation and interactive layers. Each layer loads the required resources from the resource package sequentially according to its specific rendering needs: first, the font file is loaded for text layout and fallback matching; then, the color configuration file is loaded to ensure color consistency between images and graphics; and finally, image materials and media stream data are loaded.

[0096] During resource loading, the system utilizes asynchronous loading and concurrent scheduling mechanisms, combined with a lazy loading strategy (loading only the current page and a few pages expected to be viewed), to reduce memory usage and initial rendering latency. After loading resources at each level, the rendering engine performs layer compositing according to configuration, controlling the layer stacking order and transparency to accurately reproduce the design intent of the PDF document. The initial rendering result of each page is stored in a cache pool and rendered to the screen through the browser's Canvas or SVG container, achieving synchronous page loading and rendering effects, adapting to various operating environments, including mobile devices and low-performance devices.

[0097] Through the above steps, a high-performance layered rendering mechanism is achieved, which enables a good balance between PDF content loading efficiency and visual quality, thereby improving the overall user preview experience.

[0098] Furthermore, the steps of extracting display parameters from the final optimized document preview view, adjusting the view caching strategy based on the display parameters and network transmission data, and obtaining a stable output document preview result specifically include:

[0099] A comprehensive analysis was conducted on the final optimized document preview view to extract key display parameters, including page size, resolution, and loading time.

[0100] Assess the current network transmission status;

[0101] Calculate data transmission time based on key display parameters and network transmission status;

[0102] Select an appropriate view caching strategy based on the data transmission time and the preset transmission time threshold;

[0103] Based on an adaptive view caching strategy, the initially rendered document preview view is cached on the preview device, and a stable output document preview result is generated.

[0104] In this embodiment, after completing the initial rendering of the PDF document and generating an optimized preview view, the system performs a comprehensive analysis of the current view, extracting a set of key display parameters to evaluate the overall rendering status and performance. These parameters include, but are not limited to, page size (width and height, scaling ratio), rendering resolution (DP I or pixel density), average loading time (time from request to rendering completion), and frame rate stability. Subsequently, the system monitors the transmission status of the current network environment in real time, and by listening to XHR or Fetch events in conjunction with the Performance API, it statistically analyzes current network bandwidth, latency, packet loss rate, and other indicators.

[0105] Next, based on the aforementioned display parameters and network conditions, the system uses a built-in latency evaluation model to calculate the average transmission time of each page of preview data and compares it with a set transmission time threshold (e.g., 300ms is low latency, and above 500ms is medium-high latency). Based on the calculation results, the system dynamically selects an appropriate view caching strategy. If the network is good, a full caching strategy is used, caching the preview page locally all at once to improve continuity; if the network fluctuates, the system uses paginated progressive caching or intelligent predictive caching, combining user scrolling behavior and focus prediction to preload relevant page content and reduce lag.

[0106] Ultimately, the rendered results are stored locally in the browser at an appropriate caching granularity (such as page-level, layer-level, or compressed block-level) and presented to the user in a stable output format, ensuring a smooth PDF preview experience even when switching pages repeatedly or in weak network conditions.

[0107] Through the above steps, the system achieves dynamic linkage between view output and network environment, improving the stability and usability of PDF loading in weak network environments.

[0108] Furthermore, before the step of parsing the file data stream using preset parsing rules to obtain the document object, the following steps are also included:

[0109] Determine the data source type of the file data stream;

[0110] If the file data stream is obtained from an interface, then the format of the file data stream is unified to obtain a file data stream with a unified format.

[0111] In this embodiment, to improve the universality and compatibility of PDF data parsing, the system first needs to determine the specific source type of the PDF file data stream before executing standard parsing rules. This determination process is based on the front-end file loading module, which analyzes data header features, response type, transmission method, and front-end configuration parameters to identify whether the data originates from local upload, direct URL link, or is obtained through interface calls (such as Base64 strings, Blu-ray objects, ArcBuffers, or custom package formats returned by the backend API). Once the data stream is identified as an interface return type, the system immediately enters the unified format processing flow.

[0112] The core of this process is the standardization of PDF data structures, enabling parsers to handle data uniformly without needing to adapt to different formats. For Base64 format, the system uses atob or the more efficient TypedArray to convert it to ArrayBuffer; for binary Blob or ArrayBuffer, it directly determines whether its MIME type is application / pdf and further encapsulates it into a unified Unicode Array format; if it is a URL string, it performs URL decoding, retrieves its content based on a standard Fetch request, and converts it into a unified data stream format. Furthermore, the system provides developer hooks, allowing users to register custom converters via configuration options to ensure compatibility with more complex or encrypted transmission protocols.

[0113] The unified data stream will be tagged with standard metadata (such as source identifier, timestamp, file length, and transmission status) and passed to the document parsing engine as standardized input. This avoids compatibility issues caused by different data sources, reduces front-end logic branches and repetitive conversion steps, and ensures the efficiency and stability of the entire preview process.

[0114] Through the above steps, the system achieves intelligent recognition and format unification of multiple PDF data sources, improves parsing compatibility, and simplifies front-end preprocessing logic.

[0115] In the above embodiments, this application discloses a document preview method, belonging to the field of R&D management technology, and applied to document preview in a financial insurance business system. First, based on the type and version number of the client preview device, the most suitable page rendering configuration is dynamically loaded from a preset document pre-compilation library, effectively avoiding rendering failures or performance degradation caused by differences in device compatibility. Second, the system can flexibly identify the data source type of the PDF file and perform standardized parsing using a unified format, thereby generating a stable and clearly structured PDF document object. Next, by separating the rendering logic of the document object from the data processing logic and matching appropriate resource packages, fine-grained control over complex PDF content is achieved. Combining layered rendering and page-by-page loading strategies ensures efficient content loading and gradual presentation, while dynamically adjusting the resolution adaptation strategy according to the device browser version. Finally, the system intelligently adjusts the caching mechanism by extracting display parameters and analyzing network conditions in real time, achieving a stable, smooth, and low-latency PDF preview effect. This application significantly improves the rendering performance and user experience of PDFs in various devices and complex network environments by constructing a highly modular and dynamically adaptable document preview system.

[0116] In this embodiment, the document preview method runs on an electronic device (e.g., Figure 1 The server shown can receive instructions or acquire data via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra-wideband) connections, and other currently known or future wireless connection methods.

[0117] It should be emphasized that, to further ensure the privacy and security of the aforementioned resource package information, this information can also be stored in a node of a blockchain.

[0118] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0119] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0120] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0122] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0123] Further reference Figure 3 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of a document preview device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0124] like Figure 3 As shown, the document preview device 400 described in this embodiment includes:

[0125] The rendering configuration module 401 is used to determine the preview device and dynamically load the page rendering configuration from the preset document pre-compilation library according to the version number of the preview device.

[0126] The data stream parsing module 402 is used to acquire file data streams, parse the file data streams using preset parsing rules, and obtain document objects.

[0127] The resource package acquisition module 403 is used to separate the rendering logic and data processing logic from the document object and acquire the resource package that matches the rendering logic and data processing logic.

[0128] The preliminary rendering module 404 is used to load the document content page by page in the preview device through layered rendering based on the page rendering configuration and resource package to obtain a preliminary rendered document preview view;

[0129] The browser adaptation module 405 is used to identify the browser version of the preview device and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view.

[0130] The view caching module 406 is used to extract display parameters from the final optimized document preview view, adjust the view caching strategy according to the display parameters and network transmission data, and obtain a stable output document preview result.

[0131] Further, please refer to Figure 5 The rendering configuration module 401 specifically includes:

[0132] The request parsing unit 501 is used to obtain the document preview request initiated by the client and determine the device type and version number by parsing the device identifier field in the request header;

[0133] Version matching unit 502 is used to query the version matching rules in the pre-compiled document library based on the device type and version number to obtain the corresponding library file index;

[0134] Parameter index unit 503 is used to find the appropriate page rendering parameters based on the library file index;

[0135] The dynamic loading unit 504 is used to inject page rendering parameters into the preset document rendering engine through a dynamic loading mechanism, complete the rendering configuration, and obtain the page rendering configuration.

[0136] Furthermore, the dynamic loading unit specifically includes:

[0137] The parameter binding subunit is used to bind page rendering parameters to the core functions of the document rendering engine through dynamic link library loading technology;

[0138] The rendering configuration subunit is used to automatically adjust the page rendering configuration based on the injected page rendering parameters. The page rendering configuration includes page layout, font size, and rendering precision.

[0139] The "Configure Successful" sub-unit is used to return a message indicating successful page rendering configuration after the page rendering parameters have been injected, thus obtaining the page rendering configuration.

[0140] Furthermore, the resource package acquisition module 403 specifically includes:

[0141] Modular parsing unit is used to perform modular parsing of document objects, dividing them into rendering logic responsible for page rendering and data processing logic responsible for data processing;

[0142] The rendering logic unit is used to retrieve matching rendering resource packages from a preset resource package library according to the requirements of the rendering logic. The rendering resource packages contain fonts, colors, images and videos required for page rendering.

[0143] The data processing logic unit is used to retrieve matching data processing resource packages from a preset resource package library according to the needs of the data processing logic.

[0144] The resource package integration unit is used to package and integrate rendering resource packages and data processing resource packages to form a resource package that perfectly matches the document object.

[0145] Furthermore, the preliminary rendering module 404 specifically includes:

[0146] The initialization unit is used to initialize the rendering engine based on the page layout, font size, and rendering precision in the page rendering configuration;

[0147] Content partitioning unit is used to divide the content of a document object into several layers using a layered rendering strategy. These layers include text layers, image layers, and video layers.

[0148] The sequential loading unit is used to load the corresponding rendering resources from the resource package in a hierarchical order, where the loading order is font files, color configurations, image materials, and video streams.

[0149] The preliminary rendering unit is used by the rendering engine to synthesize the loaded rendering resources according to the page layout and rendering precision, and generate the preliminary rendering result of each page of the document.

[0150] The page loading unit is used to load the preliminary rendering results page by page into the preview device to form a preliminary rendering document preview view.

[0151] Furthermore, the view cache module 406 specifically includes:

[0152] The display parameter extraction unit is used to perform a comprehensive analysis of the final optimized document preview view and extract key display parameters, including page size, resolution, and loading time.

[0153] The transmission status assessment unit is used to assess the current network transmission status;

[0154] The transmission time calculation unit is used to calculate the data transmission time based on key display parameters and network transmission status.

[0155] The caching strategy adaptation unit is used to select the appropriate view caching strategy based on the data transmission time and the preset transmission time threshold.

[0156] The preview view caching unit is used to cache the initially rendered document preview view to the preview device based on an adapted view caching strategy, and generate a stable output document preview result.

[0157] Furthermore, the document preview device 400 also includes:

[0158] The source type determination module is used to determine the data source type of the file data stream;

[0159] The unified format module is used to unify the format of file data streams if the file data stream is obtained from an interface, thus obtaining a file data stream with a unified format.

[0160] In the above embodiments, this application discloses a document preview device, belonging to the field of R&D management technology, applied to document preview in a financial insurance business system. First, based on the type and version number of the client preview device, the most suitable page rendering configuration is dynamically loaded from a preset document pre-compilation library, effectively avoiding rendering failures or performance degradation caused by device compatibility differences. Second, the system can flexibly identify the data source type of the file and perform standardized parsing using a unified format, thereby generating stable and clearly structured document objects. Next, by separating the rendering logic of the document object from the data processing logic and matching appropriate resource packages, fine-grained control over complex document content is achieved. Combining layered rendering and page-by-page loading strategies ensures efficient content loading and gradual presentation, while dynamically adjusting the resolution adaptation strategy according to the device browser version. Finally, the system intelligently adjusts the caching mechanism by extracting display parameters and analyzing network conditions in real time, achieving a stable, smooth, and low-latency document preview effect. This application significantly improves the rendering performance and user experience of documents on various devices and in complex network environments by constructing a highly modular and dynamically adaptable document preview system.

[0161] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 6 , Figure 6This is a basic structural block diagram of the computer device in this embodiment.

[0162] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected via a system bus. It should be noted that only the computer device 6 with memory 61, processor 62, and network interface 63 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0163] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0164] The memory 61 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as the hard disk or memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 6. Of course, the memory 61 may also include both the internal storage unit and its external storage device of the computer device 6. In this embodiment, the memory 61 is typically used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions for document preview methods. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or will be output.

[0165] In some embodiments, the processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to execute computer-readable instructions stored in the memory 61 or to process data, such as executing computer-readable instructions for the document preview method.

[0166] The network interface 63 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 6 and other electronic devices.

[0167] This application also provides an implementation method, namely, a computer device including a memory and a processor. The memory stores computer-readable instructions, and the processor, when executing the computer-readable instructions, implements the steps of the document preview method described above, that is, implements:

[0168] A document preview method, comprising:

[0169] Determine the preview device and dynamically load the page rendering configuration from the preset document pre-compilation library based on the preview device's version number;

[0170] Obtain the file data stream, parse the file data stream using preset parsing rules, and obtain the document object;

[0171] Separate the rendering logic and data processing logic from the document object, and obtain the resource package that matches the rendering logic and data processing logic;

[0172] Based on the page rendering configuration and resource package, the document content is loaded page by page in the preview device through layered rendering to obtain a preliminary rendered document preview view;

[0173] Identify the browser version of the preview device, and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view;

[0174] The display parameters are extracted from the final optimized document preview view, and the view caching strategy is adjusted based on the display parameters and network transmission data to obtain a stable output document preview result.

[0175] This application also provides another implementation, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the document preview method described above, i.e., to implement:

[0176] A document preview method, comprising:

[0177] Determine the preview device and dynamically load the page rendering configuration from the preset document pre-compilation library based on the preview device's version number;

[0178] Obtain the file data stream, parse the file data stream using preset parsing rules, and obtain the document object;

[0179] Separate the rendering logic and data processing logic from the document object, and obtain the resource package that matches the rendering logic and data processing logic;

[0180] Based on the page rendering configuration and resource package, the document content is loaded page by page in the preview device through layered rendering to obtain a preliminary rendered document preview view;

[0181] Identify the browser version of the preview device, and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view;

[0182] The display parameters are extracted from the final optimized document preview view, and the view caching strategy is adjusted based on the display parameters and network transmission data to obtain a stable output document preview result.

[0183] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0184] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0185] It should be noted that the software tools or components not belonging to this company that appear in the various embodiments of this application are merely illustrative examples and do not represent actual use.

[0186] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A document preview method, characterized in that, include: Determine the preview device and dynamically load the page rendering configuration from the preset document pre-compilation library according to the version number of the preview device; Obtain the file data stream, parse the file data stream using preset parsing rules, and obtain a document object; Separate the rendering logic and data processing logic from the document object, and obtain the resource package that matches the rendering logic and the data processing logic; Based on the page rendering configuration and the resource package, the document content is loaded page by page in the preview device through layered rendering to obtain a preliminary rendered document preview view; Identify the browser version of the preview device, and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view; The display parameters are extracted from the final optimized document preview view, and the view caching strategy is adjusted according to the display parameters and network transmission data to obtain a stable output document preview result.

2. The document preview method as described in claim 1, characterized in that, The step of determining the preview device and dynamically loading the page rendering configuration from the preset document pre-compilation library according to the version number of the preview device specifically includes: Obtain the document preview request initiated by the client, and determine the device type and version number by parsing the device identifier field in the request header; Based on the device type and the version number, query the version matching rules in the document pre-compilation library to obtain the corresponding library file index; Find the appropriate page rendering parameters based on the library file index; The page rendering parameters are injected into a preset document rendering engine through a dynamic loading mechanism to complete the rendering configuration and obtain the page rendering configuration.

3. The document preview method as described in claim 2, characterized in that, The step of injecting the page rendering parameters into a preset document rendering engine through a dynamic loading mechanism to complete the rendering configuration and obtain the page rendering configuration specifically includes: By using dynamic link library loading technology, the page rendering parameters are bound to the core functions of the document rendering engine; Based on the injected page rendering parameters, the page rendering configuration is automatically adjusted, wherein the page rendering configuration includes page layout, font size and rendering precision; After the page rendering parameters are injected, the system returns a message indicating that the page rendering configuration was successful, and the page rendering configuration is obtained.

4. The document preview method as described in claim 3, characterized in that, The step of separating the rendering logic and data processing logic from the document object and obtaining a resource package that matches the rendering logic and the data processing logic specifically includes: The document object is modularly parsed to separate the rendering logic responsible for page rendering and the data processing logic responsible for data processing. According to the requirements of the rendering logic, a matching rendering resource package is retrieved from the preset resource package library, wherein the rendering resource package contains fonts, colors, images and videos required for page rendering; According to the requirements of the data processing logic, a matching data processing resource package is retrieved from the preset resource package library; The rendering resource package and the data processing resource package are packaged and integrated to form a resource package that completely matches the document object.

5. The document preview method as described in claim 4, characterized in that, The step of loading document content page by page in the preview device through layered rendering based on the page rendering configuration and the resource package to obtain a preliminary rendered document preview view specifically includes: Initialize the rendering engine based on the page layout, font size, and rendering precision in the page rendering configuration; A layered rendering strategy is adopted to divide the content of the document object into several layers, including text layers, image layers, and video layers. The corresponding rendering resources are loaded from the resource package in the following order: font files, color configurations, image assets, and video streams. The rendering engine synthesizes the loaded rendering resources according to the page layout and the rendering precision to generate a preliminary rendering result for each page of the document. The initial rendering results are loaded page by page into the preview device to form a preliminary rendering preview view of the document.

6. The document preview method as described in claim 1, characterized in that, The steps of extracting display parameters from the final optimized document preview view, adjusting the view caching strategy based on the display parameters and network transmission data, and obtaining a stable output document preview result specifically include: A comprehensive analysis was performed on the final optimized document preview view to extract key display parameters, including page size, resolution, and loading time. Assess the current network transmission status; Calculate the data transmission time based on the key display parameters and the network transmission status; Based on the data transmission time and the preset transmission time threshold, select an appropriate view caching strategy; Based on the adapted view caching strategy, the initially rendered document preview view is cached on the preview device, and the stable output document preview result is generated.

7. The document preview method as described in claim 1, characterized in that, Before the step of parsing the file data stream using preset parsing rules to obtain a document object, the method further includes: Determine the data source type of the file data stream; If the file data stream is obtained from an interface, then the format of the file data stream is unified to obtain a file data stream with a unified format.

8. A document preview device, characterized in that, include: The rendering configuration module is used to determine the preview device and dynamically load the page rendering configuration from the preset document pre-compilation library according to the version number of the preview device. The data stream parsing module is used to acquire file data streams, parse the file data streams using preset parsing rules, and obtain document objects; The resource package acquisition module is used to separate the rendering logic and data processing logic from the document object and acquire the resource package that matches the rendering logic and the data processing logic. The preliminary rendering module is used to load the document content page by page in the preview device through layered rendering based on the page rendering configuration and the resource package to obtain a preliminary rendered document preview view; A browser adaptation module is used to identify the browser version of the preview device, and adjust the resolution of the initially rendered document preview view according to the browser version to obtain the final optimized document preview view. The view caching module is used to extract display parameters from the final optimized document preview view, adjust the view caching strategy according to the display parameters and network transmission data, and obtain a stable output document preview result.

9. A computer device, characterized in that, The document includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the document preview method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the document preview method as described in any one of claims 1 to 7.