Document preview method and electronic device

By building backend services and a shared cache directory based on document office software within the AI ​​platform, and combining them with a pre-trained inference model, the issues of format compatibility and resource consumption in document preview on the AI ​​platform were resolved. This resulted in efficient and compatible document preview, improving user experience and AI training efficiency.

CN121562546BActive Publication Date: 2026-03-31INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-21
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing AI platforms suffer from problems such as poor format compatibility, high resource consumption, inability to be deployed privately, and limited data processing capacity in online document preview, which affect user efficiency and AI task training efficiency.

Method used

The backend document service is built on document office software. It integrates transcoding resources from different nodes of the platform through a shared cache directory, and uses a pre-trained inference model to generate structured summaries, avoiding repeated transcoding, realizing cross-node resource reuse, and adapting to multi-format document preview.

Benefits of technology

It enables rapid online preview of massive amounts of multi-format files, reduces resource consumption, improves user efficiency and AI platform training efficiency, and ensures data security and deployment flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121562546B_ABST
    Figure CN121562546B_ABST
Patent Text Reader

Abstract

This application discloses a document preview method and electronic device, relating to the fields of storage and cloud computing technology. The method is based on a document office software to build a backend document service. It prioritizes retrieving preview documents from the shared cache directory of an artificial intelligence platform. If the document does not exist, it is automatically downloaded and generated without manual operation by the user. It adopts a backend native transcoding method instead of plugin integration, and combines a pre-trained model to perform semantic recognition on large files to generate summaries before transcoding, solving the format compatibility problem and reducing performance loss. The method is deployed on the AI ​​platform management node and uses shared caching to achieve private deployment. Through cache reuse and semantic summarization technology, it reduces resource consumption and breaks through the limitations of large file processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of storage and cloud computing, and in particular to a document preview method and an electronic device. Background Technology

[0002] With the development of the artificial intelligence industry, artificial intelligence (AI) cluster platforms have become the core support for computing power, and their storage management faces challenges such as diverse data types, frequent input and output operations, and high resource consumption.

[0003] In practical applications, online document preview is crucial for improving the efficiency of AI platform users. However, current mainstream platforms have several shortcomings: insufficient support for Office documents, requiring users to download and view them, which impacts efficiency; poor format compatibility, supporting only basic text formats, and performance bottlenecks in plugin integration solutions; and general online viewing solutions are not compatible with AI platforms, resulting in issues such as inability to deploy privately, limited data processing capacity, and high resource consumption that affects training efficiency. Therefore, enabling rapid online preview of massive amounts of multi-format files without affecting AI task training efficiency is a key technical problem that urgently needs to be solved in AI cluster storage. Summary of the Invention

[0004] This application provides a document preview method and electronic device to at least solve the problems of format compatibility defects, resource waste caused by repeated transcoding, low preview efficiency, and insufficient function adaptation in the document preview scenario of AI platform in related technologies.

[0005] This application provides a document preview method applied to the management node of an artificial intelligence platform. The method includes: responding to a preview trigger request for a target document via a backend document service; determining whether a preview document corresponding to the target document exists in the shared cache directory of the artificial intelligence platform based on the document identifier carried in the preview trigger request; wherein the backend document service is a backend service built on document office software that supports document preview, transcoding, and collaboration functions; the shared cache directory includes preview documents transcoded by different nodes of the artificial intelligence platform; if no preview document corresponding to the target document exists, downloading the target document; if the target document is a text document and its size exceeds a set threshold, obtaining a document summary of the target document based on the target document and a pre-trained inference model; wherein the pre-trained inference model is used to perform semantic recognition on the document name and part of the content to generate a structured document summary; performing format transcoding on the document summary to obtain a preview document and storing the preview document in the shared cache directory; and passing the preview document to a frontend preview interface to display the preview content of the target document on the frontend preview interface.

[0006] This application also provides a document preview device, including:

[0007] The judgment module is used to respond to the preview trigger request of the target document through the backend document service, and determine whether the preview document corresponding to the target document exists in the shared cache directory of the artificial intelligence platform based on the document identifier carried in the preview trigger request. The backend document service is a backend service built on document office software that supports document preview, transcoding and collaboration functions. The shared cache directory includes preview documents transcoded by different nodes of the artificial intelligence platform.

[0008] The download module is used to download the target document if a preview document corresponding to the target document does not exist.

[0009] The document summarization module is used to generate a document summary of the target document if the size of the target document exceeds a set threshold when the target document is a text document. The pre-trained inference model is used to perform semantic recognition on the document name and part of the content to generate a structured document summary.

[0010] The transcoding module is used to perform format transcoding operations on the document summary to obtain a preview document, and then store the preview document in a shared cache directory;

[0011] The delivery module is used to pass the preview document to the front-end preview interface so that the preview content of the target document can be displayed on the front-end preview interface.

[0012] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the above-described document preview method when executing the computer program.

[0013] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described document preview method.

[0014] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described document preview method.

[0015] This application builds a backend document service based on office software, integrating preview, transcoding, and collaboration functions. Upon responding to a target document preview trigger request, it first checks if a corresponding preview document exists in the shared cache directory of the AI ​​platform. This shared cache directory integrates transcoding results from different nodes on the platform, enabling cross-node resource reuse. If the document does not exist, it automatically downloads the target document and generates a preview document, requiring no manual user intervention and improving preview efficiency. The backend's native transcoding capabilities adapt to office suite documents. For large text files, a pre-trained inference model is introduced to perform semantic recognition of document names and parts of the content, generating a structured document summary before format transcoding. This solves the problem of complex format compatibility and avoids performance overhead from plugins. This method is deployed on the management node of the AI ​​platform, relying on the platform's own shared cache directory for private deployment adaptation. Cache reuse reduces resource consumption from repeated transcoding, and the semantic summarization capabilities of the pre-trained model overcome the limitations of large file processing, avoiding the impact of additional resource consumption on AI training efficiency. Ultimately, it achieves efficient, compatible, and low-cost document preview adapted to the characteristics of the AI ​​platform. Attached Figure Description

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

[0017] Figure 1 A schematic diagram of the specific hardware architecture on which the execution of a document preview method provided in this application depends;

[0018] Figure 2 A flowchart illustrating a document preview method provided in an embodiment of this application;

[0019] Figure 3A This is a schematic diagram illustrating the interaction of an AI cluster in a high-availability environment, as provided in an embodiment of this application.

[0020] Figure 3B A schematic diagram of the settings interface for the shared cache directory provided in an embodiment of this application;

[0021] Figure 4A A partial schematic diagram of a front-end preview interface provided in an embodiment of this application;

[0022] Figure 4B A partial schematic diagram of another front-end preview interface provided in an embodiment of this application;

[0023] Figure 5 A schematic diagram of the flowchart of a document preview method provided in an embodiment of this application;

[0024] Figure 6 This application provides a schematic diagram of the structure of a document preview device;

[0025] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0027] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0028] To more clearly illustrate the embodiments of this application, the technical terms used in the embodiments will be briefly introduced below:

[0029] Integrated storage (istorage) services are a type of distributed service that provides data storage, management, access, and backup based on a network architecture. Its core feature is that it virtualizes and pools storage resources through standardized interfaces, allowing users to call storage capacity and read and write data on demand via the Internet or private networks. It also provides highly available, scalable, and secure storage capabilities without requiring users to worry about the physical deployment and maintenance of the underlying hardware devices.

[0030] Kubernetes (k8s) is an open-source container orchestration platform that can uniformly schedule the computing and storage resources of AI clusters.

[0031] YAML (Ain't Markup Language) is a human-readable, cross-language compatible data serialization language. Its core purpose is to convert complex data structures (such as key-value pairs, lists, and nested objects) into an easy-to-read and write text format for data exchange, configuration file writing, parameter passing, and other scenarios. Its core design principles are simplicity and readability, using indentation, line breaks, and simple syntax symbols to express data hierarchy relationships.

[0032] Onlyoffice is a collection of open-source office collaboration software components. Its core purpose is to migrate local Office functions to cloud / private deployment environments. It supports integration with third-party systems through Application Programming Interface (API) to enable online editing, previewing, collaboration, and format conversion of documents, and is compatible with mainstream operating systems and development frameworks.

[0033] With the booming development of the artificial intelligence industry, the demand for computing power from scientific research enterprises and university researchers continues to rise. AI cluster platforms, with their powerful resource integration capabilities, have become core supporting infrastructure. As one of the core functions of AI clusters, storage management needs to support various types of data storage, such as user home directories, public directories, training dataset directories, and training model directories. With the high-frequency execution of AI tasks, the storage system constantly generates a large number of I / O operations, making the problem of storage resource consumption increasingly prominent.

[0034] In practical applications of AI platforms, online document preview functionality is crucial for improving user efficiency. AI cluster training datasets are typically massive, requiring users to frequently consult various documents to obtain data structure information such as data descriptions, model parameters, and experimental records. However, current mainstream AI platforms suffer from significant shortcomings in this area: most vendors lack online preview support for Office documents, and some platforms don't even have this feature at all, forcing users to download documents to their local personal computers (PCs) for viewing—a cumbersome process that severely reduces work efficiency.

[0035] Existing technologies also have limitations in document format compatibility. Most AI platforms only support viewing basic text formats such as txt, .py, and .sh, lacking effective support for frequently used formats in research and office scenarios, such as csv, xlsx, xls, doc, docx, pdf, ppt, pptx, and md. Although some developers have attempted to achieve multi-format preview by integrating various plugins, such solutions face severe performance bottlenecks. When processing large numbers of files or large files, loading latency increases significantly, failing to meet the efficient access requirements in AI scenarios.

[0036] Furthermore, the technical solutions offered by general-purpose online file viewers are ill-suited to the specific needs of AI platforms. Mainstream solutions often employ a unified transcoding and caching management model, but this suffers from three major drawbacks: first, it does not support private deployment, conflicting with the localized resource management requirements of AI clusters; second, it only supports viewing a limited number of files, failing to handle the massive data volumes of AI scenarios; and third, the transcoding and caching process consumes extremely high network, disk, and CPU resources, severely limiting the core resources required for AI task training and leading to decreased training efficiency.

[0037] In summary, in large-scale storage scenarios of AI clusters, how to achieve rapid online preview of massive amounts of multi-format files while avoiding the occupation of core computing resources and not affecting storage performance and AI task training efficiency has become a key technical problem that the industry urgently needs to solve, which is directly related to the improvement of user experience and productivity of AI platforms.

[0038] To address all or part of the aforementioned technical issues, this application clarifies that the backend document service is built upon office software, inherently possessing deep compatibility with Office documents (such as Word, Excel, and PPT), and can directly respond to preview trigger requests and process target documents. Simultaneously, by transcoding to generate preview documents and directly displaying them on the front end, the process avoids user download operations, enabling real-time online preview of Office documents and improving user efficiency. The backend document service has complete document format parsing and transcoding capabilities, supporting not only Office documents but also complex formats (such as documents containing formulas, charts, and layout styles). Through transcoding, it uniformly converts various source documents into a front-end-compatible preview format, overcoming the limitations of basic text formats. Adopting a native backend document service architecture, it eliminates the need for third-party plugins, directly completing document parsing, transcoding, and preview transmission through the platform's built-in services. This reduces compatibility conflicts and performance losses caused by plugin integration, improving the response speed and stability of the preview function. The document preview function is deployed on the management node of the AI ​​platform, relying on the platform's own infrastructure (such as shared cache directories and node collaboration mechanisms). It can be fully integrated into the private deployment architecture of the AI ​​platform, with data flow confined within the platform, ensuring data security and deployment flexibility. Through the shared cache directory design, transcoding resources from different nodes of the AI ​​platform are integrated, enabling distributed processing of large-scale documents (such as multi-node parallel transcoding and cache reuse of processed documents), improving document processing throughput and breaking through the data volume limitations of general solutions. The backend document service only triggers transcoding operations when it receives a preview request, and reusing preview documents through the shared cache directory eliminates the need for repeated transcoding, reducing unnecessary resource consumption. Simultaneously, document processing and model training tasks are deployed separately on different nodes or resource pools, avoiding the preview function's occupation of training resources and ensuring the core training efficiency of the AI ​​platform.

[0039] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] The specific application environment architecture or specific hardware architecture on which the document preview method depends is described here.

[0041] like Figure 1The diagram illustrates the specific hardware architecture upon which the document preview method relies. The top layer is the user's browser, serving as the entry point for document preview. The middle service layer comprises three core components that implement the document preview function through clear division of responsibilities: the front-end interaction (ivision) service provides the data preview page to the browser; the integrated storage (istorage) service acts as the core connector, providing preview data interfaces and data download interfaces; and the back-end document (Onlyoffice) service is responsible for document transcoding and providing Office format preview capabilities. These three components collaborate through the interaction logic indicated by the arrows. Browser requests are passed from the ivision service to the ivision service. The ivision service calls the Onlyoffice service to complete the transcoding and then returns the preview document to the ivision service, which finally renders it into a page for display to the user. Each component in the service layer performs its specific function, avoiding functional coupling.

[0042] The underlying support layer provides the foundational capabilities for the service layer. Shared file storage serves as a unified carrier for documents and transcoding caches, ensuring that all services can access the same file. The container orchestration tool Kubernetes and containers (Docker) support the containerized operation and cluster management of the services. Ubuntu, the Community Enterprise Operating System (CentOS), and Kylin are the underlying operating systems for the cluster, covering different environment adaptation needs. Through shared storage and container tools, the underlying support layer achieves unified resource scheduling and environment compatibility, ensuring smooth operation of the document preview function and providing a flexible technical foundation for the expansion of the AI ​​platform.

[0043] The embodiments of this application provide a document preview method applied to the management node of an artificial intelligence platform. The backend service of the artificial intelligence platform encapsulates the OnlyOffice interface, and the frontend does not directly expose the OnlyOffice component.

[0044] like Figure 2 As shown, the method includes the following steps:

[0045] S200: Respond to the preview trigger request of the target document through the backend document service, and determine whether there is a preview document corresponding to the target document in the shared cache directory of the artificial intelligence platform based on the document identifier carried in the preview trigger request.

[0046] Among them, the backend document (Onlyoffice) service is a backend service built on document office software that supports document preview, transcoding and collaboration functions.

[0047] In some embodiments, before executing step S200, the configuration file of the backend document service is first obtained. The configuration file includes deployment resources and service resources. The configuration file is then applied in the container orchestration tool to deploy a container image of the backend document service. A verification request is initiated within the container image. If a response message is received from the backend document service, the deployment of the backend document service is considered successful. This allows the deployment of a qualified OnlyOffice service within the Kubernetes cluster of the AI ​​platform.

[0048] This application uses container images as the deployment unit and automates the management of the OnlyOffice service through a Kubernetes daemon set. It deploys OnlyOffice service container images on multiple management nodes of the AI ​​cluster. The daemon set forces the deployment of only one container image on a specified node. Containers on multiple management nodes are limited to sharing the same cache.

[0049] The container image, such as "{IP}:5000 / inais / office-service:latest", specifies that the Onlyoffice service relies on the "inais / office-service" image from the AI ​​cluster's internal private image repository (address: {IP}:5000). The "latest" tag indicates that the latest version is being pulled, ensuring that service functionality is synchronized with cluster requirements. You can set the container image's resource limits, resource request limits, memory limits, and memory request limits. The resource limit indicates the maximum processor resources the Onlyoffice service can use. For example, "cpu:2" means the Onlyoffice service can use a maximum of 2 CPU cores to prevent excessive resource consumption that could affect other core tasks in the AI ​​cluster (such as model training). The resource request limit indicates the minimum processor resources required by the Onlyoffice service. For example, "requests:0.5" means that at least 0.5 CPU cores must be allocated to this container during Kubernetes scheduling to start, ensuring the service's basic resource requirements. The memory configuration "mem:10GB(requests:4GB)" works similarly. The 10GB limit prevents memory overflow, while the 4GB request limit ensures the basic memory supply when the service starts. This configuration satisfies the resource consumption requirements of OnlyOffice when transcoding and previewing documents, while avoiding wasting the valuable computing resources of the AI ​​cluster.

[0050] You can set the affinity, such as "nodeSelector.node-role.kubernetes.io / master: 'true'", to restrict the OnlyOffice service to start only on the management node of the AI ​​cluster, thus preventing the OnlyOffice service from occupying the resources of the compute nodes and utilizing the idle processor resources of the management node to process transcoding tasks.

[0051] Specifically, when deploying the required OnlyOffice service in a Kubernetes cluster on an AI platform, first, prepare the YAML configuration file required for Kubernetes deployment: Create a text file and define two core resources in the file. The first is the Deployment resource, specifying its namespace as `inais`, the service name as `office-service`, and the container image address as `{IP}:5000 / inais / office-service:latest`. In the container resource configuration, you can set the CPU limit to 2 cores and the request value to 0.5 cores, the memory limit to 10GB and the request value to 4GB, and configure the service port inside the container. The second is the Service resource, selecting ClusterIP as the type (indicating that only cluster-internal access is allowed), also setting the namespace to `inais`, mapping the service port to 32116, and associating it with the `office-service` tag corresponding to the Deployment to ensure that traffic can be forwarded to the corresponding Pod.

[0052] Next, log in to the control node that can operate the Kubernetes cluster (or configure the connection between Kubectl and the cluster on your local computer), open a command-line terminal, and run the command `kubectl apply -f office-service.yaml -n inais`, specifying that the resource defined in this YAML file should be created under the `inais` namespace. After the command finishes executing, use the command `kubectl get pods -n inais` to check the status of the Pod corresponding to `office-service`, confirming that it displays "Running"; then check the service to confirm that the port of `office-service` is now 32116 and the type is ClusterIP.

[0053] Finally, in any node or Pod within the cluster, a request is made using the ClusterIP corresponding to the Service and port 32116. If a response is received from the OnlyOffice service (such as the service's health check results or default page), it means that the service has been successfully deployed and can only be accessed within the cluster.

[0054] In step S200, the target document can be a training file of an artificial intelligence model, such as a knowledge base document or a CSV training dataset. The format of the target document includes, but is not limited to: csv, xlsx, xls, doc, docx, pdf, ppt, pptx, md, etc.

[0055] The preview trigger request originates from the iStorage service of the AI ​​platform. When a user triggers a document preview on the AI ​​platform, the iStorage service first performs pre-processing operations such as permission verification, file existence check, and document extension verification. Then, through the integrated backend document service script (OnlyofficeJS) file, it sends a preview trigger request to the OnlyOffice service. Permission verification prevents unauthorized users from accessing sensitive documents, ensuring data access complies with the AI ​​platform's permission control rules; file existence check prevents preview failures due to user errors or accidental text deletion; and document extension verification filters out file types that cannot be previewed, avoiding unnecessary resource consumption during encoding.

[0056] The istorage service collects the data structure information of the target document and then sends it to the backend document (Onlyoffice) service. istorage is a file management microservice that provides file management, dataset management, data list display, and preview functionality. The istorage service maps preview trigger requests to all nodes in the AI ​​cluster that deploy the Onlyoffice service. If an Onlyoffice node fails, the preview trigger request is forwarded to other healthy nodes using a round-robin algorithm based on the virtual IP, ensuring that the preview function is not interrupted due to the failure of a single node. The virtual IP is the unified access address within the AI ​​cluster that maps multiple Onlyoffice service container images.

[0057] The preview trigger request includes document metadata. The document metadata is collected and encapsulated by the iStorage service from the AI ​​cluster storage. The document metadata includes, but is not limited to: document identifier (id), document download path (path), document name (title), language type (lang), preview user (user), document suffix (suffix), document creation time (createtime), and document owner (creator).

[0058] The data structure of document metadata is shown in Table 1:

[0059] Table 1

[0060]

[0061] The document identifier is generated based on the Message-Digest Algorithm 5 (MD5) value and the transcoding timestamp. The MD5 value is used to identify the document content; even if the document names and download paths are different, as long as the content is the same, the MD5 value will be the same. The timestamp (e.g., in yyyymmdd format) records the time of the transcoding operation.

[0062] The AI ​​platform's shared cache directory stores preview documents after transcoding each document. Each preview document is placed in a separate transcoding directory to prevent duplicate transcoding. In the AI ​​cluster, shared storage (such as / mnt / inaisfs / file-cache) is a public storage space accessible to all nodes, while the OnlyOffice service's transcoding directory ( / var / lib / Onlyoffice / documentserver / App_Data / cache) is its default local path for generating preview documents. Through a mount operation (i.e., associating the shared storage directory with the OnlyOffice service's local transcoding directory), preview documents generated by the OnlyOffice service are directly stored in the AI ​​platform's shared storage, rather than solely on the OnlyOffice service's local disk.

[0063] The shared cache directory stores the document identifiers of preview documents and target documents in a corresponding manner. For example, the transcoding directory for the preview document pytorch_data.csv could be "4785ecf61da4e4d67b2fb1079af4a620". Furthermore, the AI ​​platform can quickly filter transcoding directories that have exceeded the retention period (e.g., 30 days) based on the timestamp in the document identifier, automatically deleting expired files to prevent invalid transcoding files from occupying the shared storage.

[0064] The preview trigger request also includes preview control parameters. These parameters are set by the iStorage service according to the AI ​​platform's requirements, and include, but are not limited to: whether to block download, print, and annotation functions, preview mode, and document security token. Preview mode includes options such as "View Only".

[0065] The document security token (JWT_SECRET) is a security authentication token used by the OnlyOffice service in the AI ​​cluster to interact with external services (such as the iStorage service) when accessing documents. It ensures that the iStorage service can connect to the OnlyOffice service and is used to verify the legitimacy of preview-triggered requests, preventing unauthorized access.

[0066] It is important to emphasize that the token provided by the OnlyOffice service changes upon service restart. This dynamic token change can cause the iStorage service, which has already been configured with access rules, to lose its valid token, preventing it from properly invoking the OnlyOffice service's transcoding and preview functions. This, in turn, leads to document preview failure, impacting the work efficiency of algorithm engineers. This application addresses this by fixing the document security token. By manually configuring a fixed JWT_SECRET (e.g., "ISy5JqYfAa7PnZjos8KwBS4MTSTzYn3") when the OnlyOffice service starts, this token remains unchanged during service restarts. This ensures that the iStorage service can always use the fixed token for authentication, maintaining a stable communication link between the two services and preventing service collaboration interruptions due to dynamic token changes. In scenarios involving frequent resource scheduling and service restarts in AI clusters, the interaction between the iStorage and OnlyOffice services does not require repeated token reconfiguration, reducing operational costs and preventing preview failures due to token expiration. This ensures the continuous availability of the AI ​​platform's document preview service, ultimately supporting algorithm engineers in efficiently viewing data and training models.

[0067] In some embodiments, before performing step S201, the method further includes: determining whether the preview trigger request comes from the internal whitelist of the AI ​​platform, such as the istorage service, based on the document security token included in the preview trigger request, so as to avoid external illegal requests triggering the preview.

[0068] When the iStorage service sends a preview trigger request to the OnlyOffice service, it must include a document security token that conforms to the JWT_SECRET encryption rule. Upon receiving the preview trigger request, the OnlyOffice service verifies the validity of the document security token to determine if the iStorage service has permission to access the target document. If the document security token matches and is valid, the iStorage service is allowed to access the target document, preventing unauthorized external requests from triggering document operations on the iStorage service, thereby ensuring document access security within the AI ​​platform.

[0069] During step S201, the Onlyoffice service responds to the preview trigger request of the target document. Based on the document identifier carried in the preview trigger request, it determines whether a preview document corresponding to the target document exists in the shared cache directory of the AI ​​platform. If so, and a preview document corresponding to the target document exists in the shared cache directory of the AI ​​platform, the transcoding step is skipped, and the preview document is directly passed to the front-end preview interface to display the preview content of the target document. This reduces processor resource consumption and improves preview efficiency.

[0070] Specifically, the system first queries the shared cache directory (e.g., / mnt / inaisfs / file-cache) for all transcoded preview documents based on the MD5 value in the document identifier. It then checks if a directory with that MD5 value as a prefix exists in the AI ​​platform's shared cache directory. For example, if the MD5 value of the file identifier is "abc123", the cache directory name for the preview document might be "abc123_202511261430". If it exists, the directory name is directly used as the document identifier for this preview request. Simultaneously, the transcoded preview document in that directory is retrieved and reused. This eliminates the need for the OnlyOffice service to re-perform the transcoding operation, saving processor resources and shortening preview waiting time.

[0071] It's important to note that OnlyOffice does not proactively regenerate deleted preview files after clearing the cache. Relying solely on MD5 values ​​to identify cached preview documents cannot distinguish whether a file was never transcoded or was transcoded and then deleted from the cache. Both scenarios result in "no corresponding MD5 value cache directory," potentially leading to duplicate transcoding of already transcoded files. However, by adding timestamps, the cache directory is named "MD5 value + yyyymmdd." OnlyOffice can then determine this by searching historical timestamp directories: if a directory with the same MD5 value exists for any timestamp, it indicates the document was transcoded (cache cleared), and a prompt or regeneration can be provided; if not, it means the file was never opened for transcoding, requiring an initial transcoding process, thus achieving accurate cache status identification.

[0072] If directories are named solely using MD5 values, the OnlyOffice service will throw an exception because it cannot identify the directory's ownership (such as generation time or version), causing preview requests to fail. Adding timestamps ensures that directory naming conforms to OnlyOffice's identification logic, guaranteeing the service can correctly read or determine cached status and preventing errors.

[0073] Optionally, the Onlyoffice service scans the mounted shared cache directories, searching for directories using the combination rule of "MD5 value + yyyymmdd". Specifically, it matches directory names that are prefixed with the target MD5 value followed by a timestamp. During the search, it iterates through all subdirectory names under the cache directory, extracting the prefix MD5 value and suffix timestamp through string matching, and comparing them one by one to see if they match the target MD5 value and the specified timestamp (or timestamp range). If a matching directory is found, it is determined that a preview cache exists, and the transcoded preview document in that directory is directly read and returned to the front end. If no matching directory is found, it is determined that the cache does not exist, triggering the subsequent document transcoding process and generating a new cache directory named "MD5 value + current yyyymmdd".

[0074] The above optional implementation uses the MD5 value as a prefix during retrieval to ensure that the matched preview document is consistent with the target document content, avoiding cache confusion between documents with the same name but different content. Combined with the suffix timestamp, it can distinguish cached versions of the same document generated at different times, providing a clear time basis for cache cleanup and preventing a single identifier from failing to ensure document content consistency. The Onlyoffice service can quickly identify cache directories that conform to the rules, avoiding service errors caused by naming mismatches and ensuring the smoothness of the preview process. When a search is successful, the already transcoded file is read directly, eliminating redundant steps of downloading and transcoding, freeing up the CPU and memory resources of the AI ​​cluster from repetitive computation. When a search fails, a new combined-name cache directory is generated, reserving reusable resources for subsequent previews and facilitating the cleanup of expired caches by time using the date suffix, avoiding waste of storage resources.

[0075] When the same document is previewed in different locations, the OnlyOffice service can also identify the existing preview document through the MD5 value, directly reuse the preview document, and reduce processor resource consumption.

[0076] S201. If a preview document corresponding to the target document does not exist, download the target document.

[0077] If a preview document corresponding to the target document does not exist, the Onlyoffice service calls the download interface based on the document download path carried in the preview trigger request; when calling the download interface, a document security token is carried in the request header. After receiving the request, the download interface first verifies the validity of the token (including whether the signature is correct, whether it has expired, and whether the node identifier matches), and only returns the target document after the verification is successful.

[0078] In some embodiments, the corresponding parsing module can be invoked according to the format of the original target document to extract the document content structure, and then converted into a target format that the front end can directly render (such as an intermediate format based on HTML / CSS / JS). After transcoding is completed, the Onlyoffice service generates a transcoding directory for the preview document based on the transcoding timestamp of the preview document and the hash value of the target document, and then associates the transcoding directory with the shared cache directory. Simultaneously, the transcoding time can be recorded to provide a basis for subsequent cache cleanup.

[0079] For example, for Word documents, the text structure parsing module is called to extract core structures such as text paragraphs; for Excel documents, the table data parsing module is called to extract core structures such as table column names.

[0080] The transcoding process is triggered only when a preview document for the corresponding document is not found in the shared cache directory, rather than transcoding all documents, thus reducing redundant computational pressure on the AI ​​cluster. The corresponding parsing module is called based on the document format to achieve precise format adaptation. The hash value of the target document is generated based on the file content, ensuring unique content correspondence and accurately distinguishing document versions, avoiding cache confusion. The transcoding timestamp accurately records the time of the transcoding operation, and the transcoding directory generated by combining the hash value provides version traceability, ensuring the uniqueness of each preview document in the shared cache directory. After transcoding, the directory is associated with the shared cache directory, meaning that all OnlyOffice services in the AI ​​cluster can access the same transcoding result, eliminating the need for repeated transcoding on each node. This distributed cache sharing model reduces the consumption of processor and storage resources. Simultaneously, the unified management of the shared cache directory ensures a consistent preview experience; regardless of which node's service the preview trigger request is assigned to, it can obtain the same transcoded content, avoiding preview differences caused by cache inconsistencies between nodes.

[0081] In some embodiments, if a preview document corresponding to the target document does not exist, the original target document is downloaded according to the document download path carried in the preview trigger request; if the size of the original target document exceeds a set threshold, the content structure of the target document is extracted to generate a document summary. The set threshold is, for example, 100MB. If the document size exceeds the set threshold, direct transcoding will consume a large amount of processor resources and cache space, affecting AI training tasks. Therefore, this application triggers a generative summary preview, generating a lightweight summary in advance, allowing users to quickly determine whether the document meets their needs, avoiding unnecessary full transcoding, saving CPU and cache consumption from the source, and balancing preview efficiency and cluster resource allocation.

[0082] When the OnlyOffice service downloads the original target document based on the document download path, it carries a document security token pre-agreed with the Istorage service. The Istorage service verifies the token's validity; if the token matches, it allows the OnlyOffice service to download the original target document. This design satisfies OnlyOffice's need to obtain file data while preventing unauthorized access to the interface.

[0083] The aforementioned traffic splitting design based on document size thresholds eliminates the need for full transcoding of documents exceeding the set size. Instead, only the content structure is extracted to generate a summary, reducing transcoding time from minutes to seconds and significantly improving document preview response speed. Extracting the document content structure to generate a summary precisely matches users' lightweight preview needs.

[0084] S202. If the target document is a text document and its size exceeds a set threshold, a document summary of the target document is obtained based on the target document and the pre-trained inference model.

[0085] The pre-trained inference model is used to perform semantic recognition on document names and partial content to generate structured document summaries. Pre-trained inference models include, but are not limited to: a simplified bidirectional autoregressive transformer-summary task-12 encoder-6 decoder model (DistilBART-xsum-12-6), or the Qwen3-1.7B-q4 model with 1.7 billion parameters and 4-bit quantization. These models are small in size, fast inference speed, and can meet the requirements of document semantic recognition.

[0086] Pre-trained inference models, through semantic recognition capabilities, can deeply understand the core meaning of document titles and the semantic logic of some content. They generate not simply a collection of sentences, but structured summaries with logical layers, such as presenting core viewpoints in bullet points, outlining the article's structure, and extracting key data. Pre-trained inference models possess strong generalization capabilities and can adapt to various text document formats (such as doc, pdf, txt, etc.) without requiring separate parsing logic for each format, thus reducing the complexity of technical implementation.

[0087] In the process of obtaining a document summary of a target document based on the target document and a pre-trained inference model, the document name and part of the content of the target document are extracted, and semantic recognition is performed using the pre-trained inference model to generate a structured summary.

[0088] The pre-trained inference model described above only performs semantic analysis on the document name and some core content, without processing the full text. This transforms the heavyweight transcoding task into a lightweight inference task, reducing transcoding time from minutes to seconds and improving the response speed of large document previews.

[0089] Optionally, if the target document is a data document and its size exceeds a set threshold, a document summary of the target document is generated based on the column names and some row data of the target document.

[0090] The core characteristic of data documents (such as CSV and Excel files) is structured data storage. Their preview value focuses on data dimensions (column names) and data samples (partial rows), rather than all the data. Column names clearly define the data dimensions and business meaning, while partial rows of data demonstrate data type, numerical range, and format specifications.

[0091] Extracting column names and partial row data eliminates the need for full-text processing. It transforms heavyweight full-volume transcoding into lightweight structure extraction, reducing transcoding time from minutes to seconds, thus lowering memory usage and processor resource consumption. The resulting summary, generated based on column names and partial row data, presents the core data information intuitively in a structured format, enhancing the usability and user experience of data document previews. The column name and row data extraction logic does not rely on complex models or format parsing tools; it can be implemented using only the platform's basic code. It is compatible with various data document formats such as CSV, Excel, and TSV, eliminating the need to develop separate parsing modules for each format, thus reducing technical complexity and maintenance costs.

[0092] The above embodiments, through differentiated processing using models for text types and code for data types, not only avoid the waste of resources in model calls, but also accurately meet the preview needs of different types of files, making summary generation more efficient.

[0093] In some embodiments, if no preview document exists corresponding to the target document, the original target document is downloaded according to the document download path carried in the preview trigger request. The transcoding task of the target document is then distributed to at least two nodes in the AI ​​platform, utilizing the processor resources of at least two nodes to perform format transcoding operations on the target document to obtain at least two preview documents. These at least two preview documents, along with the document identifier carried in the preview trigger request, are then stored in a shared cache directory. The at least two nodes share the storage, which is mounted under the shared cache directory of the AI ​​platform.

[0094] Optionally, the original target document can be split into independent work units that can be parallelized; relying on the Kubernetes management system of the AI ​​cluster, the scheduling system will monitor the resource status of all nodes in real time, filter out idle or low-load nodes, including non-management computing nodes, and allocate tasks by dynamically creating transcoding PODs; after the node completes the task, the transcoding result (i.e., preview document) is written to the shared cache directory.

[0095] For example, a 300-page PDF document can be split into two nodes that process 150 pages each, or multiple nodes can process different data blocks of a data document simultaneously. This can reduce the transcoding time almost linearly, improve the speed of generating preview documents, and meet users' core need for fast previewing of large documents.

[0096] The above embodiments distribute transcoding tasks to at least two nodes in the AI ​​platform through a scheduling mechanism. Parallel computing allows the processor resources of idle nodes to be utilized, and the transcoding tasks are distributed across the entire cluster, reducing the performance pressure on a single node and avoiding service response delays caused by single-node overload, thus achieving efficient utilization of cluster resources. Multi-node parallel transcoding processing shortens transcoding time and improves document transcoding efficiency. Multiple preview documents generated by transcoding can be directly written to a shared cache directory without additional data transfer between nodes (such as file copying and network synchronization), reducing data redundancy and bandwidth consumption, while ensuring that all nodes can access the latest preview documents in real time; regardless of which node a user request is assigned to, the same preview document can be obtained, ensuring a consistent preview experience.

[0097] Distributing transcoding tasks to at least two nodes creates a redundant transcoding mechanism: if one node fails to transcode due to a fault (such as hardware malfunction or service crash), the transcoding result from the other node can still be used normally, avoiding preview function interruption caused by single-node failure and improving service availability. Simultaneously, storing multiple preview documents in a shared cache directory is equivalent to creating multiple backups. Even if one preview document is corrupted due to storage abnormalities, preview requests can still be responded to through other backup files, further reducing the risk of data loss.

[0098] like Figure 3A As shown, users access the AI ​​platform through the top-level browser and initiate a preview trigger request. The preview trigger request first reaches the first-layer front-end interaction (ivision) service, which is deployed on three management nodes (management node 1, management node 2, and management node 3). The ivision services on the three management nodes share the load and distribute the request. Then, the ivision service forwards the request to the second-layer istorage service, which is also deployed on the three management nodes. The redundancy of the istorage services on the three management nodes ensures high availability. When the istorage service calls the OnlyOffice service, load balancing is achieved through the cluster virtual address and the OnlyOffice port. The virtual address is a unified address mapped to all OnlyOffice instances within the AI ​​cluster. The istorage service will round-robin distribute the preview trigger request to the OnlyOffice instances on the three management nodes to avoid overloading a single instance, improve concurrent processing capabilities, and thus ensure high availability and high load in large-scale document preview scenarios.

[0099] Each service is deployed on three management nodes to avoid single points of failure. Requests are distributed via virtual address round-robin, ensuring that the service instances on the three nodes share the load evenly and preventing a single node from crashing due to excessive requests. The Ivision service, isiterage-service service, and Onlyoffice service are responsible for entry forwarding, document management, and transcoding rendering, respectively. This decoupling allows each layer to focus on its own function, improving overall efficiency and enabling a large number of users to simultaneously initiate document preview requests.

[0100] The shared cache directory in the aforementioned embodiments is a dedicated cache directory defined within the shared cache of the AI ​​platform and mounted on the OnlyOffice service to ensure that the transcoded preview document can be shared and accessed by all nodes in the AI ​​cluster. The shared cache directory provides configurable cache management parameters, allowing users to set the retention period for temporary cache files (e.g., ...) in the management interface. Figure 3B (as shown in 30 days) and cache capacity (e.g.) Figure 3B (As shown, 100GB).

[0101] The shared cache directory is also configured with a cleanup policy, which performs cleanup operations periodically. Priority is given to cleaning up expired files based on their retention period, such as deleting cache directories older than 30 days at 1:00 AM every day. If the cache capacity exceeds the set threshold, emergency cleanup is triggered to retain cache files from the most recent time period (e.g., 1 day) to ensure available space for AI cluster storage resources.

[0102] This application stores preview documents in a shared directory and mounts them to the OnlyOffice service. This means that all nodes in the AI ​​cluster can directly access the transcoding results without repeated transcoding, reducing processor and memory consumption. Simultaneously, the association logic between the cache directory and document identifiers (MD5 + timestamp) ensures the uniqueness and traceability of transcoded files, preventing cache confusion between different versions of documents and providing accurate time-based judgment for cleanup strategies. The configurability of cache retention duration and cache capacity allows the AI ​​platform to flexibly adjust according to actual scenarios. Cleaning based on retention duration ensures the timeliness of the cache; when the capacity exceeds a threshold, emergency cleanup is triggered to quickly release storage space, preventing transcoding failures or service interruptions due to storage exhaustion.

[0103] S203. Perform a format transcoding operation on the document summary to obtain a preview document, and store the preview document in the shared cache directory.

[0104] By converting the format, the summary is transformed into a preview document that can be directly rendered by the front end, without requiring users to install any additional plugins. This allows users to quickly grasp key information and enhances the practical value of the document preview function. After generating the preview document, the summary is stored in a shared cache directory. When users access the document later, it can be read directly from the shared cache directory, resulting in a fast response, reducing the resource consumption caused by repeated transcoding, and shortening the response time of subsequent previews.

[0105] In some embodiments, the generated document summary of the target document is saved to a shared cache directory according to the naming rule "MD5+yyyymmdd", such as " / mnt / inaisfs / file-cache / {md5+yyyymmdd} / abstract.md". This summary can be directly reused during subsequent previews without repeatedly calling the model, further reducing resource consumption.

[0106] S204. Pass the preview document to the front-end preview interface to display the preview content of the target document on the front-end preview interface.

[0107] As a storage abstraction service for the AI ​​platform, the istorage service itself does not have document rendering capabilities. It needs to integrate the OnlyOffice service's preview capabilities into its own service flow through scripts (JavaScript, JS) files. The OnlyOffice service's JS file encapsulates the core document preview capabilities, including key APIs for initializing the preview editor, rendering the transcoded document, and controlling the preview interface interaction. The OnlyOffice JS file is only accessible to components within the AI ​​cluster (such as the istorage service). External networks cannot obtain the JS file or call the OnlyOffice service through this IP address, thus avoiding the risk of document data leakage due to unauthorized external access.

[0108] After the OnlyOffice service finishes processing, it returns the preview document to the front-end preview interface (view.html) generated by the Istorage service via the API of the JS file, triggering the document rendering logic of the OnlyOffice service, so that users can see interactive preview content in the browser.

[0109] In some embodiments, the document metadata of the target document is integrated through an integrated storage service, and then the document metadata is injected into a preset template to generate a front-end preview interface.

[0110] Specifically, the iStorage service uses the Thymeleaf template engine to integrate the target document's metadata, then injects the metadata into a pre-defined view.html template, ultimately generating a complete HTML preview page. Thymeleaf is a server-side template engine in the Java ecosystem that supports combining backend data with HTML templates to generate dynamic pages.

[0111] For example, in the front-end preview interface, the document name is displayed at the top, and the preview user information is displayed in the upper right corner.

[0112] Based on the aforementioned embodiments, a document summary is first loaded and presented either directly or as a floating prompt. In response to the user's input in the front-end interface to select full transcoding of the target document, a format transcoding operation is performed on the target document to obtain a full preview document, which is then stored in a shared cache directory.

[0113] Suppose a user is viewing a 100MB CSV file. The front-end preview interface first displays "Column Names: User ID (int), Transaction Amount (float), Transaction Time (datetime); First 10 rows sample: [1001, 299.9, 2025-10-01]...". If the user determines the current preview content meets their needs, a full transcoding is triggered. The original target document is downloaded, and its format is transcoded to obtain the full preview document. This full preview document is then saved to a shared cache directory using the naming convention "MD5+yyyymmdd". It can be reused for subsequent previews without repeated transcoding, further reducing resource consumption.

[0114] The previous lightweight summary preview provided users with a quick decision-making entry point, while the full transcoding function serves as a supplement for in-depth use, covering all scenarios from initial screening to advanced use. Users can choose whether to perform full transcoding through the front-end interface, which not only gives users control over the preview method, avoiding passively waiting for full transcoding or being unable to view the complete content, but also allows system resources to be focused on scenarios that truly require full preview, achieving a win-win situation for user experience and resource efficiency.

[0115] In some embodiments, based on the preview control parameters included in the preview trigger request, a target operation control corresponding to the preview control parameters is set in the front-end preview interface. The target operation control includes at least one of a download control, a print control, an annotation control, and a preview mode control. Alternatively, based on the language type included in the preview trigger request, the front-end preview interface corresponding to the language type can be loaded.

[0116] For example, the OnlyOffice service automatically loads the preview interface in the language specified in the preview trigger request, such as... Figure 4A The Chinese text displayed is "File-View". Figure 4B The English text "File-View" is displayed, eliminating the need for manual switching by the user. For example, in preview requests for confidential documents, the control parameters can hide download and print controls to prevent document leaks; in scenarios requiring collaborative editing, annotation controls can be displayed to support multiple users' annotations.

[0117] The above embodiments dynamically display or hide controls such as download, print, annotation, and preview modes based on parameters, achieving precise matching of permissions and functions. This dynamic configuration mechanism allows the front-end preview interface to flexibly adjust according to different scenarios and adapt to different business needs, ensuring document security while improving operational convenience. The combination of personalized operation controls and a localized language interface allows users with different needs and backgrounds to obtain a smooth preview experience, enhancing user stickiness and satisfaction with the AI ​​platform and further improving the closed-loop experience of the document preview service.

[0118] In AI platform document preview scenarios, if the preview is successful, the view.html page can be directly loaded to display the document, reducing the operation path. However, the preview process involves multiple steps such as permission verification, file recognition, and transcoding. An error in any step can lead to failure. If only error codes (such as "403" or "500") are returned, users without technical backgrounds may find it difficult to understand the problem and may even misjudge it as a platform malfunction. This application's iStorage service uses pre-defined error scenario judgment logic. When an error is triggered at a certain step, it matches the corresponding error message and renders the error.html page. This provides a visual HTML page (error.html) that intuitively indicates the cause of the error (such as "You do not have preview permission for this document" or "File size exceeds the 100MB limit"), and can also include solution suggestions (such as "Contact the administrator to apply for permission" or "Compress the file and try again"), reducing the cost for users to understand and resolve the problem.

[0119] The Thymeleaf template engine supports injecting dynamic error information into the error.html template. For example, when an "insufficient permissions" error is detected, iStorage encapsulates the error type "permission_denied" and the message "You do not have permission to access this document, please contact the administrator" into the "Model," then specifies the "View" as the error.html template, and returns the integrated error page to the browser using the ModelAndView pattern. This approach avoids the redundancy of developing separate static pages for each error and allows for the dynamic generation of personalized prompts based on different error scenarios.

[0120] In summary, the document preview method provided in this application employs differentiated processing strategies for documents of different types and sizes in terms of transcoding efficiency and resource utilization. For large text documents, structured summaries are generated using pre-trained inference models such as DistilBART-xsum-12-6. For large data documents, column names and partial row data are extracted to construct the preview core. Multi-node parallel transcoding overcomes the efficiency bottleneck of single nodes, while an on-demand transcoding mechanism avoids redundant computation, allowing the core computing power of the AI ​​cluster to focus on critical tasks. In terms of cache management, a shared cache directory and a unique identifier rule of "MD5 value + timestamp" enable cluster-level transcoding resource reuse. Combined with configurable retention duration and capacity thresholds, and a dual intelligent cleanup strategy, this ensures both cache timeliness and storage security while preventing space overflow, achieving dynamic balance of storage resources. In terms of user experience and functionality, the front-end supports dynamic configuration of operation controls such as download, print, and annotation based on preview control parameters, and combines multi-language interface loading to meet personalized and global needs. It also offers a dual option of lightweight summary preview and user-triggered full transcoding, covering all scenarios from quick filtering to in-depth use. Regarding service stability and scalability, multi-node redundant deployment, shared storage architecture, and fault tolerance mechanisms improve service availability in distributed scenarios, while modular design and standardized components (such as the Thymeleaf template engine and OnlyOffice service) reduce the cost of feature expansion and maintenance, and can adapt to various document formats and cluster deployment requirements.

[0121] like Figure 5 The illustrated document preview method's workflow architecture begins with the client establishing a connection with the UI layer's iVision service. The client retrieves the list of files to be previewed and sends a preview request. Upon receiving the request, the UI layer's iVision service reads configuration parameters to determine the target document's path, storage name, and type. Simultaneously, it forwards the user's data and storage request to the backend's iStorage service, forming the interaction hub between the frontend and backend.

[0122] The backend iStorage service first performs permission checks and verifies basic file information, including whether permissions are exceeded, file existence, size, and type. If the verification fails, an error message is returned. If the verification passes, the cache is checked based on the file's MD5 value. If a cache directory exists that starts with the MD5 value, the cache is directly reused and an identifier (id) is set as the directory name. If it does not exist, a unique ID containing the MD5 value and the transcoding timestamp (yyyyMMddHHmmss) is generated to achieve precise cache location and uniqueness management. Subsequently, the backend iStorage service configures key parameters for OnlyOffice, including file name, file download path, language type, preview user information, and interface controls (such as disabling download and print buttons), adapting to the frontend's personalized configuration needs.

[0123] Document transcoding and caching management can be collaboratively handled by the primary and secondary replicas (OnlyOffice). Multiple replicas share a cache directory (e.g., *** / file-cache), uniformly generating and reusing preview caches to avoid redundant transcoding and improve resource utilization. Simultaneously, by setting JWT_SECRET through the JWT authentication mechanism, preview trigger requests from the backend isite service must include authentication information. Combined with the Secure Sockets Layer (SSL) certificate of the AI ​​platform UIivision service, this ensures that all requests are transmitted via Hypertext Transfer Protocol Secure (HTTPS) with unchanged domain names, achieving data security without requiring security trusts and compensating for the shortcomings of permission control in comparison files. Furthermore, replicas forward data requests, perform disk write processing, and data synchronization to maintain service consistency.

[0124] In the result return process, the backend iStorage service calls the internal download interface (only available in AI cluster OnlyOffice and requires JWT certification) to obtain the transcoding result, generate a preview view (ModelAndView, view.html) or an error view (error.html), and feed it back to the client through the UI layer iVision service. The entire process maintains the same domain name for redirection, improving the continuity of the user experience.

[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to 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.

[0126] like Figure 6 As shown, embodiments of this application also provide a document preview device, the device comprising:

[0127] The judgment module 601 is used to respond to the preview trigger request of the target document through the backend document service, and determine whether there is a preview document corresponding to the target document in the shared cache directory of the artificial intelligence platform based on the document identifier carried in the preview trigger request; wherein, the backend document service is a backend service built on document office software that supports document preview, transcoding and collaboration functions; the shared cache directory includes preview documents transcoded by different nodes of the artificial intelligence platform;

[0128] Download module 602 is used to download the target document if a preview document corresponding to the target document does not exist;

[0129] The document summarization module 603 is used to generate a document summary of the target document based on the target document and a pre-trained inference model if the target document is a text document and its size exceeds a set threshold. The pre-trained inference model is used to perform semantic recognition on the document name and part of the content to generate a structured document summary.

[0130] Transcoding module 604 is used to perform format transcoding on the document summary to obtain a preview document and store the preview document in a shared cache directory;

[0131] The delivery module 605 is used to deliver the preview document to the front-end preview interface so that the preview content of the target document can be displayed on the front-end preview interface.

[0132] As an optional implementation provided in this application, the judgment module 601 is further configured to: determine whether the preview trigger request comes from the internal whitelist of the artificial intelligence platform based on the document security token included in the preview trigger request.

[0133] As an optional implementation provided in this application, the transmission module 605, after transmitting the preview document to the front-end preview interface to display the preview content of the target document on the front-end preview interface, is further configured to: respond to the user's input in the front-end preview interface to select full transcoding of the target document, perform a format transcoding operation on the target document to obtain a full preview document, and store the full preview document in a shared cache directory; and transmit the full preview document to the front-end preview interface.

[0134] As an optional implementation provided in this application, the document summary generation module 603 is further configured to: if the target document is a data document and its size exceeds a set threshold, generate a document summary of the target document based on the column names and some row data of the target document.

[0135] As an optional implementation provided in this application, the transcoding module 604, when storing the preview document to the shared cache directory, is specifically used to: determine the transcoding timestamp of the preview document; determine the transcoding directory of the preview document based on the transcoding timestamp and the hash value of the target document; and associate the transcoding directory of the preview document with the shared cache directory.

[0136] As an optional implementation provided in this application, the document summary generation module 603 is further configured to: if no preview document corresponding to the target document exists, download the original target document; distribute the transcoding task of the target document to at least two nodes in the artificial intelligence platform, so as to utilize the processor resources of at least two nodes to perform format transcoding operation on the target document to obtain at least two preview documents; wherein, at least two nodes share storage, and the shared storage is mounted in the shared cache directory of the artificial intelligence platform; and store at least two preview documents and document identifiers corresponding to each other in the shared cache directory.

[0137] As an optional implementation provided in this application, the transmission module 605 is further configured to: set the target operation control corresponding to the preview control parameters in the front-end preview interface according to the preview control parameters included in the preview trigger request; the target operation control includes at least one of a download control, a print control, an annotation control, and a preview mode control; and load the front-end preview interface corresponding to the language type according to the language type included in the preview trigger request.

[0138] As an optional implementation provided in this application, the device further includes a service deployment module, configured to: obtain a configuration file for a backend document service, the configuration file including deployment resources and service resources; apply the configuration file in a container orchestration tool to deploy a container image of the backend document service to start the backend document service; initiate a verification request in the container image; and determine that the backend document service has been successfully deployed if a response message from the backend document service is received.

[0139] As an optional implementation provided in this application, the transmission module 605 is further configured to integrate the document metadata of the target document through the integrated storage service. The document metadata includes at least one of the following: document identifier, document download path, document name, language type, preview user, document suffix, document creation time, and document owner; and inject the document metadata into a preset template to generate a front-end preview interface.

[0140] For a description of the features in the embodiment corresponding to the document preview device, please refer to the relevant description of the embodiment corresponding to the document preview method, which will not be repeated here.

[0141] like Figure 7As shown, embodiments of this application also provide an electronic device, including a memory 701 and a processor 702, wherein the memory 701 stores a computer program, and the processor 702 is configured to run the computer program to perform the steps in any of the above-described document preview method embodiments.

[0142] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described document preview method embodiments when it is run.

[0143] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0144] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described document preview method embodiments.

[0145] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described document preview method embodiments.

[0146] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0147] The foregoing has provided a detailed description of a document preview and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the methods and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method of document previewing, characterized by, A management node applied to an artificial intelligence platform, comprising: In response to a preview triggering request of a target document, judging whether a preview document corresponding to the target document exists in a shared cache directory of the artificial intelligence platform according to a document identifier carried in the preview triggering request, wherein the shared cache directory comprises preview documents converted by different nodes of the artificial intelligence platform. If the preview document corresponding to the target document does not exist, downloading the target document. If the target document is a text document and its size exceeds a set threshold, obtaining a document abstract of the target document based on the target document and a pre-trained inference model, wherein the pre-trained inference model is used for semantic recognition of a document name and part of content to generate a structured document abstract. Performing a format conversion operation on the document abstract to obtain a preview document, and storing the preview document in the shared cache directory. Passing the preview document to a front-end preview interface to display preview content of the target document on the front-end preview interface.

2. The method of claim 1, wherein, Before the step of judging whether the preview document corresponding to the target document exists in the shared cache directory of the artificial intelligence platform according to the document identifier carried in the preview triggering request, the method further comprises: Determining whether the preview triggering request is from an internal white list of the artificial intelligence platform according to a document security token included in the preview triggering request.

3. The method of claim 1, wherein, After the step of passing the preview document to the front-end preview interface to display the preview content of the target document on the front-end preview interface, the method further comprises: In response to an input of a user in the front-end preview interface selecting full-amount conversion of the target document, performing a format conversion operation on the target document to obtain a full-amount preview document, and storing the full-amount preview document in the shared cache directory. Passing the full-amount preview document to the front-end preview interface.

4. The method of claim 1, wherein, After the step of downloading the target document if the preview document corresponding to the target document does not exist, and before the step of performing a format conversion operation on the document abstract to obtain a preview document, and storing the preview document in the shared cache directory, the method further comprises: If the target document is a data document and its size exceeds a set threshold, generating a document abstract of the target document based on column names and part of row data of the target document.

5. The method of claim 1, wherein, Storing the preview document in the shared cache directory comprises: Determining a conversion timestamp of the preview document. Determining a conversion directory of the preview document according to the conversion timestamp and a hash value of the target document. Associating the conversion directory of the preview document to the shared cache directory.

6. The method of claim 1, wherein, If the preview document corresponding to the target document does not exist, after the target document is downloaded, and before the format conversion operation is performed on the document abstract to obtain the preview document and the preview document is stored in the shared cache directory, the method further comprises: distributing the target document conversion task to at least two nodes in the artificial intelligence platform to perform format conversion operation on the target document to obtain at least two preview documents using the processor resources of the at least two nodes; wherein the at least two nodes share storage, and the shared storage is mounted under the shared cache directory of the artificial intelligence platform; storing the at least two preview documents corresponding to the document identifier in the shared cache directory.

7. The method of claim 1, wherein, After the preview document is delivered to the front-end preview interface to display the preview content of the target document in the front-end preview interface, the method further comprises: According to the preview control parameters included in the preview trigger request, set the target operation control corresponding to the preview control parameters in the front-end preview interface; the target operation control includes at least one of download control, print control, annotation control and preview mode control; According to the language type included in the preview trigger request, load the front-end preview interface corresponding to the language type.

8. The method of claim 1, wherein, Before the preview trigger request of the target document is responded by the back-end document service, and whether the preview document corresponding to the target document exists in the shared cache directory of the artificial intelligence platform is determined according to the document identifier carried in the preview trigger request, the method further comprises: obtain the configuration file of the back-end document service, the configuration file includes deployment resources and service resources; apply the configuration file in the container orchestration tool, deploy the container image of the back-end document service to start the back-end document service; in the container image, initiate a verification request; if the response message of the back-end document service is received, it is determined that the back-end document service is deployed successfully.

9. The method of claim 1, wherein, Before the preview document is delivered to the front-end preview interface to display the preview content of the target document in the front-end preview interface, the method further comprises: Integrate the document metadata of the target document through the integrated storage service, the document metadata includes at least one of document identifier, document download path, document name, language type, preview user, document suffix, document creation time and document owner; inject the document metadata into the preset template to generate the front-end preview interface.

10. An electronic device, comprising: comprise: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the document preview method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Service document printing method and device and computer readable medium

    CN114281276A

  • Document online preview method and device, electronic equipment and readable storage medium

    CN119692302A