Method for realizing local off-line preview of document at mobile terminal and related equipment thereof

By locally compiling the source code of the office suite on the Android side and combining the document format conversion tool to generate the target document format conversion tool, the limitations of local offline preview of Android-side office documents in the existing technology are solved, and efficient and stable document preview is achieved. , improves the user experience.

CN119474010APending Publication Date: 2025-02-18CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411495431.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing Android side realizes local offline preview of office documents, such as relying on external services, insufficient format compatibility, and poor rendering effects, which leads to many inconveniences and challenges when users face higher quality preview experiences in a network-free environment or pursuing a higher quality preview experience.

Method used

By obtaining the source code of the preset office suite and compiling it into a shared library file, and encapsulate it with the document operation package of the preset document format conversion tool, the target document format conversion tool can be generated, and Office documents can be previewed locally and offline on the mobile terminal and put them in Convert to a pre-determined format (such as PDF) for display.

Benefits of technology

It realizes efficient and stable local offline preview of various office document formats on Android devices, avoiding the problems of relying on external services, poor format compatibility and poor rendering effects, and significantly improving the user's document preview experience in a network-free environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The invention discloses a method for realizing local off-line preview of a document at a mobile terminal and related equipment thereof, and belongs to the technical field of research and development management. The method comprises the following steps: acquiring a source code of an office suite, and compiling the source code to obtain a shared library file; a document operation package of a preset document format conversion tool is obtained, and the preset document format conversion tool is a document format conversion tool which can be used in the first development environment; the shared library file and the document operation package are packaged, a target document format conversion tool is obtained, and the target document format conversion tool is a document format conversion tool which can be used in the second development environment; converting the format of the to-be-previewed document into a predetermined format by using a target document format conversion tool; and displaying the to-be-previewed document in a display form of a predetermined format. The invention further relates to the technical field of block chains, and the to-be-previewed document is stored in a block chain network. According to the method and the device, the document preview experience of a user in a mobile terminal network-free environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of R&D management technology, and specifically relates to a method for implementing local offline preview of documents on a mobile terminal and related equipment. Background Art

[0002] With the rapid development of mobile Internet technology and the popularization of smart terminal devices, previewing Office documents on mobile devices has become an indispensable function for users in their daily work, study and life. This demand has prompted many developers and companies to invest in the research and development and optimization of related technologies to meet the needs of users to view and edit documents anytime and anywhere in different scenarios.

[0003] Implementing local offline preview of office documents on Android means that on mobile devices (such as smartphones or tablets) running the Android operating system, documents in the Microsoft Office suite, including files in Word, Excel, PowerPoint and other formats, can be directly viewed and previewed without a network connection.

[0004] There are many mainstream solutions for implementing office document preview on Android, but they all have corresponding limitations. For example, TBSReader's preview service relies on an external x5 kernel for rendering, and relying on an external kernel may lead to a decrease in application performance and stability, especially when processing large or complex Office documents, and there is no guarantee that the kernel can be loaded successfully every time; for another example, the preview service that comes with Office can only preview online office documents, not local ones; and although Apache POI's preview service can parse word and excel documents, it will generate header style errors when parsing ppt documents. At the same time, Apache POI uses Java's AWT (AbstractWindow Toolkit) library when processing documents, but the AWT library is not suitable for the Android platform, which means that the use of Apache POI on Android may be restricted or require additional adaptation work.

[0005] None of the above preview services can perfectly realize local offline preview of office documents on Android, because they have their own limitations, such as dependence on external services, insufficient format compatibility, poor rendering effect, etc., which causes users to face many inconveniences and challenges when they are in an off-network environment or pursuing a higher-quality preview experience. Summary of the invention

[0006] The purpose of the embodiments of the present application is to propose a method, apparatus, computer device and storage medium for implementing local offline preview of documents on a mobile terminal, so as to solve the technical problem that the existing Android terminal has its own limitations in implementing local offline preview of office documents, resulting in many inconveniences and challenges faced by users in an off-network environment or when pursuing a higher quality preview experience.

[0007] In order to solve the above technical problems, the embodiment of the present application provides a method for implementing local offline preview of documents on a mobile terminal, which adopts the following technical solution:

[0008] A method for implementing local offline preview of a document on a mobile terminal, comprising:

[0009] Obtain the source code corresponding to the preset office suite, and compile the source code to obtain a shared library file;

[0010] Obtaining a document operation package of a preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment;

[0011] Encapsulating the shared library file and the document operation package to obtain a target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment;

[0012] Obtain the document to be previewed, and use a target document format conversion tool to convert the format of the document to be previewed into a predetermined format;

[0013] The document to be previewed is displayed on the mobile terminal interface in a predetermined format.

[0014] Further, the steps of obtaining source code corresponding to the preset office suite and compiling the source code to obtain a shared library file specifically include:

[0015] Determine a production environment of a preset office suite, and determine a code format corresponding to the source code based on the production environment of the preset office suite to obtain a first code format;

[0016] Determine a production environment corresponding to the second development environment, and determine a code format used by a target document format conversion tool based on the production environment corresponding to the second development environment to obtain a second code format;

[0017] Determine a matching compilation tool based on the first code format and the second code format;

[0018] Use the matching compilation tool to compile the source code to obtain the shared library file.

[0019] Furthermore, the steps of using a matching compilation tool to compile the source code to obtain a shared library file specifically include:

[0020] The source code is divided according to the functional division of the preset office suite to obtain several source code fragments;

[0021] Use a matching compilation tool to compile each source code fragment to obtain several library files;

[0022] Adapt each library file to the platform of the second development environment respectively;

[0023] The library files adapted to the platform of the second development environment are combined to obtain a shared library file.

[0024] Furthermore, before encapsulating the shared library file and the document operation package to obtain the target document format conversion tool, the method further includes:

[0025] Creating a bridge interface adapted to the production environment of the preset office suite and the first development environment, wherein the bridge interface is used to implement communication between the preset office suite and the preset document format conversion tool;

[0026] Use the bridge interface to connect the default office suite and the default document format conversion tool.

[0027] Further, the steps of connecting the preset office suite and the preset document format conversion tool using the bridge interface specifically include:

[0028] Reading the production code corresponding to the preset office suite line by line through the bridge interface to obtain a first code line sequence;

[0029] Reading the production code corresponding to the preset document format conversion tool line by line through the bridge interface to obtain a second code line sequence;

[0030] Compare the first code line sequence with the second code line sequence to obtain detailed information of code interaction;

[0031] According to the detailed information of the code interaction, a bridge interface is used to connect the preset office suite with the preset document format conversion tool.

[0032] Further, the step of obtaining the document to be previewed and converting the format of the document to be previewed into a predetermined format using a target document format conversion tool specifically includes:

[0033] Build an asynchronous processing task queue and store the documents to be previewed in the asynchronous processing task queue;

[0034] Read the document to be previewed from the asynchronous processing task queue by asynchronous loading;

[0035] Use the target document format conversion tool to convert the format of the read document to be previewed into a predetermined format.

[0036] Furthermore, the document to be previewed is displayed on the interface of the mobile terminal in a predetermined format, specifically including:

[0037] Get the preset document display tool;

[0038] Use a document display tool to render the document to be previewed in a predetermined format;

[0039] The rendered document to be previewed is displayed on the mobile interface.

[0040] In order to solve the above technical problems, the embodiment of the present application further provides a device for implementing local offline preview of documents on a mobile terminal, which adopts the following technical solution:

[0041] A device for implementing local offline preview of a document on a mobile terminal, comprising:

[0042] A compilation module is used to obtain the source code corresponding to the preset office suite and compile the source code to obtain a shared library file;

[0043] An operation package module, used to obtain a document operation package of a preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment;

[0044] The encapsulation module is used to encapsulate the shared library file and the document operation package to obtain a target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment;

[0045] The conversion module is used to obtain the document to be previewed and convert the format of the document to be previewed into a predetermined format using a target document format conversion tool;

[0046] The display module is used to display the document to be previewed in a predetermined format on the interface of the mobile terminal.

[0047] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0048] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the method for realizing local offline preview of a document on a mobile terminal as described in any one of the above items are implemented.

[0049] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0050] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the method for implementing local offline preview of a document on a mobile terminal as described in any one of the above.

[0051] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0052] The present application discloses a method for realizing local offline preview of documents on a mobile terminal and its related equipment, belonging to the field of research and development management technology. The present application obtains the source code of an office suite and compiles the source code to obtain a shared library file; obtains a document operation package of a preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in a first development environment; encapsulates the shared library file and the document operation package to obtain a target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in a second development environment; obtains the document to be previewed, and uses the target document format conversion tool to convert the format of the document to be previewed into a predetermined format; and displays the document to be previewed in a predetermined format on the interface of the mobile terminal. The present application compiles and integrates the source code of the office suite locally on the mobile terminal, and combines the document format conversion tools in other environments to create a document format conversion tool that can be used offline in an Android environment. The tool can convert Office documents into a predetermined format and display them on the interface through a preview component, realizing an efficient offline document preview function, avoiding the problems of relying on external services, poor format compatibility and poor rendering effects, and improving the user's preview experience in a network-free environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0054] Figure 1 An exemplary system architecture diagram is shown in which the present application can be applied;

[0055] Figure 2 A flowchart of an embodiment of a method for implementing local offline preview of a document on a mobile terminal according to the present application is shown;

[0056] Figure 3 A structural schematic diagram of an embodiment of a device for implementing local offline preview of a document on a mobile terminal according to the present application is shown;

[0057] Figure 4A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0059] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0060] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

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

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

[0063] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0064] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0065] It should be noted that the method for implementing local offline preview of documents on a mobile terminal provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the device for implementing local offline preview of documents on a mobile terminal is generally set in the server / terminal device.

[0066] It should be understood that Figure 1 The numbers of terminal devices, networks and servers in the embodiment are merely illustrative. The above system may have any number of terminal devices, networks and servers according to implementation requirements.

[0067] For example, taking the implementation of local offline document preview on Android mobile terminals as an example, in order to solve the technical problem that the existing Android terminals have their own limitations in implementing local offline preview of office documents, which causes users to face many inconveniences and challenges when they are in a networkless environment or pursue a higher quality preview experience. This application will be implemented through the following steps:

[0068] Compile the source code corresponding to the preset office suite (exemplarily, such as LibreOffice source code) into a shared library file (exemplarily, such as an SO library) available for Android, and use a compilation tool (exemplarily, such as a Native Development Kit, i.e., NDK tool) to compile the C / C++ source code of LibreOffice into a shared library SO library suitable for Android, so that it can run on an Android mobile device.

[0069] A document operation package (exemplarily, such as a jar package) integrating a preset document format conversion tool (exemplarily, such as the JODConverter tool): JODConverter is a Java-based document format conversion tool for converting documents from one format to another. In this solution, JODConverter interacts with the LibreOffice shared library compiled by the NDK through a bridge interface (exemplarily, such as the JavaNative Interface, JNI interface).

[0070] Encapsulate the target document format conversion tool (exemplarily, such as encapsulating it into a Lib library): encapsulate the SO library and JODConverter to make it a document format conversion tool suitable for the Android development environment, namely, the Lib library. This Lib library will be able to implement document format conversion in Android applications.

[0071] Document format conversion: When a user opens an Office document on a mobile device, the encapsulated Lib library is used to convert the document (such as Word, Excel, PPT, etc.) into PDF format.

[0072] PDF display: The converted document is displayed on the Android device through a document display tool (for example, a PDFViewer component).

[0073] It should be noted that the various specific tools or components appearing in the embodiments of the present application are only used for illustrative purposes and do not represent actual use.

[0074] Continue to refer Figure 2 , showing a flowchart of an embodiment of a method for implementing local offline preview of documents on a mobile terminal according to the present application. The following is a specific description of the method for implementing local offline preview of documents on a mobile terminal disclosed in the present application based on the various exemplary specific tools or components described above. The method for implementing local offline preview of documents on a mobile terminal includes:

[0075] S201, obtaining source code corresponding to a preset office suite, and compiling the source code to obtain a shared library file.

[0076] Specifically, LibreOffice is an open source office suite that supports the processing of multiple document formats, such as Word, Excel, PowerPoint, etc. The core part of LibreOffice is written in C / C++. When these codes need to be executed on Android devices, they must be compiled into shared library files (SO libraries) suitable for the Android architecture through the Android NDK (Native Development Kit) compilation tool. This process includes obtaining the community version source code of LibreOffice and adjusting its configuration to adapt to the architecture and environment of the Android system, especially the resource limitations of mobile devices. The code needs to be trimmed during compilation, retaining only the functional modules related to document format conversion and rendering to avoid wasting system resources. The final generated SO library file will be used on Android devices, allowing applications to call local C / C++ code to achieve fast and efficient document processing.

[0077] S202: Obtain a document operation package of a preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in a first development environment.

[0078] Specifically, JODConverter is a tool dedicated to document format conversion, running in the Java environment. JODConverter can convert Office documents to other formats, such as PDF, by calling LibreOffice functions. In order for JODConverter to work in Android, you need to obtain its core document operation packages, which usually include Java code, dependent libraries, and related configuration files. The functions of JODConverter are mainly completed by interacting with LibreOffice in Java, so the toolkit allows Java code to control LibreOffice's document conversion operations. The flexibility of JODConverter lies in its support for multiple document formats and its ability to handle complex format conversion processes, but JODConverter itself needs to rely on the Java environment. Since Android also supports Java, it can be combined with LibreOffice's native shared library (SO library) through the JNI (JavaNative Interface) interface to achieve efficient conversion of Android documents.

[0079] S203, encapsulating the shared library file and the document operation package to obtain a target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment.

[0080] Specifically, the purpose of encapsulating the SO library and JODConverter's document operation package is to enable the Android system to call these libraries and implement document conversion functions. This process requires combining the SO library with JODConverter to create a Lib library suitable for the Android development environment. The core of this encapsulation process is to bridge the native code and Java code through JNI to ensure that the Android application can call the functions implemented by the underlying C / C++ code at the Java code level. For example, when a user opens a document in an Android application, the Lib library will first pass the operation instructions to JODConverter, and then call the compiled LibreOffice SO library through JNI to handle the document format conversion. The encapsulated Lib library must ensure compatibility with different document formats, and optimize resource management to ensure smooth operation on Android devices with limited resources. In addition, the encapsulated Lib library must also provide a clear API interface to facilitate Android developers to directly call the document conversion function.

[0081] S204, obtaining the document to be previewed, and using a target document format conversion tool to convert the format of the document to be previewed into a predetermined format.

[0082] Specifically, when a user uploads or opens a document (such as Word, Excel, or PPT) through a mobile application, the system will first obtain the original format of the document and start the document format conversion process through the previously encapsulated Lib library. The process begins with JODConverter being responsible for accepting user requests and passing the document format to the JNI interface. At the JNI layer, the compiled LibreOffice SO library is called to handle the document conversion. This conversion process involves multiple steps, such as parsing the document's metadata, reading the document content, and mapping the content to the target format (such as PDF). For large documents or complex formats, the conversion tool also needs to handle the compatibility and display effects of multiple document elements such as fonts, images, and tables. Finally, the conversion tool converts the original document to the target format (such as PDF) and stores it locally. During the conversion process, the system needs to ensure efficient resource management and use asynchronous operations to avoid the conversion process blocking the user interface and affecting the user experience.

[0083] S205: Display the document to be previewed in a predetermined format on the interface of the mobile terminal.

[0084] Specifically, the converted document (usually in PDF format) will be displayed through the PDFViewer component on the mobile terminal. PDFViewer is a commonly used document display tool in Android applications, allowing users to view PDF documents and providing basic interactive functions, such as zooming, scrolling, and paging browsing. In this process, the application loads the locally stored PDF file and renders it to the user's screen. The displayed interface must not only be able to display the document content smoothly, but also provide a good user experience, such as fast page loading, smooth scrolling experience, and support for user gesture operations. In order to optimize the preview effect, the system can preload some pages to avoid delays when the user scrolls. At the same time, the document display component can be integrated with other functions, such as supporting text search, annotations, and tags, to enhance the user's document browsing experience. PDFViewer provides users with a smooth and controllable offline document preview experience through efficient rendering mechanisms and flexible interactive operations.

[0085] In the above embodiment, an efficient method for previewing documents locally and offline on an Android mobile terminal is implemented. First, the community version source code of LibreOffice is obtained and compiled, and converted into a shared library file (SO library) suitable for the Android system, so that the application can execute local C / C++ code in the Android environment, thereby having powerful document processing capabilities. Secondly, the document operation package of JODConverter is obtained, which is a tool for document format conversion in a Java development environment. By encapsulating the shared library file and the document operation package, a target document format conversion tool (Lib library) is generated so that it can be called in an Android development environment. When a user needs to preview a document, the application uses the target document format conversion tool to convert the Office document to be previewed (such as Word, Excel, PPT, etc.) into a predetermined format (such as PDF). Finally, the PDFViewer component is used to display the converted document in high quality on the mobile terminal interface. It realizes the local, efficient, and offline preview of multiple office document formats on Android devices, avoiding problems such as dependence on external services, poor format compatibility, and poor rendering effects, significantly improving the user's document preview experience in a non-network environment, and reducing development and maintenance costs by using open source tools.

[0086] Further, the steps of obtaining source code corresponding to the preset office suite and compiling the source code to obtain a shared library file specifically include:

[0087] Determine a production environment of a preset office suite, and determine a code format corresponding to the source code based on the production environment of the preset office suite to obtain a first code format;

[0088] Determine a production environment corresponding to the second development environment, and determine a code format used by a target document format conversion tool based on the production environment corresponding to the second development environment to obtain a second code format;

[0089] Determine a matching compilation tool based on the first code format and the second code format;

[0090] Use the matching compilation tool to compile the source code to obtain the shared library file.

[0091] In this embodiment, it is first necessary to determine the production environment of the preset office suite, such as the LibreOffice office suite, whose code is mainly written in C / C++ language. The key to this step is to identify and analyze the source code of the office suite, clarify its code structure, functional modules and the compiler and tool chain used for development. Then, according to the characteristics of the Android development environment, it is necessary to determine the code format used by the target document format conversion tool. Here, Android development mainly uses Java, but when it is necessary to efficiently execute local C / C++ code, it must be compiled into an Android executable SO library file with the help of the compilation tool NDK (Native Development Kit). Therefore, the conversion from C / C++ code to an Android system-compatible SO library is achieved by a matching compilation tool (i.e., NDK tool).

[0092] The specific process includes inputting the LibreOffice source code into the NDK tool, and then generating a shared library file that can be called on an Android device through a series of compilation, linking, and optimization processes. In this way, the system can call the underlying code written in C / C++ at the Java layer through the JNI (Java Native Interface) interface to maintain efficient document processing capabilities. At the same time, the compilation process must ensure compatibility with the Android device architecture (such as the ARM architecture) and optimize resource usage to adapt to the performance limitations of mobile devices.

[0093] Through the above steps, the C / C++-based office suite was converted into a shared library (SO library) that can be executed in the Android environment, allowing the system to locally call efficient document processing functions and improve the performance of document format conversion and rendering. Ultimately, this solution ensures efficient and stable execution of complex document preview tasks on Android devices, improving the user's document viewing experience in an offline state.

[0094] Furthermore, the steps of using a matching compilation tool to compile the source code to obtain a shared library file specifically include:

[0095] The source code is divided according to the functional division of the preset office suite to obtain several source code fragments;

[0096] Use a matching compilation tool to compile each source code fragment to obtain several library files;

[0097] Adapt each library file to the platform of the second development environment respectively;

[0098] The library files adapted to the platform of the second development environment are combined to obtain a shared library file.

[0099] In this embodiment, we first analyze the functional modules of LibreOffice in depth, such as document format parsing, table processing, image embedding, page layout and other functions, and decompose the LibreOffice source code into multiple source code fragments. Each fragment represents a different functional module. This division not only helps to optimize the compilation efficiency, but also facilitates the subsequent library file adaptation in the Android system.

[0100] Next, use the matching compilation tool, namely the NDK tool, to compile these source code snippets one by one. The NDK tool allows C / C++ code to be compiled into a library file suitable for the Android system, so each code snippet will generate an independent library file after compilation.

[0101] After the library file is generated, it needs to be adapted to the Android development environment. The adaptation process involves optimizing the library file and the Android operating system architecture (such as ARM or x86 architecture) to ensure that it can run efficiently on a specific hardware platform. This adaptation operation involves the development of the JNI interface so that Android applications can call the underlying C / C++ code through Java code.

[0102] After all library files are successfully adapted to the Android environment, these successfully adapted library files are combined to generate a final shared library file, namely Android's SO library. This shared library file will integrate the functions of all modules and can be directly called by the Android system to realize the complete functions of document format processing and conversion.

[0103] Through the above steps, the large office suite code is modularized, gradually compiled and adapted to the Android system, and finally an efficient shared library file is generated. This not only improves the efficiency of document preview and conversion, but also reduces system resource usage through modular compilation, ensuring that complex document processing tasks can be smoothly executed on Android devices.

[0104] Furthermore, before encapsulating the shared library file and the document operation package to obtain the target document format conversion tool, the method further includes:

[0105] Creating a bridge interface adapted to the production environment of the preset office suite and the first development environment, wherein the bridge interface is used to implement communication between the preset office suite and the preset document format conversion tool;

[0106] Use the bridge interface to connect the default office suite and the default document format conversion tool.

[0107] In this embodiment, it is first necessary to identify the production environment of the LibreOffice office suite, that is, the development environment based on the C / C++ language. The community version of LibreOffice source code is written in C / C++, which can provide powerful document processing and format conversion capabilities. The goal of this step is to enable the LibreOffice office suite to communicate with the JODConverter tool developed based on Java.

[0108] Because Android applications usually run in a Java environment, the JNI (Java Native Interface) interface is needed to bridge the LibreOffice office suite and the JODConverter tool. The main function of the JNI interface is to establish a communication bridge between Java code and native C / C++ code, so that the Java program can call the underlying C / C++ code functions. Therefore, the JNI interface must first be designed and implemented at the C / C++ level so that it can forward Java requests to the core functional modules of LibreOffice to perform document conversion, rendering and other operations. The process of creating this interface requires ensuring the correct handling of issues such as parameter passing and memory management to avoid incompatibilities between different programming languages.

[0109] Next, you need to write the corresponding JNI call code at the Java level to ensure that the Java tool JODConverter can interact with the C / C++ code of LibreOffice through the JNI interface. JODConverter is a document format conversion tool used in the Java environment, which can achieve conversion between multiple document formats through LibreOffice. Under the bridge of JNI, JODConverter can use the powerful document processing capabilities of LibreOffice to delegate the document conversion tasks received in Java to the C / C++ code for execution, and then return the results to the Java application after the conversion is completed.

[0110] Through the above steps, the Java development environment and the production environment of the C / C++ office suite are seamlessly connected, allowing Android applications to call LibreOffice's document processing capabilities through JODConverter and JNI interfaces. In this way, the system can efficiently perform conversions in multiple document formats, realize local document processing and preview functions on Android devices, and greatly improve the performance and compatibility of document processing.

[0111] Further, the steps of connecting the preset office suite and the preset document format conversion tool using the bridge interface specifically include:

[0112] Reading the production code corresponding to the preset office suite line by line through the bridge interface to obtain a first code line sequence;

[0113] Reading the production code corresponding to the preset document format conversion tool line by line through the bridge interface to obtain a second code line sequence;

[0114] Compare the first code line sequence with the second code line sequence to obtain detailed information of code interaction;

[0115] According to the detailed information of the code interaction, a bridge interface is used to connect the preset office suite with the preset document format conversion tool.

[0116] In this embodiment, the production code of the LibreOffice office suite and the JODConverter tool is read line by line through the JNI interface to achieve seamless interaction and data transfer between the two. First, each line of code is extracted from the C / C++ source code of LibreOffice to form a first code line sequence, which can help the system understand the document processing logic, data structure, and function calling method of LibreOffice. At the same time, the corresponding code lines are extracted from the Java code of JODConverter to form a second code line sequence. In order to facilitate the comparison of code line sequences, the mutual calls between Java and C / C++ need to be implemented through the JNI interface, so the system needs to obtain the interaction points and data flow of the two codes.

[0117] Next, the system compares the two sequences of code lines to obtain detailed information about the code interaction, such as parameter types, data structures, function calling conventions, etc. This process not only helps the system identify which functions need to be called through the JNI interface, but also clarifies the data conversion that needs to be processed during the call (such as converting Java objects to C / C++ objects). Based on the detailed information about the code interaction, the system can more effectively design the JNI interface to connect the two. After the connection is achieved, the functions of the LibreOffice office suite can be called by JODConverter to complete tasks such as document format conversion and rendering.

[0118] Through the above steps, the code interaction between LibreOffice and JODConverter is realized, providing an efficient bridge channel for the two, allowing Android applications to flexibly call document processing functions written in C / C++, improving the flexibility and performance of document format conversion, and allowing users to smoothly preview and process various documents even in offline state.

[0119] Further, the step of obtaining the document to be previewed and converting the format of the document to be previewed into a predetermined format using a target document format conversion tool specifically includes:

[0120] Build an asynchronous processing task queue and store the documents to be previewed in the asynchronous processing task queue;

[0121] Read the document to be previewed from the asynchronous processing task queue by asynchronous loading;

[0122] Use the target document format conversion tool to convert the format of the read document to be previewed into a predetermined format.

[0123] In this embodiment, an asynchronous processing task queue is first constructed, which is designed to manage the processing tasks of documents to be previewed. Through the asynchronous task queue, the system can effectively allocate and schedule document processing tasks, thereby improving user experience and system performance. After the user selects the documents to be previewed, these documents will be stored in the task queue, allowing the system to perform document conversion operations when there are idle resources. This design can avoid interface blocking caused by document processing and improve the responsiveness of the application.

[0124] Subsequently, the system reads the document to be previewed from the task queue through asynchronous loading. The document reading and format conversion can be performed in the background, and the user can continue other operations while waiting. This method helps to improve the concurrent processing capability of the application. After using the target document format conversion tool, the read document to be previewed will be converted to a predetermined format, such as PDF format, so that it can be finally presented in the user interface.

[0125] Through the above steps, by building an asynchronous processing task queue, the solution effectively improves the processing efficiency and user experience of document preview. The asynchronous loading and processing mechanism enables users to convert documents in the background while continuing to operate the application, thereby avoiding interface freezes and response delays and ensuring a smooth user experience.

[0126] Furthermore, the document to be previewed is displayed on the interface of the mobile terminal in a predetermined format, specifically including:

[0127] Get the preset document display tool;

[0128] Use a document display tool to render the document to be previewed in a predetermined format;

[0129] The rendered document to be previewed is displayed on the mobile interface.

[0130] PDFViewer is a component or tool used to display PDF documents in Android applications. It allows applications to display PDF files in a graphical way and provides basic interactive functions such as zooming, scrolling, and paging.

[0131] In this embodiment, a preset document display tool, namely the PDFViewer component, is first obtained. The component is specifically used to process the display and interaction of PDF documents, and can efficiently render the document to be previewed, ensuring that the user can view the content in a clear format. After using the PDFViewer component, the system renders the document to be previewed in a predetermined format, parses the text, image and format information in the document and presents it to the user to ensure the accuracy and fluency of the rendering effect. After the rendering is completed, the system will display the document on the user interface of the mobile terminal to ensure that the user can view the document content intuitively. By combining rendering capabilities and good user interface design, the user's experience of browsing documents on mobile devices can be improved.

[0132] Through the above steps, the PDFViewer component is used to achieve efficient rendering and display of documents in a predetermined format, allowing users to view document content clearly and smoothly on mobile devices, improving user experience and interactivity.

[0133] It should be noted that the various specific tools or components appearing in the embodiments of the present application are only used for illustrative purposes and do not represent actual use.

[0134] In the above embodiment, the present application discloses a method for realizing local offline preview of documents on a mobile terminal, which belongs to the field of research and development management technology. The present application obtains the source code of the office suite and compiles the source code to obtain a shared library file; obtains the document operation package of the preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment; encapsulates the shared library file and the document operation package to obtain the target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment; obtains the document to be previewed, and uses the target document format conversion tool to convert the format of the document to be previewed into a predetermined format; and displays the document to be previewed in a predetermined format on the interface of the mobile terminal. The present application compiles and integrates the source code of the office suite locally on the mobile terminal, and combines the document format conversion tool to create a document format conversion tool that can be used offline in the Android environment. The tool can convert Office documents into a predetermined format and display them on the interface through a preview component, thereby realizing an efficient offline document preview function, avoiding the problems of relying on external services, poor format compatibility, and poor rendering effects, and improving the user's preview experience in a network-free environment.

[0135] In this embodiment, the method for implementing local offline preview of a document on a mobile terminal is executed on an electronic device (eg Figure 1 The server shown in the figure) can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0136] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned document information to be previewed, the above-mentioned document information to be previewed can also be stored in a node of a blockchain.

[0137] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0138] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, 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 knowledge to obtain the best results.

[0139] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0140] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the 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 above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0141] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0142] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a device for implementing a local offline preview of a document on a mobile terminal. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0143] like Figure 3 As shown, the device 300 for implementing local offline preview of a document on a mobile terminal according to this embodiment includes:

[0144] The compiling module 301 is used to obtain the source code corresponding to the preset office suite and compile the source code to obtain a shared library file;

[0145] An operation package module 302 is used to obtain a document operation package of a preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment;

[0146] The encapsulation module 303 is used to encapsulate the shared library file and the document operation package to obtain a target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment;

[0147] The conversion module 304 is used to obtain the document to be previewed and convert the format of the document to be previewed into a predetermined format using a target document format conversion tool;

[0148] The display module 305 is used to display the document to be previewed in a predetermined format on the interface of the mobile terminal.

[0149] Furthermore, the compiling module 301 is specifically used for:

[0150] Determine the production environment of a preset office suite, and determine the code format corresponding to the source code based on the production environment of the preset office suite to obtain a first code format; determine the production environment corresponding to the second development environment, and determine the code format used by the target document format conversion tool based on the production environment corresponding to the second development environment to obtain a second code format; determine a matching compilation tool based on the first code format and the second code format; use the matching compilation tool to compile the source code to obtain a shared library file.

[0151] Furthermore, the compiling module 301 is further used for:

[0152] The source code is divided according to the functional division of the preset office suite to obtain several source code fragments; each source code fragment is compiled using a matching compilation tool to obtain several library files; each library file is adapted to the platform of the second development environment; the library files adapted to the platform of the second development environment are combined to obtain a shared library file.

[0153] Furthermore, the device 300 for implementing local offline preview of a document on a mobile terminal further includes an interface module, which is specifically used for:

[0154] A bridge interface is created to adapt to the production environment of the preset office suite and the first development environment, wherein the bridge interface is used to realize communication between the preset office suite and the preset document format conversion tool; and the preset office suite and the preset document format conversion tool are connected using the bridge interface.

[0155] Furthermore, the interface module is further used for:

[0156] The production code corresponding to the preset office suite is read line by line through the bridge interface to obtain a first code line sequence; the production code corresponding to the preset document format conversion tool is read line by line through the bridge interface to obtain a second code line sequence; the first code line sequence and the second code line sequence are compared to obtain detailed information of code interaction; according to the detailed information of code interaction, the preset office suite is connected to the preset document format conversion tool using the bridge interface.

[0157] Furthermore, the conversion module 304 is specifically used for:

[0158] Construct an asynchronous processing task queue and store the document to be previewed in the asynchronous processing task queue; read the document to be previewed from the asynchronous processing task queue by asynchronous loading; use the target document format conversion tool to convert the format of the read document to be previewed into a predetermined format.

[0159] Furthermore, the display module 305 is specifically used for:

[0160] Obtain a preset document display tool; use the document display tool to render a document to be previewed in a predetermined format; and display the rendered document to be previewed on an interface of a mobile terminal.

[0161] In the above embodiment, the present application discloses a device for realizing local offline preview of documents on a mobile terminal, which belongs to the field of research and development management technology. The present application obtains the source code of the office suite and compiles the source code to obtain a shared library file; obtains the document operation package of the preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment; encapsulates the shared library file and the document operation package to obtain the target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment; obtains the document to be previewed, and uses the target document format conversion tool to convert the format of the document to be previewed into a predetermined format; and displays the document to be previewed in a predetermined format on the interface of the mobile terminal. The present application compiles and integrates the source code of the office suite locally on the mobile terminal, and combines the document format conversion tool to create a document format conversion tool that can be used offline in the Android environment. The tool can convert Office documents into a predetermined format and display them on the interface through a preview component, realizing an efficient offline document preview function, avoiding the problems of relying on external services, poor format compatibility and poor rendering effect, and improving the user's preview experience in a network-free environment.

[0162] To solve the above technical problems, the present application also provides a computer device. Figure 4, Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0163] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 4 with a memory 41, a processor 42, and a network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform 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 (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0164] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0165] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), 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, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for a method for realizing local offline preview of documents on a mobile terminal, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0166] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the method for implementing the local offline preview of the document on the mobile terminal.

[0167] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0168] In the above embodiment, the present application discloses a computer device, which belongs to the field of research and development management technology. The present application obtains the source code of the office suite and compiles the source code to obtain a shared library file; obtains the document operation package of the preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment; encapsulates the shared library file and the document operation package to obtain the target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment; obtains the document to be previewed, and uses the target document format conversion tool to convert the format of the document to be previewed into a predetermined format; and displays the document to be previewed in a predetermined format on the interface of the mobile terminal. The present application compiles and integrates the source code of the office suite locally on the mobile terminal, and combines the document format conversion tool to create a document format conversion tool that can be used offline in the Android environment. The tool can convert Office documents into a predetermined format and display them on the interface through a preview component, realizing an efficient offline document preview function, avoiding the problems of relying on external services, poor format compatibility and poor rendering effects, and improving the user's preview experience in a network-free environment.

[0169] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the method for implementing local offline preview of a document on a mobile terminal as described above.

[0170] In the above embodiment, the present application discloses a computer-readable storage medium, which belongs to the field of research and development management technology. The present application obtains the source code of the office suite and compiles the source code to obtain a shared library file; obtains the document operation package of the preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment; encapsulates the shared library file and the document operation package to obtain the target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment; obtains the document to be previewed, and uses the target document format conversion tool to convert the format of the document to be previewed into a predetermined format; and displays the document to be previewed in a predetermined format on the interface of the mobile terminal. The present application compiles and integrates the source code of the office suite locally on the mobile terminal, and combines the document format conversion tool to create a document format conversion tool that can be used offline in the Android environment. The tool can convert Office documents into a predetermined format and display them on the interface through a preview component, realizing an efficient offline document preview function, avoiding the problems of relying on external services, poor format compatibility and poor rendering effects, and improving the user's preview experience in a network-free environment.

[0171] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0172] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present 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. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0173] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A method for implementing local offline preview of a document on a mobile terminal, characterized in that: include: Obtain source code corresponding to a preset office suite, and compile the source code to obtain a shared library file; Obtaining a document operation package of a preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment; Encapsulating the shared library file and the document operation package to obtain a target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment; Acquire a document to be previewed, and use the target document format conversion tool to convert the format of the document to be previewed into a predetermined format; The document to be previewed is displayed on the interface of the mobile terminal in the predetermined format.

2. The method for implementing local offline preview of a document on a mobile terminal according to claim 1, characterized in that: The step of obtaining source code corresponding to the preset office suite and compiling the source code to obtain a shared library file specifically includes: Determining a production environment of the preset office suite, and determining a code format corresponding to the source code based on the production environment of the preset office suite to obtain a first code format; Determining a production environment corresponding to the second development environment, and determining a code format used by the target document format conversion tool based on the production environment corresponding to the second development environment, to obtain a second code format; Determining a matching compilation tool based on the first code format and the second code format; The source code is compiled using the matching compilation tool to obtain the shared library file.

3. The method for implementing local offline preview of a document on a mobile terminal as claimed in claim 2, characterized in that: The step of using the matching compilation tool to compile the source code to obtain the shared library file specifically includes: The source code is divided according to the functional division of the preset office suite to obtain a plurality of source code fragments; Using the matching compilation tool to compile each of the source code fragments respectively to obtain a plurality of library files; respectively adapting each of the library files to the platform of the second development environment; The library files adapted to the platform of the second development environment are combined to obtain the shared library files.

4. The method for implementing local offline preview of a document on a mobile terminal as claimed in claim 2, characterized in that: Before the step of encapsulating the shared library file and the document operation package to obtain the target document format conversion tool, the step further includes: Creating a bridge interface adapted to the production environment of the preset office suite and the first development environment, wherein the bridge interface is used to implement communication between the preset office suite and the preset document format conversion tool; The preset office suite and the preset document format conversion tool are connected using the bridge interface.

5. The method for implementing local offline preview of a document on a mobile terminal as claimed in claim 4, characterized in that: The step of using the bridge interface to connect the preset office suite and the preset document format conversion tool specifically includes: Reading the production code corresponding to the preset office suite line by line through the bridge interface to obtain a first code line sequence; Reading the production code corresponding to the preset document format conversion tool line by line through the bridge interface to obtain a second code line sequence; Compare the first code line sequence and the second code line sequence to obtain detailed information of code interaction; According to the detailed information of the code interaction, the preset office suite is connected with the preset document format conversion tool using the bridge interface.

6. The method for implementing local offline preview of a document on a mobile terminal according to claim 1, characterized in that: The step of obtaining the document to be previewed and converting the format of the document to be previewed into a predetermined format using the target document format conversion tool specifically includes: Constructing an asynchronous processing task queue, and storing the document to be previewed in the asynchronous processing task queue; Reading the document to be previewed from the asynchronous processing task queue in an asynchronous loading manner; The target document format conversion tool is used to convert the format of the read document to be previewed into a predetermined format.

7. The method for implementing local offline preview of a document on a mobile terminal according to claim 1, characterized in that: The step of displaying the document to be previewed in the predetermined format on the interface of the mobile terminal specifically includes: Get the preset document display tool; Rendering the document to be previewed in a predetermined format using the document display tool; The rendered document to be previewed is displayed on the interface of the mobile terminal.

8. A device for realizing local offline preview of a document on a mobile terminal, characterized in that: include: A compiling module, used for obtaining source code corresponding to a preset office suite, and compiling the source code to obtain a shared library file; An operation package module, used to obtain a document operation package of a preset document format conversion tool, wherein the preset document format conversion tool is a document format conversion tool that can be used in the first development environment; An encapsulation module, used to encapsulate the shared library file and the document operation package to obtain a target document format conversion tool, wherein the target document format conversion tool is a document format conversion tool that can be used in the second development environment; A conversion module, used to obtain a document to be previewed, and convert the format of the document to be previewed into a predetermined format using the target document format conversion tool; The display module is used to display the document to be previewed in the predetermined format on the interface of the mobile terminal.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the method for realizing local offline preview of a document on a mobile terminal as described in any one of claims 1 to 7 is implemented.

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 method for implementing local offline preview of a document on a mobile terminal according to any one of claims 1 to 7.