Document online preview method and device, electronic equipment and readable storage medium
By sharding and converting online documents with large memory capacity, the problem of poor document preview performance in the prior art is solved, and efficient document preview and excellent user experience are achieved.
Patent Information
- Application Number
- CN202311246563.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-03-25
AI Technical Summary
Existing online document preview tools have poor performance when processing documents with large memory capacity, resulting in slow or stuttering previews, affecting preview performance and experience.
By parsing the original format online documents, the document elements are sharded based on sharding strategies (such as shard balance strategy and semantic continuity strategy), multiple document shards are obtained, and then the shards are formatted and rendered, and rendered in the distributed order in the original document.
It improves the performance of document preview, reduces network resource consumption, ensures the uniform distribution and semantic continuity of document shards, and improves the user's preview experience.
Smart Images

Figure CN119692302A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to document processing technology, and in particular to a document online preview method, device, electronic device and readable storage medium. Background Art
[0002] As the business continues to grow, document content continues to surge, and the memory capacity occupied by documents is also increasing. Some online document preview tools will become slower or even freeze when previewing these documents with large memory capacity, seriously affecting the preview performance and experience. Therefore, how to achieve efficient preview of online documents has become one of the hot issues in current research. Summary of the invention
[0003] The embodiments of the present application provide a document online preview method, device, electronic device and readable storage medium, which can realize efficient preview of online documents through strategic sharding.
[0004] In one aspect, an embodiment of the present application provides a method for online previewing of a document, the method comprising:
[0005] Parsing the online document in the original format to obtain N document elements of the online document;
[0006] Slice the N document elements based on a slicing strategy to obtain M document slices in an original format, wherein one document slice includes one document element or multiple continuous document elements, the slicing strategy includes at least one of a slicing balance strategy and a semantic continuity strategy, N is an integer greater than 1, and M is an integer greater than 1;
[0007] Performing format conversion processing on the M document segments in the original format to obtain M document segments in the preview format, wherein the M document segments in the original format correspond to the M document segments in the preview format one by one;
[0008] The M document segments in the preview format are rendered according to the distribution order of the M document segments in the original format in the online document.
[0009] In one aspect, an embodiment of the present application provides a document online preview device, comprising:
[0010] A parsing module, used for parsing the online document in the original format to obtain N document elements of the online document;
[0011] A fragmentation module, configured to fragment the N document elements based on a fragmentation strategy to obtain M document fragments in an original format, wherein one document fragment includes one document element or multiple continuous document elements, and the fragmentation strategy includes at least one of a fragmentation balance strategy and a semantic continuity strategy, N is an integer greater than 1, and M is an integer greater than 1;
[0012] A conversion module, used for performing format conversion processing on the M document segments in the original format to obtain the M document segments in the preview format, wherein the M document segments in the original format correspond to the M document segments in the preview format one by one;
[0013] The rendering module is used to render the M document segments in the preview format according to the distribution order of the M document segments in the original format in the online document.
[0014] An embodiment of the present application provides an electronic device, including:
[0015] Memory for storing computer executable instructions or computer programs;
[0016] The processor is used to implement the document online preview method provided in the embodiment of the present application when executing the computer executable instructions or computer programs stored in the memory.
[0017] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions or a computer program for implementing the document online preview method provided in the embodiment of the present application when executed by a processor.
[0018] An embodiment of the present application provides a computer program product, including a computer program or a computer executable instruction. When the computer program or the computer executable instruction is executed by a processor, the document online preview method provided by the embodiment of the present application is implemented.
[0019] The embodiments of the present application have the following beneficial effects:
[0020] Through the embodiment of the present application, the online document to be previewed is parsed, and then the N document elements obtained by parsing the online document are fragmented based on at least one of the fragmentation balance strategy and the semantic continuity strategy, so that the document fragmentation can at least achieve the minimum response number or a reasonable semantic presentation effect. Then, each document fragment is formatted, and after obtaining the document fragmentation in the preview format, the rendering is completed according to the distribution order of the document fragmentation. The preview document is first fragmented and then formatted, and finally the fragmentation rendering is performed in sequence according to the order of the document fragmentation. This solution not only improves the rendering efficiency, but also reduces the consumption of network resources, and can also make the fragmentation rendering of the online document meet the reading semantic requirements or the fastest response speed, thereby improving the overall performance of the online preview. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1A 1 is a schematic diagram of the architecture of the online document preview system 100 provided in an embodiment of the present application;
[0022] Figure 1BIt is a flowchart of a document online preview method provided in an embodiment of the present application;
[0023] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0024] Figure 3 It is a flowchart of a document online preview method provided in an embodiment of the present application;
[0025] Figure 4 It is a processing flow chart of the word document preview method provided in the embodiment of the present application;
[0026] Figure 5 It is a schematic diagram of document segmentation processing provided by an embodiment of the present application;
[0027] Figure 6 It is a schematic diagram of document image processing provided by an embodiment of the present application;
[0028] Figure 7 It is an optional flow chart of the word document preview method provided in the embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0030] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0031] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0032] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0033] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0034] 1) Hypertext Markup Language (HTML) is a markup language. It includes a series of tags that can unify the document format on the Internet and connect scattered Internet resources into a logical whole. HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc.
[0035] 2) Jsoup tool is an HTML parser that can be used to directly parse a link address, HTML text content, such as various HTML tags or elements.
[0036] 3) POI tool is a cross-platform free open source application interface that can create interfaces for reading, maintaining and operating various types of document formats, and can also be used for importing and exporting files.
[0037] The embodiments of the present application provide a document online preview method, device, electronic device and readable storage medium, which can provide efficient preview for documents with large memory capacity.
[0038] The following describes exemplary applications of the electronic device provided in the embodiments of the present application. The electronic device provided in the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), smart phones, smart speakers, smart watches, smart televisions, and vehicle-mounted terminals. It can also be implemented as a server, such as an independent physical server, a server cluster consisting of multiple servers, or a cloud server capable of cloud computing.
[0039] Referring to FIG. 1 , FIG. 1 is a schematic diagram of the architecture of an online document preview system 100 provided in an embodiment of the present application. A terminal 400 is connected to a server 200 via a network 300 . The network 300 may be a wide area network or a local area network, or a combination of the two.
[0040] The terminal 400 runs document browsing programs (Application, APP) for various application scenarios, for example, it can be an instant messaging APP, a reading APP, a video APP, a game APP, or other software programs. When a user (or other artificial intelligence program) uploads an online document at the terminal 400 and initiates a document online preview request, and then sends it to the server 200 through the network 300, the server 200 responds to the document online preview request initiated by the user at the terminal 400, and obtains the online document in the original format uploaded by the user, and parses the online document in the original format to obtain N document elements of the online document. Next, the N document elements of the online document are fragmented based on the fragmentation strategy to obtain M document fragments in the original format, and then the M document fragments in the original format are format-converted to obtain M document fragments in the preview format. Finally, according to the distribution order of the M document fragments in the original format in the online document, the M document fragments in the preview format are rendered in sequence. When all the document fragments are rendered, the rendering result of the online document is returned to the terminal 400 through the network 300 for display, and the user can preview the rendering result of the online document in the terminal 400. Alternatively, the server 200 may return a document slice to the terminal 400 before rendering it completely, so that the terminal 400 can display the M document slices one by one, and the server 200 takes much less time to render a document slice than to render M document slices. Each document slice is returned to the terminal 400 for display after rendering, which can improve the response speed for online preview and avoid users waiting for too long.
[0041] In some embodiments, Figure 1A The server 200 shown in can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0042] The embodiments of the present application can be implemented with the help of artificial intelligence (AI) technology, which is a 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. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.
[0043] Taking the server provided in the embodiment of the present application as an example, for example, a server cluster can be deployed in the cloud, thereby opening up artificial intelligence cloud services (AI as a Service, AIaaS) to users or developers. The AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to opening an AI theme mall, and all users or developers can access one or more artificial intelligence services provided by the AIaaS platform through an application programming interface.
[0044] For example, the server in the cloud is encapsulated with a program of the document online preview method provided in the embodiment of the present application. The user calls the document online preview service in the cloud service through a terminal (the terminal runs an APP, such as an instant messaging APP, a reading APP, etc.), so that the server deployed in the cloud calls the program of the encapsulated document online preview method. After the terminal uploads the online document and initiates an online document preview request, the server will obtain the online document in the original format uploaded by the terminal, and parse the online document in the original format to obtain N document elements of the online document. Next, the N document elements of the online document are fragmented based on the fragmentation strategy to obtain M document fragments in the original format, and then the M document fragments in the original format are format converted to obtain M document fragments in the preview format. Finally, according to the distribution order of the M document fragments in the original format in the online document, the M document fragments in the preview format are rendered in sequence. When all the document fragments are rendered, the rendering result of the online document is returned to the terminal for user browsing.
[0045] Next, an exemplary application when the device is implemented as a terminal will be described, see Figure 1B , Figure 1BThe present invention is a flowchart of a document online preview method provided by an embodiment of the present application. First, a user uploads an online document in a client and initiates a document online preview request. After the client responds to the user's document online preview request, it directly obtains the uploaded online document in the original format, and parses the online document in the original format to obtain N document elements of the online document. Next, the N document elements of the online document are fragmented based on a fragmentation strategy to obtain M document fragments in the original format. Then, the M document fragments in the original format are format-converted to obtain M document fragments in the preview format. Finally, according to the distribution order of the M document fragments in the original format in the online document, the M document fragments in the preview format are rendered in sequence. When all the document fragments are rendered, the rendering result of the online document is directly displayed on the client for the user to browse.
[0046] See also Figure 2 , Figure 2 is a schematic diagram of the structure of the server 200 provided in an embodiment of the present application, Figure 2 The server 200 shown includes: at least one processor 410, a memory 450, and at least one network interface 420. The various components in the server 200 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .
[0047] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0048] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0049] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0050] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0051] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0052] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
[0053] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The document online preview device 453 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a parsing module 4531, a slicing module 4532, a conversion module 4534, and a rendering module 4535. These modules are logical, and therefore can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0054] In some embodiments, the terminal or server can implement the document online preview method provided by the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (APPlication, APP), that is, a program that needs to be installed in the operating system to run, such as a live broadcast APP or an instant messaging APP; it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to a browser environment. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.
[0055] The document online preview method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server 200 provided in the embodiment of the present application.
[0056] See also Figure 3 , is a flowchart of a document online preview method provided in an embodiment of the present application, which can be executed by an electronic device, specifically by a processor of the electronic device. The processor can be the aforementioned terminal or server. Figure 3 The document online preview method shown may include the following steps:
[0057] In step 101, the online document in the original format is parsed to obtain N document elements of the online document.
[0058] In some embodiments, when a preview request for initiating an online document is received, the uploaded online document in the original format is obtained, wherein the document in the original format may be in word format, excel format, ppt format, etc., and the number of documents may be one or more. When responding to the preview request for the online document, these documents in the original format are parsed and processed to obtain an ordered list of document elements (IBodyElement ordered list) and an ordered list of picture elements (XWPFPictureData ordered list). The parsing process may be implemented using a POI parsing tool or other file analysis tools, such as a file analyzer (FileAnalyzer), or a document parsing program algorithm may be used. The ordered list of document elements includes N document elements, where N is an integer greater than 1, and the document elements are specifically paragraph elements, title elements, table elements, picture elements, and line break elements of the document, wherein the picture element here is actually a label link of the picture, not the original image data of the picture, and the original image data of the picture is saved in binary form in the ordered list of picture elements.
[0059] For example, if "It's going to rain today" is a paragraph in a document, then this paragraph is the paragraph element of the document; if "A document online preview method" is the title of a document, then this title is the title element of the document. If there is a table in the document, this table is the table element of the document; the image element in the document is the image tag link, such as "img / 001", not the original image data of the image. In addition, if there is a blank line between two paragraphs or two articles in the document, then this blank line is the line break element of the document.
[0060] In step 102, N document elements are fragmented based on a fragmentation strategy to obtain M document fragments in the original format.
[0061] Following the above embodiment, after the online document is parsed and processed to obtain N document elements, the N document elements can be fragmented using the fragmentation strategy based on the document element to obtain M document fragments in the original format. That is, the document in the original format is divided into M document fragments, and the fragmentation method can be performed according to a preset document fragmentation strategy, where the fragmentation strategy can be a fragmentation balance strategy or a semantic continuity strategy, N is an integer greater than 1, and M is an integer greater than 1.
[0062] As an example, see Figure 5 , a document fragment in the original format includes one document element or multiple continuous document elements, that is, the document fragment needs to ensure the continuity of the document elements. For example, document fragment 1 is composed of document element 1, document element 2 and document element 3; document fragment 3 is composed of document element 7, document element 8 and document element 9. The fragmentation strategy includes at least one of the following: fragmentation balance strategy and semantic continuity strategy. That is, fragmentation can be performed based only on the semantic continuity strategy, fragmentation can be performed based only on the fragmentation balance strategy, or fragmentation can be performed based on both strategies. As the name implies, the fragmentation balance strategy refers to fragmentation based on the number of document elements contained in each document fragment, for example, the number of document elements contained in each document fragment is W; the semantic continuity strategy is based on the same or similar semantics expressed by the document elements contained in each document fragment. For a detailed introduction to these two strategies, please refer to the subsequent description.
[0063] The following first introduces a solution for sharding based on two strategies at the same time. In some embodiments, the sharding strategy includes a sharding balance strategy and a semantic continuity strategy. In the embodiment of the present application, considering that for online documents with large memory capacity, in some environments with poor network resources, the preview performance of the document will be affected. When the real-time network speed of the document preview environment is less than the real-time network speed threshold, it means that the network resources of the current document preview environment are poor. At this time, the N document elements of the online document can first be sharded according to the sharding uniform strategy to obtain M document fragments, and then according to the number of the M initial document fragments and the content complexity of the online document, it is determined whether it is necessary to use the semantic continuity strategy to continue the sharding process.
[0064] In other embodiments, if the real-time network speed is greater than or equal to the real-time network speed threshold, it means that the network resources of the current document preview environment are good, and there is no need to consider whether the document elements in the document fragments obtained by the fragmentation processing are uniform. The semantic continuity strategy is directly used to fragment the N document elements to obtain multiple document fragments in the original format, and the multiple document fragments in the original format are directly used as the M document fragments in the original format.
[0065] Above Figure 3The illustrated step 102 can be implemented by the following steps 1021A to 1023A:
[0066] In step 1021A, when the real-time network speed is less than the real-time network speed threshold, the N document elements are fragmented based on the fragmentation balancing strategy to obtain multiple initial document fragments in the original format.
[0067] In some embodiments, when the real-time network speed is less than the real-time network speed threshold, a uniform sharding strategy can be used to shard N document elements to obtain multiple initial document shards in the original format. The sharding balance strategy is intended to ensure that after sharding the online document in the original format, the document elements contained in the multiple document shards are divided as evenly as possible, so that document shards with a particularly small number of document elements will not be divided, resulting in an additional network request being sent when rendering document shards with a particularly small number of document elements.
[0068] In step 1022A, when the content complexity of the online document does not exceed the complexity threshold, or the number of initial document fragments is less than the number threshold, multiple initial document fragments in the original format are used as M document fragments in the original format.
[0069] For some online documents in the original format with small memory capacity, these online documents contain fewer document elements and low content complexity, such as some online documents that are pure text and do not contain many other document elements, or online documents that have been divided into multiple initial document fragments but the number of divisions is small, it can be determined whether the online document needs to be fragmented according to the content complexity of the online document and the number of initial document fragments. Considering that in the case of good network environment and document rendering environment, there is no need to continue fragmenting the initial document fragments that have been obtained. Therefore, when the content complexity of the online document does not exceed the preset document complexity threshold or the number of initial document fragments is less than the preset number threshold, the multiple initial document fragments in the original format are directly used as M document fragments in the original format.
[0070] In step 1023A, when the content complexity of the online document exceeds the complexity threshold and the number of initial document fragments is not less than the number threshold, based on the semantic continuity strategy, fragment adjustment processing is performed on multiple initial document fragments in the original format to obtain M document fragments in the original format.
[0071] Following the above embodiment, when the content complexity of the online document exceeds the preset document complexity threshold, and the number of initial document fragments is not less than the preset number threshold, it means that the number of multiple initial document fragments is too large and the divided document contents are relatively redundant. Then, based on the semantic continuity strategy, multiple initial document fragments of the current online document can be subjected to fragment adjustment processing, that is, the current initial document fragments can be combined or adjusted to obtain M document fragments in the original format again.
[0072] In other embodiments, it may be determined whether to use a semantic continuity strategy for adjustment only by the content complexity of the online document. When the content complexity of the online document exceeds a preset document complexity threshold or the number of initial document fragments is greater than a preset number threshold, a semantic continuity-based strategy may be directly used to perform fragment adjustment processing on multiple initial document fragments of the current online document.
[0073] In some embodiments, the above step 1023A can be implemented by following the steps 10231A to 10234A, which are described in detail below.
[0074] In step 10231A, multiple initial document fragments are combined according to their distribution order in the online document to obtain an initial document fragment sequence.
[0075] In some embodiments, when adjusting the current multiple initial document fragments based on the semantic continuity strategy, considering that the multiple document fragments are sorted according to the order of distribution of the initial document fragments in the online document, the multiple document fragments are first combined according to the distribution order in the online document to obtain the initial document fragment sequence. In the document fragment sequence, there may be two adjacent document fragments with high semantic similarity, for example, belonging to the same paragraph or the same scene description. These original document fragments can be appropriately merged to reduce the number of initial document fragments.
[0076] Steps 10232A to 10233A are performed for every two adjacent initial document fragments in the initial document fragment sequence.
[0077] In step 10232A, the semantic similarity between two adjacent initial document fragments is calculated.
[0078] Continuing from the above embodiment, after obtaining multiple initial document fragment sequences, for every two adjacent initial document fragments in the initial document fragment sequence, a text encoding model can be called to embed and then encode these initial document fragments to obtain a semantic feature vector of each document fragment, and then determine the similarity of the semantic feature vectors of each two adjacent initial document fragments, wherein determining the similarity of two semantic feature vectors can be calculating the cosine similarity between the vectors, or can be calculating the Euclidean distance between the vectors.
[0079] In step 10233A, two adjacent initial document fragments whose semantic similarity is greater than a semantic similarity threshold are merged to obtain a merged document fragment.
[0080] After determining the semantic similarity of any two adjacent initial document fragments, further determine whether the current semantic similarity exceeds a preset similarity threshold. If so, it means that the two current adjacent initial document fragments are semantically similar, and the adjacent initial document fragments are merged to obtain a merged document fragment.
[0081] Optionally, if the Euclidean distance of the semantic feature vectors of any two adjacent initial document fragments is calculated, it is necessary to determine whether the Euclidean distance is less than a preset Euclidean distance threshold. If it is less than, it means that the two adjacent initial document fragments are semantically similar, and the adjacent initial document fragments are merged to obtain a merged document fragment.
[0082] After determining the semantic similarity of any two adjacent initial document fragments, and further determining that the current semantic similarity is not greater than a preset similarity threshold, it is indicated that the current two adjacent initial document fragments are semantically dissimilar, and no adjustment or combination is required, and the two adjacent initial document fragments are directly retained. Optionally, when determining the Euclidean distance of the semantic feature vectors of any two adjacent initial document fragments, and further determining that the Euclidean distance is less than a preset Euclidean distance threshold, it is indicated that the current two adjacent initial document fragments are semantically dissimilar, and no adjustment or combination is required, and the two adjacent initial document fragments are directly retained.
[0083] In step 10234A, the obtained merged document fragments and the unmerged initial document fragments are taken as M document fragments in the original format.
[0084] After performing fragment adjustment processing on the M initial document fragments, some of the initial document fragments are merged, and the merged document fragments and the unmerged initial document fragments are used as M document fragments in the original format. Here, the unmerged initial document fragments are adjacent initial document fragments that are directly retained without being merged.
[0085] The following describes a solution for sharding online documents based only on the shard balancing strategy.
[0086] In some embodiments, the above step 102 can also be implemented by the following steps 1021B to 1023B, which are described in detail below.
[0087] In step 1021B, the pre-sharding size corresponding to the sharding balancing strategy is obtained.
[0088] In some embodiments, when the sharding strategy is adjusted to a uniform sharding strategy according to the network environment, the pre-sharding size set in the sharding balance strategy can be obtained first. This pre-sharding size is pre-set according to the number of document elements in the online document, and needs to be changed later according to the specific situation of the sharding.
[0089] In step 1022B, a document element sequence consisting of N document elements is obtained.
[0090] After the online document is parsed, an ordered list of document elements will be obtained. A document element sequence consisting of N document elements will be obtained from the ordered list of document elements. The document element sequence here is arranged in the order of distribution of each document element in the online document. In this way, when the online document is fragmented, the content order and logical order of the document will not be disrupted.
[0091] In step 1023B, the document element sequence is segmented according to the pre-segment size and the total number of N document elements to obtain M subsequences. The M subsequences are M document segments in the original format.
[0092] In some embodiments, the above step 1023B can also be implemented by the following steps 10231B to 10232B, which are described in detail below.
[0093] After obtaining a document element sequence consisting of N document elements, the document element sequence can be divided by a sharding balance strategy, and then the document element sequence can be segmented according to the segmentation result to obtain M subsequences. The total number of document elements contained in the document element sequence can be counted first, and then the N document elements in the document element sequence can be segmented in combination with a pre-set pre-sharding size to obtain M subsequences, each of which contains at least one document element. The sharding balance strategy in the embodiment of the present application is to ensure that the number of document elements contained in the segmented subsequences is as evenly distributed as possible.
[0094] In step 10231B, the number of subsequences M and the number of document elements included in one subsequence are determined according to the pre-segmentation size and the total number of N document elements.
[0095] In some embodiments, step 10231B can also be implemented by following steps 102311B to 102314B, which are described in detail below.
[0096] In step 102311B, the first quotient of the total number and the pre-segmentation size is taken as the number M of subsequences.
[0097] After determining the total number of document elements contained in the document element sequence and the preset pre-segment size, the first quotient of the total number and the pre-segment size is used as the number of subsequences, and the number M of the segmented subsequences can be determined by the first quotient.
[0098] In step 102312B, the second quotient of the total number and the number of subsequences is taken as the actual minimum number of fragments.
[0099] Considering that after the online document is segmented, when previewing, the corresponding document segments need to be rendered in sequence according to the order of the document segments until the entire online document is rendered. Each rendering of a document segment may send a network request, so the segmentation balance strategy is to make the number of segments as small as possible under the condition that the number of document elements contained in the document segment is reasonable, that is, the number of segmented subsequences is as small as possible. Therefore, after determining the number of subsequences M, the second quotient of the total number and the number of subsequences is calculated as the actual minimum number of segments, where the actual minimum number of segments refers to the minimum number of document elements contained in each subsequence after segmentation.
[0100] In step 102313B, the actual maximum number of fragments is calculated based on the actual minimum number of fragments, the number of subsequences, and the total number.
[0101] After the document elements are segmented according to the actual minimum number of shards, that is, the minimum number of document elements contained in each subsequence after segmentation, some document elements may be unevenly distributed, and there may be a subsequence that contains only a small number of document elements. At this time, it is necessary to calculate the actual maximum number of shards based on the actual minimum number of shards, the number of subsequences, and the total number. Specifically, according to the number of subsequences M, the product of the actual minimum number of shards and the number of subsequences M is subtracted from the total number. The difference (subtraction result) obtained at this time is the number of a small number of document elements, and then the sum of the difference and the actual minimum number of shards is taken as the actual maximum number of shards.
[0102] In step 102314B, the number of document elements included in one subsequence is equal to the actual maximum number of fragments, and the number of document elements included in each subsequence in the M-1 subsequences is equal to the actual minimum number of fragments.
[0103] After determining the actual maximum number of fragments, the actual maximum number of fragments is used as the number of document elements included in any one of the subsequences, and the actual minimum number of fragments is used as the number of document elements included in each of the M-1 subsequences. This also means that a small number of document elements are merged into any one of the subsequences, and the number of document elements included in each of the other subsequences (M-1 subsequences) is the actual minimum number of fragments. This can avoid the need for the last few small document elements to be treated as a separate subsequence and increase the number of subsequences. In this way, the number of fragments for all subsequences has been determined.
[0104] For example, after a document is parsed, the total number m of document elements included in the document element sequence is 215, and the preset pre-segmentation size number n is 50, then the number p of subsequences is the first quotient of the total number m and the pre-segmentation size n, then the number p of subsequences can be determined to be 4 (i.e. 215 divided by 50), the actual minimum number of fragments q of the document is the second quotient of the total number m and the number p of subsequences, then the actual minimum number of fragments q can be determined to be 53 (i.e. 215 divided by 4), then the product of the actual minimum number of fragments q and the number p of subsequences is subtracted from the total number m, and the subtraction result is 3 (i.e. 215-4*53), and the actual maximum number of fragments Q is the sum of the subtraction result and the actual minimum number of fragments q, then the actual maximum number of fragments Q can be determined to be 56 (i.e. 53+3). Here, 56 is the original number of documents included in any one of the subsequences, and 53 is the number of document elements included in each of the other three subsequences.
[0105] In step 10232B, the document element sequence is segmented according to the number M of subsequences and the number of document elements included in one subsequence to obtain M subsequences.
[0106] After determining the number of subsequences M and the number of document elements included in a subsequence, it means that the document element sequence has been divided according to the sharding balance strategy, and then the document element sequence is segmented according to the division result to finally obtain M subsequences of the online document.
[0107] Continuing with the above example, according to the document fragmentation strategy, the final segmentation result of the document element sequence is: 4 subsequences, and the number of document elements contained in each subsequence is 53, 53, 53, and 56 respectively. If it is divided according to the pre-fragmentation size number n (that is, 50), the final segmentation result is: 50, 50, 50, 50, 15. The document elements contained in the last subsequence are very small, and in extreme cases may be equal to 1. This will increase an additional network request when loading the preview of the online document.
[0108] After segmenting the document element sequence to obtain M subsequences of the online document, each subsequence can be used as a document fragment of the online document. Therefore, each obtained subsequence is used as a document fragment in the original format, and the online document in the original format is segmented into M document fragments.
[0109] Therefore, through the embodiments of the present application, the document element sequence of the online document is evenly divided by utilizing the shard balancing strategy to obtain multiple subsequences, thereby reducing the distribution skew of the document shards, making the document elements of the document shards evenly distributed, and reducing the network overhead of loading an additional document shard.
[0110] In some embodiments, N document elements of an online document are segmented to obtain M document segments in the original format. This process can also be implemented through a text model. First, the target text in the original format of the online document is extracted, and then the target text is segmented to obtain multiple text sequences of the target text, wherein the sentence segmentation can be performed using a text segmentation tool or a word segmentation tool. Then, for each text sequence, the text model is called to perform embedding processing on the corresponding text sequence, and then encoding processing is performed to obtain the semantic feature vector of each text sequence, and then the semantic feature vector is mapped to determine the category probability of each text sequence, thereby determining the text category of each text sequence, and then the online document is divided according to the text category, and the text sequences contained in each text category are merged as a document segment.
[0111] In some embodiments, after step 102, the following steps 105 to 107 may also be performed, which are described in detail below.
[0112] In step 105, an image tag link is obtained, and the original image of the image in the document slice in the original format is converted into an image tag link.
[0113] In some embodiments, after obtaining the document segment in the original format, considering that some document elements in the document segment may be images, the embodiments of the present application process the image-type document elements separately, first obtaining the image tag links of all images in the document segment in the original format, and then converting the original images of the images in the document segment in the original format into image tag links.
[0114] In step 106 , the image data of the image is uploaded to the file system.
[0115] Continuing with the above embodiment, when obtaining image tag links for all images, the image data of each image is uploaded to the file system according to the ordered list of image elements (including the original image data of the image), wherein the original image data of the image here is generated based on the original image of the image, and the file system can be a picture storage system, a relational database, or other databases and systems with storage functions.
[0116] In step 107, a mapping relationship between the storage address of the image in the file system and the image tag link of the image is established.
[0117] After each image is uploaded to the system, the file system will assign a storage address to each stored image, and at the same time establish a mapping relationship between the image storage address in the file system and the image tag link of the image, so that the document is associated with the file system, so that when the document is subsequently rendered, the corresponding image data can be queried from the file system according to the mapping relationship for image rendering.
[0118] For example, in a document fragment of a certain original format, three document elements respectively contain picture 1, picture 2, and picture 3, and the image tag link addresses of these three pictures are respectively " / image / 001, / image / 002, / image / 003", then the original images of all images in the document elements are converted into image tag link addresses. After the three document elements in the document fragment are uploaded and stored in the file system, the file system sets three storage addresses for picture 1, picture 2, and picture 3, such as " / file / 001, / file / 002, / file / 003". At the same time, a mapping relationship between the storage address of the image in the file system and the image tag link of the image is established, for example, picture 1: image tag link address / image / 001, file system storage address / file / xxx. When the document element picture 1 in the document fragment starts to be rendered, the image tag of picture 1 is parsed, and the image tag link address " / image / 001" can be located at the storage address " / file / 001" of the file system according to the mapping relationship, so that the image data of picture 1 can be obtained from the file system for rendering picture 1.
[0119] In step 103, format conversion is performed on the M document segments in the original format to obtain M document segments in the preview format.
[0120] In some embodiments, step 103 may also be implemented by following steps 1031 to 1033, which are described in detail below.
[0121] In step 1031, each document segment in the original format is converted into a preview format to obtain a document segment converted into a preview format.
[0122] In some embodiments, after obtaining M document segments in the original format, for each document segment in the original format, the document segment can be converted to a preview format to obtain a document segment converted to a preview format, that is, a document segment in a preview format. For example, if the document segment in the original format is in word format, then the document segment in word format is converted to obtain a document segment in html format in a preview format. The format conversion method can utilize a document format conversion tool, a document open source parsing tool, or an artificial intelligence algorithm, etc., which is not specifically limited here.
[0123] In step 1032, if the document segment in the original format does not include an image tag link of the image, the document segment converted into the preview format is a document segment in the preview format.
[0124] When converting the format of the document fragment in the original format, it is also necessary to consider whether the document element of the document fragment includes the image tag link of the image, in other words, whether the document element of the document fragment contains the image. When the document fragment in the original format does not include the image tag link of the image, it means that there is no image in the online document in the original format, and the document fragment converted by the preview format is directly used as the document fragment in the preview format.
[0125] In step 1033, if the document segment in the original format includes an image tag link of an image, the storage address of the image data of the image in the file system is queried based on the image tag link of the image, and the image tag link of the image is replaced with the storage address of the image data of the image in the file system to obtain the document segment in the preview format.
[0126] Continuing with the above embodiment, steps 105 to 107 need to be executed before step 1033. When the document fragment in the original format includes an image tag link of an image, it means that there is an image in the online document in the original format and the image has been uploaded to the file system. Then, based on the image tag link of the image in the original element of the document (for example, / image / 001), a mapping relationship is established between the storage address in the file system and the image tag link of the image, and the storage address of the image data of the image in the file system (for example, / file / 001) is queried.
[0127] When the storage address of the image data in the file system (for example, / file / 001) is queried in the file system, the image tag link (for example, / image / 001) of the image in the document segment converted after the preview format is replaced with the storage address of the image data in the file system (for example, / file / 001), and the document segment in the preview format is obtained, so that the image data can be read from the file system according to the storage address for rendering later.
[0128] In some embodiments, after the N document elements of the online document are processed by slicing based on the slicing strategy to obtain the M document slices in the original format, it is also possible to determine whether the document slices in the original format include the document element as the title of the online document by determining whether the document element in the document slice belongs to the title of the online document. When the document slices in the original format include the document element as the title of the online document, a document directory tree can be generated based on the document element as the title of the online document and the title level. Specifically, the title (e.g., first-level title, second-level title, ..., n-level title) in the document slice can be determined by parsing the tag attribute of each document element in the document slice and obtaining the tag attribute value, thereby determining whether the title in the document slice (e.g., first-level title, second-level title, ..., n-level title), thereby determining whether the document slice includes the title of the online document and the corresponding title level. Next, all the titles are formed into a nested array list, and an algorithm for generating a tree by array conversion, such as an array flattening processing method, a multi-tree algorithm or other recursive algorithm, is used to convert the nested array list into a multi-tree structure as the document directory tree of the online document in the original format.
[0129] After format conversion is performed on each document fragment in the original format to obtain the document fragment in the preview format, the paragraph tag of each document element included in the document fragment in the preview format can also be obtained, wherein the method of obtaining can be to use a parsing tool, such as a Jsoup tool or other text parsing tool, and then determine whether the content corresponding to the paragraph tag is the title of the online document after obtaining the paragraph tag. When it is determined that the content corresponding to the paragraph tag is the title, an anchor mark is configured for the current paragraph tag, and the anchor mark is bound to the corresponding title in the document directory tree. For example, a mapping relationship can be established, or the same anchor mark is also set in the document directory tree, corresponding to the anchor mark configured for the current paragraph tag, wherein the anchor mark here is used to jump to the content corresponding to the anchor mark when the bound title is triggered.
[0130] Through the embodiments of the present application, while extracting the title attributes in the document fragments to construct the document directory tree, a binding relationship between the document anchor and the document directory tree is established, thereby realizing the function of jumping through the document directory navigation, thereby quickly locating any title position of the online document, further improving the user's preview experience.
[0131] In step 104, the M document segments in the preview format are rendered according to the distribution order of the M document segments in the original format in the online document.
[0132] In some embodiments, step 104 may also be implemented by following steps 1041 to 1042, which are described in detail below.
[0133] In step 1041, non-image content in the document segment in a preview format is rendered.
[0134] In some embodiments, after each document segment of the online document is converted into a preview format, in order to prevent the content order and logical order of the document from being disrupted, the M document segments in the preview format need to be rendered in sequence according to the distribution order of the M document segments in the original format in the online document. First, during the rendering process, it is necessary to consider whether there is an image in the document segment. If not, for each document segment in the preview format, all non-image contents in the document segments in the preview format are rendered in sequence according to the distribution order of the M document segments in the original format in the online document.
[0135] In step 1042, if the document segment in the preview format includes the storage address of the image in the file system, the image data of the image is obtained from the file system based on the storage address, and rendering processing is performed on the image data.
[0136] In some embodiments, if there is an image in the document segment, that is, the document segment in the preview format includes the storage address of the image in the file system, then based on this storage address, the image data of the current image is obtained from the file system storing the current image, and then rendering processing is performed on the image data.
[0137] In some embodiments, "obtaining image data of an image from a file system based on a storage address" in step 1042 may be implemented by following steps 10421 to 10422, which are described in detail below.
[0138] In step 10421, if the memory space occupied by the original image is less than or equal to the memory space threshold, the original image is obtained from the file system as image data based on the storage address.
[0139] When acquiring the image data of an image from the file system, it is necessary to determine whether the memory space occupied by the original image of the current image is greater than the memory space threshold. In some embodiments, when all images in the online document in the original format are uploaded to the file system, it is necessary to determine whether the memory space occupied by the original image of the current uploaded image exceeds the memory space threshold. If the memory space occupied by the original image of the image is less than or equal to the memory space threshold, the original image is directly uploaded to the file system for storage. If it exceeds, the current uploaded image is compressed in memory or size to obtain a thumbnail of the current uploaded image, and the original image and the thumbnail are uploaded together to the file system for storage and assigned a storage address. Therefore, when reading image data for document rendering, it is necessary to determine whether the memory space occupied by the current image exceeds the memory space threshold.
[0140] When rendering an image, if the memory space occupied by the original image of the previous image is less than or equal to the memory space threshold, the original image of the image is directly obtained from the file system based on the storage address as image data for rendering.
[0141] In step 10422, if the memory space occupied by the original image is greater than the memory space threshold, a thumbnail of the image is obtained from the file system based on the storage address as image data.
[0142] When rendering an image, if the memory space occupied by the original image of the current image is greater than the memory space threshold, it means that the current image has been compressed in memory or size before being uploaded to the file system, that is, there is still a corresponding thumbnail in the original image. At this time, the thumbnail of the image is first obtained from the file system based on the storage address as image data, and then the image data of the thumbnail is rendered. When a viewing request for the image is received, the original image of the image is obtained from the file system based on the storage address as image data for rendering for browsing.
[0143] Through the embodiment of the present application, the online document to be previewed is parsed and then sliced through the slice strategy to obtain multiple document slices, and then the multiple document slices are format converted to obtain preview format document slices, and then all preview format document slices are rendered in sequence according to the order of appearance of the document slices. Not only the advantage of easy rendering of preview format documents is utilized, but the adopted slice strategy and slice algorithm also reduce the distribution inclination of document slices, so that the document elements of the document slices are evenly distributed, and the network overhead of additional loading of sequential document slices is reduced. When the document slices are parsed, the image data contained therein is processed separately and saved in the file system, so that when rendering, the data is accessed through the file system image address without local loading, and the efficiency of image loading is improved under the method of combining thumbnails, which improves the user's preview experience. In addition, the title attribute in the document slice is extracted to construct a document directory tree, and the document anchor of the document title tag is established and bound to the document directory tree, realizing the function of jumping through the document directory navigation, thereby quickly locating any title position of the document, further improving the user's preview experience.
[0144] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.
[0145] In the document management application scenario, individual users or groups manage and maintain business data by building their own knowledge base, and an important function of the knowledge base is the management of documents, which can provide online previews of documents. The formats of documents include word format, excel format, ppt format, etc., and the preview of documents generally uses corresponding online preview tools or software to apply to documents of different document formats. However, the preview tools or software are highly versatile and cannot be customized to meet the needs of different businesses. For various documents with huge memory, smooth previews cannot be performed. It is necessary to optimize the preview tools or software, or pay fees to open more document functions. In the related art, for documents with huge memory, the format of the document is transformed by some technical means, such as scanning and converting the document into a picture format (PDF format) or a hypertext markup language format (i.e., HTML format), so that it can be previewed smoothly. The document memory may be larger and only the most basic preview function can be realized, and special processing of the document content is not supported. Some important elements in the document, such as original image elements, cannot be downloaded and rendered by clicking, and navigation functions and link jumps cannot be realized. The corresponding title paragraph in the document can only be located by sliding. At this time, the document preview performance is greatly reduced.
[0146] Based on the above scenario, an embodiment of the present application improves an online preview method of a document by dividing the original document into multiple segments and then converting each segment into an HTML document, so that the memory size of the document will not be too large. The pictures in the document will be processed separately and uploaded to the file system. Then the picture address in the HTML file is replaced with the address of the picture in the file system, and then the title in the document is parsed. Through the multi-tree algorithm, the directory tree of the original document is constructed, and the directory jump function is realized by setting an anchor point in the HTML document.
[0147] For details, see Figure 4 , Figure 4 This is a processing flow chart of the word document preview method provided in the embodiment of the present application. Figure 4 To explain in detail.
[0148] In step 401, the word document uploaded by the user is obtained.
[0149] In some embodiments, when a user uploads a word document to be previewed on the client and initiates a document browsing request, the word document uploaded by the user is obtained. Here, there can be only one or more word documents uploaded by the user as documents to be previewed. For the sake of convenience, they are referred to as word documents below.
[0150] In step 402, the backend service is started in response to the request.
[0151] In step 403, file stream data is received.
[0152] When receiving a document browsing request initiated by a user, the relevant backend service or cloud service will be started to process the uploaded word document in response to the request. After the document service is started, the word document is received and stored in the form of data received from the file stream.
[0153] In step 404, document elements in the word document are parsed.
[0154] After the document is uploaded, the POI tool is used to load and parse the word document to obtain all the data in the document, including text and pictures (if any). After being parsed by POI, the word document is processed into two parts, an ordered list of document elements (IbodyElement) and an ordered list of picture elements (XWPFPictureData), which represent the document content (paragraphs, titles, tables, pictures, line breaks, etc.) and picture data (binary data) respectively. N document elements constitute the document content, and multiple picture elements constitute the document picture data, that is, one picture element represents a piece of document picture data, and the list order is the order in which the current picture appears in the document.
[0155] In some embodiments, when a word document is parsed using the POI tool, an address is assigned to each element in the document, and the image name field in the address is numbered in the order in which the images appear in the document, so that the document can be processed in a structured manner.
[0156] For example, if there are three pictures in a word document, the picture paths can be set to "word / media / image1.png", "word / media / image2.png", and "word / media / image3.png" respectively.
[0157] In step 405, n consecutive document elements in the document are packaged into a document segment.
[0158] In step 406, the document fragments are converted into HTML documents.
[0159] After the Word document is parsed into N document elements and image elements, considering that these document elements are in order, the consecutive n document elements can be grouped into a group, and the document elements included in each group are regarded as a document fragment. For details, see Figure 5 , Figure 5 is a schematic diagram of document segmentation processing provided by an embodiment of the present application, such as Figure 5As shown, after the word document is parsed, 11 ordered sequences of document elements are obtained, and then 3 consecutive document elements are taken as a group, thus obtaining a total of four groups, and then the document elements in each group are taken as a document fragment, thus obtaining four document fragments.
[0160] In some embodiments, in order to ensure that the document elements contained in each document fragment are distributed as evenly as possible, the document fragmentation algorithm can be used to perform document fragmentation. Specifically, the total number of document elements in a word document is m, and the number of pre-fragmented document elements is n. Then the number of document fragments p can be determined as the quotient of the total number of document elements and the number of pre-fragmented document elements (the remainder is rounded off), that is, p = m / n, and the actual minimum number of document fragments q is the quotient of the total number of document elements m and the number of document fragments (the remainder is rounded off), that is, q = m / p (rounded off). Finally, the actual maximum number of fragments Q is calculated based on the total number of document elements, the number of document fragments, and the actual minimum number of document fragments. The calculation formula is as shown in formula (1):
[0161] Q=q+(m–p*q) Formula (1)
[0162] In the above formula (1), m is the total number of document elements, p is the number of document fragments, and q is the actual minimum number of document fragments.
[0163] For example, the total number of document elements of a document is 215, and the number of pre-sharded document elements is 50. Then the number of document fragments p can be determined as 4 (i.e., 215 divided by 50), and the actual minimum number of document fragments q can be determined as 53 (i.e., 215 divided by 4). Finally, the actual maximum number of fragments is calculated to be 56 (i.e., 53+(215-4*53). Therefore, the final fragmentation results of all document elements of the document are: 53, 53, 53, 56. If each fragment is 50 on average, the fragmentation results are: 50, 50, 50, 50, 15. The last fragment is very small, and in extreme cases it may be equal to 1. This will increase the network request for loading the preview document.
[0164] like Figure 5 As shown, after the word document is segmented, format conversion is performed on each document segment to obtain document segments in HTML format, that is, each document segment is converted into a text segment in HTML format. When the terminal browser renders and displays the document, it can be rendered in sequence according to the order of the HTML text segments.
[0165] Through the embodiments of the present application, the fragmentation algorithm used during document fragmentation also reduces the distribution skew of the document fragments, so that the document elements of the document fragments are evenly distributed, reducing the network overhead of loading an additional document fragment.
[0166] Continue to see Figure 4 , in step 407, the document image is obtained and uploaded to the file system.
[0167] In step 408, the address of the image in the segmented HTML document is replaced with the address of the image on the file system.
[0168] In some embodiments, the word document may also carry image elements. For the ordered list of image elements obtained after parsing the word document, each image in the ordered list can be uploaded and saved to a file system or other image storage system (database), such as FastDFS. For details, see Figure 6 , Figure 6 is a schematic diagram of document image processing provided by an embodiment of the present application, such as Figure 6 As shown in the figure, the original word document is divided into four paragraphs according to the paragraphs, each paragraph can be used as a document segment, and each document segment may carry image elements (such as Figure 5 Paragraph 1, paragraph 2, paragraph 3), where paragraph 2 is a document segment, which contains not only document elements (text) but also pictures.
[0169] After POI parsing of the original word document fragments, all images in the document are uploaded to the system. When uploading to the system, a mapping relationship between the file system image address and the document image memory address is established, and the image size needs to be limited. If the size of the uploaded image is larger than the preset image size threshold of the file system, the image can be compressed to obtain a thumbnail of the current image, and then the original image and thumbnail are uploaded to the file system together, and the image memory address and thumbnail memory address are recorded at the same time.
[0170] After the corresponding position of the image in the document is parsed by POI, the image is converted into an address form, which is also the document image memory address, such as Figure 6 In the figure, the image memory data stores the document image memory addresses of Image 1, Image 2, and Image 3, which are " / image / 001, / image / 002, / image / 003" respectively. When the images are uploaded to the file system, each image has a corresponding file system image address in the system. If the image has a thumbnail, an additional thumbnail address must be saved. The addresses of Image 1, Image 2, and Image 3 in the file system are " / file / xxx, / file / yyy, / file / zzz" respectively. At this time, a mapping relationship between the file system image address and the document image memory address needs to be established, for example, Image 1: memory address / image / 001, file system address / file / xxx.
[0171] After format conversion is performed on each document segment, each document segment becomes a document in HTML format. At this time, the image position of the document segment is converted into an image tag (img tag) of an HTML element, and the image link address of the image tag corresponds to the image memory address before format conversion. For example, the link address of the image tag corresponding to image 1 is / image / 001. After format conversion, the link address of the image tag corresponding to image 1 will be replaced with the file system image address according to the mapping relationship between the file system image address and the document image memory address. Therefore, the link address of the image tag corresponding to image 1 is replaced from / image / 001 to " / file / xxx". The addresses of images 2 and 3 of other document segments will also be replaced in a similar way.
[0172] In some embodiments, the Jsoup tool can be used to parse the image tags in the HTML document fragments, and then the file system address of the current image is obtained from the file system according to the mapping relationship between the file system image address and the document image memory address, and then the image link address of the image tag is replaced with the file system image address and the address of the corresponding thumbnail. When the browser loads the image in the HTML document fragment, the thumbnail is first loaded according to the address of the thumbnail. When the thumbnail is selected, the original image is loaded according to the file system image address. Thus, by loading the thumbnail, the image rendering time can be reduced, and the efficiency of document loading can be improved.
[0173] Through the embodiments of the present application, when the document fragments are parsed, the image data contained therein is processed separately and saved in the file system. When rendering, the data is accessed through the file system image address without the need for local loading. In combination with the thumbnail method, the efficiency of image loading is improved, thereby enhancing the user's preview experience.
[0174] Continue to see Figure 4 In step 409, the document titles are parsed in order according to the document meta-attributes.
[0175] In step 410, the document directory tree is reorganized based on a multi-tree algorithm.
[0176] In some embodiments, after a word document is parsed into N document elements by POI, if the document element belongs to the title of the document, it corresponds to the title tag (style tag) in the html element after format conversion processing, so the document meta-attribute (i.e., title attribute) can be parsed to determine whether the tag attribute value of each document element is the title level, thereby determining the title in the word document (e.g., first-level title, second-level title, ..., n-level title), and then all the titles are formed into a nested array list, and then the algorithm for generating a tree through array conversion, such as an array flattening processing method, a multi-tree algorithm or other recursive algorithm, is used to convert the nested array list into a multi-tree structure as the word document directory tree. The document target tree represents the directory structure of the word document, so that any title position or text position of the document can be located at any time.
[0177] In step 411, the title in the document fragment HTML is parsed, and the relationship between the directory tree and the title in HTML is established.
[0178] In some embodiments, after all document segments of a word document are formatted and processed to obtain text segments in HTML format, the Jsoup tool can be used to parse the HTML document segments to obtain the first-level sub-tags (i.e., paragraph tags) in the HTML document segments.
[0179] Next, traverse the first-level subtags of each HTML document fragment. If it is determined that the tag content of the first-level subtag is the title in the document, the first-level subtag is considered to be a title tag, and an identifier (id) is set for the current title tag, which is the document anchor id. The same identifier id is also set corresponding to the position of the current tag in the document directory tree. In this way, a binding relationship is established between the document anchor and the document directory tree. You can jump to the title position corresponding to the document anchor by clicking the document directory, thereby achieving the effect of clicking the directory to jump.
[0180] Through the embodiments of the present application, the title attributes in the document fragments are extracted to construct a document directory tree, and a binding relationship between the document anchor and the document directory tree is established, thereby realizing the function of jumping through the document directory navigation, thereby quickly locating any title position of the document, further improving the user's preview experience.
[0181] In step 412, the document HTML fragment data is stored.
[0182] In step 413, the document directory tree and document fragment meta information are stored.
[0183] After all document fragments in the word document are converted to HTML format, all fragment data are stored in the database in sequence. After storage, a list of document fragment identifiers (ID) is recorded. The order of this list records the order of the document fragments. After the document title is parsed in order according to the document meta-attributes, the document directory tree constructed according to the title attributes will also be stored in the database and combined with the document fragment identifier list to form the document fragment metadata.
[0184] In step 414, rendering of the preview document begins in response to the request.
[0185] In step 415, the document directory tree and document fragment meta information are returned.
[0186] After processing the word document to be previewed and saving the document directory tree and document fragment metadata information of the word document in the database, the current word document is rendered and previewed in response to the preview request. The document metadata is requested from the database, and the database returns the document directory tree and document fragment metadata, that is, the document directory tree and the document fragment identifier (id).
[0187] In step 416, the document directory tree is rendered, and the document segments are loaded in order according to the document segment identifiers.
[0188] In step 417, the rendered image is loaded according to the image address on the html image tag.
[0189] After obtaining the first-level document fragment identifier of the document target tree returned by the database, the body of the entire word document can be rendered according to the document target tree. In this process, all HTML document fragments are rendered in sequence according to the document fragment sequence of the document fragment identifier. For document fragments carrying images, the current image is rendered according to the image address on the HTML image tag, that is, the current image is rendered according to the file system image address that has been replaced and the current image thumbnail address.
[0190] In step 418, the document is loaded for preview.
[0191] When all HTML document fragments are rendered, it means that the document is loaded and can be previewed. When the document fragments are rendered, there is no order in which the document directory and document fragments are loaded, and there is no order in which the document fragments are loaded. However, the order in which the HTML document fragments appear must strictly follow the order of the document fragment identifier list, otherwise the document order will be disrupted. In other words, the HTML document fragment identifier list is an ordered list, and the order in which the text fragments are loaded and rendered is in accordance with the order in which the document content is displayed. When loading the document, the third document fragment can be loaded first, but the order in which the document fragments are presented on the page must be after the first document fragment to ensure that the document structure is not messed up.
[0192] For loading pictures in HTML document segments, after the HTML document segments are rendered, the corresponding pictures are loaded to the file system through the file system picture address and thumbnail address for rendering. If the currently rendered picture stores thumbnails, the thumbnail of the picture is first rendered according to the thumbnail address, and then the original picture is rendered according to the file system picture address. At this time, the thumbnail is rendered and displayed in the document. If you need to view the original picture of the currently rendered picture, you can click on the thumbnail to load the original picture for display. Therefore, the word document preview method provided in the embodiment of the present application has been combined with Figure 4 The steps are introduced.
[0193] See also Figure 7 , Figure 7 It is an optional flow chart of the word document preview method provided in the embodiment of the present application.
[0194] In step 701, the uploaded word document is obtained.
[0195] In some embodiments, the browser uploads the word document to the server, and after receiving the word document file, the server uploads it to the file system, such as FastDFS, by establishing a document parsing message and sending it to the message queue.
[0196] In step 702, a parsing tool is called to parse the document to obtain the document memory data format and the image memory data.
[0197] The document parsing service listens to the document parsing messages in the message queue, then downloads the word document from the file system, loads and parses it using the POI tool, and obtains an ordered list of document elements and an ordered list of image data.
[0198] In step 703, the document is segmented.
[0199] Determine the number of document fragments, group the document into n document elements according to the number of document fragments, take the document elements of each group as a document fragment, fragment the word, and convert each document fragment into HTML text.
[0200] In step 704 , the image data in the slice of the document is uploaded to the file system, and the process proceeds to step 707 .
[0201] Get an ordered list of image data and upload all image data to the file system (FastDFS). During uploading, if the image size exceeds a certain size, compress the image again, and then upload the thumbnail and the original image to the file system at the same time. The file system sets a file system image address and a corresponding thumbnail address for each thumbnail and original image.
[0202] In step 705 , the word document fragments are formatted and processed to obtain HTML format document fragments, and the process proceeds to step 707 .
[0203] Each document fragment is formatted separately to obtain a document fragment in HTML format.
[0204] In step 706 , a document directory tree is constructed, and the process proceeds to step 707 .
[0205] Call the parsing tool to parse the document elements with style attributes and numbers in the document fragments, determine whether the document element is a title, and form a document directory list in a nested array format by determining the titles in the document. Then, through the array conversion tree algorithm, the directory list is converted into a directory tree to obtain the document directory tree. Then use the Jsoup tool to parse the HTML format document fragments, parse the first-level sub-tags in the HTML document to determine whether it is a document title, and set the identifier at the title tag as the document anchor, corresponding to the position of the current title tag in the document directory tree, and set the same identifier bound to the document directory tree, so that you can jump to the document title position by clicking on the directory, achieving the effect of clicking on the directory to jump.
[0206] It should be noted that in Figure 7 In the embodiment of the present invention, steps 703 to 704, steps 703 to 705, and steps 703 to 706 are executed in any order and can be executed serially or in parallel. Where permitted, the specific order or sequence can be interchanged so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. The corresponding steps of the embodiments of the present application are arranged for different processing for the convenience of explanation, but should not be regarded as limiting the order of execution.
[0207] In step 707, the image tag address of the HTML format document segment is replaced.
[0208] Parse the image tags in the HTML document fragments and replace the original memory addresses of the images on the image tags with the corresponding file system image addresses.
[0209] In step 708, the document parsing result is saved.
[0210] Each HTML document is fragmented and saved to the database one by one in the order in which the documents appear, to obtain an array of document fragment identifiers, and then the document directory tree and the document fragment identifier array are combined into document metadata and saved to the database.
[0211] When responding to a browsing request, the document metadata is obtained from the database, the word document is rendered and displayed according to the document directory tree, and the document fragments are rendered in sequence according to the order of the document fragment identifier data. After the document is rendered, it can be queried.
[0212] Through the embodiment of the present application, the document to be previewed is parsed and then processed by a fragmentation algorithm to obtain multiple document fragments, and then the multiple document fragments are formatted and processed to obtain HTML format document fragments, and then all HTML format document fragments are rendered in sequence according to the order of appearance of the document fragments. Not only does it take advantage of the advantage of HTML format documents being easy to render, but the adopted fragmentation algorithm also reduces the distribution inclination of document fragments, so that the document elements of the document fragments are evenly distributed, and reduces the network overhead of additionally loading sequential document fragments. When the document fragments are parsed and processed, the image data contained therein is processed separately, and the images are stored in the file system. When rendering, the data is accessed through the file system image address without local loading, and the efficiency of image loading is improved in the combination of thumbnails, which improves the user's preview experience. In addition, the title attributes in the document fragments are extracted to construct a document directory tree, and a document anchor is established to bind to the document directory tree, realizing the function of jumping through the document directory navigation, thereby quickly locating any title position of the document, further improving the user's preview experience.
[0213] The following is a description of an exemplary structure of the document online preview device 453 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2As shown, the software modules stored in the document online preview device 453 of the memory 440 may include: a parsing module 4531, used to parse the online document in the original format to obtain N document elements of the online document; a fragmentation module 4532, used to fragment the N document elements of the online document based on a fragmentation strategy to obtain M document fragments in the original format, wherein one document fragment in the original format includes one document element or multiple continuous document elements, and the fragmentation strategy includes: at least one of a fragmentation balance strategy and a semantic continuity strategy, N is an integer greater than 1, and M is an integer greater than 1; a format conversion module 4533, used to perform format conversion processing on the M document fragments in the original format respectively to obtain document fragments in the preview format, and one document fragment in the original format corresponds to one document fragment in the preview format; a rendering module 4534, used to render the M document fragments in the preview format according to the distribution order of the M document fragments in the original format in the online document.
[0214] In some embodiments, the fragmentation module 4532 is also used to fragment N document elements of the online document based on a fragmentation balance strategy to obtain multiple document fragments in the original format when the real-time network speed is less than the real-time network speed threshold; when the content complexity of the online document does not exceed the complexity threshold, or the number of initial document fragments is less than the number threshold, use the multiple document fragments in the original format as M document fragments in the original format; when the content complexity of the online document exceeds the complexity threshold and the number of initial document fragments is not less than the number threshold, perform fragmentation adjustment processing on the multiple document fragments in the original format based on a semantic continuity strategy to obtain M document fragments in the original format.
[0215] In some embodiments, the fragmentation module 4532 is also used to combine multiple document fragments in the order of distribution in the online document to obtain an initial document fragment sequence; perform the following processing on every two adjacent initial document fragments in the initial document fragment sequence: calculate the semantic similarity of two adjacent initial document fragments; merge two adjacent initial document fragments whose semantic similarity is greater than a semantic similarity threshold to obtain a merged document fragment; and use the obtained merged document fragment and the unmerged initial document fragments as M document fragments in the original format.
[0216] In some embodiments, the sharding module 4532 is also used to obtain a pre-sharding size corresponding to a sharding balance strategy; obtain a document element sequence consisting of N document elements, wherein the document element sequence is arranged in the order of distribution of each document element in the online document; and segment the document element sequence according to the pre-sharding size and the total number of N document elements in the online document to obtain multiple subsequences, wherein the M subsequences are M document fragments in the original format.
[0217] In some embodiments, the fragmentation module 4532 is further used to determine the number of subsequences and the number of document elements included in a subsequence based on the pre-fragmentation size and the total number of N document elements in the online document; and to segment the document element sequence according to the number of subsequences and the number of document elements included in a subsequence to obtain M subsequences.
[0218] In some embodiments, the fragmentation module 4532 is further used to use the first quotient of the total number and the pre-fragmentation size as the number of subsequences M; use the second quotient of the total number and the number of subsequences as the actual minimum number of fragments; calculate the actual maximum number of fragments based on the actual minimum number of fragments, the number of subsequences and the total number; the number of document elements included in a subsequence is equal to the actual maximum number of fragments M-1 subsequences, and the number of document elements included in each subsequence is equal to the actual minimum fragmentation data.
[0219] In some embodiments, the format conversion module 4533 is also used to perform preview format conversion processing on each document segment in the original format to obtain a document segment converted into the preview format; if the document segment in the original format does not include an image tag link of the image, the document segment converted into the preview format is a document segment in the preview format; if the document segment in the original format includes an image tag link of the image, the storage address of the image data of the image in the file system is queried based on the image tag link of the image, and the image tag link of the image is replaced with the storage address of the image data of the image in the file system to obtain the document segment in the preview format.
[0220] In some embodiments, the rendering module 4534 is also used to render non-image content in the document segment in the preview format; if the document segment in the preview format includes the storage address of the image in the file system, the image data of the image is obtained from the file system based on the storage address, and rendering processing is performed on the image data.
[0221] In some embodiments, the rendering module 4534 is also used to obtain the original image of the image from the file system as the image data based on the storage address if the memory space occupied by the original image of the image is less than or equal to the memory space threshold; if the memory space occupied by the original image of the image is greater than the memory space threshold, obtain a thumbnail of the image from the file system as the image data based on the storage address.
[0222] In some embodiments, the segmentation module 4532 is also used to obtain an image tag link and convert the original image of the image in the original format document segment into an image tag link; upload the image data of the image to the file system; establish a mapping relationship between the storage address of the image in the file system and the image tag link of the image; wherein the image data of the image is generated based on the original image of the image.
[0223] In some embodiments, the fragmentation module 4532 is further used to generate a document directory tree based on the document element as the title of the online document and the title level when the document fragment in the original format includes a document element as the title of the online document.
[0224] In some embodiments, the format conversion module 4533 is also used to obtain the paragraph tag of each document element included in the document segment of the preview format; when the content corresponding to the paragraph tag is a title, an anchor identifier is configured for the paragraph tag, and the anchor identifier is bound to the corresponding title in the document directory tree, wherein the anchor identifier is used to jump to the content corresponding to the anchor identifier when the bound title is triggered.
[0225] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the document online preview method described in the embodiment of the present application.
[0226] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the document online preview method provided by the embodiment of the present application.
[0227] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0228] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0229] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0230] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0231] In summary, through the embodiment of the present application, the online document to be previewed is parsed and then sliced through the slice strategy to obtain multiple document slices, and then the multiple document slices are format converted to obtain preview format document slices, and then all preview format document slices are rendered in sequence according to the order of appearance of the document slices. Not only does it take advantage of the easy rendering of the preview format document, but the adopted slice strategy and slice algorithm also reduce the distribution tilt of the document slices, so that the document elements of the document slices are evenly distributed, reducing the network overhead of additional loading of sequential document slices. When the document slices are parsed, the image data contained therein is processed separately and saved in the file system, so that when rendering, the data is accessed through the file system image address without local loading, and the efficiency of image loading is improved in combination with the thumbnail method, which improves the user's preview experience. In addition, the title attribute in the document slice is extracted to construct a document directory tree, and the document anchor of the document title tag is established and bound to the document directory tree, realizing the function of jumping through the document directory navigation, thereby quickly locating any title position of the document, further improving the user's preview experience.
[0232] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A document online preview method, characterized in that: The method comprises: Parsing the online document in the original format to obtain N document elements of the online document; Slice the N document elements based on a slicing strategy to obtain M document slices in an original format, wherein one document slice includes one document element or multiple continuous document elements, the slicing strategy includes at least one of a slicing balance strategy and a semantic continuity strategy, N is an integer greater than 1, and M is an integer greater than 1; Performing format conversion processing on the M document segments in the original format to obtain M document segments in the preview format, wherein the M document segments in the original format correspond to the M document segments in the preview format one by one; The M document segments in the preview format are rendered according to the distribution order of the M document segments in the original format in the online document.
2. The method according to claim 1, characterized in that The sharding strategy includes a sharding balance strategy and a semantic continuity strategy; The fragmentation process of the N document elements based on the fragmentation strategy to obtain M document fragments in the original format includes: In the case where the real-time network speed is less than the real-time network speed threshold, the N document elements are fragmented based on the fragmentation balancing strategy to obtain a plurality of initial document fragments in the original format; When the content complexity of the online document does not exceed a complexity threshold, or the number of initial document fragments is less than a number threshold, the multiple initial document fragments in the original format are used as M document fragments in the original format; When the content complexity of the online document exceeds the complexity threshold and the number of initial document fragments is not less than the number threshold, based on the semantic continuity strategy, fragment adjustment processing is performed on the multiple initial document fragments in the original format to obtain M document fragments in the original format.
3. The method according to claim 2, characterized in that The method of performing segment adjustment processing on the multiple initial document segments in the original format based on the semantic continuity strategy to obtain M document segments in the original format includes: Combining the multiple initial document fragments according to the distribution order in the online document to obtain an initial document fragment sequence; The following processing is performed for every two adjacent initial document fragments in the initial document fragment sequence: calculating the semantic similarity of the two adjacent initial document fragments; Merging the two adjacent initial document fragments whose semantic similarity is greater than a semantic similarity threshold to obtain a merged document fragment; The obtained merged document fragments and the unmerged initial document fragments are used as the M document fragments in the original format.
4. The method according to claim 1, characterized in that The sharding strategy includes a sharding balancing strategy, and the sharding process is performed on the N document elements based on the sharding strategy to obtain M document shards in the original format, including: Obtain the pre-sharding size corresponding to the sharding balancing strategy; Acquire a document element sequence consisting of the N document elements, wherein the document element sequence is arranged according to the distribution order of each document element in the online document; According to the pre-segment size and the total number of the N document elements, the document element sequence is segmented to obtain M subsequences, where the M subsequences are the M document segments in original formats.
5. The method according to claim 4, characterized in that The segmenting process is performed on the document element sequence according to the pre-segmentation size and the total number of the N document elements to obtain M subsequences, including: Determine the number M of subsequences and the number of document elements included in one subsequence according to the pre-segmentation size and the total number of the N document elements; According to the number M of the subsequences and the number of document elements included in one subsequence, the document element sequence is segmented to obtain the M subsequences.
6. The method according to claim 5, characterized in that The determining, according to the pre-segmentation size and the total number of the N document elements, the number of subsequences M and the number of document elements included in one subsequence comprises: Taking a first quotient of the total number and the pre-slicing size as the number M of the subsequences; Taking a second quotient of the total number and the number of the subsequences as the actual minimum number of fragments; The actual maximum number of fragments is calculated according to the actual minimum number of fragments, the number of subsequences and the total number; The number of document elements included in one subsequence is equal to the actual maximum number of fragments, and the number of document elements included in each subsequence in the M-1 subsequences is equal to the actual minimum number of fragments.
7. The method according to claim 1, characterized in that The step of performing format conversion processing on the M document segments in the original format to obtain the M document segments in the preview format includes: Performing preview format conversion processing on each document segment in the original format to obtain a document segment converted into a preview format; If the document segment in the original format does not include an image tag link of an image, the document segment converted into the preview format is the document segment in the preview format; If the document segment in the original format includes an image tag link of an image, the storage address of the image data of the image in the file system is queried based on the image tag link of the image, and the image tag link of the image is replaced with the storage address of the image data of the image in the file system to obtain the document segment in the preview format.
8. The method according to claim 1, characterized in that The rendering of the M document segments in the preview format according to the distribution order of the M document segments in the original format in the online document includes: Renders non-image content in document slices in preview format; If the document segment in the preview format includes a storage address of an image in a file system, image data of the image is acquired from the file system based on the storage address, and rendering processing is performed on the image data.
9. The method according to claim 8, characterized in that The acquiring the image data of the image from the file system based on the storage address comprises: If the memory space occupied by the original image of the image is less than or equal to the memory space threshold, obtaining the original image of the image from the file system as the image data based on the storage address; If the memory space occupied by the original image of the image is greater than the memory space threshold, a thumbnail of the image is obtained from the file system based on the storage address as the image data.
10. The method according to claim 7, characterized in that Before querying the storage address of the image data of the image in the file system based on the image tag link of the image, the method further includes: Obtaining an image tag link, and converting an original image of the image in the document slice in the original format into the image tag link; uploading image data of the image to the file system; Establishing a mapping relationship between a storage address of the image in the file system and an image tag link of the image; The image data of the image is generated based on the original image of the image.
11. A document online preview device, characterized in that: The device comprises: A parsing module, used for parsing the online document in the original format to obtain N document elements of the online document; A fragmentation module, configured to fragment the N document elements based on a fragmentation strategy to obtain M document fragments in an original format, wherein one document fragment includes one document element or multiple continuous document elements, and the fragmentation strategy includes at least one of a fragmentation balance strategy and a semantic continuity strategy, N is an integer greater than 1, and M is an integer greater than 1; A conversion module, used for performing format conversion processing on the M document segments in the original format to obtain the M document segments in the preview format, wherein the M document segments in the original format correspond to the M document segments in the preview format one by one; The rendering module is used to render the M document segments in the preview format according to the distribution order of the M document segments in the original format in the online document.
12. An electronic device, characterized in that: The electronic device comprises: Memory for storing computer executable instructions or computer programs; The processor is configured to implement the document online preview method according to any one of claims 1 to 10 when executing the computer executable instructions or computer programs stored in the memory.
13. A readable storage medium storing computer executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the document online preview method according to any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Document preview method and electronic equipment
CN121562546A
Document preview method and electronic device
CN121562546B