Document processing method and device, electronic equipment and storage medium
By calculating the complexity factors and feature vectors of documents, and rationally splitting and scheduling sub-documents, the problem of inconsistent sub-document granularity and low processing efficiency in traditional document processing is solved, and efficient document processing is achieved.
Patent Information
- Application Number
- CN202410971997.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-08
AI Technical Summary
Traditional document processing methods fail to fully consider the attributes of the document to be processed, resulting in inconsistent sub-document granularity, high business priority documents blocking the system, low-priority document starvation, and the "barrel short board effect" of single sub-document delay, etc. problem, resulting in poor document processing efficiency.
By obtaining the characteristic attributes of the document to be processed, calculating complex factors for reasonable splitting, obtaining the characteristic vector of the sub-document, and determining the scheduling order based on the vector and the current moment, efficient scheduling of sub-documents is achieved.
It achieves reasonable and efficient splitting and scheduling of documents, avoids the problems of inconsistent sub-document granularity and low processing efficiency in traditional methods, and improves the efficiency of document processing.
Smart Images

Figure CN118747111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of document processing, and in particular to a document processing method, device, electronic device and storage medium. Background Art
[0002] At present, many online business scenarios on the Internet involve online reading of documents. These documents are in different formats and sizes, and need to be uniformly processed and converted (such as converting PDF to images) to adapt to different devices. The processing and conversion of large quantities of documents often consumes a lot of system IT resources and takes a long time. When encountering some large documents, it is also easy to cause system congestion, memory overflow, service crash and other problems. Splitting documents and scheduling them to distributed instances for processing is a good way to solve such problems. However, the traditional document processing method fails to fully consider the attributes of the documents to be processed, so that splitting documents by traditional splitting methods is prone to inconsistent sub-document granularity, which is not convenient for scheduling and processing, and thus it is difficult to better shorten the system's document processing time. The traditional scheduling method will cause high-priority documents to block the system, low-priority documents to be "starved", and a single sub-document delay. The "barrel short board effect" and other problems make the scheduling of documents for processing inefficient.
[0003] Therefore, how to split and schedule documents reasonably and efficiently has become a problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of this application is to provide a document processing method, device, electronic device and storage medium, aiming to solve the technical problem of how to split and schedule documents reasonably and efficiently.
[0005] To achieve the above object, the present application proposes a document processing method, which comprises:
[0006] Acquire a first characteristic attribute of a document to be processed, and calculate a complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document;
[0007] Splitting the document to be processed according to the complexity factor to obtain a collection of sub-documents;
[0008] Acquire a second characteristic attribute of the sub-document collection, and vectorize the second characteristic attribute to form a characteristic vector;
[0009] Based on the feature vector and the current time, a scheduling order of the sub-document collection is determined, and the sub-document collection is scheduled for processing according to the scheduling order.
[0010] In one embodiment, the first characteristic attribute includes the number of document pages and additional adjustment attributes, and the step of calculating the complexity factor of the document to be processed based on the first characteristic attribute includes:
[0011] Determining the initial complexity factor of the document to be processed according to the number of document pages;
[0012] An adjustment coefficient is determined by the additional adjustment attribute, and the complexity factor of the processed document is obtained by multiplying the adjustment coefficient with the initial complexity factor.
[0013] In one embodiment, the step of determining the adjustment coefficient by using the additional adjustment attribute comprises:
[0014] For any attribute indicator in the additional attributes, multiply the feature score mapped by the attribute indicator by the preset indicator coefficient of the attribute indicator to obtain a weighted product of the attribute indicator, wherein the types of the attribute indicators include document type, number of bytes, number of fonts, content tendency, business priority, and business importance;
[0015] After traversing the attribute indicators in the additional attributes, a weighted product collection is obtained, and the weighted products in the weighted product collection are summed to obtain the adjustment coefficient.
[0016] In one embodiment, the document to be processed is processed by a document processing system, and the step of splitting the document to be processed according to the complexity factor includes:
[0017] Determining the candidate number of splits of the to-be-processed document according to the complexity factor and the document processing capability of the document processing system;
[0018] If the candidate split number is not an integer, the candidate split number is rounded to obtain the target split number;
[0019] The document to be processed is split based on the target number of splits.
[0020] In one embodiment, the step of determining the scheduling order of scheduling the sub-document collection based on the feature vector and the current time includes:
[0021] Mapping the feature vector to a coordinate system, and mapping the current moment to the coordinate system to form a current time point in the coordinate system;
[0022] Calculating the relative distance from the current time point to the feature vector in the coordinate system;
[0023] The scheduling order of scheduling the sub-document collection is determined according to the calculated relative distance, wherein the relative distance is positively correlated with the priority of the sub-document in the scheduling order.
[0024] In one embodiment, after the step of scheduling the sub-documents for processing according to the scheduling order, the step further includes:
[0025] After monitoring and scheduling the sub-document collection, processing the current processing time of any sub-document in the sub-document collection;
[0026] When the current processing time exceeds a preset time limit, stop processing the sub-document and record the processing progress of the sub-document;
[0027] Return to the step of determining the scheduling order of the sub-document collection based on the feature vector and the current time, and when the sub-document collection is scheduled for processing again, process the sub-documents based on the processing progress.
[0028] In one embodiment, the second characteristic attribute at least includes a document entry time point at which the processing of the to-be-processed document begins, a business priority, and a document completion degree, and the method further includes:
[0029] Based on the split relationship between the document to be processed and the sub-document collection, the document entry time point, the business priority, and the document completion degree are used as tree node contents to construct an N-ary tree corresponding to the document to be processed;
[0030] When it is detected that any sub-document in the sub-document collection has completed scheduling, the document completion degree is updated based on the N-ary tree, and the sub-document collection is returned to execute the step of determining the scheduling order of the sub-document collection based on the feature vector and the current time.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a document processing device, the document processing device comprising:
[0032] A complexity factor calculation module, used for obtaining a first characteristic attribute of a document to be processed, and calculating a complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document;
[0033] A splitting module, used for splitting the document to be processed according to the complexity factor to obtain a collection of sub-documents;
[0034] A vectorization module, used for obtaining a second characteristic attribute of the sub-document collection, and vectorizing the second characteristic attribute to form a characteristic vector;
[0035] The scheduling module is used to determine the scheduling order of the sub-document collection based on the feature vector and the current time, and schedule the sub-document collection for processing according to the scheduling order.
[0036] In addition, to achieve the above objectives, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the document processing method described above.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the document processing method described above are implemented.
[0038] The present application provides a document processing method, which first obtains a first characteristic attribute of a document to be processed, and calculates a complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document, so as to determine the degree of precision of splitting the document by determining the complexity of the document; then the document to be processed is split according to the complexity factor to obtain a sub-document collection, so as to split documents of different complexities with different degrees of precision; then the second characteristic attribute of the sub-document collection is obtained, and the second characteristic attribute is vectorized to form a feature vector, and the key characteristic attributes of the split sub-documents are vectorized to improve the efficiency of determining the scheduling order of the sub-document collection based on the relative distance from the point to the vector; finally, based on the feature vector and the current time, the scheduling order of the sub-document collection is determined, and the sub-document collection is scheduled for processing according to the scheduling order, so as to achieve efficient scheduling and processing of the sub-documents.
[0039] To summarize, the present application comprehensively considers the characteristic attributes of the document to be processed to reasonably split the document to be processed, and then vectorizes the key characteristic attributes of the split sub-documents, and determines the order of scheduling the sub-documents for processing based only on the vectorized characteristic vectors and the current document processing time. This avoids the problem of poor document processing efficiency caused by the traditional document processing method that does not fully consider the attributes of the document to be processed and adopts inappropriate document splitting and scheduling methods, resulting in inconsistent sub-document granularity, high business priority documents blocking the system, low priority documents "starving", and single sub-document delays. This achieves the effect of reasonable and efficient document splitting and scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 A flowchart of the first embodiment of the document processing method of the present application is provided;
[0043] Figure 2 A schematic diagram of feature vector mapping of the document processing method provided in Example 1 of the present application;
[0044] Figure 3 A schematic diagram of spatial distance calculation of a document processing method provided in Example 1 of the present application;
[0045] Figure 4 A schematic diagram of the scheduling and sorting of the document processing method provided in Example 1 of the present application;
[0046] Figure 5 A flowchart of the second embodiment of the document processing method of this application is provided;
[0047] Figure 6 A flowchart of the third embodiment of the document processing method of this application is provided;
[0048] Figure 7 A schematic diagram of updating spatial coordinates of a document processing method provided in Embodiment 3 of the present application;
[0049] Figure 8 A schematic diagram of an N-ary tree generation method for document processing provided in Example 3 of the present application;
[0050] Fig. 9 A brief flowchart of the document processing method provided in Example 3 of the present application;
[0051] Fig.10 A schematic diagram of the document splitting process of the document processing method provided in Example 3 of the present application;
[0052] Fig.11 A schematic diagram of the overall scheduling process of the document processing method provided in Example 3 of the present application;
[0053] Fig.12 This is a schematic diagram of the module structure of the document processing device according to an embodiment of the present application;
[0054] Fig.13 This is a schematic diagram of the device structure of the hardware operating environment involved in the document processing method in the embodiment of the present application.
[0055] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0057] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0058] The main solution of the embodiment of the present application is: obtaining the first characteristic attribute of the document to be processed, and calculating the complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document; splitting the document to be processed according to the complexity factor to obtain a collection of sub-documents; obtaining the second characteristic attribute of the collection of sub-documents, and vectorizing the second characteristic attribute to form a feature vector; determining the scheduling order of the collection of sub-documents based on the feature vector and the current time, and scheduling the collection of sub-documents for processing according to the scheduling order.
[0059] Traditional document processing methods fail to fully consider the properties of the documents to be processed, which makes it easy for the sub-documents to be inconsistent in granularity when splitting documents through traditional splitting methods, making it difficult to schedule and process them, and thus making it difficult to shorten the system's document processing time. Traditional scheduling methods will cause problems such as high-priority documents blocking the system, "starvation" of low-priority documents, and the "barrel short board effect" of delays in individual sub-documents, making the scheduling of documents inefficient. Therefore, how to reasonably and efficiently split and schedule documents has become a problem that needs to be solved urgently.
[0060] The present application provides a solution, which comprehensively considers the characteristic attributes of the document to be processed to reasonably split the document to be processed, and then vectorizes the key characteristic attributes of the split sub-documents, and determines the order of scheduling the sub-documents for processing based only on the vectorized characteristic vectors and the current document processing time. It avoids the problem of poor document processing efficiency caused by the traditional document processing method that does not fully consider the attributes of the document to be processed and adopts inappropriate document splitting and scheduling methods, resulting in inconsistent sub-document granularity, high business priority documents blocking the system, low priority documents "starving", and single sub-document delay "short board effect", etc., and achieves the effect of reasonable and efficient document splitting and scheduling.
[0061] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes an electronic device as an example to illustrate this embodiment and the following embodiments.
[0062] Based on this, the present application embodiment provides a document processing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the document processing method of this application.
[0063] In this embodiment, the document processing method includes steps S10 to S40:
[0064] Step S10, obtaining a first characteristic attribute of the document to be processed, and calculating a complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document;
[0065] It should be noted that the document to be processed may be a PDF (Portable Document Format) document, a Word document, or other types of documents. This embodiment does not specifically limit the type of the document to be processed.
[0066] In addition, it should be noted that the first characteristic attribute refers to the attribute in the document to be processed that is used to characterize the characteristics of the document itself, which may include attributes such as the number of document pages, document type, number of bytes, number of bytes, content tendency, business priority, and business importance. This implementation does not specifically limit the type of the first characteristic attribute.
[0067] In addition, it should be noted that the higher the complexity factor of the file to be processed is, the more copies the file to be processed needs to be split into; the lower the complexity factor of the file to be processed is, the fewer copies the file to be processed needs to be split into.
[0068] It is understandable that improper document splitting may result in different granularities of sub-documents, affecting scheduling operations. Therefore, step S10 can be performed to more reasonably split different documents by fully evaluating the attributes of the documents.
[0069] Exemplarily, the document page number, document type, byte number, byte quantity, content tendency, business priority, and business importance of the document to be processed, i.e., the first characteristic attribute, are obtained, and the complexity factor of the document to be processed is calculated based on the above first characteristic attribute.
[0070] In a feasible implementation manner, the first characteristic attribute includes the number of document pages and additional adjustment attributes;
[0071] It should be noted that the number of document pages is the total number of pages contained in the document, which allows users to quickly understand the length and structure of the document; additional adjustment attributes are attributes other than the number of document pages that are used to characterize the characteristics of the document itself, and may include document type, number of bytes, number of bytes, content tendency, business priority, business importance and other attributes. This implementation does not specifically limit the types of additional adjustment attributes.
[0072] The step of calculating the complexity factor of the document to be processed based on the first characteristic attribute in step S10 may include steps S11 to S12:
[0073] Step S11, determining the initial complexity factor of the document to be processed according to the number of pages of the document;
[0074] It should be noted that the initial complexity factor is the most intuitive representation of the complexity of splitting the document to be processed. It is the benchmark quantitative data for splitting the document. The number of document pages to be processed is proportional to the value of the initial complexity factor, that is, the more document pages there are, the larger the initial complexity factor is, and the fewer document pages there are, the smaller the initial complexity factor is.
[0075] It is understandable that, since the calculation of the complexity factor requires an intuitive document feature as a benchmark attribute, step S11 is performed to provide effective benchmark data for calculating the complexity factor by taking the number of document pages as the benchmark attribute.
[0076] Step S12: determining an adjustment coefficient through the additional adjustment attribute, and obtaining the complexity factor of the processed document by multiplying the adjustment coefficient by the initial complexity factor.
[0077] It should be noted that the adjustment coefficient is the data adjusted for the initial complex factor by comprehensively considering the additional adjustment attributes.
[0078] It should be noted that the preset score is a score that is pre-set and associated with the first characteristic attribute, and each different characteristic attribute is associated with a corresponding preset score.
[0079] It is understandable that since the calculation of the complexity factor requires quantifying the characteristic attributes of the document, step S12 is performed to quantify the characteristic attributes of the document to be processed, thereby achieving the number of copies of the document to be processed determined by judging the quantized numerical value.
[0080] Exemplarily, when the first characteristic attribute of the document to be processed obtained includes the document type, the characteristic score of the document type is determined according to the document type and the preset score associated with the document type; when the first characteristic attribute of the document to be processed obtained includes the number of bytes, the characteristic score of the number of bytes is determined according to the number of bytes and the preset score associated with the number of bytes; when the first characteristic attribute of the document to be processed obtained includes the number of fonts, the characteristic score of the number of fonts is determined according to the number of fonts and the preset score associated with the number of fonts; when the first characteristic attribute of the document to be processed obtained includes the content tendency type, the characteristic score of the content tendency is determined according to the content tendency and the preset score associated with the content tendency; when the first characteristic attribute of the document to be processed obtained includes the business priority, the characteristic score of the business priority is determined according to the business priority and the preset score associated with the business priority; when the first characteristic attribute of the document to be processed obtained includes the business importance, the characteristic score of the business importance is determined according to the business importance and the preset score associated with the business importance.
[0081] In this implementation, the complexity factor of the document to be processed is calculated by comprehensively considering the characteristic attributes of the document to be processed, thereby solving the problem of being unable to quantify the cost required for document processing.
[0082] In a feasible implementation manner, the step of determining the adjustment coefficient by using the additional adjustment attribute in step S12 may include steps S101 to S102:
[0083] Step S101, for any attribute indicator in the additional attributes, multiply the feature score mapped by the attribute indicator by the preset indicator coefficient of the attribute indicator to obtain a weighted product of the attribute indicator, wherein the types of the attribute indicators include document type, number of bytes, number of fonts, content tendency, business priority, and business importance;
[0084] It should be noted that the preset indicator index is pre-set data for measuring the importance of different attribute indicators; document type refers to the format type of the document to be processed; the number of bytes refers to the size of the storage space occupied by the document to be processed; the number of fonts refers to the number of all fonts appearing in the document to be processed; content tendency refers to a pre-set characteristic attribute for indicating the content type in the document to be processed; business priority refers to a pre-set characteristic attribute for indicating whether the document to be processed requires high real-time return; business importance refers to a pre-set characteristic attribute for indicating whether the business of processing the document to be processed is an important business.
[0085] It is understandable that since the number of split documents cannot be adjusted according to different needs in traditional document processing, step S101 is performed to multiply the feature score of the document to be processed by the preset index coefficient to assign controllable weights to the scores of different feature attributes, thereby improving the controllability of document processing.
[0086] For example, to help understand the process of mapping attribute indexes to feature scores in this embodiment, please refer to the following Table 1:
[0087]
[0088] Table 1
[0089] In the case where the types of attribute indicators include document type, the number of bytes, the number of fonts, the content tendency, the business priority, and the business importance, the mapped feature score is determined according to the attribute indicators in the additional adjustment attributes. In Table 1 above, the number of document pages is used as the base attribute, and the initial complexity factor is obtained based on this. In the figure, the document type, the number of bytes, the number of fonts, the content tendency, the business priority, and the business importance are used as additional adjustment attributes of the document to be processed, where the basic number of bytes is 1000KB, the content tendency is a preset business attribute used to indicate the content type of the business document, the business priority is a preset business attribute used to indicate whether the business document requires high real-time return, and the business importance is a preset business attribute used to indicate whether the business is an important business. When the document type is a PDF document, the feature score of the document type is 2; when the document type is a Word document, the feature score of the document type is 1; when the document type is an XLS (Excel spreadsheet) document, the feature score of the document type is 1, and a number greater than 0 can also be set as the feature score of the document type according to different document types. The feature score of the number of bytes is the value obtained by dividing the total number of bytes in the document by 1000, and the feature score of the number of fonts is the number of all fonts appearing in the document. When the content tendency is text type, the feature score of the content tendency is 1; when the content tendency is balanced type, the feature score of the content tendency is 2; when the content tendency is table type, the feature score of the content tendency is 3; when the content tendency is image type, the feature score of the content tendency is 4. The feature score of business priority is any score preset from 1 to 5 in the document, and the feature score of business importance is any score preset from 1 to 3 in the document. After obtaining the feature score of the above attribute index mapping, the feature score is multiplied by the preset index coefficient, that is, the preset index coefficient corresponding to the document type is 0.15, the preset index coefficient corresponding to the number of bytes is 0.15, the preset index coefficient corresponding to the number of fonts is 0.05, the preset index coefficient corresponding to the content tendency is 0.30, the preset index coefficient corresponding to the business priority is 0.20, and the preset index coefficient corresponding to the business importance is 0.15, to obtain the weighted product.
[0090] Step S102, after traversing the attribute indicators in the additional attributes, a weighted product collection is obtained, and the weighted products in the weighted product collection are summed to obtain the adjustment coefficient.
[0091] It is understandable that, since it is currently impossible to comprehensively consider document features with different weights, performing step S102 provides an effective method for comprehensively considering document features with different weights.
[0092] For example, to help understand the process of calculating complex factors in this embodiment, please refer to the following Table 2:
[0093]
[0094]
[0095] Table 2
[0096] In the example document 1 in Table 2 above, the first characteristic attribute of the document to be processed is PDF document, the number of bytes is 1000KB, the number of document pages is 35 pages, the number of fonts is 1, the content tendency is text type, the business priority is 2, and the business importance is 1. Therefore, according to the number of document pages of 35 pages, the number of document pages is divided by 10 to obtain an initial complexity factor of 3.5. According to the document type being PDF document, the feature score of the document type is determined to be 2. According to the number of bytes being 1000KB, the feature score of the number of bytes is determined to be 1. According to the number of fonts being 1, the feature score of the number of fonts is determined to be 1. According to the content tendency being text type, the feature score of the content tendency is determined to be 1. According to the business priority being 2, the feature score of the business priority is determined to be 2. According to the business importance being 1, the feature score of the business importance is determined to be 1. The above feature scores are respectively multiplied by the products of the preset indicator coefficients associated with them, that is, 2*0.15+0.15+0.05+0.3+2*0.20+0.15, to obtain 1.35. Then 1.35 is multiplied by the initial complexity factor 3.5 to obtain the complexity factor of the document to be processed, 4.725. Then divide the complexity factor 4.725 by the document processing capability value 2 to get the number of splits of the document to be processed, 2.3635, and then round up the number of splits to get 3, so the document to be processed is split into 3 parts, that is, into sub-documents with page distributions of 12, 12, and 11. In the example document 2 in Table 2, the first characteristic attribute of the document to be processed is PDF document, the number of bytes is 3000KB, the number of document pages is 40 pages, the number of fonts is 1, the content tendency is balanced, the business priority is 1, and the business importance is 1. Therefore, according to the number of document pages of 40 pages, the number of document pages is divided by 10 to obtain an initial complexity factor of 4. According to the document type being PDF document, the feature score of the document type is determined to be 2. According to the number of bytes being 3000KB, the feature score of the number of bytes is determined to be 3. According to the number of fonts being 1, the feature score of the number of fonts is determined to be 1. According to the content tendency being balanced, the feature score of the content tendency is determined to be 2. According to the business priority being 1, the feature score of the business priority is determined to be 1. According to the business importance being 1, the feature score of the business importance is determined to be 1. The above feature scores are respectively multiplied by the products of the preset indicator coefficients associated with them, that is, 2*0.15+3*0.15+0.05+2*0.3+2*0.20+0.15, to obtain 1.75. Then 1.75 is multiplied by the initial complexity factor 4 to obtain the complexity factor 7 of the document to be processed. Then divide the complexity factor 7 by the document processing capability value 2 to get the number of splits of the document to be processed, which is 3.5. Then round up the number of splits to get 4, so the document to be processed is split into 4 parts, that is, into sub-documents with page distribution of 10, 10, 10, 10.
[0097] In this embodiment, the complexity factors of the document to be processed are calculated by comprehensively considering the number of document pages, document type, number of bytes, number of fonts, content tendency, business priority, and business importance of the document to be processed, thereby solving the problem of being unable to quantify and comprehensively evaluate the cost required for document processing.
[0098] Step S20, splitting the document to be processed according to the complexity factor to obtain a collection of sub-documents;
[0099] It should be noted that the sub-document collection refers to a collection of document fragments formed by dividing the document to be processed according to certain rules. These document fragments are consistent with the document to be processed in content and format, but only contain part of the content of the document to be processed.
[0100] It is understandable that since traditional document splitting methods will cause the granularity of the sub-documents after splitting to be inconsistent, step S20 is performed to quantify the splitting cost of splitting the document to be processed, and to perform more reasonable splitting processing on the split document, thereby avoiding the problem of inconsistent granularity of sub-documents after splitting by traditional splitting methods, which affects the scheduling operation, and achieving the effect of improving the uniformity of sub-document granularity in the process of splitting documents.
[0101] In a feasible implementation manner, the document to be processed is processed by a document processing system, and the step of splitting the document to be processed according to the complexity factor in step S20 may include steps S21 to S23:
[0102] Step S21, determining the candidate number of splits of the document to be processed according to the complexity factor and the document processing capability of the document processing system;
[0103] It should be noted that document processing capability is the information obtained by evaluating the performance of the document processing system.
[0104] It is understandable that, since different document processing systems have different document processing capabilities, performing step S21 can avoid the performance of the document processing system from not matching the performance scheduling of the actual document processing work, thereby achieving full and reasonable scheduling of the document processing performance of the document processing system.
[0105] Exemplarily, the number of splits of the document to be processed is obtained by dividing the calculated complexity factor by the document processing capability value obtained by evaluating the document processing system. For example, when the calculated complexity factor is 4.725 and the document processing capability value of the document processing system is 2, the number of candidate splits of the document to be processed is 2.3635, which is obtained by dividing the complexity factor 4.725 by the document processing capability value 2.
[0106] Step S22, when the candidate split number is not an integer, rounding the candidate split number to obtain a target split number;
[0107] It is understandable that since in the actual process of calculating the number of splits, the calculated split score may not be an integer, performing step S22 can solve the problem of not being able to determine how to split the document based on a non-integer number of splits when the number of splits is not an integer.
[0108] Exemplarily, when the candidate split number is not an integer, the candidate split number is rounded up to an integer and the integer is used as the split number. For example, when the split number is 2.3625, the integer 3 that is greater than 2.3625 and closest to 2.3625 is used as the split number.
[0109] Exemplarily, when the candidate split number is an integer, the calculated candidate split number is determined as the target split number for splitting the file to be processed.
[0110] Step S23, splitting the to-be-processed document based on the target number of splits.
[0111] Exemplarily, when the number of pages of the document to be processed is 35 and the target number of splits is 3, the document to be processed is split into three sub-documents according to the number of pages, and the number of pages of the three sub-documents are 12, 12, and 11 respectively.
[0112] In this embodiment, the document to be processed is split by determining the target number of splits based on the complexity factor and the system document processing capability, thereby achieving the effect of making the granularity of the split sub-documents as balanced as possible.
[0113] Step S30, obtaining a second characteristic attribute of the sub-document collection, and vectorizing the second characteristic attribute to form a characteristic vector.
[0114] It should be noted that the second characteristic attribute refers to the key characteristic attribute in the sub-document after splitting, which may include document entry time, business priority and document completion, wherein business priority refers to the processing priority of the business corresponding to the sub-document, and document completion is used to identify the processing progress of the pending document corresponding to the sub-document, which can be obtained by dividing the number of completed sub-documents by the total number of sub-documents after splitting. Document entry time refers to the moment when the pending document enters the document processing system. This embodiment does not specifically limit the type of the second characteristic attribute.
[0115] It is understandable that since the traditional document scheduling method cannot be applied to scheduling sub-documents of different priorities at the same time, step S30 is performed to vectorize the second characteristic attribute of the sub-document so that the key characteristic attributes of the sub-document are comprehensively considered, providing an effective way to achieve more efficient sub-document scheduling processing.
[0116] Exemplarily, the document entry time, business priority and document completion of the split sub-document are obtained, the document entry time, business priority and document completion are quantified respectively, and the numerical values obtained after quantization are used as three elements in a three-dimensional vector. The formed three-dimensional vector is the feature vector.
[0117] Step S40: determining the scheduling order of the sub-document collection based on the feature vector and the current time, and scheduling the sub-document collection for processing according to the scheduling order.
[0118] It should be noted that the scheduling order refers to the order in which the sub-document collection is scheduled to enter the buffer queue for consumption processing. According to this order, the sub-document collection can be consumed and processed in an orderly manner.
[0119] It is understandable that if scheduling is performed according to the traditional FIFO (First Input First Output) order, high-priority documents may not be processed in time, while if scheduling is performed according to the business priority order, low-priority documents will have to wait. Therefore, step S40 is performed to avoid the problem of not being able to take into account the processing of documents of different priorities, thereby achieving the effect of improving the versatility of document scheduling.
[0120] Exemplarily, when the elements in the feature vector respectively represent the quantitative results of the document entry time, business priority and document completion, the scheduling order of the sub-documents is determined according to the current time of processing the document to be processed, taking into account the quantitative values of the document entry time, business priority and document completion of the sub-documents, and the sub-documents are sorted according to the scheduling order and entered into the buffer queue for processing.
[0121] The present embodiment provides a document processing method, which comprehensively considers the characteristic attributes of the document to be processed to reasonably split the document to be processed, and then vectorizes the key characteristic attributes of the split sub-documents, and determines the order of scheduling the sub-documents for processing based only on the vectorized characteristic vectors and the current document processing time. This avoids the problem of poor document processing efficiency caused by traditional document processing methods that do not fully consider the attributes of the document to be processed and adopt inappropriate document splitting and scheduling methods, resulting in inconsistent sub-document granularity, high business priority documents blocking the system, low priority documents "starving", and a single sub-document delay "short board effect", etc., and achieves the effect of reasonable and efficient document splitting and scheduling.
[0122] In a feasible implementation manner, the step of determining the scheduling order of scheduling the sub-document collection based on the feature vector and the current time in step S40 may include steps S41 to S43:
[0123] Step S41, mapping the feature vector to a coordinate system, and mapping the current moment to the coordinate system to form a current time point in the coordinate system;
[0124] It should be noted that the current time point is a point in the coordinate system used to represent the current time of processing the document, and this point will continue to move with the change of time.
[0125] It is understandable that, since the conventional process of determining the scheduling order of the scheduling sub-documents is complicated, performing step S41 can provide an effective data basis for subsequently determining the scheduling order by calculating the coordinate distance only by mapping the feature vector to the coordinate system.
[0126] For example, please refer to Figure 2 , Figure 2 A feature vector mapping schematic diagram of a document processing method is provided. The figure shows that parent document 1, parent document 2 and parent document N, namely, document to be processed 1, document to be processed 2 and document to be processed N, are split into two sub-documents, namely, sub-document 1-1 and sub-document 1-2, three sub-documents, namely, sub-document 2-1, sub-document 2-2 and sub-document 2-3, and N sub-documents, namely, sub-document N-1, sub-document N-2...sub-document NN, and the feature vectors based on the second feature attributes of the above-split sub-documents are vectorized to the spatial rectangular coordinate system O-XYZ, and the feature vector (XYZ) with the origin O as the starting point in the figure is obtained. 1 , Y 1 , Z 1 )、(X 2 , Y 2 , Z 2 ) and (X 3 , Y 3, Z 3 ), where the X-axis of the spatial rectangular coordinate system represents the time point, the Y-axis represents the business priority, and the Z-axis represents the document completion degree. At the same time, normalization is performed on the Y-axis dimension. In addition, the largest dotted space in the figure represents the restricted range of the document space distribution, which limits the value range on the X-axis to the positive half axis of X, the value range on the Y-axis to 0 to 1, and the value range on the Z-axis to 0 to 100%.
[0127] Step S42, calculating the relative distance from the current time point to the feature vector in the coordinate system;
[0128] It should be noted that the relative distance is the distance from the current time point to the end of the feature vector.
[0129] For example, by the following formula:
[0130]
[0131] Calculate the current time point (X t , 0, 0), to the eigenvector (X 1 , Y 1 , Z 1 ), wherein the relative distance is normalized in the X-axis dimension to ensure that the maximum response time of the document processing system does not exceed the preset response time X max .
[0132] Step S43: determining the scheduling order of the sub-document collection according to the calculated relative distance, wherein the relative distance is positively correlated with the priority of the sub-document in the scheduling order.
[0133] For example, please refer to Figure 3 , Figure 3 A schematic diagram of spatial distance calculation of a document processing method is provided. The figure shows that the feature vector (X 1 , Y 1 , Z 1 ) and (X 2 , Y 2 , Z 2) is mapped to the spatial rectangular coordinate system O-XYZ, and two eigenvectors with the origin O as the starting point are obtained in the figure. Among them, the X-axis of the spatial rectangular coordinate system represents the time point, the Y-axis represents the business priority, and the Z-axis represents the document completion degree. At the same time, normalization is performed on the Y-axis dimension. In addition, the largest dotted space in the figure represents the restricted range of the document space distribution. The range limits the value range on the X-axis to the positive half axis of X, the value range on the Y-axis to 0 to 1, and the value range on the Z-axis to 0 to 100%. The current time point is a point in the X-axis that moves continuously with the change of time (X t , 0, 0). Through the following formula:
[0134]
[0135] Calculate the current time point (X t , 0, 0) to two eigenvectors (X i , Y i , Z i ) is the eigenvector (X 1 , Y 1 , Z 1 ) and (X 2 , Y 2 , Z 2 ) relative distance L 1 and L 2 , where the relative distance is normalized in the X-axis dimension to ensure that the maximum response time of the document processing system does not exceed the preset response time X max At the same time, normalization is also performed on the Y-axis dimension. In this figure, the current time point (X t ,0,0) to the eigenvector (X 1 , Y 1 , Z 1 ) relative distance L 1 Greater than the current time point (X t ,0,0) to the eigenvector (X 2 , Y 2 , Z 2 ) relative distance L 2 , so the eigenvector (X 1 , Y 1 , Z 1 ) corresponds to the split sub-document, compared with the feature vector (X 2 , Y 2 , Z 2 )The corresponding split sub-documents are scheduled first.
[0136] For further information, please refer to Figure 4 , Figure 4A scheduling and sorting diagram of a document processing method is provided. The diagram shows that the sub-documents are sorted by relative distance according to the scheduling order of the sub-documents that have been determined, that is, the order in which the calculated relative distance is larger and the earlier it is scheduled, and all the split sub-documents in the document processing system at this time, that is, sub-document 1-1, sub-document 1-2, sub-document 2-1, sub-document 2-2, sub-document 2-3, etc. in the diagram, are scheduled into the buffer queue for consumption processing in turn according to the scheduling order.
[0137] In this implementation, by mapping the vector in the coordinate system and calculating the relative distance from the point in the coordinate system to the vector, the problem of high business priority documents blocking the system and low priority documents waiting for processing for a long time caused by traditional scheduling methods is avoided. The problem of not being able to reasonably schedule sub-documents with different characteristic attributes is avoided, and efficient and reasonable scheduling of sub-documents is achieved.
[0138] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 5 , Figure 5 This is a flowchart of the second embodiment of the document processing method of the present application. After step S40, the document processing method further includes steps S401 to S403:
[0139] Step S401, after monitoring and scheduling the sub-document collection, processing the current processing time of any sub-document in the sub-document collection;
[0140] It should be noted that the current processing time is the length of time it takes for the document processing system to consume and process any sub-document in the split sub-task collection.
[0141] It is understandable that since the processing time of each subtask is uncertain in the actual processing of the sub-document, in order to prevent abnormal subtasks from blocking the system, step S401 is performed. By monitoring the current processing time of the sub-document, it is possible to identify the situation where the single processing time of the subtask exceeds the specified time.
[0142] Step S402, when the current processing time exceeds a preset limited time, stop processing the sub-document and record the processing progress of the sub-document;
[0143] It should be noted that the processing progress is a record of the processed content of the sub-document when the processing of the sub-document is stopped.
[0144] It is understandable that, in actual sub-document processing, the processing time of a sub-document may be too long, so step S402 is performed to save the processing progress of the sub-document each time it is processed, so that the sub-document can be processed continuously in the next processing based on the previous processing.
[0145] Step S403, returning to the step of determining the scheduling order of scheduling the sub-document collection based on the feature vector and the current time, and processing the sub-documents based on the processing progress when the sub-document collection is scheduled for processing again.
[0146] It is understandable that since the traditional scheduling method cannot reasonably process the sub-documents that require too long processing time, step S403 is performed to continue processing the sub-document on the basis of the previous processing, thereby avoiding the failure to successfully process the sub-documents that require too long processing time and improving the processing efficiency of the document.
[0147] In this embodiment, by limiting the single processing time of the subtask, the problem of task blocking when the document processing system processes the sub-document is avoided, thereby achieving the effect of improving the document processing timeliness of the document processing system.
[0148] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those of the above-mentioned embodiments 1 and 2 can be referred to the above introduction, and will not be repeated in the following. Figure 6 , Figure 6 This is a flowchart of the third embodiment of the document processing method of the present application. The second characteristic attribute at least includes the document entry time point when the processing of the document to be processed begins, the business priority, and the document completion degree;
[0149] It should be noted that the document entry time point refers to the moment when the pending document corresponding to the sub-document before the split enters the document processing system and starts processing; the document completion degree is the progress of the processing of the pending document before the sub-document corresponding to the split. The initial value of the document completion degree is 0 after the pending document is split, and it will continue to increase after the sub-document after the split of the pending document is successfully processed, until it increases to 1, indicating that the pending document has been completely processed.
[0150] The method may further include steps S100 to S200:
[0151] Step S100, based on the split relationship between the document to be processed and the sub-document collection, the document entry time point, the business priority, and the document completion degree are used as tree node contents to construct an N-ary tree corresponding to the document to be processed;
[0152] It should be noted that an N-ary tree is a tree data structure in which each node can have at most N child nodes.
[0153] It can be understood that since an efficient document scheduling process requires a clear relationship to be established between different sub-documents after splitting, step S100 is performed, and the hierarchical structure of the document is represented by an N-ary tree, with the document to be processed as the root node and each sub-document after splitting as a child node, which clearly records the splitting relationship between the documents, avoids the problem of unclear document splitting relationship, and provides an effective data structure for efficient document processing.
[0154] For example, to help understand the process of constructing an N-ary tree in this embodiment, please refer to Figure 8 , Figure 8 A schematic diagram of N-ary tree generation of a document processing method is provided, which indicates that an original document, i.e., a document to be processed, is split, and an N-ary tree structure is established according to the document structure. In the figure, a parent document 1 and a parent document N, i.e., a document to be processed 1 and a document to be processed N, are split into two sub-documents, i.e., sub-document 1-1 and sub-document 1-2, and N sub-documents, i.e., sub-document N-1, sub-document N-2...sub-document NN, respectively. Each sub-document records three characteristic attributes, i.e., the second characteristic attribute: a document entry time point X, a business priority Y, and a document completion Z, wherein the business priority Y is normalized so that its value range is limited to 0 to 1, and the value of the document completion is between 0 and 100%.
[0155] Step S200, when it is detected that any sub-document in the sub-document collection has completed scheduling processing, the document completion degree is updated based on the N-ary tree, and the sub-document collection is returned to execute the step of determining the scheduling order of the sub-document collection based on the feature vector and the current time.
[0156] It is understandable that, since the data status update process of the traditional scheduling method is relatively complicated, step S200 is performed to complete the data status update only by updating the document completion degree, thereby achieving the effect of improving the efficiency of scheduling and processing documents.
[0157] For example, please refer to Figure 7 , Figure 7 A schematic diagram of updating the spatial coordinates of a document processing method is provided. By formula:
[0158]
[0159] When it is detected that any sub-document in the sub-document collection has completed scheduling, the document completion degree of the sub-document collection is updated based on the N-ary tree. This is equivalent to moving the feature vector mapped in the spatial rectangular coordinate system O-XYZ upward along the Z axis by ΔZ. 1 , Y 1 , Z 1 ) is moved up to become the eigenvector (X 1 , Y 1 , Z 1 +ΔZ), as shown by the bold arrow in the figure, wherein the X-axis of the spatial rectangular coordinate system represents the time point, the Y-axis represents the business priority, and the Z-axis represents the document completion. At the same time, normalization is performed on the Y-axis dimension. In addition, the largest dotted space in the figure represents the restricted range of the document space distribution, which limits the value range on the X-axis to the positive half axis of X, the value range on the Y-axis to 0 to 1, and the value range on the Z-axis to 0 to 100%, and ΔZ represents the document completion change value. When the value of the document completion attribute of the sub-document reaches 100%, it means that the to-be-processed document corresponding to the sub-document collection has been processed. At this time, the feature vectors of the remaining unprocessed sub-documents of the to-be-processed documents are determined in a scheduling order; when the value of the document completion number attribute does not reach 100%, it means that there are still unprocessed sub-documents in the to-be-processed documents. At this time, the scheduling order of the updated feature vectors of the sub-document collection is determined.
[0160] In this embodiment, the data status of the sub-document collection is updated by updating the split relationship based on the N-ary tree, thereby avoiding the complex data status update process of the traditional scheduling method. The data status update is completed only by updating the document completion degree, thereby improving the efficiency of scheduling document processing.
[0161] For example, to help understand the implementation process of the document processing method obtained by combining this embodiment with the above-mentioned embodiment 1 and embodiment 2, please refer to Fig. 9 , Fig. 9 A brief flowchart of a document processing method is provided, specifically:
[0162] The document to be processed is input into the document splitting module of the document processing system. In the document splitting module, the complexity factor is first calculated according to the characteristic attributes of the document to be processed, and then the parent document, i.e., the file to be processed, is split according to the calculated complexity factor to form a collection of sub-documents after the split, and the business priority of each sub-document collection is calculated. Then all the sub-documents after the split are input into the sub-document scheduling module, and the state snapshot scheduling is first performed in the sub-document scheduling module, that is, scheduling is performed according to the vector distribution. In the state snapshot scheduling, the three-dimensional vector is first mapped according to the characteristic attributes of the sub-document after the split, and then the sub-document is scheduled to enter the buffer queue according to the relative distance calculated in the coordinate system. In the buffer queue, it is consumed and processed in sequence, that is, it is processed by the instance in the time slice allocated by the system, i.e., the preset limited time, giving full play to the advantages of distributed instance deployment, ensuring that all instances are saturated and improving the utilization rate of system resources. Then, after subsequent processing, the processed document is output. This method has no restrictions on the size of the documents to be processed, which solves the problem of system memory overflow and crash caused by individual large documents. At the same time, this method has no restrictions on the type of documents, which solves the problem of poor versatility of traditional document processing methods. In addition, this method can also support the simultaneous processing of large batches of documents, improving the concurrency of document processing.
[0163] For further information, please refer to Fig.10 , Fig.10 A document splitting process diagram of a document processing method is provided. In the figure, an initial complexity factor is first calculated based on a first characteristic attribute of a document to be processed, and an adjustment coefficient is scored based on a preset coefficient, i.e., a preset index coefficient. Then, the final complexity factor is calculated based on the calculated initial complexity factor and the scored adjustment coefficient, and the number of splits is calculated based on the calculated final complexity factor. When the number of splits is not an integer, the number of splits is rounded up to obtain an integer number of splits. The number of split pages is calculated based on the integer number of splits, and the key document attributes of the sub-document collection after splitting, i.e., the second characteristic attribute, are recorded.
[0164] For further information, please refer to Fig.11 , Fig.11A schematic diagram of the overall scheduling process of a document processing method is provided. In the figure, a document state snapshot, i.e., an N-ary tree, is first generated based on the split relationship of the document, and then the document state snapshot is mapped to a coordinate system, and the relative distance from the current time point to the feature vector corresponding to the document state snapshot is calculated in the coordinate system, and then the sub-documents are sorted into a buffer queue according to the relative distance values from large to small. When the buffer queue is empty, it means that all sub-documents have been processed and the scheduling operation ends; when the buffer queue is not empty, the sub-task, i.e., the sub-document collection processing operation is performed. When the processing of the subtask exceeds the time slice, that is, when the current processing time of any subdocument in the subdocument collection exceeds the preset time limit, stop the processing and record the progress, and then put the subtask back into the spatial coordinate system to recalculate the relative distance; when the processing of the subtask does not exceed the time slice, that is, when the current processing time does not exceed the preset time limit, update the document completion attribute of the N-ary tree corresponding to the subtask. When the value of the document completion attribute reaches 100%, it means that the parent document, that is, the document to be processed, has been processed. At this time, remove the N-ary tree and calculate the relative distance of the spatial coordinates of the vectors mapped by the remaining N-ary trees; when the value of the document completion number attribute does not reach 100%, it means that there are still unprocessed subdocuments in the parent document. At this time, calculate the relative distance of the spatial coordinates of the vectors mapped by the remaining subdocuments.
[0165] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the document processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0166] This application also provides a document processing device, please refer to Fig.12 , the document processing device comprises:
[0167] A complexity factor calculation module 10, used to obtain a first characteristic attribute of a document to be processed, and calculate a complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document;
[0168] A splitting module 20, configured to split the document to be processed according to the complexity factor to obtain a collection of sub-documents;
[0169] A vectorization module 30, configured to obtain a second characteristic attribute of the sub-document collection, and vectorize the second characteristic attribute to form a characteristic vector;
[0170] The scheduling module 40 is used to determine the scheduling order of the sub-document collection based on the feature vector and the current time, and schedule the sub-document collection for processing according to the scheduling order.
[0171] Optionally, the complex factor calculation module 10 is further used for:
[0172] Determining the initial complexity factor of the document to be processed according to the number of document pages;
[0173] An adjustment coefficient is determined by the additional adjustment attribute, and the complexity factor of the processed document is obtained by multiplying the adjustment coefficient with the initial complexity factor.
[0174] Optionally, the complex factor calculation module 10 is further used for:
[0175] For any attribute indicator in the additional adjustment attributes, the feature score mapped by the attribute indicator is multiplied by the preset indicator coefficient of the attribute indicator to obtain a weighted product of the attribute indicator, wherein the types of the attribute indicators include document type, number of bytes, number of fonts, content tendency, business priority, and business importance;
[0176] After traversing the attribute indicators in the additional attributes, a weighted product collection is obtained, and the weighted products in the weighted product collection are summed to obtain the adjustment coefficient.
[0177] Optionally, the to-be-processed document is processed by a document processing system, and the splitting module 20 is further used for:
[0178] Determining the candidate number of splits of the to-be-processed document according to the complexity factor and the document processing capability of the document processing system;
[0179] If the candidate split number is not an integer, the candidate split number is rounded to obtain the target split number;
[0180] The document to be processed is split based on the target number of splits.
[0181] Optionally, the scheduling module 40 is further configured to:
[0182] Mapping the feature vector to a coordinate system, and mapping the current moment to the coordinate system to form a current time point in the coordinate system;
[0183] Calculating the relative distance from the current time point to the feature vector in the coordinate system;
[0184] The scheduling order of scheduling the sub-document collection is determined according to the calculated relative distance, wherein the relative distance is positively correlated with the priority of the sub-document in the scheduling order.
[0185] Optionally, after the step of scheduling the sub-documents for processing according to the scheduling order, the step further includes:
[0186] After monitoring and scheduling the sub-document collection, processing the current processing time of any sub-document in the sub-document collection;
[0187] When the current processing time exceeds a preset time limit, stop processing the sub-document and record the processing progress of the sub-document;
[0188] Return to the step of determining the scheduling order of the sub-document collection based on the feature vector and the current time, and when the sub-document collection is scheduled for processing again, process the sub-documents based on the processing progress.
[0189] Optionally, the second characteristic attribute at least includes a document entry time point for starting to process the document to be processed, a business priority, and a document completion degree, and the document processing apparatus is further used for:
[0190] Based on the split relationship between the document to be processed and the sub-document collection, the document entry time point, the business priority, and the document completion degree are used as tree node contents to construct an N-ary tree corresponding to the document to be processed;
[0191] When it is detected that any sub-document in the sub-document collection has completed scheduling, the document completion degree is updated based on the N-ary tree, and the sub-document collection is returned to execute the step of determining the scheduling order of the sub-document collection based on the feature vector and the current time.
[0192] The document processing device provided by the present application adopts the document processing method in the above embodiment, which can solve the technical problem of how to reasonably and efficiently split and schedule documents. Compared with the prior art, the beneficial effects of the document processing device provided by the present application are the same as the beneficial effects of the document processing method provided by the above embodiment, and other technical features in the document processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0193] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the document processing method in the above-mentioned embodiment 1.
[0194] Reference below Fig.13, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, notebook computers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.13 The document processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0195] like Fig.13 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0196] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0197] The electronic device provided by the present application adopts the document processing method in the above embodiment, which can solve the technical problem of how to reasonably and efficiently split and schedule documents. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the document processing method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0198] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0199] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0200] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the document processing method in the above-mentioned embodiment.
[0201] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0202] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0203] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: obtains the first characteristic attribute of the document to be processed, and calculates the complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document; obtains the first characteristic attribute of the document to be processed, and calculates the complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document; splits the document to be processed according to the complexity factor to obtain a collection of sub-documents; obtains the second characteristic attribute of the collection of sub-documents, and vectorizes the second characteristic attribute to form a feature vector; determines the scheduling order of the collection of sub-documents based on the feature vector and the current time, and schedules the collection of sub-documents for processing according to the scheduling order.
[0204] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0205] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0206] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0207] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned document processing method, and can solve the technical problem of how to reasonably and efficiently split and schedule documents. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the document processing method provided in the above-mentioned embodiment, and will not be repeated here.
[0208] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A document processing method, characterized in that: The method includes: Acquire a first characteristic attribute of a document to be processed, and calculate a complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document; Splitting the document to be processed according to the complexity factor to obtain a collection of sub-documents; Acquire a second characteristic attribute of the sub-document collection, and vectorize the second characteristic attribute to form a characteristic vector; Based on the feature vector and the current time, a scheduling order of the sub-document collection is determined, and the sub-document collection is scheduled for processing according to the scheduling order.
2. The method according to claim 1, characterized in that The first characteristic attribute includes the number of document pages and additional adjustment attributes, and the step of calculating the complexity factor of the document to be processed based on the first characteristic attribute includes: Determining the initial complexity factor of the document to be processed according to the number of document pages; An adjustment coefficient is determined by the additional adjustment attribute, and the complexity factor of the processed document is obtained by multiplying the adjustment coefficient with the initial complexity factor.
3. The method according to claim 2, characterized in that The step of determining the adjustment coefficient by using the additional adjustment attribute comprises: For any attribute indicator in the additional adjustment attributes, the feature score mapped by the attribute indicator is multiplied by the preset indicator coefficient of the attribute indicator to obtain a weighted product of the attribute indicator, wherein the types of the attribute indicators include document type, number of bytes, number of fonts, content tendency, business priority, and business importance; After traversing the attribute indicators in the additional attributes, a weighted product collection is obtained, and the weighted products in the weighted product collection are summed to obtain the adjustment coefficient.
4. The method according to claim 1, characterized in that The document to be processed is processed by a document processing system, and the step of splitting the document to be processed according to the complexity factor comprises: Determining the candidate number of splits of the to-be-processed document according to the complexity factor and the document processing capability of the document processing system; If the candidate split number is not an integer, the candidate split number is rounded to obtain the target split number; The document to be processed is split based on the target number of splits.
5. The method according to claim 1, characterized in that The step of determining the scheduling order of scheduling the sub-document collection based on the feature vector and the current time includes: Mapping the feature vector to a coordinate system, and mapping the current moment to the coordinate system to form a current time point in the coordinate system; Calculating the relative distance from the current time point to the feature vector in the coordinate system; The scheduling order of scheduling the sub-document collection is determined according to the calculated relative distance, wherein the relative distance is positively correlated with the priority of the sub-document in the scheduling order.
6. The method according to claim 1, characterized in that After the step of scheduling the sub-documents for processing according to the scheduling order, the following step is further included: After monitoring and scheduling the sub-document collection, processing the current processing time of any sub-document in the sub-document collection; When the current processing time exceeds a preset time limit, stop processing the sub-document and record the processing progress of the sub-document; Return to the step of determining the scheduling order of the sub-document collection based on the feature vector and the current time, and when the sub-document collection is scheduled for processing again, process the sub-documents based on the processing progress.
7. The method according to claim 1, characterized in that The second characteristic attribute at least includes a document entry time point at which the processing of the to-be-processed document begins, a business priority, and a document completion degree, and the method further includes: Based on the split relationship between the document to be processed and the sub-document collection, the document entry time point, the business priority, and the document completion degree are used as tree node contents to construct an N-ary tree corresponding to the document to be processed; When it is detected that any sub-document in the sub-document collection has completed scheduling, the document completion degree is updated based on the N-ary tree, and the sub-document collection is returned to execute the step of determining the scheduling order of the sub-document collection based on the feature vector and the current time.
8. A document processing device, characterized in that: The device comprises: A complexity factor calculation module, used for obtaining a first characteristic attribute of a document to be processed, and calculating a complexity factor of the document to be processed based on the first characteristic attribute, wherein the complexity factor is used to quantify the complexity of splitting the document; A splitting module, used for splitting the document to be processed according to the complexity factor to obtain a collection of sub-documents; A vectorization module, used for obtaining a second characteristic attribute of the sub-document collection, and vectorizing the second characteristic attribute to form a characteristic vector; The scheduling module is used to determine the scheduling order of the sub-document collection based on the feature vector and the current time of processing the document to be processed, and schedule the sub-document collection for processing according to the scheduling order.
9. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the document processing method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the document processing method according to any one of claims 1 to 7 are implemented.
