Cross-platform document task processing method, device and equipment based on multi-thread parallelism
Through the cross-platform document task processing method based on multi-threaded parallelism, the task of processing PDF documents is decomposed and parallelized, and the problems of large R&D investment, low efficiency and insufficient convenience in traditional methods are solved, and efficient and convenient document processing and cross-border processing are achieved. Platform compatibility.
Patent Information
- Application Number
- CN202411490679.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-14
AI Technical Summary
Traditional PDF document processing methods have problems such as large investment in R&D, low efficiency and insufficient convenience.
A cross-platform document task processing method based on multi-threaded parallelism is adopted. By obtaining user needs and operations, target tasks are created, decomposed into subtasks, and parallel processing is realized, incremental parsing and pagination rendering are achieved.
It improves the efficiency and convenience of document processing, reduces R&D costs, and enhances cross-platform compatibility and user experience.
Smart Images

Figure CN119440760A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document processing technology, and in particular to a cross-platform document task processing method, device and equipment based on multi-threaded parallelism. Background Art
[0002] Currently, for the processing (such as generation, editing, etc.) of PDF documents, Adobe Acrobat software, iText open source library, etc. are usually used to develop document processing functions, and they are put into use only after the development is completed.
[0003] However, practice has found that the traditional document processing through Adobe Acrobat software has large R&D investment and low R&D efficiency, which easily leads to low document processing efficiency; while the document processing function developed through the iText open source library is not convenient enough and has low document processing efficiency. It can be seen that it is particularly important to propose a technical solution to improve document processing efficiency. Summary of the invention
[0004] The present invention provides a cross-platform document task processing method, device and equipment based on multi-threaded parallelism, which can improve the efficiency of document processing and help improve the convenience of document processing.
[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a cross-platform document task processing method based on multi-threaded parallelism, the method is applied to a cross-platform document task processing system based on multi-threaded parallelism, and the system includes a network attached storage device and an electronic device, the network attached storage device is communicatively connected with the electronic device, and the method includes:
[0006] Acquire a user's demand for a target document and a user operation on the target document triggered by the user on a target platform;
[0007] Creating a target task corresponding to the target document according to the user demand and the user operation, the target task including an incremental parsing task and / or a paging rendering task;
[0008] The target task is decomposed into multiple subtasks, and based on a parallel processing algorithm, a comprehensive processing operation is performed on all the subtasks in parallel to obtain a comprehensive processing result of the target document, wherein the comprehensive processing result includes an incremental parsing result and / or a paged rendering result.
[0009] As an optional embodiment, in the first aspect of the present invention, the method further comprises:
[0010] When the target task includes the incremental parsing task, determining basic information of the target document, the basic information of the target document including one or more combinations of a document version number of the target document, an object directory of the target document, and a file length of the target document;
[0011] Based on the incremental parsing algorithm, a parsing operation is performed on the target document according to the basic information; or,
[0012] When the target task includes the paged rendering task, determining the target rendering queue corresponding to the paged rendering task, and performing a rendering operation on the target document according to the target rendering queue based on a paged rendering algorithm; or
[0013] When the target task includes the incremental parsing task and the paging rendering task, the operation of decomposing the target task into a plurality of subtasks is triggered.
[0014] As an optional implementation, in the first aspect of the present invention, performing a parsing operation on the target document based on the basic information based on a parsing incremental algorithm includes:
[0015] Based on the basic information, the directory structure of the target document is parsed to obtain directory parsing information of the target document, wherein the directory parsing information includes the position of each object in the target document in the target document;
[0016] According to the user demand and the user operation, determining the target object that needs to be processed currently in the target document from all the objects, the target object including one or more combinations of pages, fonts and images;
[0017] Based on a parsing incremental algorithm, a parsing operation is performed on the target document.
[0018] As an optional implementation, in the first aspect of the present invention, determining the target rendering queue corresponding to the paging rendering task includes:
[0019] According to the user operation, determining the target page that the target document currently needs to display, and loading the target page into a preset rendering queue;
[0020] When the target document is a multi-page document, obtaining the sorting information of each page of the target document;
[0021] According to the sorting information of all the pages, adjacent pages of the target page are screened out from all the pages, wherein the adjacent pages include a previous page of the target page and / or a subsequent page of the target page;
[0022] The adjacent pages of the target page are synchronously loaded into the rendering queue to obtain the target rendering queue corresponding to the paging rendering task.
[0023] As an optional implementation manner, in the first aspect of the present invention, creating the target task corresponding to the target document according to the user demand and the user operation includes:
[0024] Generate a to-be-executed strategy for the target object in the target document according to the user demand, wherein the to-be-executed strategy includes a parsing strategy and / or a rendering strategy;
[0025] Analyzing the policy adjustment requirements of the to-be-executed policy according to the user operation, wherein the user operation includes one or more combinations of page turning, zooming, and page sliding;
[0026] According to the policy adjustment requirement, the policy to be executed is adjusted to obtain the target policy of the target document;
[0027] According to the target strategy, a task matching the target object is created as a target task corresponding to the target document.
[0028] As an optional embodiment, in the first aspect of the present invention, the method further comprises:
[0029] Acquire processing data generated during the process of executing the processing operation corresponding to the target task;
[0030] Based on a streaming compression algorithm, a compression operation is performed on the processed data to obtain compressed document content, so that the processing operation and the compression operation are performed synchronously;
[0031] The compressed document content is written into a preset file system to save the target document.
[0032] As an optional implementation manner, in the first aspect of the present invention, decomposing the target task into a plurality of subtasks includes:
[0033] Obtaining the task content of the target task, and analyzing the complexity of the target task according to the task content of the target task;
[0034] Acquire device information of a document processing device corresponding to the target platform, and analyze the device processing capability of the document processing device according to the device information;
[0035] Determining the task decomposition requirements of the target task according to the complexity of the target task and the device processing capability of the document processing device;
[0036] Based on the task decomposition requirements of the target task, the target task is decomposed into multiple subtasks.
[0037] The second aspect of the present invention discloses a cross-platform document task processing device based on multi-threaded parallelism, the device is applied to a cross-platform document task processing system based on multi-threaded parallelism, and the system includes a network attached storage device and an electronic device, the network attached storage device is communicatively connected with the electronic device, and the device includes:
[0038] An acquisition module, used to acquire a user's demand for a target document and a user operation on the target document triggered by the user on a target platform;
[0039] A creation module, used to create a target task corresponding to the target document according to the user demand and the user operation, wherein the target task includes an incremental parsing task and / or a paging rendering task;
[0040] A decomposition module, used for decomposing the target task into multiple subtasks;
[0041] The parallel processing module is used to perform comprehensive processing operations on all the subtasks in parallel based on a parallel processing algorithm to obtain a comprehensive processing result of the target document, wherein the comprehensive processing result includes an incremental parsing result and / or a page rendering result.
[0042] As an optional implementation, in the second aspect of the present invention, the device further includes:
[0043] A determination module, used for determining basic information of the target document when the target task includes the incremental parsing task, the basic information of the target document including one or more combinations of a document version number of the target document, an object directory of the target document, and a file length of the target document;
[0044] A parsing module, configured to perform a parsing operation on the target document based on the basic information based on a parsing incremental algorithm;
[0045] The determination module is further configured to determine a target rendering queue corresponding to the paging rendering task when the target task includes the paging rendering task;
[0046] A rendering module, configured to perform a rendering operation on the target document according to the target rendering queue based on a paged rendering algorithm;
[0047] When the target task includes the incremental parsing task and the paging rendering task, the parallel processing module is triggered to perform the operation of decomposing the target task into a plurality of subtasks.
[0048] As an optional implementation, in the second aspect of the present invention, the parsing module performs the parsing operation on the target document based on the basic information based on the parsing incremental algorithm, specifically including:
[0049] Based on the basic information, the directory structure of the target document is parsed to obtain directory parsing information of the target document, wherein the directory parsing information includes the position of each object in the target document in the target document;
[0050] According to the user demand and the user operation, determining the target object that needs to be processed currently in the target document from all the objects, the target object including one or more combinations of pages, fonts and images;
[0051] Based on a parsing incremental algorithm, a parsing operation is performed on the target document.
[0052] As an optional implementation, in the second aspect of the present invention, the manner in which the determination module determines the target rendering queue corresponding to the paging rendering task specifically includes:
[0053] According to the user operation, determining the target page that the target document currently needs to display, and loading the target page into a preset rendering queue;
[0054] When the target document is a multi-page document, obtaining the sorting information of each page of the target document;
[0055] According to the sorting information of all the pages, adjacent pages of the target page are screened out from all the pages, wherein the adjacent pages include a previous page of the target page and / or a subsequent page of the target page;
[0056] The adjacent pages of the target page are synchronously loaded into the rendering queue to obtain the target rendering queue corresponding to the paging rendering task.
[0057] As an optional implementation, in the second aspect of the present invention, the creation module creates the target task corresponding to the target document according to the user demand and the user operation, specifically including:
[0058] Generate a to-be-executed strategy for the target object in the target document according to the user demand, wherein the to-be-executed strategy includes a parsing strategy and / or a rendering strategy;
[0059] Analyzing the policy adjustment requirements of the to-be-executed policy according to the user operation, wherein the user operation includes one or more combinations of page turning, zooming, and page sliding;
[0060] According to the policy adjustment requirement, the policy to be executed is adjusted to obtain the target policy of the target document;
[0061] According to the target strategy, a task matching the target object is created as a target task corresponding to the target document.
[0062] As an optional implementation, in the second aspect of the present invention, the acquisition module is further used to acquire processing data generated during the execution of the processing operation corresponding to the target task;
[0063] And, the device further comprises:
[0064] A compression module, configured to perform a compression operation on the processed data based on a streaming compression algorithm to obtain compressed document content, so that the processing operation and the compression operation are performed synchronously;
[0065] The storage module is used to write the compressed document content into a preset file system to save the target document.
[0066] As an optional implementation, in the second aspect of the present invention, the decomposition module decomposes the target task into multiple subtasks in a manner that specifically includes:
[0067] Obtaining the task content of the target task, and analyzing the complexity of the target task according to the task content of the target task;
[0068] Acquire device information of a document processing device corresponding to the target platform, and analyze the device processing capability of the document processing device according to the device information;
[0069] Determining the task decomposition requirements of the target task according to the complexity of the target task and the device processing capability of the document processing device;
[0070] Based on the task decomposition requirements of the target task, the target task is decomposed into multiple subtasks.
[0071] A third aspect of the present invention discloses an electronic device, comprising:
[0072] A memory storing executable program code;
[0073] a processor coupled to the memory;
[0074] The processor calls the executable program code stored in the memory to execute the cross-platform document task processing method based on multi-threaded parallelism disclosed in the first aspect of the present invention.
[0075] A fourth aspect of the present invention discloses a network attached storage device, wherein the network attached storage device has a memory storing executable program code;
[0076] a processor coupled to the memory;
[0077] The processor calls the executable program code stored in the memory to execute the cross-platform document task processing method based on multi-threaded parallelism disclosed in the first aspect of the present invention.
[0078] The fifth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the cross-platform document task processing method based on multi-threaded parallelism disclosed in the first aspect of the present invention.
[0079] The sixth aspect of the present invention discloses a cross-platform document task processing system based on multi-threaded parallelism, the system comprising the electronic device disclosed in the third aspect of the present invention, and the electronic device is communicatively connected to the network attached storage device disclosed in the fourth aspect of the present invention, and the electronic device is installed with a computer application capable of executing the cross-platform document task processing method based on multi-threaded parallelism disclosed in the first aspect of the present invention.
[0080] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0081] The implementation of the present invention can obtain the user's needs for the target document and the user operations on the target document triggered by the user on the target platform, and create a target task corresponding to the target document according to the user's needs and user operations. The target task includes an incremental parsing task and / or a paging rendering task, which can improve the creation accuracy and efficiency of the target task corresponding to the target document. The target task is then decomposed into multiple subtasks, which improves the decomposition accuracy of the target task. Finally, after the pre-target task is decomposed, based on a parallel processing algorithm, a comprehensive processing operation is performed in parallel on all the subtasks obtained by the decomposition to obtain a comprehensive processing result of the target document. Incremental parsing tasks and paging rendering tasks can be processed in parallel during the document processing process, which is beneficial to improving the processing efficiency and processing speed of the document. The document processing process developed by the Dart language can realize cross-platform processing of the target document, which is beneficial to improving the compatibility of cross-platform document processing, as well as to improving the processing efficiency and convenience of the document, thereby helping to improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0083] Figure 1 It is a flowchart of a cross-platform document task processing method based on multi-threaded parallelism disclosed in an embodiment of the present invention;
[0084] Figure 2 It is a flowchart of another cross-platform document task processing method based on multi-threaded parallelism disclosed in an embodiment of the present invention;
[0085] Figure 3 It is a structural schematic diagram of a cross-platform document task processing device based on multi-threaded parallelism disclosed in an embodiment of the present invention;
[0086] Figure 4 It is a structural schematic diagram of another cross-platform document task processing device based on multi-threaded parallelism disclosed in an embodiment of the present invention;
[0087] Figure 5 is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention;
[0088] Figure 6 It is a schematic diagram of the structure of a network attached storage device disclosed in an embodiment of the present invention;
[0089] Figure 7 It is a structural diagram of a cross-platform document task processing system based on multi-threaded parallelism disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0090] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0091] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.
[0092] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0093] The present invention discloses a cross-platform document task processing method, device and equipment based on multi-threaded parallelism, which can obtain the user demand of the user for the target document and the user operation for the target document triggered by the user on the target platform, and create the target task corresponding to the target document according to the user demand and the user operation, the target task includes an incremental parsing task and / or a paging rendering task, which can improve the creation accuracy and efficiency of the target task corresponding to the target document, and then decompose the target task into multiple subtasks, which improves the decomposition accuracy of the target task. Finally, after the pre-target task is decomposed, based on the parallel processing algorithm, all the subtasks obtained by the decomposition are performed in parallel to obtain the comprehensive processing result of the target document, which can realize the parallel processing of the incremental parsing task and the pressure-dividing rendering task in the document processing process, which is conducive to improving the processing efficiency and processing speed of the document, and the document processing flow developed by the Dart language can realize the cross-platform processing of the target document, which is conducive to improving the compatibility of cross-platform document processing, and is conducive to improving the processing efficiency and convenience of the document, so as to improve the user experience. The following are described in detail.
[0094] Embodiment 1
[0095] See also Figure 1 , Figure 1 1 is a flow chart of a cross-platform document task processing method based on multi-threaded parallelism disclosed in an embodiment of the present invention. Figure 1The described cross-platform document task processing method based on multi-threaded parallelism can be developed based on the Dart language, wherein the method developed based on the Dart language has better cross-platform performance, can run stably in a variety of operating systems and environments, and the cross-platform document task processing method based on multi-threaded parallelism can be applied to a cross-platform document task processing system based on multi-threaded parallelism, and the system includes a network attached storage device and an electronic device, the network attached storage device is communicatively connected to the electronic device, and the method can also be applied to a cross-platform document task processing device based on multi-threaded parallelism, wherein the device may include a processing device or a processing server, wherein the processing server may include a cloud server or a local server, and the embodiments of the present invention do not limit this. Figure 1 As shown, the cross-platform document task processing method based on multi-threaded parallelism may include the following operations:
[0096] 101. Obtain user requirements for a target document and user operations on the target document triggered by the user on a target platform.
[0097] In an embodiment of the present invention, optionally, user requirements may include one or more combinations of user requirements for page display of the target document, user requirements for image display of the target document, and user requirements for font display of the target document, wherein the page display requirement may include a requirement for displaying the number of pages and a requirement for display ratio of the corresponding page (the ratio of the page to the display screen of the display device), the image display requirement may include a combination of one or more requirements for image clarity, image resolution, image scaling ratio, and image brightness, and the font display requirement may include a combination of one or more requirements for font type, color of the corresponding font type, and size of the corresponding font type, which is not limited in the embodiment of the present invention.
[0098] In an embodiment of the present invention, optionally, the user operation may include one or more combinations of a user's page turning operation on the target document, a user's page scrolling operation on the target document, and a user's editing operation on any object in the target document (such as a page, font, image, etc.).
[0099] 102. Create target tasks corresponding to the target documents based on user needs and user operations.
[0100] In an embodiment of the present invention, the target task may include an incremental parsing task and / or a paged rendering task. Wherein, when the target task includes an incremental parsing task, the parsing operation corresponding to the incremental parsing task may be performed, or a parallel processing operation based on multiple subtasks of the incremental parsing task may be performed; when the target task includes a paged rendering task, the rendering operation corresponding to the paged rendering task may be performed, or a parallel processing operation based on multiple subtasks of the paged rendering task may be performed; when the target task includes an incremental parsing task and a paged rendering task, the operation in step 103 may be triggered, and the embodiment of the present invention does not limit this.
[0101] 103. Break down the target task into multiple subtasks.
[0102] In the embodiment of the present invention, specifically, based on the to-be-parsed object contained in the incremental parsing task in the target task, the incremental parsing task is decomposed into a plurality of incremental parsing subtasks, wherein each incremental parsing subtask corresponds to an to-be-parsed object;
[0103] Based on the to-be-rendered page of the paging rendering task in the target task, the paging rendering task is decomposed into a plurality of paging rendering subtasks, wherein each paging rendering subtask corresponds to a to-be-rendered page.
[0104] 104. Based on the parallel processing algorithm, comprehensive processing operations are performed on all subtasks in parallel to obtain a comprehensive processing result of the target document.
[0105] In an embodiment of the present invention, the comprehensive processing result may include an incremental parsing result and / or a paged rendering result. Specifically, when the target task includes an incremental parsing task, the comprehensive processing result includes the incremental parsing result; when the target task includes a paged rendering task, the comprehensive processing result includes the paged rendering result; when the target task includes an incremental parsing task and a paged rendering task, the comprehensive processing result includes the incremental parsing result and the paged rendering result.
[0106] In an embodiment of the present invention, a parallel processing algorithm utilizes multi-threading or multi-core processing technology to process multiple tasks in parallel when parsing and rendering a PDF document, thereby improving overall processing efficiency and reducing delays.
[0107] It can be seen that implementation Figure 1The described cross-platform document task processing method based on multi-threaded parallelism can obtain the user's user needs for the target document and the user operations on the target document triggered by the user on the target platform, and create a target task corresponding to the target document according to the user needs and user operations, the target task includes an incremental parsing task and / or a paging rendering task, which can improve the creation accuracy and efficiency of the target task corresponding to the target document, and then decompose the target task into multiple subtasks, thereby improving the decomposition accuracy of the target task. Finally, after the pre-target task is decomposed, based on the parallel processing algorithm, a comprehensive processing operation is performed on all the subtasks obtained by the decomposition in parallel to obtain a comprehensive processing result of the target document, and can realize parallel processing of incremental parsing tasks and paging rendering tasks during the document processing process, which is conducive to improving the processing efficiency and processing speed of the document, and the document processing process developed by the Dart language can realize cross-platform processing of the target document, which is conducive to improving the compatibility of cross-platform document processing, and is conducive to improving the processing efficiency and convenience of the document, thereby helping to improve the user experience. In addition, the document processing process developed by the Dart language is conducive to reducing the cost of document processing compared with commercial software such as Adobe Acrobat used in the prior art.
[0108] In an optional embodiment, the method may further include:
[0109] When the target task includes an incremental parsing task, determine the basic information of the target document;
[0110] Based on the incremental parsing algorithm, the target document is parsed according to the basic information.
[0111] In the embodiment of the present invention, optionally, the basic information of the target document may include one or more combinations of a document version number of the target document, an object directory of the target document, and a file length of the target document.
[0112] Specifically, the basic information of the target document is determined in the following way:
[0113] Read the file header information of the target document, and identify the basic information of the target document based on the file header information. This can improve the recognition efficiency and accuracy of the basic information of the target document based on the file header information, thereby facilitating the subsequent parsing efficiency and speed of the document based on the quickly identified basic information.
[0114] In the embodiment of the present invention, an optional incremental parsing algorithm can gradually parse the structure of a PDF document without loading the entire PDF file at once, thereby reducing memory usage and is particularly suitable for processing large files.
[0115] It can be seen that this optional embodiment can automatically determine the basic information of the target document when the target task includes an incremental parsing task, thereby improving the efficiency and accuracy of determining the basic information of the target document, and then can perform parsing operations on the target document based on the basic information based on the incremental parsing algorithm, thereby improving the parsing efficiency and speed of the target document.
[0116] In this optional embodiment, as an optional implementation, performing a parsing operation on the target document based on the basic information based on the parsing incremental algorithm may include:
[0117] Based on the basic information, parse the directory structure of the target document to obtain the directory parsing information of the target document;
[0118] According to user needs and user operations, determine the target object that needs to be processed currently in the target document from all objects;
[0119] Based on the incremental parsing algorithm, the parsing operation is performed on the target document.
[0120] In an embodiment of the present invention, the directory parsing information includes the position of each object in the target document in the target document. Optionally, the basic information may also include a cross-reference table of the target document. Specifically, based on the cross-reference table, the specific position of each object in the target document is parsed. Optionally, the target object includes one or more combinations of pages, fonts, and images. Specifically, according to user needs and user operations, the content of each target object (such as: the content stream of each page) is gradually parsed and converted into visual content. After completing the necessary object loading and content parsing, the page is rendered for the user to view.
[0121] It can be seen that this optional implementation method can parse the directory structure of the target document based on the basic information, and obtain the directory parsing information of the target document (the target parsing information includes the position of each object in the target document in the target document), thereby improving the parsing accuracy and parsing efficiency of the target structure of the target document, and then determine the target object that currently needs to be processed in the target document from all objects according to user needs and user operations, and can improve the determination accuracy and determination efficiency of the target object based on the target parsing information obtained by accurate parsing, and perform parsing operations on the target document based on the parsing incremental algorithm, which can improve the parsing accuracy and parsing reliability of the target document, and can improve the parsing diversity and flexibility of the target document through diversified user needs and user operations.
[0122] In another optional embodiment, the method may further include:
[0123] When the target task includes a paged rendering task, a target rendering queue corresponding to the paged rendering task is determined, and based on the paged rendering algorithm, a rendering operation is performed on the target document according to the target rendering queue.
[0124] In an embodiment of the present invention, a page-based rendering algorithm processes and renders a PDF document in pages, only loading and rendering the page content currently required to be displayed, thereby optimizing the rendering speed and reducing the processor burden, and is particularly suitable for mobile devices.
[0125] It can be seen that this optional embodiment can automatically determine the target rendering queue corresponding to the paging rendering task when the target task includes a paging rendering task, thereby improving the determination accuracy and efficiency of the target rendering queue, and then performing the rendering operation on the target document according to the pre-set target rendering queue. The page switching speed and switching efficiency in the subsequent rendering process can be improved through the pre-loaded rendering queue, which is beneficial to improving the rendering speed and rendering efficiency of the page, as well as improving the accuracy of the paging rendering of the page.
[0126] In this optional embodiment, as an optional implementation, determining a target rendering queue corresponding to a paging rendering task includes:
[0127] According to the user operation, the target page that needs to be displayed at the current time of the target document is determined, and the target page is loaded into the preset rendering queue;
[0128] When the target document is a multi-page document, obtaining the sorting information of each page of the target document;
[0129] According to the sorting information of all pages, filter out the adjacent pages of the target page from all pages;
[0130] The adjacent pages of the target page are synchronously loaded into the rendering queue to obtain the target rendering queue corresponding to the paging rendering task.
[0131] In the embodiment of the present invention, optionally, the adjacent pages include the previous page of the target page and / or the next page of the target page. Specifically, when the target page is the first page in the target document, the adjacent pages of the target page include the next page of the target page; when the target page is the last page in the target document, the adjacent pages of the target page include the previous page of the target page; when the target page is neither the first page nor the last page, the adjacent pages of the target page include the previous page of the target page and the next page of the target page.
[0132] In the embodiment of the present invention, specifically, the method may further include:
[0133] Determine page markup information of the target page;
[0134] According to the page mark information of the target page, determining whether the page mark information is used to indicate whether there is a corresponding associated page for the target page;
[0135] When it is determined that the page mark information is used to indicate that the target page has a corresponding associated page, the associated page is synchronously loaded into the target rendering queue.
[0136] The page markup information of the target page may be determined in the following manner:
[0137] Sending a marking reminder message for the target page to the user to remind the user to mark the target page, and obtaining the marking information of the target page by the user as the page marking information of the target page; or
[0138] Analyze the page content of each page, and calculate the content relevance between each page based on the page content of all pages;
[0139] According to the content relevance between all pages, at least one page whose content relevance with the target page is greater than or equal to the preset relevance is screened out from all pages as the associated page corresponding to the target page, and the target page is marked according to the associated page corresponding to the target page to obtain the page marking information of the target page. In this way, by setting the analysis process of the page content relevance, the accuracy of determining the page associated with the target page that needs to be loaded into the rendering queue can be improved, and by loading the associated page into the rendering queue for rendering and display, it is helpful to further enrich the relevance and richness of the displayed page content, thereby helping to improve the user's viewing speed and viewing efficiency of the relevant page content of the target document, and further helping to improve the user's reading experience of the target document.
[0140] It can be seen that this optional implementation method can determine the target page that needs to be displayed currently in the target document according to the user operation, thereby improving the determination accuracy and efficiency of the target page, and loading the target page into the preset rendering queue, thereby improving the loading accuracy of the target page, which is beneficial to improving the subsequent rendering speed and efficiency of the target page based on the pre-loaded target page. When the target document is a multi-page document, the sorting information of each page of the target document is automatically obtained, and then the adjacent pages of the target page are filtered out from all pages according to the sorting information of all pages, thereby improving the filtering accuracy and filtering efficiency of the adjacent pages of the target page. Subsequently, the adjacent pages of the target page are synchronously loaded into the rendering queue to obtain the target rendering queue corresponding to the paging rendering task, thereby improving the loading accuracy of the adjacent pages. By setting the page determination process, it is beneficial to improve the determination accuracy, diversity and flexibility of the pages that need to be loaded into the rendering queue, thereby improving the determination accuracy, diversity and flexibility of the rendering queue.
[0141] Embodiment 2
[0142] See also Figure 2 , Figure 2 1 is a flow chart of a cross-platform document task processing method based on multi-threaded parallelism disclosed in an embodiment of the present invention. Figure 2 The described cross-platform document task processing method based on multi-threaded parallelism can be developed based on the Dart language, wherein the method developed based on the Dart language has better cross-platform performance, can run stably in a variety of operating systems and environments, and the cross-platform document task processing method based on multi-threaded parallelism can be applied to a cross-platform document task processing system based on multi-threaded parallelism, and the system includes a network attached storage device and an electronic device, the network attached storage device is communicatively connected to the electronic device, and the method can also be applied to a cross-platform document task processing device based on multi-threaded parallelism, wherein the device may include a processing device or a processing server, wherein the processing server may include a cloud server or a local server, and the embodiments of the present invention do not limit this. Figure 2 As shown, the cross-platform document task processing method based on multi-threaded parallelism may include the following operations:
[0143] 201. Obtain user requirements for a target document and user operations on the target document triggered by the user on a target platform.
[0144] 202. Generate a to-be-executed policy for a target object in a target document according to user requirements.
[0145] In the embodiment of the present invention, the strategy to be executed may include a parsing strategy and / or a rendering strategy.
[0146] 203. Analyze the policy adjustment requirements of the policy to be executed according to the user operation.
[0147] In an embodiment of the present invention, optionally, the user operation includes a combination of one or more of page turning, zooming, and page sliding. Specifically, according to the user operation, the user's input information for the target document on the system interface of the target platform is analyzed, and the policy to be adjusted is determined according to the user's input information to obtain the policy adjustment requirement. Optionally, the policy adjustment requirement may include a parsing policy adjustment requirement and / or a rendering policy adjustment requirement, which is not limited in the embodiment of the present invention.
[0148] 204. According to the policy adjustment requirement, the policy to be executed is adjusted to obtain the target policy of the target document.
[0149] In an embodiment of the present invention, specifically, when the policy adjustment requirement includes a parsing policy adjustment requirement, the parsing strategy is adjusted according to the parsing policy adjustment requirement to obtain a target parsing strategy for the target document; and / or, when the policy adjustment requirement includes a rendering strategy adjustment requirement, the rendering strategy is adjusted according to the rendering strategy adjustment requirement to obtain a target rendering strategy for the target document.
[0150] 205. According to the target strategy, a task matching the target object is created as the target task corresponding to the target document.
[0151] 206. Break down the target task into multiple subtasks.
[0152] 207. Based on the parallel processing algorithm, comprehensive processing operations are performed on all subtasks in parallel to obtain a comprehensive processing result of the target document.
[0153] In the embodiment of the present invention, for other descriptions of step 201 to step 207, please refer to the detailed description of step 101 to step 104 in the first embodiment, and the embodiment of the present invention will not be repeated.
[0154] It can be seen that implementation Figure 2The described cross-platform document task processing method based on multi-threaded parallelism can obtain the user's user needs for the target document and the user operations on the target document triggered by the user on the target platform, and create a target task corresponding to the target document according to the user needs and user operations, the target task includes an incremental parsing task and / or a paging rendering task, which can improve the creation accuracy and efficiency of the target task corresponding to the target document, and then decompose the target task into multiple subtasks, thereby improving the decomposition accuracy of the target task. Finally, after the pre-target task is decomposed, based on the parallel processing algorithm, a comprehensive processing operation is performed on all the subtasks obtained by the decomposition in parallel to obtain a comprehensive processing result of the target document, and can realize parallel processing of incremental parsing tasks and paging rendering tasks during the document processing process, which is conducive to improving the processing efficiency and processing speed of the document, and the document processing process developed by the Dart language can realize cross-platform processing of the target document, which is conducive to improving the compatibility of cross-platform document processing, and is conducive to improving the processing efficiency and convenience of the document, thereby helping to improve the user experience, and at the same time, compared with the commercial software such as Adobe Acrobat used in the prior art, the document processing process developed by the Dart language is conducive to reducing the cost of document processing. In addition, it is also possible to generate strategies to be executed for the target object in the target document according to user needs, such as parsing strategies and rendering strategies, thereby improving the generation accuracy and efficiency of the strategies to be executed corresponding to the target object of the target document, and then analyze the policy adjustment needs of the strategies to be executed according to user operations, such as turning pages and zooming, thereby improving the analysis accuracy and efficiency of the policy adjustment needs, and then accurately adjust the strategies to be executed according to the policy adjustment needs to obtain the target strategy of the target document, which can improve the accuracy and reliability of the adjusted target strategy based on the policy adjustment needs, and finally, through the target strategy determined in advance, create a task that matches the target object as the target task corresponding to the target document, which can improve the creation accuracy of the target task, thereby facilitating improving the subsequent processing accuracy and efficiency of the document based on the accurately created task.
[0155] In an optional embodiment, the method may further include:
[0156] Obtaining processing data generated during the process of executing the processing operation corresponding to the target task;
[0157] Based on the streaming compression algorithm, a compression operation is performed on the processed data to obtain the compressed document content, so that the processing operation and the compression operation are performed synchronously;
[0158] Write the compressed document content into the preset file system to save the target document.
[0159] In an embodiment of the present invention, optionally, the processed data may include first processed data generated during an incremental parsing operation, may include second processed data generated during a paged rendering operation, and may also include second processed data generated during a multi-subtask parallel processing operation of incremental parsing and paged rendering. Specifically, a stream compression algorithm is used in the generation and editing process of a PDF document. By streaming and compressing the document content in real time, the document volume is effectively reduced, and storage and transmission are accelerated. Specifically, the document content of the target document can be read and processed segment by segment to avoid loading all the content at once. For example: for segment-by-segment processing, the document content (such as text paragraphs, images) can be read step by step, and the document content can be processed sequentially; when generating or editing a PDF, all content will not be loaded into the memory at once, but will be processed, output or saved as the content is read.
[0160] It can be seen that this optional embodiment can obtain the processing data generated in the process of executing the processing operation corresponding to the target task, and based on the streaming compression algorithm, perform a compression operation on the processing data to obtain the compressed document content, so that the processing operation and the compression operation are performed synchronously, and then the compressed document content is written into the preset file system to realize the preservation of the target document. It can realize the synchronization of document processing and document compression through streaming compression, which is beneficial to improve the document processing efficiency while improving the document compression efficiency to improve the document preservation efficiency.
[0161] In another optional embodiment, decomposing the target task into multiple subtasks in step 206 may include:
[0162] Obtain the task content of the target task, and analyze the complexity of the target task based on the task content of the target task;
[0163] Obtain device information of the document processing device corresponding to the target platform, and analyze the device processing capability of the document processing device based on the device information;
[0164] Determine the task decomposition requirements of the target task based on the complexity of the target task and the equipment processing capabilities of the document processing equipment;
[0165] Based on the task decomposition requirements of the target task, decompose the target task into multiple subtasks.
[0166] In the embodiment of the present invention, optionally, the device processing capacity can be used to reflect the maximum number of tasks that the document processing device can process within the same time length, and can also be used to reflect the shortest processing time and the longest processing time that the document processing device can achieve when processing each task. The complexity of the target task can be used to reflect the total time required to process the target task and / or the speed of processing the target task. Specifically, according to the complexity of the target task, the first decomposition requirement of the target task is determined, and according to the device processing capacity of the document processing device, the second decomposition requirement of the target task is determined, and then according to the first decomposition requirement and the second decomposition requirement, the task decomposition requirement of the target task is determined, which is not limited in the embodiment of the present invention.
[0167] In the embodiment of the present invention, optionally, the task decomposition requirement can be used to indicate the requirement of the target task to be decomposed, and the task decomposition requirement can include the requirement of the number of decompositions of the target task and the requirement of the object range of the corresponding subtasks after decomposition, which is not limited in the embodiment of the present invention. For example, assuming that the target task needs to be decomposed into 4 subtasks, the target task can be directly divided into 4 subtasks according to the length of the task; assuming that the processing complexity of the target task is high, so that the processing time required is long and the speed is slow, then as many target objects of the target task with a smaller number as possible can be divided into the corresponding subtasks.
[0168] It can be seen that this optional embodiment can obtain the task content of the target task, and analyze the complexity of the target task based on the task content of the target task, thereby improving the analysis accuracy and analysis efficiency of the complexity of the target task, and obtain the device information of the document processing device corresponding to the target platform, and analyze the device processing capability of the document processing device based on the device information, thereby improving the analysis accuracy and analysis efficiency of the device processing capability of the document processing device, and then determine the task decomposition requirements of the target task based on the complexity of the target task and the device processing capability of the document processing device, thereby improving the determination accuracy and reliability of the decomposition requirements of the target task, and then decompose the target task into multiple subtasks based on the task decomposition requirements of the target task, so that whether the target task needs to be decomposed can be determined through the task complexity / device processing capability, and when it is determined that decomposition is required, the accuracy, flexibility and diversity of the decomposition of the target task can be improved based on the required number of task decompositions / object scope.
[0169] In yet another optional embodiment, the above step 207 performs comprehensive processing operations on all subtasks in parallel based on a parallel processing algorithm to obtain a comprehensive processing result of the target document, which may include:
[0170] Based on the parallel processing algorithm, comprehensive processing operations are performed on all subtasks in parallel to obtain the processing results of each subtask;
[0171] When the target task includes an incremental parsing task, for the incremental parsing subtasks in all subtasks, the processing results of all incremental parsing subtasks are synthesized to obtain the incremental parsing result of the target document;
[0172] When the target task includes a page rendering task, for the page rendering subtasks in all the subtasks, the processing results of all the page rendering subtasks are synthesized to obtain the page rendering result of the target document.
[0173] It can be seen that this optional embodiment can perform comprehensive processing operations on all subtasks in parallel based on a parallel processing algorithm to obtain the processing results of each subtask, and can use multi-threading or multi-core processing technology to realize parallel processing of multiple subtasks when parsing and rendering PDF documents, which is beneficial to improving the overall processing efficiency and processing speed of the document, and is beneficial to reducing the delay and jamming phenomenon when the document is displayed due to slow document processing speed. When the target task includes an incremental parsing task, for the incremental parsing subtasks in all subtasks, the processing results of all incremental parsing subtasks are synthesized to obtain the incremental parsing result of the target document. When the target task includes a paging rendering task, for the paging rendering subtasks in all subtasks, the processing results of all paging rendering subtasks are synthesized to obtain the paging rendering result of the target document. After the processing result of each subtask is obtained by parallel processing, the processing results of all tasks of the same type can be synthesized to improve the accuracy and reliability of the final processing result.
[0174] Embodiment 3
[0175] See also Figure 3 , Figure 3 1 is a schematic diagram of a cross-platform document task processing device based on multi-threaded parallelism disclosed in an embodiment of the present invention. Figure 3 The described cross-platform document task processing device based on multi-threaded parallelism can be developed based on the Dart language, wherein the method developed based on the Dart language has better cross-platform performance and can run stably in a variety of operating systems and environments, and the cross-platform document task processing device based on multi-threaded parallelism can include a processing device or a processing server, wherein the processing server can include a cloud server or a local server, which is not limited in the embodiment of the present invention. Figure 3 As shown, the cross-platform document task processing device based on multi-threaded parallelism may include:
[0176] An acquisition module 301 is used to acquire a user's demand for a target document and a user operation on the target document triggered by the user on a target platform;
[0177] A creation module 302 is used to create a target task corresponding to the target document according to user needs and user operations, and the target task includes an incremental parsing task and / or a page rendering task;
[0178] A decomposition module 303 is used to decompose the target task into multiple subtasks;
[0179] The parallel processing module 304 is used to perform comprehensive processing operations on all subtasks in parallel based on a parallel processing algorithm to obtain a comprehensive processing result of the target document, wherein the comprehensive processing result includes an incremental parsing result and / or a page rendering result.
[0180] In the embodiment of the present invention, specifically, when the target task includes an incremental parsing task and a page rendering task, the parallel processing module 304 is triggered to perform an operation of decomposing the target task into a plurality of subtasks.
[0181] It can be seen that implementation Figure 3 The described cross-platform document task processing device based on multi-threaded parallelism can obtain the user's user needs for the target document and the user operations on the target document triggered by the user on the target platform, and create a target task corresponding to the target document according to the user needs and user operations. The target task includes an incremental parsing task and / or a paging rendering task, which can improve the creation accuracy and efficiency of the target task corresponding to the target document. The target task is then decomposed into multiple subtasks, which improves the decomposition accuracy of the target task. Finally, after the pre-target task is decomposed, based on the parallel processing algorithm, a comprehensive processing operation is performed on all the subtasks obtained by the decomposition in parallel to obtain a comprehensive processing result of the target document. In the document processing process, parallel processing of incremental parsing tasks and paging rendering tasks can be realized, which is conducive to improving the processing efficiency and processing speed of the document. The document processing process developed by the Dart language can realize cross-platform processing of the target document, which is conducive to improving the compatibility of cross-platform document processing, and is conducive to improving the processing efficiency and convenience of the document, thereby helping to improve the user experience. In addition, the document processing process developed by the Dart language is conducive to reducing the cost of document processing compared to commercial software such as Adobe Acrobat used in the prior art.
[0182] In an optional embodiment, if Figure 4 As shown, Figure 4 is a schematic diagram of the structure of another cross-platform document task processing device based on multi-threaded parallelism disclosed in an embodiment of the present invention, wherein the device may also include:
[0183] A determination module 305, configured to determine basic information of a target document when the target task includes an incremental parsing task, the basic information of the target document including a document version number of the target document, an object directory of the target document, and a combination of one or more of the file length of the target document;
[0184] The parsing module 306 is used to perform a parsing operation on the target document based on the basic information based on the parsing incremental algorithm.
[0185] It can be seen that implementation Figure 4 The described device can also automatically determine the basic information of the target document when the target task includes an incremental parsing task, thereby improving the efficiency and accuracy of determining the basic information of the target document, and then can perform parsing operations on the target document based on the basic information based on the incremental parsing algorithm, thereby improving the parsing efficiency and speed of the target document.
[0186] In this optional embodiment, as an optional implementation, the parsing module 306 performs the parsing operation on the target document based on the basic information based on the parsing incremental algorithm, which specifically includes:
[0187] Based on the basic information, the directory structure of the target document is parsed to obtain the directory parsing information of the target document, wherein the directory parsing information includes the position of each object in the target document in the target document;
[0188] According to user needs and user operations, the target object that needs to be processed currently in the target document is determined from all objects, and the target object includes one or more combinations of pages, fonts and images;
[0189] Based on the incremental parsing algorithm, the parsing operation is performed on the target document.
[0190] It can be seen that this optional implementation method can parse the directory structure of the target document based on the basic information, and obtain the directory parsing information of the target document (the target parsing information includes the position of each object in the target document in the target document), thereby improving the parsing accuracy and parsing efficiency of the target structure of the target document, and then determine the target object that currently needs to be processed in the target document from all objects according to user needs and user operations, and can improve the determination accuracy and determination efficiency of the target object based on the target parsing information obtained by accurate parsing, and perform parsing operations on the target document based on the parsing incremental algorithm, which can improve the parsing accuracy and parsing reliability of the target document, and can improve the parsing diversity and flexibility of the target document through diversified user needs and user operations.
[0191] In this optional embodiment, as another optional implementation, the determination module 305 is further used to determine the target rendering queue corresponding to the paging rendering task when the target task includes the paging rendering task. Figure 4 As shown, the device may also include:
[0192] A rendering module 307, configured to perform a rendering operation on a target document based on a page rendering algorithm and a target rendering queue;
[0193] It can be seen that this optional implementation can automatically determine the target rendering queue corresponding to the paging rendering task when the target task includes a paging rendering task, thereby improving the accuracy and efficiency of determining the target rendering queue, and then performing the rendering operation on the target document according to the pre-set target rendering queue. The page switching speed and switching efficiency in the subsequent rendering process can be improved through the pre-loaded rendering queue, which is beneficial to improving the rendering speed and rendering efficiency of the page, as well as improving the accuracy of the paging rendering of the page.
[0194] In this optional implementation, optionally, the method in which the determination module 305 determines the target rendering queue corresponding to the paging rendering task may specifically include:
[0195] According to the user operation, the target page that needs to be displayed at the current time of the target document is determined, and the target page is loaded into the preset rendering queue;
[0196] When the target document is a multi-page document, obtaining the sorting information of each page of the target document;
[0197] According to the sorting information of all pages, adjacent pages of the target page are screened out from all pages, and the adjacent pages include a previous page of the target page and / or a next page of the target page;
[0198] The adjacent pages of the target page are synchronously loaded into the rendering queue to obtain the target rendering queue corresponding to the paging rendering task.
[0199] It can be seen that this optional implementation can also determine the target page that the target document currently needs to display according to user operations, thereby improving the determination accuracy and efficiency of the target page, and loading the target page into a preset rendering queue, thereby improving the loading accuracy of the target page, which is beneficial to improving the subsequent rendering speed and efficiency of the target page based on the pre-loaded target page. When the target document is a multi-page document, the sorting information of each page of the target document is automatically obtained, and then the adjacent pages of the target page are filtered out from all pages according to the sorting information of all pages, thereby improving the filtering accuracy and filtering efficiency of the adjacent pages of the target page. Subsequently, the adjacent pages of the target page are synchronously loaded into the rendering queue to obtain the target rendering queue corresponding to the paging rendering task, thereby improving the loading accuracy of the adjacent pages. By setting the page determination process, it is beneficial to improve the determination accuracy, diversity and flexibility of the pages that need to be loaded into the rendering queue, thereby improving the determination accuracy, diversity and flexibility of the rendering queue.
[0200] In another optional embodiment, the creation module 302 may create the target task corresponding to the target document according to the user's needs and user operations in the following manner:
[0201] Generate a strategy to be executed for a target object in a target document according to user needs, where the strategy to be executed includes a parsing strategy and / or a rendering strategy;
[0202] Analyze the policy adjustment requirements of the policy to be executed according to user operations, where the user operations include one or more combinations of page turning, zooming, and page sliding;
[0203] According to the policy adjustment requirements, the policy to be executed is adjusted to obtain the target policy of the target document;
[0204] According to the target strategy, a task matching the target object is created as the target task corresponding to the target document.
[0205] It can be seen that this optional embodiment can generate to-be-executed strategies for the target object in the target document according to user needs, such as: parsing strategy, rendering strategy, thereby improving the generation accuracy and efficiency of the to-be-executed strategies corresponding to the target object of the target document, and then analyze the policy adjustment requirements of the to-be-executed strategies according to user operations, such as: turning pages, zooming, etc., thereby improving the analysis accuracy and efficiency of the policy adjustment requirements, and then accurately adjust the to-be-executed strategies according to the policy adjustment requirements to obtain the target strategy of the target document, which can improve the accuracy and reliability of the adjusted target strategy based on the policy adjustment requirements, and finally, through the pre-determined target strategy, create a task matching the target object as the target task corresponding to the target document, which can improve the creation accuracy of the target task, thereby facilitating improving the subsequent processing accuracy and efficiency of the document based on the accurately created task.
[0206] In another optional embodiment, the acquisition module 301 is further used to acquire the processing data generated during the process of executing the processing operation corresponding to the target task. Figure 4 As shown, the device may also include:
[0207] A compression module 308, configured to perform a compression operation on the processed data based on a stream compression algorithm to obtain compressed document content, so that the processing operation and the compression operation are performed synchronously;
[0208] The storage module 309 is used to write the compressed document content into a preset file system to save the target document.
[0209] It can be seen that this optional embodiment can obtain the processing data generated in the process of executing the processing operation corresponding to the target task, and based on the streaming compression algorithm, perform a compression operation on the processing data to obtain the compressed document content, so that the processing operation and the compression operation are performed synchronously, and then the compressed document content is written into the preset file system to realize the preservation of the target document. It can realize the synchronization of document processing and document compression through streaming compression, which is beneficial to improve the document processing efficiency while improving the document compression efficiency to improve the document preservation efficiency.
[0210] In another optional embodiment, the decomposition module 303 decomposes the target task into multiple subtasks in the following manner:
[0211] Obtain the task content of the target task, and analyze the complexity of the target task based on the task content of the target task;
[0212] Obtain device information of the document processing device corresponding to the target platform, and analyze the device processing capability of the document processing device based on the device information;
[0213] Determine the task decomposition requirements of the target task based on the complexity of the target task and the equipment processing capabilities of the document processing equipment;
[0214] Based on the task decomposition requirements of the target task, decompose the target task into multiple subtasks.
[0215] It can be seen that this optional embodiment can obtain the task content of the target task, and analyze the complexity of the target task based on the task content of the target task, thereby improving the analysis accuracy and analysis efficiency of the complexity of the target task, and obtain the device information of the document processing device corresponding to the target platform, and analyze the device processing capability of the document processing device based on the device information, thereby improving the analysis accuracy and analysis efficiency of the device processing capability of the document processing device, and then determine the task decomposition requirements of the target task based on the complexity of the target task and the device processing capability of the document processing device, thereby improving the determination accuracy and reliability of the decomposition requirements of the target task, and then decompose the target task into multiple subtasks based on the task decomposition requirements of the target task, so that whether the target task needs to be decomposed can be determined through the task complexity / device processing capability, and when it is determined that decomposition is required, the accuracy, flexibility and diversity of the decomposition of the target task can be improved based on the required number of task decompositions / object scope.
[0216] Embodiment 4
[0217] See also Figure 5 , Figure 5 Schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. Figure 5 As shown, the electronic device may include:
[0218] A memory 401 storing executable program codes;
[0219] a processor 402 coupled to the memory 401;
[0220] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the cross-platform document task processing method based on multi-threaded parallelism described in the first embodiment of the present invention or the second embodiment of the present invention.
[0221] Embodiment 5
[0222] See also Figure 6 , Figure 6 Schematic diagram of the structure of a network attached storage device disclosed in an embodiment of the present invention. Figure 6 As shown, the network attached storage device stores a memory 501 of executable program code;
[0223] a processor 502 coupled to the memory 501;
[0224] The processor 502 calls the executable program code stored in the memory 501 to execute the steps of the cross-platform document task processing method based on multi-threaded parallelism described in the first embodiment of the present invention or the second embodiment of the present invention.
[0225] Embodiment 6
[0226] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the cross-platform document task processing method based on multi-threaded parallelism described in Embodiment 1 or Embodiment 2 of the present invention.
[0227] Embodiment 7
[0228] See also Figure 7 , Figure 7 Schematic diagram of a cross-platform document task processing system based on multi-threaded parallelism disclosed in an embodiment of the present invention. Figure 7 As shown, the system includes the electronic device 40 described in the fourth embodiment of the present invention, and the electronic device 40 is communicatively connected with the network attached storage device 50 described in the fifth aspect of the present invention, and the electronic device 40 is installed with a computer application that can execute the cross-platform document task processing method based on multi-threaded parallelism described in the first embodiment of the present invention or the second embodiment of the present invention.
[0229] Embodiment 8
[0230] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the cross-platform document task processing method based on multi-threaded parallelism described in Embodiment 1 or Embodiment 2.
[0231] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0232] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0233] Finally, it should be noted that the cross-platform document task processing method, device and equipment based on multi-threaded parallelism disclosed in the embodiments of the present invention only discloses the preferred embodiments of the present invention, which are only used to illustrate the technical scheme of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical schemes recorded in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical schemes from the spirit and scope of the technical schemes of the embodiments of the present invention.
Claims
1. A method for processing a cross-platform document task based on multi-threaded parallelism, the method being applied to a cross-platform document task processing system based on multi-threaded parallelism, and the system comprising a network attached storage device and an electronic device, the network attached storage device being communicatively connected to the electronic device, characterized in that: The method comprises: Acquire a user's demand for a target document and a user operation on the target document triggered by the user on a target platform; Creating a target task corresponding to the target document according to the user demand and the user operation, the target task including an incremental parsing task and / or a paging rendering task; The target task is decomposed into multiple subtasks, and based on a parallel processing algorithm, a comprehensive processing operation is performed on all the subtasks in parallel to obtain a comprehensive processing result of the target document, wherein the comprehensive processing result includes an incremental parsing result and / or a paged rendering result.
2. The cross-platform document task processing method based on multi-threaded parallelism according to claim 1 is characterized in that: The method further comprises: When the target task includes the incremental parsing task, determining basic information of the target document, the basic information of the target document including one or more combinations of a document version number of the target document, an object directory of the target document, and a file length of the target document; Based on the incremental parsing algorithm, a parsing operation is performed on the target document according to the basic information; or, When the target task includes the paged rendering task, determining the target rendering queue corresponding to the paged rendering task, and performing a rendering operation on the target document according to the target rendering queue based on a paged rendering algorithm; or When the target task includes the incremental parsing task and the paging rendering task, the operation of decomposing the target task into a plurality of subtasks is triggered.
3. The cross-platform document task processing method based on multi-threaded parallelism according to claim 2 is characterized in that: The step of performing a parsing operation on the target document based on the basic information based on the parsing incremental algorithm includes: Based on the basic information, the directory structure of the target document is parsed to obtain directory parsing information of the target document, wherein the directory parsing information includes the position of each object in the target document in the target document; According to the user demand and the user operation, determining the target object that needs to be processed currently in the target document from all the objects, the target object including one or more combinations of pages, fonts and images; Based on the incremental parsing algorithm, a parsing operation is performed on the target document.
4. The cross-platform document task processing method based on multi-threaded parallelism according to claim 2 is characterized in that: The determining a target rendering queue corresponding to the paging rendering task includes: According to the user operation, determining the target page that the target document currently needs to display, and loading the target page into a preset rendering queue; When the target document is a multi-page document, obtaining the sorting information of each page of the target document; According to the sorting information of all the pages, adjacent pages of the target page are screened out from all the pages, wherein the adjacent pages include a previous page of the target page and / or a subsequent page of the target page; The adjacent pages of the target page are synchronously loaded into the rendering queue to obtain the target rendering queue corresponding to the paging rendering task.
5. The cross-platform document task processing method based on multi-threaded parallelism according to any one of claims 1 to 4, characterized in that: The step of creating a target task corresponding to the target document according to the user demand and the user operation includes: Generate a to-be-executed strategy for the target object in the target document according to the user demand, wherein the to-be-executed strategy includes a parsing strategy and / or a rendering strategy; Analyzing the policy adjustment requirements of the to-be-executed policy according to the user operation, wherein the user operation includes one or more combinations of page turning, zooming, and page sliding; According to the policy adjustment requirement, the policy to be executed is adjusted to obtain the target policy of the target document; According to the target strategy, a task matching the target object is created as a target task corresponding to the target document.
6. The cross-platform document task processing method based on multi-threaded parallelism according to claim 5 is characterized in that: The method further comprises: Acquire processing data generated during the process of executing the processing operation corresponding to the target task; Based on a streaming compression algorithm, a compression operation is performed on the processed data to obtain compressed document content, so that the processing operation and the compression operation are performed synchronously; The compressed document content is written into a preset file system to save the target document.
7. The cross-platform document task processing method based on multi-threaded parallelism according to any one of claims 1, 2, 3, 4 and 6, characterized in that: Decomposing the target task into multiple subtasks includes: Obtaining the task content of the target task, and analyzing the complexity of the target task according to the task content of the target task; Acquire device information of a document processing device corresponding to the target platform, and analyze the device processing capability of the document processing device according to the device information; Determining the task decomposition requirements of the target task according to the complexity of the target task and the device processing capability of the document processing device; Based on the task decomposition requirements of the target task, the target task is decomposed into multiple subtasks.
8. A cross-platform document task processing device based on multi-threaded parallelism, the device is applied to a cross-platform document task processing system based on multi-threaded parallelism, and the system includes a network attached storage device and an electronic device, the network attached storage device is communicatively connected with the electronic device, characterized in that: The device comprises: An acquisition module, used to acquire a user's demand for a target document and a user operation on the target document triggered by the user on a target platform; A creation module, used to create a target task corresponding to the target document according to the user demand and the user operation, wherein the target task includes an incremental parsing task and / or a paging rendering task; A decomposition module, used for decomposing the target task into multiple subtasks; The parallel processing module is used to perform comprehensive processing operations on all the subtasks in parallel based on a parallel processing algorithm to obtain a comprehensive processing result of the target document, wherein the comprehensive processing result includes an incremental parsing result and / or a page rendering result.
9. An electronic device, characterized in that: The electronic device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the cross-platform document task processing method based on multi-threaded parallelism as described in any one of claims 1-7.
10. A network attached storage device, characterized in that: The network attached storage device stores a memory having executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the cross-platform document task processing method based on multi-threaded parallelism as described in any one of claims 1-7.
11. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the multi-threaded parallel cross-platform document task processing method according to any one of claims 1 to 7.
12. A cross-platform document task processing system based on multi-threaded parallelism, characterized in that: The system comprises the electronic device as claimed in claim 9, and the electronic device is communicatively connected to the network attached storage device as claimed in claim 9, and a computer application capable of executing the method as claimed in any one of claims 1-7 is installed in the electronic device.