Skill generation methods and systems, document processing methods and systems
By acquiring processing flow records and abnormal results, candidate modules are identified based on dependencies and processing skills are generated, which solves the problems of inaccurate defect location and low efficiency in document processing, and realizes efficient defect analysis and skill reuse.
Patent Information
- Application Number
- CN202611488717.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-23
- Publication Date
- 2026-11-06
AI Technical Summary
In existing document processing methods, defect location relies on human experience, which has poor accuracy, low processing efficiency, and the processing experience is difficult to reuse.
By acquiring processing stream records and exception handling results, candidate processing modules are determined based on the dependencies between processing objects. Downstream modules are then called using reference output data to generate target processing skills.
It improved the accuracy and efficiency of defect location, enabled the reusability of defect analysis conclusions, and enhanced the efficiency of document processing.
Smart Images

Figure CN123050409A_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of artificial intelligence technology, and in particular to a skill generation method, a skill generation system, a document processing method, and a document processing system. Background Technology
[0002] With the rapid development of artificial intelligence technology, document processing methods that involve multiple processing modules working together are becoming increasingly widespread.
[0003] Currently, document processing is usually completed collaboratively by multiple processing modules. Each processing module performs processing actions on the processing objects in the target document in a serial or parallel manner according to their dependencies. In the event of defects in the processing results, the processing records are usually read manually, the causes of the defects are analyzed, and the processing logic of the relevant processing modules is adjusted, or the processing experience is recorded for future reference.
[0004] However, the above methods have certain limitations in practical applications. The processing flow involves a large number of processing modules, and processing objects are passed between modules, making it difficult to determine the correspondence between defects and processing modules. Defect localization relies on human experience, resulting in poor accuracy. Furthermore, manual analysis requires checking each processing module one by one, leading to low processing efficiency and difficulty in reusing processing experience. There is an urgent need for a skill generation method that can accurately locate the responsible module corresponding to a defect and transform verified repairs into processing skills that can be reused in subsequent tasks. Summary of the Invention
[0005] In view of this, embodiments of this specification provide a skill generation method. One or more embodiments of this specification also relate to a document processing method, a skill deployment method, a method for displaying defect tracing information, a document processing platform, a computing device, a computer-readable storage medium, and a computer program product, to solve the aforementioned technical problems.
[0006] According to a first aspect of the embodiments of this specification, a skill generation method is provided, comprising: Retrieve the processing flow records and exception handling results generated by calling the processing flow to process the target document. The processing flow includes multiple processing modules, and the exception handling results include the defect object of the target document. Based on the dependencies between processing objects in the processing flow record, candidate processing modules corresponding to the defective object are determined from multiple processing modules; Based on the reference output data of the candidate processing module, the downstream processing module is called to process the target document and obtain the reference processing result. If the reference processing results do not include defective objects, the candidate processing module is identified as the target responsibility module, and the target processing skill is generated based on the target responsibility module.
[0007] According to a second aspect of the embodiments of this specification, a document processing method is provided, comprising: Get the document to be processed; Pre-analyze the document to be processed to obtain its task characteristics; Based on task characteristics, target processing skills are retrieved from the skill base, wherein the target processing skills are generated according to the method described above; Based on target processing skills, processing actions are performed on the document to be processed to obtain the processing result.
[0008] According to a third aspect of the embodiments of this specification, a skill deployment method is provided, comprising: Obtain the target processing skill and the release certificate for the target processing skill generated according to the skill generation method described above; Register the target processing skills to the skill library in accordance with the applicable conditions and version indicated in the certificate, and establish the binding relationship between the target processing skills and the corresponding processing modules in the processing flow; The skill library and processing flow are deployed on the learning control plane and task data plane of the document processing platform, respectively. The skill library and processing flow are interconnected through stable object identifiers and versioned data structures. When the task characteristics of a document processing task meet the applicable conditions, the processing flow is invoked according to the binding relationship to execute the processing action, and the retrieval weight of the target processing skill in the skill library is updated according to the processing result produced by the execution of the processing action.
[0009] According to a fourth aspect of the embodiments of this specification, a method for displaying defect tracing information is provided, including: Obtain the processing stream records and exception handling results generated by the processing stream processing the target document. The exception handling results include the defect object of the target document. Based on the dependencies between processing objects in the processing flow record, an object-level error cause-effect graph is constructed, and along the object-level error cause-effect graph, the candidate processing modules corresponding to the defective objects and the responsibility values corresponding to each candidate processing module are determined. A display interface is generated based on the page images of the target document. The display interface includes the page image, the location of the defective object in the page image, the candidate processing module, the dependency relationship between the defective object and the candidate processing module, and the responsibility value. In response to the selection of a target processing module in the display interface, the processing flow record corresponding to the target processing module, evidence of the defective object, and the target processing skills corresponding to the target processing module are displayed.
[0010] According to a fifth aspect of the embodiments of this specification, a document processing platform is provided, including a learning control plane and a task data plane; The learning control plane includes a skill generation module, which is used to obtain the processing flow records and exception handling results generated by calling the processing flow to process the target document, determine the candidate processing modules based on the dependencies between the processing objects in the processing flow records, call the downstream processing modules based on the reference output data of the candidate processing modules to obtain the reference processing results, generate the target processing skills based on the target responsibility modules determined therefrom, and register the target processing skills and the target processing skills' release certificates to the skill library. The task data plane includes a document processing module, which is used to acquire documents to be processed, pre-analyze the documents to obtain task features, retrieve target processing skills from the skill base based on the task features, and execute processing actions on the documents to be processed based on the target processing skills to obtain the processing results of the documents to be processed; the learning control plane and the task data plane are interconnected through stable object identifiers and versioned data structures.
[0011] According to a sixth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above method.
[0012] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the above-described method.
[0013] According to an eighth aspect of the embodiments of this specification, a computer program product is provided, including computer-executable instructions that, when executed by a processor, implement the steps of the above-described method.
[0014] One embodiment of this specification implements a skill generation method, comprising: acquiring processing flow records and exception handling results generated by calling a processing flow to process a target document, wherein the processing flow includes multiple processing modules, and the exception handling results include defect objects of the target document; determining candidate processing modules corresponding to the defect objects from the multiple processing modules based on the dependencies between processing objects in the processing flow records; calling downstream processing modules to process the target document based on reference output data of the candidate processing modules to obtain reference processing results; and determining the candidate processing modules as target responsibility modules when the reference processing results do not include defect objects, and generating target processing skills based on the target responsibility modules.
[0015] By acquiring the processing flow records and exception handling results generated from processing the target document through the processing flow, the correspondence between defect objects and processing objects is clarified, improving the accuracy of defect localization. By identifying candidate processing modules corresponding to defect objects based on the dependencies between processing objects in the processing flow records, the scope of defect localization is narrowed from the entire processing flow, improving the processing efficiency of defect analysis. By calling downstream processing modules based on the reference output data of candidate processing modules and obtaining reference processing results, the association between candidate processing modules and defects can be objectively verified, further improving the accuracy of defect localization. By identifying the target responsible module and generating target processing skills when the reference processing results do not include the defect object, the defect analysis conclusions are transformed into reusable processing skills, eliminating the need for repeated analysis when processing similar documents, thus improving the processing efficiency of document processing. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating a skill generation method provided in one embodiment of this specification; Figure 2 This is a schematic diagram of a multimodal processing stream record and object-level error cause-effect graph provided in one embodiment of this specification; Figure 3 This is a schematic diagram illustrating a layout backfilling and displacement constraint processing procedure provided in one embodiment of this specification; Figure 4 This is a schematic diagram illustrating the generation of defect attribution, defect feature information, and candidate processing skills according to an embodiment of this specification; Figure 5 This is a schematic diagram of a data structure for a candidate processing skill provided in one embodiment of this specification; Figure 6 This is a schematic diagram illustrating a hierarchical selection, skill set, and release system provided in one embodiment of this specification; Figure 7 This is a flowchart illustrating a document processing method provided in one embodiment of this specification; Figure 8 This is a flowchart illustrating a pre-analysis and parsing path selection process provided in one embodiment of this specification; Figure 9 This is a schematic diagram illustrating a process for binding skill retrieval, conflict resolution, and execution plan according to one embodiment of this specification; Figure 10 This is a schematic diagram of the overall architecture for skill generation and iterative optimization provided in one embodiment of this specification; Figure 11 This is a schematic diagram of a closed loop for skill lifecycle and relapse monitoring provided in one embodiment of this specification; Figure 12This is a flowchart illustrating a skill deployment method provided in one embodiment of this specification; Figure 13 This is a flowchart illustrating a method for displaying defect tracing information according to one embodiment of this specification; Figure 14 This is a schematic diagram of the structure of a document processing platform provided in one embodiment of this specification; Figure 15 This is a schematic diagram of the structure of a skill generation system provided in one embodiment of this specification; Figure 16 This is a schematic diagram of the structure of a document processing system provided in one embodiment of this specification; Figure 17 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0017] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0018] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0019] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0020] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in one or more embodiments of this specification are obtained through open-source datasets or public datasets that comply with their license agreements, or are obtained with full authorization from the relevant parties. Moreover, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0021] In one or more embodiments of this specification, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.
[0022] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as NLP tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0023] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0024] Optical Character Recognition (OCR) is a technology that converts text regions in a page image into editable text. It detects the position of the text and recognizes the character content, outputting text lines or character sequences with positional information.
[0025] Table Structure Recognition (TSR) is a technique that recovers the row and column skeleton and cell range from a table image, outputting the row and column structure of the table and the coordinates of each cell.
[0026] Multimodal Large Language Model (MLLM) is a large-scale pre-trained model that can simultaneously process multiple modal inputs such as text and images and generate text output.
[0027] Graph Neural Networks (GNNs) are a type of neural network that takes a graph structure as input and aggregates neighborhood information through message passing between nodes to learn representations of nodes or the entire graph.
[0028] A Bayesian Network (BN) is a probabilistic graphical model that uses a directed acyclic graph to represent the conditional dependencies between random variables, and is used to infer causal relationships and conditional probabilities between variables.
[0029] Bayesian optimization (BO) is a black-box optimization method for expensive objective functions. It estimates the distribution of the objective function's values using a surrogate model and selects the next sampling point accordingly.
[0030] Causal structure learning is a statistical learning method that infers the direction and structure of causal relationships between variables from observed data.
[0031] Vector embedding is a way of mapping objects to low-dimensional dense vectors, so that the similarity between objects can be measured by the distance or angle between the vectors.
[0032] A knowledge graph (KG) is a structured knowledge base organized with entities as nodes and relationships between entities as edges.
[0033] A relational database (RDB) is a type of database that organizes data in two-dimensional tables, establishes relationships between tables through keys, and supports structured queries.
[0034] A graph database is a database that uses nodes and edges as the basic storage units and is optimized for multi-hop relational queries.
[0035] A vector database is a database that uses vectors as indexes and supports nearest neighbor retrieval based on vector similarity.
[0036] Object storage is a storage method that uses objects as units, accesses them through unique identifiers, and manages data using a flat address space. It is suitable for storing unstructured data such as page images and document files.
[0037] The Pareto Front is a set of non-dominant solutions in multi-objective optimization. A solution in the set that is better on one objective must be worse on another.
[0038] A sandbox is an isolated environment that restricts the execution of a program to limited resources and permissions, allowing the program's behavior to be executed and observed without affecting the production environment.
[0039] Shadow Run is a release verification method that allows the new version and the online version to process the same request in parallel and record the execution results separately without changing the actual output.
[0040] Canary release is a release method that first distributes a new version to a portion of traffic or tasks, and then gradually expands the distribution scope after observing that the metrics are normal.
[0041] A sequential test is a statistical test method that accumulates evidence step by step as samples arrive one by one and makes a judgment based on that evidence.
[0042] With the rapid development of artificial intelligence technology, document processing methods that involve multiple processing modules working together are becoming increasingly widespread.
[0043] Currently, document processing is usually completed collaboratively by multiple processing modules. Each processing module performs processing actions on the processing objects in the target document in a serial or parallel manner according to their dependencies. In the event of defects in the processing results, the processing records are usually read manually, the causes of the defects are analyzed, and the processing logic of the relevant processing modules is adjusted, or the processing experience is recorded for future reference.
[0044] However, the above methods have certain limitations in practical applications. The processing flow involves a large number of processing modules, and processing objects are passed between modules, making it difficult to determine the correspondence between defects and processing modules. Defect localization relies on human experience, resulting in poor accuracy. At the same time, manual analysis requires checking each processing module one by one, leading to low processing efficiency and difficulty in reusing processing experience.
[0045] In view of this, a skill generation method is provided in this specification. One or more embodiments of this specification also relate to a document processing method, a skill deployment method, a method for displaying defect tracing information, a document processing platform, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0046] Specifically, see Figure 1 , Figure 1 A flowchart of a skill generation method according to an embodiment of this specification is shown, such as... Figure 1 As shown, the method specifically includes the following steps.
[0047] Step 102: Obtain the processing flow record and exception handling result generated by calling the processing flow to process the target document. The processing flow includes multiple processing modules, and the exception handling result includes the defect object of the target document.
[0048] The skill generation method provided in one or more embodiments of this specification can be applied to defect analysis and skill generation scenarios, and can be deployed on document processing platforms such as document translation services, document parsing services, and document format restoration services as a decision module for defect analysis and skill generation.
[0049] A processing flow is a processing chain formed by the sequential processing steps a target document undergoes during its processing. Specifically, a processing flow includes multiple processing modules, each of which can perform processing actions on the target document in a sequential order. The output data of the upstream processing module serves as the input data for the downstream processing module. The processing flow can be configured according to the type of the target document and processing requirements. For example, for a document containing both scanned pages and original pages, the processing flow may include steps such as layout analysis, optical character recognition, table structure recognition, content translation, layout re-filling, and page rendering. A processing flow can be used to carry out the complete processing of a target document from input to output.
[0050] A processing module is a functional unit within a processing flow that performs one or more processing actions. Specifically, processing modules can be configured with processing parameters, processing tools, and processing versions. They can be implemented as independent processes, services, or functions, or they can be invoked uniformly by a scheduling component as nodes within the processing flow. Processing modules are used to execute processing actions on processing objects and output processing results. Furthermore, the same processing module can use different processing parameters or tools in different processing iterations. The version and configuration information of the processing module can be saved along with the processing flow records to distinguish changes in the processing module itself from changes in the input data during defect analysis.
[0051] The target document is the document processed by the processing stream. Specifically, the target document can be a document containing at least one of the following: scanned and native mixed pages, multi-column layouts, tables, formulas, text in images, rotated text, special fonts, transparent layers, complex backgrounds, or nested objects. It can be provided in the form of a file, a collection of files, or a data stream, and its pages, areas, text lines, cells, and images constitute the processing object. The target document can be used to provide input to the processing stream and serve as a carrier of the processing object.
[0052] A processing flow record is a record generated during the processing of a target document by a processing flow. Specifically, processing flow records can be generated in an append-only manner, and the record content may include at least one of the following: processing task identifier, processing run identifier, processing stage identifier, node identifier, action identifier, processing object identifier, input reference, output reference, model or tool version, start time, end time, processing status, and content hash. Data such as page images, document files, masks, formulas, and logs referenced by the processing flow record can be stored in object storage, and reference and verification information can be saved. Processing flow records can be used to reconstruct the process of the processing flow performing processing actions on the processing object.
[0053] Anomaly handling results are the processing outcomes obtained by processing the target document through the processing flow, including defect objects. Specifically, anomaly handling results can include defect objects in the target document. These defect objects can be processing objects corresponding to preset defect types in the processing results. Preset defect types can include at least one of the following: omitted translations, source text remnants, missing characters, missing tables or images, overlapping layouts, and premature compositing. Anomaly handling results can be represented as a processed document, a processed page image, or a combination of both. Anomaly handling results can be used to indicate the location and type of defects.
[0054] A defect object is a processing object identified as having a defect in the exception handling results. Specifically, a defect object can include text lines, cells, regions, images, or pages in the target document, and can carry its corresponding defect type and processing object identifier. Defect objects can be used to indicate processing objects whose causes need to be located in the processing flow.
[0055] In practical applications, obtaining the processing stream records and exception handling results generated by the call processing stream to process the target document can be achieved through various methods.
[0056] One alternative approach is to have each processing module write processing flow records in real time according to a unified recording format during the processing flow execution. After the processing flow is completed, an evaluation component evaluates the processing results to identify defective objects and obtain abnormal handling results. Specifically, each processing module can record input references before executing a processing action and output references after execution, and write processing object identifiers and action identifiers. The evaluation component can evaluate step by step at granular levels such as page, region, cell, and text line, compare the evaluation results with preset defect types, and identify the processing objects that match successfully as defective objects. The processing flow records and abnormal handling results are generated synchronously in the same processing process.
[0057] Another alternative approach is to backtrack the processing flow after its execution, based on the input and output data retained during the process. During this backtracking, a processing flow record is generated, and the backtracked processing results are evaluated to identify defective objects. Specifically, backtracking can execute processing actions sequentially according to the order of the processing modules, saving input and output data after each module completes. For processing modules configured with random procedures or external calls, the random parameters can be fixed or the same call parameters can be used during backtracking to ensure consistency with the original processing results. The processing flow record can be generated as needed after the processing is complete, suitable for scenarios where the processing was not fully recorded.
[0058] In addition, the aforementioned methods can be used in combination. For example, during the processing, the processing actions and object identifiers of each processing module can be recorded, and after the processing is completed, input and output data can be supplemented for the defective processing objects based on the abnormal processing results.
[0059] In an optional embodiment, environment snapshot information and integrity verification information may also be stored in the processing stream record. The environment snapshot information may include at least one of the following: the processing module version, processing tool version, font version, data structure version, and policy version used during processing stream execution. The integrity verification information may include the hash value of the data referenced by the processing stream record. Since the cause of defects may be related to changes in the processing module version or data structure version, storing the environment snapshot information allows for comparison of different processing processes under the same environmental conditions, and the integrity verification information can be used to confirm that the processing stream record used for analysis is consistent with the processing record used during processing.
[0060] In an optional embodiment, the processing flow records, evaluation results, defect objects, and dependencies involved in the same defect can be grouped into a single evidence set according to the processing object identifier, and saved together with an environmental snapshot, so that the defect situation can be replayed as a whole. Specifically, the processing flow records and the skill library can respectively be responsible for the retention of defect situations and processing capabilities. The former saves the processing process when the defect occurred at the processing object granularity, while the latter saves the verified target processing skills. The two enable the analysis conclusions of the defect and the corresponding processing capabilities to continue between processing tasks, forming a closed loop from defect analysis to skill generation, and then from skill reuse back to the document processing process.
[0061] In this step, by acquiring the processing flow records and exception handling results generated from processing the target document using the processing flow, a correspondence is established between the processing status of each processing module and the exception handling results, including defect objects, through the processing objects. This allows defects to be located to specific processing objects. Since the processing flow records are recorded at the processing object level and retain processing module version information, the association between defect objects and processing modules has a traceable data foundation, thereby improving the accuracy of defect location and providing input for subsequent determination of candidate processing modules and generation of target processing skills.
[0062] Step 104: Based on the dependencies between processing objects in the processing flow record, determine the candidate processing module corresponding to the defect object from multiple processing modules.
[0063] A processing object is an object in the target document that undergoes processing actions performed by the processing module. Specifically, a processing object can include at least one of the following: page, region, text line, cell, image, and formula. It can be passed between different processing modules and undergo morphological changes as the processing flow progresses. A processing object can carry a stable object identifier that remains stable during processing, allowing the form of the same processing object to be associated across different processing modules. Processing objects can be used to carry the input and output of processing actions and serve as connection points for dependencies. Furthermore, processing objects can originate from the target document itself or be generated by the processing module during processing, forming a multi-level structure from source objects to output objects. The cause of defective objects can be traced back along this multi-level structure.
[0064] A dependency relationship is an association between processing objects resulting from processing actions. Specifically, a dependency relationship can include at least one of the following: generation relationship, input dependency relationship, mapping relationship, and substitution relationship. A generation relationship indicates that a processing object is generated by another processing object through a processing action; an input dependency relationship indicates that the processing of a processing object requires another processing object as input; a mapping relationship indicates the correspondence between processing objects before and after processing; and a substitution relationship indicates that a processing object is replaced by another processing object during processing. For example, a text line object is processed by a content translation module to generate a translated object, forming a generation relationship between the translated object and the text line object; a layout backfilling module needs layout position data when processing backfill objects, forming an input dependency relationship between the backfill objects and the layout position data. Dependencies can be determined by input and output references in the processing flow record, or by the order in which processing object identifiers appear. Dependencies can be used to represent a unidirectional association between processing objects from upstream to downstream.
[0065] Candidate processing modules are processing modules that correspond to defective objects and may cause defects. Specifically, candidate processing modules may include processing modules corresponding to processing objects to which the defective object belongs or depends, and there may be one or more of them. If the defective object is located in the middle of the processing flow, candidate processing modules may include processing modules preceding that processing stage. Candidate processing modules can be used to limit the scope of subsequent verification.
[0066] In practical applications, the candidate processing module corresponding to the defective object can be determined from multiple processing modules based on the dependencies between processing objects in the processing stream record. This can be achieved through various methods.
[0067] One alternative approach is to search backwards along the dependencies, starting from the defective object, based on the position of the processing object identifier in the processing flow record, identifying the relevant processing modules as candidate processing modules. Specifically, first, search the processing flow record for records carrying defective object identifiers to determine the processing module that outputs the defective object. Then, determine the processing module that processes the input object based on the input object identifier in the record, and so on, until a processing object originating from the target document itself is found. All the relevant processing modules constitute candidate processing modules. Thus, the candidate processing modules strictly correspond to the dependencies, and completeness can be determined by whether the dependencies have been traversed.
[0068] Another alternative approach is to determine candidate processing modules based on the stage and node identifiers in the processing flow record, according to the sequential order of the processing modules in the processing flow. Specifically, the processing stage where the defective object is located can be determined, and the processing modules corresponding to that stage and all preceding stages can be identified as candidate processing modules. For processing modules in the processing flow that are allowed to be executed in parallel, the branches with dependencies on the parallel branches and the defective object can be included as candidate processing modules, while branches without dependencies can be excluded.
[0069] Another alternative method is to statistically analyze the processing modules involved in defect objects containing the same defect type based on the processing flow records from multiple processing steps, and identify the processing modules whose occurrence frequency meets a preset threshold as candidate processing modules. Specifically, processing flow records for multiple processing steps corresponding to the same defect type can be collected, and the participation of each processing module when the defect type occurs can be statistically analyzed. Processing modules that meet the preset threshold are retained, while those that do not meet the preset threshold can be excluded or retained as modules to be verified.
[0070] In addition, based on any of the aforementioned methods, candidate processing modules can be screened by combining the risk level of the processing module. For example, modules with higher risk levels and closer dependencies on the defective object can be retained, while processing modules with lower risk levels and more distant dependencies can be excluded.
[0071] In an optional embodiment, the association information between each identified candidate processing module and the defective object can also be recorded. This association information may include the dependency level, the number of processing objects involved in the current processing, and the processing version of the candidate processing module. Since different candidate processing modules have varying degrees of association with the defective object, recording this association information allows subsequent verification to proceed from closest to furthest in terms of association strength, and prioritizes verifying processing modules with higher association strength when verification resources are limited.
[0072] In this step, by identifying the dependency relationships between processed objects in the processing flow record, candidate processing modules corresponding to the defect object are determined from multiple processing modules. This narrows the scope of defect location from all processing modules included in the processing flow to processing modules that have a dependency relationship with the defect object. Since the dependency relationship is objectively determined by the processing flow record, the determination of candidate processing modules has a verifiable processing record basis, providing a clear scope for subsequent verification by referring to the output data. This improves the processing efficiency of defect analysis and the accuracy of defect location.
[0073] Step 106: Based on the reference output data of the candidate processing module, call the downstream processing module to process the target document and obtain the reference processing result.
[0074] Reference output data is the processing data corresponding to the output data of the candidate processing module. Specifically, reference output data can be the data that the candidate processing module should output when performing processing actions on the processing object, such as the translated data that the content translation module should output. Reference output data can come from output data that has been verified and confirmed during historical processing, output data that has been corrected after manual verification, or output data generated by other processing versions or other processing paths for the same processing object. Reference output data can be used to replace the output data of the candidate processing module.
[0075] Downstream processing modules are those that follow candidate processing modules in the processing flow and have a dependency on their output data. Specifically, downstream processing modules can include subsequent processing modules immediately adjacent to the candidate processing module, or multiple processing modules following the candidate processing module. The scope can be determined based on the dependencies between processing objects in the processing flow record. When multiple downstream processing modules exist, they are called sequentially according to their order in the processing flow. Downstream processing modules can be used to continue processing the target document after the output data of the candidate processing module has been replaced.
[0076] The reference processing result is the result obtained by calling downstream processing modules to process the target document based on reference output data. Specifically, the reference processing result corresponds to the exception handling result. The difference is that the reference processing result is obtained when the output data of the candidate processing module is replaced, while the processing parameters and processing version of the downstream processing module remain unchanged, and its manifestation is consistent with the exception handling result. The reference processing result can be used to compare with the exception handling result to determine whether the defective object still exists.
[0077] In practical applications, the downstream processing module is called to process the target document based on the reference output data of the candidate processing module to obtain the reference processing result. This can be achieved through various methods.
[0078] One alternative approach is to replace the output data of the candidate processing module with the reference output data and then re-invoke the downstream processing module to process the target document. Specifically, the output data generated by the candidate processing module during processing can be saved first, and then the downstream processing modules can be invoked in the order of their processing in the processing flow after replacing the reference output data. For processing modules preceding the candidate processing module, the processing results can reuse exception handling results, eliminating the need for re-execution. Thus, the scope of re-execution only covers the downstream processing modules following the candidate processing module.
[0079] Another alternative approach is to rewrite the execution plan of the processing flow, redirecting the data source corresponding to the output data of the candidate processing module to the reference output data, and then executing the downstream processing module according to the rewritten execution plan. Specifically, in the execution plan corresponding to the processing flow, the output reference of the node corresponding to the candidate processing module can be modified to the reference corresponding to the reference output data, while keeping the node and connection relationship of the downstream processing module unchanged. After the execution plan is completed, the defective object can be found in the processing results according to the processing object identifier.
[0080] Another alternative approach is to re-execute only the downstream processing modules that depend on the defective object after replacing the output data of the candidate processing module, while reusing the original processing results for other processing objects. Specifically, the set of affected processing objects can be determined based on the dependencies between processing objects. This set can include the defective object, the processing objects that the defective object depends on, and the processing objects that depend on the output data of the candidate processing module. For processing objects not included in the set, the corresponding processing results from the exception handling results can be directly reused.
[0081] In addition, for each candidate processing module, the output data can be replaced with the corresponding reference output data and the downstream processing module can be called to obtain the reference processing results corresponding to each candidate processing module.
[0082] In an optional embodiment, comparison information can also be saved for the replacement process. This comparison information may include the replaced output data, reference output data, the processing objects involved in the replacement, and the downstream processing modules that were called and re-executed. Since the difference between the reference processing result and the abnormal processing result is used to determine whether the candidate processing module caused a defect, saving the comparison information makes the judgment process traceable and verifiable, and also allows the replacement process to be re-executed when there is doubt about the judgment result.
[0083] In this step, the downstream processing module is called to process the target document based on the reference output data of the candidate processing module, and a reference processing result is obtained. This transforms the determination of the cause of the defect into a comparative analysis of the processing result. Since the obtained reference processing result only replaces the output data of the candidate processing module, the difference between the reference processing result and the abnormal processing result can be directly correlated with the candidate processing module. This limits the determination of the cause to the processing module in which the output data changes, thereby improving the accuracy of defect location.
[0084] Step 108: If the reference processing results do not include defective objects, determine the candidate processing module as the target responsibility module, and generate the target processing skill based on the target responsibility module.
[0085] The target responsibility module is the processing module identified as causing the defect among the candidate processing modules. The meaning of candidate processing modules is described in the preceding embodiments and will not be repeated here. Specifically, there can be one target responsibility module, or multiple processing modules if multiple processing modules jointly cause the same defect. The target responsibility module can be used to limit the processing modules that need adjustment. For example, the target responsibility module can be a processing module from the layout analysis module, content translation module, or layout backfilling module that prevents the defective object from reappearing. Furthermore, since the determination of the target responsibility module is based on the reference processing results, the determination process can be reproduced; the correspondence between the target responsibility module and the defective object can be saved along with the processing flow record for subsequent processing to retrieve the corresponding processing skills.
[0086] Target processing skills are processing capabilities generated based on target responsibility modules and used to adjust the processing behavior of those modules. Specifically, target processing skills can be saved in the form of configuration information, parameter information, process information, or verification information. The content points to the processing stage corresponding to the target responsibility module in the processing flow and corresponds to the target responsibility module and its processing version. Target processing skills can be used to adjust the processing behavior in subsequent document processing.
[0087] In practical applications, when the reference processing results do not include defective objects, the candidate processing module can be identified as the target responsibility module through various methods.
[0088] One alternative method is to evaluate the reference processing result using the same evaluation method used when obtaining the anomaly handling result, and determine the target responsible module based on the presence of the defective object in the reference processing result; the specific implementation of the evaluation method is described in the embodiments below, and will not be repeated here. Specifically, if no defective object appears in the reference processing result, it can be determined that the output data of the candidate processing module is a condition for the generation of the defect, and the candidate processing module is determined as the target responsible module.
[0089] Another alternative approach is to determine the differences between the reference processing results and the anomaly processing results in terms of defect evaluation metrics, and then identify the candidate processing module as the target responsibility module if preset conditions are met. Specifically, the defect evaluation metrics may include at least one of the following: the elimination status of the target defect, the number of processing objects involved in the defect, the number of pages involved in the defect, and the distribution of the defect on the page layout. If the reference processing results are improved and the degree of improvement meets preset conditions, the candidate processing module can be identified as the target responsibility module. If the degree of improvement does not meet preset conditions, the candidate processing module can be retained and other candidate processing modules can continue to be validated.
[0090] Another optional method is to determine whether the defective object appears in the corresponding reference processing result for each candidate processing module, and identify the candidate processing module that prevents the defective object from appearing as the target responsible module. For specific implementation methods of performing replacement and invocation for multiple candidate processing modules, please refer to the aforementioned embodiments, which will not be repeated here. If multiple candidate processing modules can prevent the defective object from appearing, multiple target responsible modules can be retained. If the defect corresponding to the defective object no longer appears in the reference processing result, it is considered that the reference processing result does not include the defective object. This situation only constitutes evidence of responsibility for the candidate processing module. The determination of the target responsible module can also be based on a comprehensive judgment combining structural evidence, temporal evidence, and counterfactual contributions, without limiting the target responsible module to a single one. If the reference processing result still includes the defective object, the responsibility of the candidate processing module is not excluded. The responsibility assumption can be retained, and replacement and invocation can continue to be performed on other candidate processing modules. If multiple processing modules jointly cause the defect, replacement and invocation can also be performed on combinations of processing modules.
[0091] In addition, based on any of the aforementioned methods, the processing action sequence in the processing flow record can be combined with the verification target responsibility module of the exception record. If the verification result contradicts the processing sequence of the candidate processing module, the candidate processing module can be retained and transferred to manual review.
[0092] In practical applications, generating target processing skills based on the target responsibility module can also be achieved through various methods.
[0093] One alternative approach is to generate target processing skill content based on the processing behavior of the target responsibility module and the defect object, and organize it into configuration information that can be read and executed by the processing flow. Specifically, the processing parameters, tools, and processes used by the target responsibility module when processing the defect object can be determined first. Based on the defect type of the defect object, the content that needs to be adjusted can be determined, and the content that needs to be adjusted, along with the identifier of the target responsibility module and the processing version, can be written into the target processing skill.
[0094] Another alternative approach is to generate target processing skills based on the node configurations corresponding to the target responsibility modules in the processing stream. This involves modifying the node configurations and saving them as new configuration information. Specifically, the nodes corresponding to the target responsibility modules in the processing stream and their input / output references can be read, the node configurations modified, and the differences between the modified and original configurations saved as target processing skills.
[0095] Another alternative approach is to generate one or more skill versions and determine the target processing skill from them. Specifically, several different skill versions can be generated based on the same defect object, with each skill version differing in the adjusted configuration items; then, the target processing skill is determined based on the performance of each skill version on the same type of defect, and the undetermined skill versions can be retained for future reference.
[0096] In addition, the basis for generating target processing skills can be recorded when generating them. The basis for generation can include the identifier and processing version of the target responsibility module, the defect type of the defect object, and the comparison between the reference processing results and the abnormal processing results.
[0097] In an optional embodiment, after determining the target responsibility module, defect feature information characterizing the current defect can be generated based on the target responsibility module and the defect object. The defect feature information may include at least one of the following: characteristics of the processing object to which the defect object belongs, processing characteristics of the target responsibility module, and environmental characteristics during the execution of the processing flow. This information is saved along with the target processing skill. Since the same type of defect may appear repeatedly in different target documents, saving the defect feature information allows the scope of application of the target processing skill to correspond to the defect situation when the processing skill was generated.
[0098] In this step, by identifying candidate processing modules as target responsibility modules and generating target processing skills based on these modules, the analysis conclusions of defects are transformed from a one-time evaluation of processing results into reusable processing capabilities. Since the determination of target responsibility modules is based on whether the defect object in the reference processing results has been eliminated, there is a verifiable correspondence between target responsibility modules and defects. At the same time, target processing skills exist in the form of independently saved processing capabilities, so that the same type of defects can be processed without re-analysis in subsequent document processing, thereby improving the accuracy of defect location and the processing efficiency of document processing.
[0099] In an optional embodiment of this specification, before obtaining the processing stream record and the exception handling result, the method further includes: The processing flow is invoked to perform processing actions on the processing objects in the target document and obtain the raw processing results. Evaluate each processed object in the original processing results to obtain the evaluation results; The evaluation results are analyzed. If the evaluation results correspond to a preset defect type, the processing object corresponding to the evaluation results is identified as a defect object, and the original processing results including the defect object are identified as abnormal processing results.
[0100] A processing action is a processing operation performed by a processing module on a processing object. Specifically, a processing action may include at least one of the following: layout analysis, optical character recognition, table structure recognition, content translation, layout backfilling, and page rendering. Each processing action corresponds to its own input data and processing parameters. For example, the content translation action takes a text line processing object as input and outputs translated data. Processing actions are executed at the granularity of the processing object, and the same processing module can perform the same processing action on multiple processing objects. Processing actions can be used to generate processing data corresponding to the processing object.
[0101] The raw processing result is the result of processing actions performed on the processing objects in the target document by the processing flow. Specifically, the raw processing result can be represented as a processed document, page image, or a combination of both and intermediate artifacts, and includes the content, position, and form information of each processing object after the processing action is performed, such as the translated data output by the content translation action and the layout position data output by the layout backfilling action. The raw processing result is saved according to the granularity of the processing object, so that the processing data of the same processing object at different processing stages can be distinguished. The raw processing result can be used to provide the data basis for performance evaluation. Furthermore, the raw processing result and the anomaly processing result have the same data form but different judgment states; the former is the input for evaluation, and the latter is the output of evaluation.
[0102] The evaluation results are conclusions drawn from evaluating each processed object in the original processing results. Specifically, the evaluation results can be generated by a deterministic evaluator and a multimodal evaluator. The deterministic evaluator performs judgments based on at least one of the following: quantity conservation relationship, preservation status of protected objects, text character coverage, data structure integrity, placeholder position, font coverage, and compilation errors. The multimodal evaluator performs judgments based on whether text is missing, regions overlap, graphics are complete, images and text are lost, and visual styles are abnormal in the processed page images. The evaluation results include the processed object identifier, the conditions met, the preset defect type, and the confidence level of the evidence and source. For example, a processed object in a cell may have missing content due to insufficient character coverage. The evaluation results can be used to identify processed objects with defects in the original processing results.
[0103] Preset defect types are classification criteria used to determine whether a processed object has defects. Specifically, preset defect types can include at least one of the following: omitted translation content, source text remnants, missing characters, missing tables or images, overlapping layouts, and premature synthesis. Each preset defect type corresponds to its own judgment conditions, applicable object types, and risk levels. For example, missing tables or images correspond to the judgment condition that the number of table or image objects in the processed result is less than the corresponding number of objects in the target document. Preset defect types can be configured and expanded according to the type of the target document and processing requirements. Preset defect types can be used to compare with evaluation results and serve as the basis for determining defective objects. Furthermore, preset defect types are stored independently of the evaluation method in the form of classification criteria, enabling evaluation results from different evaluation sources to be interpreted according to the same classification criteria, and historical evaluation results can still be understood after changes to preset defect types.
[0104] In practical applications, calling the processing stream to perform processing actions on the processing objects in the target document and obtain the raw processing results can be achieved through various methods.
[0105] One alternative approach is to execute processing actions on each processing object sequentially according to the order of processing modules in the processing stream, and save the processing data output by each processing action as the original processing result. Specifically, the execution order of processing actions can be determined according to the type of processing object. For example, for text line processing objects, optical character recognition can be performed first, followed by content translation. After each processing action is executed, the processing data and the processing object identifier are saved together, and processing objects that have not undergone processing actions retain their original data.
[0106] Another alternative approach is to divide the target document into pages or regions, perform processing actions in batches based on the division results, and then summarize the results of each batch into the original processing result. Specifically, processing actions can be performed page by page in sequence, and within the same page, actions can be performed sequentially according to the categories of regions, text lines, and cells. For target documents that mix scanned pages and native pages, the corresponding processing modules can be called according to page type, and the results of each page can be saved separately and summarized after all pages have been processed.
[0107] In addition, the execution information of each processing action can be saved during the process of obtaining the original processing results. The execution information may include the processing module identifier, processing parameters and processing version.
[0108] After obtaining the raw processing results, further evaluation can be performed. In practical applications, evaluating each processed object in the raw processing results and obtaining the evaluation results can be achieved through various methods.
[0109] One alternative approach is for a deterministic evaluator to evaluate each processing object item by item according to the judgment criteria, and to use the matched criteria as the evaluation result. Specifically, the deterministic evaluator can determine whether a processing object is missing based on quantity conservation, whether a protected object has been altered based on the preservation status of the protected object, whether the content is complete based on text character coverage, whether fields are missing based on data structure integrity, whether placeholders are conserved based on placeholder positions, whether fonts are missing based on font coverage, and whether the translation is compileable based on compilation errors. The matched criteria, along with the processing object identifier and evidence, are recorded as the evaluation result; processing objects that do not match the judgment criteria are not recorded.
[0110] Another alternative approach is to use a multimodal evaluator to compare the processed page image with the page image of the target document to obtain evaluation results for each processed object. Specifically, the multimodal evaluator can extract features from the page image according to the categories of region, text line, and cell, and compare the features of the processed page image with the features of the corresponding positions in the target document. Based on the comparison results, it determines whether the text is missing, whether the regions overlap, whether the graphics are complete, and whether the font styles are consistent. The comparison results are mapped back to the processed objects in the original processing results according to the position of the processed objects in the processing flow, forming the evaluation results.
[0111] In addition, the evaluation results given by the deterministic evaluator and the multimodal evaluator can be compared with each other. If the judgment conclusions of the two evaluation sources are inconsistent, the two judgments can be retained and their respective source confidence levels can be recorded.
[0112] After obtaining the evaluation results, they can be further analyzed. In practical applications, the evaluation results are analyzed, and if the evaluation results correspond to a preset defect type, the processing object corresponding to the evaluation results is identified as the defect object, and the original processing result is identified as the abnormal processing result. This can also be achieved through various methods.
[0113] One alternative method is to compare the conditions matched by the evaluation results with the judgment conditions corresponding to each preset defect type, and identify the processing objects that match the comparison as defect objects. Specifically, the processing object identifier and the matched conditions can be read from the evaluation results, and the matched conditions can be compared with the judgment conditions of each preset defect type to determine the preset defect type corresponding to the evaluation results. If the comparison matches, the processing object indicated by the processing object identifier is identified as a defect object and the preset defect type is recorded. If any processing object is identified as a defect object, the original processing result is identified as an abnormal processing result.
[0114] Another alternative method is to determine the defect object based on the source confidence level carried by the evaluation result and the judgment threshold corresponding to the preset defect type. Specifically, the source confidence level can be read from the evaluation result, compared with the judgment threshold corresponding to the preset defect type, and if the source confidence level is not lower than the judgment threshold, the object to be processed is determined as a defect object; if the source confidence level is lower than the judgment threshold, the object to be processed is retained as an object to be reviewed and its evaluation result is recorded. Each preset defect type is configured with its own judgment threshold.
[0115] In addition, various methods can be used in combination. For example, the preset defect type corresponding to the evaluation result can be determined by comparing the judgment conditions, and the result can be verified by comparing the source confidence level with the judgment threshold to make the judgment basis clear and the judgment conclusion reliable. Alternatively, the evaluation results can be collected according to the distribution of the evaluation results in the original processing results and the dependency relationship between the processing objects, and the defect objects can be determined based on the collection results.
[0116] In an optional embodiment, the determination process of the defective object can also save the determination criteria information. The determination criteria information may include the determination conditions hit by the evaluation result, the source and source confidence level of the evaluation result, and the processing path of the object in the processing flow. The source of the evaluation result may include a deterministic evaluator, a multimodal evaluator, and human feedback. Human feedback can be received in the form of selecting an abnormal area, selecting a defect type, confirming the repair result, or correcting the processing content. The area corresponding to the human feedback is converted into an evaluation result based on the correspondence between the page position and the object identifier, and the source confidence level is retained according to the feedback source. Saving the determination criteria information allows the determination result of the defective object to be reviewed in subsequent analysis, and also allows for the re-determination of the defective object if the source confidence level changes.
[0117] In the embodiments of this specification, processing actions are performed on the processing objects in the target document by calling the processing flow to obtain the original processing results, and evaluation is performed on each processing object to obtain the evaluation results, so that the defective objects are located one by one at the granularity of the processing objects. Since the acquisition and parsing of the evaluation results are based on the judgment conditions, the process of determining the defective objects and abnormal processing results can be reproduced and verified, and the defective objects are determined in the object-by-object judgment. Thus, the discovery of defects is directly given by the object-by-object judgment in the processing process, which improves the accuracy of defect location and the processing efficiency of defect analysis.
[0118] In an optional embodiment of this specification, after obtaining the processing stream record and the exception handling result, the method further includes: Based on stable object identifiers, cross-module alignment is performed on processing objects processed by multiple processing modules to obtain the dependencies between processing objects.
[0119] A stable object identifier is an identifier that indicates the same processing object when the processing flow processes the target document. Specifically, stable object identifiers can be assigned and reused when a processing object is generated by a processing module. For processing objects that can naturally inherit identifiers, their identifiers are inherited from upstream processing objects. For example, when a region object is segmented into text line objects, the identifier of the text line object corresponds to the identifier of the region object. For visual objects such as page images, masks, and rendering results, their identifiers are determined during processing. The processing object identifiers recorded in the processing flow record are stable object identifiers. Stable object identifiers can be used to mark input and output references of processing objects in the processing flow record. Furthermore, stable object identifiers can align source document objects, text lines, regions, cells, translation units, backfill objects, and defect objects, providing an association benchmark for cross-module alignment.
[0120] Cross-module alignment associates processing objects processed by multiple modules as if they were the same. Specifically, cross-module alignment uses a stable object identifier as a benchmark, searching for records carrying the same identifier in the processing flow to establish a correspondence between input and output processing objects. For example, it associates region objects, text line objects, and backfill objects as the same processing object. For processing objects that naturally inherit stable object identifiers, their input and output processing objects are directly associated according to the stable object identifier. For visual objects that do not naturally inherit stable object identifiers, cross-module alignment generates tracking edges through coordinate transformations, text similarity, pixel masks, and structural topology, and saves the corresponding matching confidence for each tracking edge. Cross-module alignment can be used to obtain the dependencies between processing objects.
[0121] In practical applications, based on stable object identifiers, cross-module alignment of processing objects processed by multiple processing modules can be performed to obtain the dependencies between processing objects, which can be achieved through various methods.
[0122] One alternative approach is to use stable object identifiers as the basis for association, merging processing objects in the processing stream records according to their identifiers, and determining dependencies based on the merged processing order. Specifically, a mapping table between identifiers and processing objects can be established, grouping the processing stream records written by each processing module according to the processing object identifier. Records within the same group belong to different forms of the same processing object. Records within the same group are then sequentially connected according to the order of processing modules in the processing stream, forming a connection relationship between the corresponding processing modules from upstream processing objects to downstream processing objects. This connection relationship includes generation relationships, input dependency relationships, mapping relationships, and replacement relationships.
[0123] Another alternative approach is to generate tracking edges for visual objects that cannot naturally inherit stable object identifiers, using coordinate transformations and containment relationships, and then determine dependencies accordingly. Specifically, the coordinate systems of the processed objects before and after processing can be obtained according to the processing versions of each processing module. Coordinate transformations, including translation, scaling, and rotation, are used to map the coordinates of upstream processed objects to the coordinate systems of downstream processed objects. Containment relationships are calculated within the mapped coordinate ranges, and upstream and downstream processed objects with containment relationships are identified as the two ends of the tracking edges. For processed objects with multiple containment relationships, the tracking edges are selected based on the type of the processed object and the processing order.
[0124] Another alternative approach is to utilize text similarity, pixel masks, and structural topology to generate tracking edges and save matching confidence scores, thereby determining dependencies. Specifically, the text content of upstream and downstream processing objects can be compared to determine whether they are the source and translation of the same processing object through text similarity; pixel masks can be generated for the regions where upstream and downstream processing objects are located in the page image, and the positional correspondence can be determined by the overlap of the masks; the structural topology of the processing objects in the layout can be compared, such as the row and column skeleton of a table and the adjacency order of regions, to determine structural correspondence; and each tracking edge saves its matching confidence score, discarding or retaining tracking edges that do not meet preset conditions as tracking edges to be verified.
[0125] In addition, multiple methods can be combined. For example, priority can be given to merging according to stable object identifiers, and the tracking edges of unmerged processing objects can be determined sequentially according to visual judgment, so that identifier inheritance and visual judgment complement each other. For multiple tracking edges, one can be selected and retained according to the matching confidence, or multiple edges can be retained and each carry a matching confidence.
[0126] In an optional embodiment, the tracing edges and matching confidence scores obtained from cross-module alignment can also be saved along with the processing stream record to form an object map. Specifically, the object map may include a source processing object identifier, a target processing object identifier, a tracing edge type, and a matching confidence score. The tracing edge type may include at least one of identifier inheritance, coordinate correspondence, text correspondence, mask correspondence, and structural correspondence. The object map can be used to record the correspondence of processing objects in cross-module alignment, ensuring that dependencies are not lost when the processing process ends. Furthermore, the hash value of the data referenced by the object map can be saved along with the processing stream record, ensuring that the processing objects used in subsequent analysis are consistent with those used during processing.
[0127] In an optional embodiment, multiple alignment hypotheses can be retained even when multiple dependencies exist. Specifically, for processing objects whose correspondence cannot be determined based on coordinate transformation, text similarity, and structural topology, multiple tracking edges can be retained, each carrying a matching confidence score, and the connections corresponding to each tracking edge are retained in the dependency relationship. The dependency relationship thus manifests as a directed structure composed of processing objects and connections, with the direction of the connections pointing from upstream processing objects to downstream. Furthermore, retaining multiple alignment hypotheses allows the tracing of the causes of defective objects to continue even when the correspondence has not yet been determined.
[0128] In the embodiments of this specification, cross-module alignment is performed on the processing objects processed by multiple processing modules based on stable object identifiers to obtain the dependencies between the processing objects. This allows the processing objects recorded by each processing module to be merged into a processing link at the processing object granularity. Since the dependencies are objectively determined by the processing flow records and stable object identifiers, the associations between processing objects have verifiable identifiers. For visual objects that cannot naturally inherit stable object identifiers, cross-module alignment uses coordinate transformation, inclusion relationships, text similarity, pixel masks, and structural topology to generate tracking edges and save matching confidence, so that visual objects are also included in the same processing link, thereby expanding the coverage of dependencies and improving the accuracy of defect localization.
[0129] In one optional embodiment of this specification, based on the dependencies between processing objects in the processing stream record, a candidate processing module corresponding to the defective object is determined from multiple processing modules, including: Obtain an object-level error cause-effect graph based on the dependencies between various processing objects; Along the object-level error cause-effect graph, retrieve the processing objects that the defective object depends on from the defective object in reverse order; The processing module that performs processing actions on the processing object is identified as a candidate processing module.
[0130] An object-level error cause-effect graph is a graph structure with processing objects and processing actions as nodes and causal relationships as directed edges. Specifically, the nodes of an object-level error cause-effect graph include source objects, sensing objects, translation objects, backfilling objects, output objects, evaluation objects, and action nodes. The source object corresponds to the processing object of the target document; the sensing object, translation object, backfilling object, and output object correspond to the output objects of the sensing, translation, backfilling, and rendering stages, respectively; the evaluation object corresponds to the output object of the evaluation stage; and the action node corresponds to the processing action. Object-level error cause-effect graphs can be used to represent the causal relationships between defective objects and upstream nodes. The nodes of an object-level error cause-effect graph can also include nodes related to the processing order arrangement and the operating environment, so that the candidate responsibility scope obtained from reverse retrieval covers all stages of sensing, translation, backfilling, arrangement, and environment.
[0131] The directed edges in an object-level error cause-effect graph include generating edges, input dependency edges, mapping edges, replacement edges, blocking edges, evaluation edges, and counterfactual effect edges. Specifically, generating edges, input dependency edges, mapping edges, and replacement edges represent the generation relationship, input relationship, correspondence relationship, and substitution relationship between nodes, respectively. Blocking edges represent that the processing action was not executed by the processing module. Evaluation edges represent the evaluation object's judgment of the defective object. Counterfactual effect edges represent the changes in the defective object after a node is replaced or removed. Directed edges can be used to represent the causal transmission path between the defective object and upstream nodes.
[0132] Reverse retrieval is a retrieval method that, in an object-level error cause-effect graph, proceeds in the opposite direction of the directed edges, starting from the defective object and visiting upstream nodes layer by layer to obtain the processing objects it depends on. Specifically, reverse retrieval starts with the node containing the defective object, adds the processing objects corresponding to the upstream nodes to the retrieval results, and arranges them from nearest to farthest in terms of dependency level. Reverse retrieval can be used to determine the set of upstream nodes of a defective object. Furthermore, the retrieval direction of reverse retrieval is from the output side to the upstream input side, and termination conditions can include accessing the source object, the current node not having an upstream node, the number of processing objects in the retrieval results meeting a preset quantity condition, and no change in the visited nodes and retrieval results.
[0133] In practical applications, obtaining object-level error cause-effect graphs based on the dependencies between various processing objects can be achieved through a variety of methods.
[0134] One alternative approach is to establish nodes and directed edges line by line based on the input and output references in the processing flow record. Specifically, each record in the processing flow record can be traversed, and the processing objects corresponding to the output and input references indicated by the record can be established as nodes. Directed edges can be established between the input-side nodes and the output-side nodes according to the type of dependency relationship. Action nodes can be established for the processing actions indicated by the record and correspond to the processing modules. Changes in the form of the processing object can be represented by establishing mapping edges between the two nodes before and after the change.
[0135] Another alternative approach is to group nodes according to the type of the object being processed and then construct an object-level error cause-effect graph for each group. Specifically, source objects, perception objects, translation objects, backfilling objects, and output objects can be divided into multiple node groups according to the order of processing modules. Within the same node group, generation edges and input dependency edges are established, and mapping edges and replacement edges are established between adjacent node groups. Evaluation objects are established on the output side and connected to defect objects through evaluation edges. Action nodes are attached to their respective node groups and record the processing modules.
[0136] Another alternative approach is to supplement directed edges based on historical processing flow records from multiple processing steps. Specifically, records where processing actions were not processed can be found in the historical processing flow records, and blocking edges can be established between the corresponding nodes accordingly. Records where output data was replaced with known correct output data or a certain processing action was removed can be found in the historical processing flow records, and counterfactual influence edges can be established between the corresponding nodes and the defective object based on whether the defective object changed after the replacement or removal. No counterfactual influence edges are established for records where the defective object did not change.
[0137] In addition, when the object identifiers in the processing stream record are not continuous, the correspondence between processing objects can be determined according to the description of cross-module alignment in the aforementioned embodiments, and mapping edges or dependency edges can be supplemented and the matching confidence can be saved.
[0138] After constructing the object-level error cause-effect graph, a reverse retrieval can be performed. In practical applications, retrieving the processing objects that the defective object depends on from the defective object along the object-level error cause-effect graph can also be achieved through various methods.
[0139] One alternative approach is to start from the defective object and expand layer by layer along the reverse direction of the directed edges until the set of upstream nodes is obtained. Specifically, each directed edge ending at the node containing the defective object can be identified. The processing objects corresponding to the upstream nodes connected by each directed edge are added to the search results, and the same identification process is performed on newly added processing objects. If the same processing object is accessed multiple times, it is retained only once. Thus, the termination condition for reverse retrieval can be that no new processing objects have been added to the search results or the source object has been accessed. The completeness of the search results is determined based on whether the visited directed edges cover the upstream path.
[0140] Another alternative approach is to limit the scope of the reverse retrieval based on the type of directed edge. Specifically, reverse retrieval can be performed along generating edges, input dependency edges, and mapping edges, excluding evaluation edges and counterfactual influence edges from the retrieval direction, thus limiting the processed objects obtained from the retrieval to the upstream of the causal chain. Therefore, the termination condition for the reverse retrieval can be that the current node contains only the excluded directed edges.
[0141] Another alternative method is to assign edge weights to each directed edge based on its type, the temporal order of the processed objects, and the matching confidence level, and then expand the search in descending order of weight. Specifically, directed edges representing causal transmission are assigned higher weights, while directed edges representing evaluation and contribution are assigned lower weights. During the expansion process, the weights of visited directed edges are accumulated, and expansion stops when the accumulated weights fall below a preset weight condition. Thus, the termination condition for reverse retrieval can be that the accumulated edge weights fall below a preset weight condition.
[0142] In addition, reverse retrieval can be performed on multiple defect objects in the anomaly handling results, and the union of the processing objects obtained from each retrieval can be taken; if the same processing object is retrieved multiple times, the correspondence between each defect object and the processing object can be recorded.
[0143] After obtaining the processing object through reverse retrieval, candidate processing modules can be further identified. In practical applications, the processing module that performs the processing action on the processing object can be identified as a candidate processing module, which can be achieved through various methods.
[0144] One alternative approach is to determine candidate processing modules based on the correspondence between action nodes and processing modules. Specifically, the action nodes corresponding to the processing objects obtained through reverse retrieval can be determined in the object-level error cause-effect graph, and the processing modules can be found based on the action identifiers and node identifiers associated with the action nodes. The found processing modules are then identified as candidate processing modules. If the same processing object is processed multiple times in different processing modules, each processing module is identified as a candidate processing module.
[0145] Another alternative method is to determine candidate processing modules based on the processing stage identifier and node identifier in the processing flow record. Specifically, the processing modules indicated by the processing stage and node corresponding to the defective object can be determined as candidate processing modules according to the order of processing modules in the processing flow. For specific implementation methods, please refer to the foregoing embodiments, which will not be repeated here.
[0146] Another alternative method is to determine candidate processing modules by combining the processing status and exception information in the processing stream record. Specifically, processing modules whose processing status or exception information indicates interruption, blocking, or empty output can be filtered from the processing stream record. The filtered processing modules are then matched with the processing objects obtained from the reverse retrieval. Processing modules that successfully match are determined as candidate processing modules, while those that do not match are excluded. Thus, processing modules whose processing actions have not been completed normally are given priority in being included as candidate processing modules; the processing status and exception information include the execution status of the processing action, the time taken for the processing process, and the completeness of the output data.
[0147] In addition, multiple processing action records for the same processing object can be merged. Records with the same processing action and processing module version can be merged into one candidate processing module, and records with the same processing action but different versions can be identified as candidate processing modules respectively.
[0148] In an optional embodiment, a responsibility distribution between each candidate processing module and the defective object can also be determined. Specifically, the responsibility distribution can be determined by combining structural evidence and counterfactual contributions. Structural evidence may include the dependency level between the node corresponding to the candidate processing module and the defective object, the event sequence in the processing flow record, the processing trajectory described by the processing module, and anomaly information. Counterfactual contributions may include changes to the defective object after replacing the output data of the candidate processing module with reference output data or removing its processing action. The two types of contributions are determined according to the following formula: each candidate processing module corresponds to a responsibility value constituting the responsibility distribution. The responsibility distribution can be used to characterize the probability that the defective object is caused by each candidate processing module.
[0149]
[0150]
[0151] Among them, replacement contribution Used to replace the output data of the candidate processing module with the reference output data and re-execute downstream processing when the original defect is located and reliable reference output data exists; remove contribution. This is used to remove a modification from a candidate processing skill during the verification process and compare it with a candidate processing skill that has not had that modification removed; the removal method is not used when no candidate processing skills have been generated yet. To handle the values of quality indicators, To determine the outcome, the comparison of the two types of contributions should be performed while fixing other intervention conditions and recalculating the affected downstream processing results. A positive value indicates that the corresponding candidate processing module has an effect on the defective object.
[0152] In an optional embodiment, threshold determination can be performed on structural evidence and counterfactual contributions, and multiple liability assumptions can be retained. Specifically, if structural evidence meets preset structural evidence conditions and counterfactual contributions meet preset contribution conditions, the liability value of the corresponding candidate processing module in the liability distribution can be increased, and the order of each candidate processing module can be determined according to the liability value. If neither condition is met, the liability values of multiple candidate processing modules are retained, and the liability distribution is not converged to a single candidate processing module. Since the same defect object may be caused by multiple processing modules, retaining multiple liability assumptions allows the processing skills generated for each candidate processing module to participate in the verification, and the effective processing module can be determined by referring to the processing results.
[0153] In the embodiments of this specification, by obtaining an object-level error cause-effect graph based on the dependencies between processing objects, the processing flow of the target document is transformed from an event-based record into a graph structure with causal relationships as directed edges, providing a searchable carrier for the causes of defect objects. By retrieving the processing objects that the defect object depends on from the defect object along the object-level error cause-effect graph, the causes of the defect object are traced upstream layer by layer from the output side along the directed edges, and the retrieval range and termination conditions are determined by the object-level error cause-effect graph. By determining the processing module that performs the processing action as a candidate processing module, the causes of the defect object are assigned to a specific processing module, forming one or more candidate processing modules, thereby improving the accuracy of defect object location and the processing efficiency of defect analysis.
[0154] In one optional embodiment of this specification, a schematic diagram of a multimodal processing stream record and an object-level error cause-effect graph is provided. Specifically, see [link to relevant documentation]. Figure 2 , Figure 2 A schematic diagram of a multimodal processing stream record and object-level error cause-effect graph provided according to an embodiment of this specification is shown, such as... Figure 2 As shown.
[0155] Processing flow records are generated in an append-only manner and aligned with task input evidence, execution trajectory, intermediate artifacts, evaluation evidence, and tracking metadata by processing object identifier, processing stage identifier, and timestamp. Task input evidence includes target documents and pages, language pairs and task features, as well as processing flow and strategy versions. Execution trajectory includes execution plans and nodes, calls to processing tools, model inputs and outputs, and processing sequence. Intermediate artifacts include bounding boxes, table skeletons and translations, fonts and masks, and rendered pages. Evaluation evidence includes defective objects and locations, evaluation values, compilation errors, and human feedback. Tracking metadata includes stable object identifiers, versions and parent-child relationships, and content hashes.
[0156] The processing objects for defect objects are organized in the order of source object, perception object, translation object, backfill object and defect object. Each processing object and processing action is a node in the object-level error cause-effect graph. The generation relationship, input dependency relationship, coverage relationship, mapping relationship, replacement relationship, blocking relationship, evaluation relationship and counterfactual influence relationship between processing objects are directed edges in the object-level error cause-effect graph.
[0157] In the embodiments of this specification, by aligning and storing task input evidence, execution trajectory, intermediate products, evaluation evidence, and tracking metadata in the processing flow record according to the processing object identifier, processing stage identifier, and timestamp, various types of evidence involved in the same defect object can be restored as a whole. By constructing an object-level error causal graph with processing objects and processing actions as nodes and directed edges for generation relationships, input dependency relationships, coverage relationships, mapping relationships, replacement relationships, blocking relationships, evaluation relationships, and counterfactual influence relationships, the causal transmission path between the defect object and the upstream processing object has a searchable structure. By organizing the processing objects oriented towards the defect object in the order of source object, perception object, translation object, backfill object, and defect object, the cause of the defect can be traced step by step along the same processing link. The above processing enables the location of the defect object and the analysis of its causes to be carried out on the same evidence basis, thereby improving the accuracy of defect location and the processing efficiency of defect analysis.
[0158] In one optional embodiment of this specification, based on the reference output data of the candidate processing module, a downstream processing module is invoked to process the target document, including: Replace the output data of the candidate processing module with the reference output data; Based on the reference output data, the downstream processing module is called to process the target document and obtain the reference processing result.
[0159] Output data refers to the data obtained by the processing module when performing processing actions on the processed object. Specifically, output data can include intermediate and output artifacts generated during processing, such as the area coordinates and reading order output by the layout analysis module, the translated data output by the content translation module, and the layout position data output by the layout backfilling module. Output data can exist in the form of document files, page images, masks, or structured data, and is recorded in the processing flow record with its output reference and content hash. Output data can be used to provide input data for downstream processing modules or for the evaluation component to perform evaluation.
[0160] In practical applications, replacing the output data of the candidate processing module with the reference output data can be achieved through various methods.
[0161] One alternative approach is to replace the output reference corresponding to the output data of the candidate processing module with the output reference corresponding to the reference output data in the processing stream record, and write the replacement event in an append-only manner. Specifically, the output reference points to the artifact in object storage. When performing the replacement, the identifier of the processing object remains unchanged, and only the artifact pointed to by the output reference is changed from the actual output data generated by the candidate processing module to the reference output data. The content hash in the processing stream record is also updated synchronously to the content hash of the reference output data. The replacement event can record the identifier of the processing object that performs the replacement, the output reference before and after the replacement, and the time information, and save them together with the processing stream record.
[0162] Another alternative approach is to establish a mapping relationship between output data and reference output data based on the processing object identifier, and provide reference output data according to the mapping relationship when the downstream processing module reads input data. Specifically, the mapping relationship uses the processing object identifier as an index to record the correspondence between the actual output data generated by the candidate processing module and the reference output data. When the downstream processing module reads input data, it determines whether the processing object identifier corresponding to the input data exists in the mapping relationship. If it exists, reference output data is provided; otherwise, the actual output data generated by the candidate processing module is provided. The connection relationship between each processing module in the processing flow and the processing actions of the downstream processing module remain unchanged. The replacement process does not change the processing process recorded in the processing flow record, which is suitable for scenarios where replacement is performed separately for multiple candidate processing modules.
[0163] In addition, a consistency check can be performed on the reference output data before the replacement is executed. The consistency check can include whether the processing object identifier corresponding to the reference output data is consistent with the output data of the candidate processing module, whether the data structure version of the reference output data is compatible with the data structure version supported by the downstream processing module, and whether the content hash of the reference output data is consistent with the record value. If the check passes, the replacement is executed; if it fails, the output data of the candidate processing module is retained and the reference output data is re-determined.
[0164] After the output data is replaced with the reference output data, the input data received by each processing module following the candidate processing module changes. Therefore, it is still necessary to call the downstream processing module based on the reference output data to process the target document and obtain the reference processing result. In practical applications, calling the downstream processing module based on the reference output data to process the target document and obtain the reference processing result can also be achieved through various methods.
[0165] One alternative approach is to sequentially call each downstream processing module following the candidate processing module according to the stage and node identifiers in the processing flow record, until the page rendering stage at the end of the processing flow is completed. Specifically, the reference output data is used as the input data for the first processing module after the candidate processing module. After each downstream processing module completes its execution, its output data, output reference, and content hash are updated, and the updated output data is used as the input data for the next processing module. During the calling process, the processing parameters, processing tool version, font version, and environment snapshot of each downstream processing module remain consistent with the current processing, and the processing results before the candidate processing module use the exception handling results.
[0166] Another alternative approach is to determine the affected subgraph based on the object-level error cause-effect graph, and only call the downstream processing modules within the affected subgraph, while processing modules outside the affected subgraph do not perform any processing actions. Specifically, starting from the node corresponding to the defective object, the process can be traversed downwards along the edges representing generation relationships and input dependencies in the object-level error cause-effect graph to determine the output object that needs to be regenerated and the processing module that generates the output object. The processing modules that are after the candidate processing modules in the processing flow and are located within the affected subgraph are called as downstream processing modules; pages or regions outside the affected subgraph retain the original processing results.
[0167] In addition, during the process of calling each downstream processing module, the evaluation component can evaluate the output data of the downstream processing module according to the processing object, and save the evaluation results and the reference processing results together, so that the reference processing results and their evaluation results are obtained in the same processing process.
[0168] In one optional embodiment, reference output data can be determined from multiple sources. Reference output data can be provided by manual annotation, such as manually selecting, classifying, approving repairs, or editing translations of the output data from candidate processing modules, and converting the manually confirmed data into reference output data consistent with its form. Reference output data can also be provided by historical artifacts, i.e., verified output data generated by the same processing object under historical processing versions, historical processing parameters, or historical processing paths. Reference output data can also be stored in an artifact library, indexed by the processing object identifier and content hash, and retrieved according to the processing object identifier during replacement. Reference output data from different sources differ in reliability and acquisition cost; determining reference output data according to its source allows the replacement process to adapt to evidentiary conditions such as manual feedback, version backtracking, and processing path reuse.
[0169] Reference output data can also be the verified historical correct results of the same processing object, or the reference results generated by a processing path independent of the candidate processing module and verified. Before performing the replacement, the compatibility of the reference output data with the current processing object, data structure and context can be verified, and the source and verification evidence of the reference output data can be saved. Unverified model output is not used as reference output data.
[0170] In an optional embodiment, the affected subgraph can be defined and frozen artifacts reused as follows: repeating only the processing actions within the affected subgraph and reusing frozen artifacts for processing results outside the affected subgraph can be called partial replay. The affected subgraph can be traced back from the node corresponding to the defective object to the node corresponding to the candidate processing module, and extended downwards to the set of output objects required to re-evaluate the defective object. For pages, regions, or text lines outside the affected subgraph, whose processing results are consistent before and after replacement, the frozen artifacts that match can be found in the processing flow record or artifact library according to the content hash and reused directly without re-executing the corresponding processing module. Since the parts unaffected by replacement are consistent before and after replacement, reusing frozen artifacts that match the content hash can reduce the number of processing actions while maintaining the comparability of the reference processing results. Specifically, when performing replacement, only the output data corresponding to the candidate processing module is replaced, while other non-intervention conditions remain consistent, and the affected downstream processing and evaluation are re-executed without using the downstream cached results formed before replacement. The processing results outside the affected subgraph are unrelated to replacement and can reuse frozen artifacts.
[0171] In an optional embodiment, necessary context can be added to the processing within the affected subgraph. The necessary context may include at least one of the following: the page size of the page containing the affected subgraph, the adjacent blocks adjacent to the processing object within the affected subgraph, the font involved in the processing object, and the table skeleton; the necessary context is provided together with the reference output data when the downstream processing module performs the processing action. Since the processing actions of the layout class depend on the position and adjacency of the processing object on the page, providing the necessary context together with the reference output data ensures that the processing actions within the affected subgraph are consistent with the processing conditions in the complete page, thereby enabling the processing results to be compared with abnormal processing results.
[0172] In an optional embodiment, the downstream processing module may include a layout backfilling module, which can backfill the translation onto the page in the following manner. Specifically, a pre-backfilling analysis can be performed on the translation on the page, including background type, occlusion, anchor points, and the extent of translation expansion, and the backfilling method can be determined accordingly. The backfilling methods include erasing, patching, covering, rearranging, and displacement. Subsequently, the layout constraints corresponding to the backfilling method are expressed as constraint relationships and constraint solving is performed. The solution content includes page boundaries, reading order, non-overlap between processed objects, and displacement of protected objects and each movable object. The positions of fixed objects such as images, stamps, and table lines remain unchanged during the backfilling process, while the positions of movable objects such as text blocks and title blocks are adjusted according to the displacement obtained from the solution. The constraint relationships include adjacency, containment, reading order, alignment, and cross-page continuity. The solution results are rendered and then backfilled into the output document. The goal of the backfilling is to reduce displacement, overlap, boundary violations, and anchor point deviations while maintaining punctuation.
[0173] In the embodiments of this specification, by replacing the output data of the candidate processing module with reference output data, and calling the downstream processing module to process the target document based on the reference output data to obtain a reference processing result, the subsequent processing steps of the candidate processing module can be re-executed under the condition that the input data changes in a controlled manner while the processing path and processing parameters remain unchanged. Since the processing actions of the candidate processing module are not re-executed, the difference between the reference processing result and the abnormal processing result can be attributed to the output data of the candidate processing module. At the same time, the calling scope of the downstream processing module and the frozen artifacts reused outside the affected subgraph can be determined based on the object-level error cause-effect graph, and the processing resources consumed to obtain the reference processing result can be controlled, thereby improving the accuracy of defect location and the processing efficiency of document processing.
[0174] In one optional embodiment of this specification, a schematic diagram of the processing procedure for layout backfilling and displacement constraints is provided. Specifically, see [link to documentation]. Figure 3 , Figure 3 This diagram illustrates a layout backfilling and displacement constraint processing procedure according to an embodiment of this specification, as shown below. Figure 3 As shown.
[0175] Before backfilling the translated text on the page, a pre-backfill analysis is performed. This analysis includes background type, occlusion, anchor points, and the extent of translation expansion. Based on the analysis results, the backfilling method is determined, including erasing, patching, covering, rearranging, and displacement. The layout constraints corresponding to the backfilling method are expressed as constraint relationships, and constraint solving is performed. The solution includes page boundaries, reading order, non-overlapping between objects, protected objects, and the displacement of each movable object. Fixed objects include images, stamps, page decorations, and table lines, whose positions remain unchanged during backfilling. Movable objects include body text blocks, title blocks, and table text blocks, whose positions are adjusted according to the solved displacement amounts. Constraint relationships include adjacency, containment, reading order, alignment, and page continuity. The output document is rendered and backfilled according to the solution results. The goal of backfilling is to reduce displacement, overlap, boundary violations, and anchor point deviations while maintaining punctuation. A processing strategy is selected between line breaks, displacement, and scaling.
[0176] In the embodiments of this specification, by performing pre-filling analysis and filling method decision-making on the backfilling of the translation on the page, the backfilling methods such as erasure, repair, overlay, rearrangement, and displacement are determined according to the background type and occlusion situation; by expressing the page constraints as constraint relationships and performing constraint solving, the position of fixed objects remains unchanged while the position of movable objects is adjusted according to the displacement amount obtained from the solution, and the reading order and the non-overlap between objects have a judgment basis; by selecting processing strategies among line breaks, displacement, and scaling, punctuation marks and page boundaries are maintained. The above processing makes the backfilling result compatible with the page layout of the output document, thereby improving the processing accuracy of document processing.
[0177] In one optional embodiment of this specification, generating target processing skills based on the target responsibility module includes: Based on the defect object and the target responsibility module, generate defect feature information; Based on the target responsibility module and defect feature information, target processing skills are generated.
[0178] Defect feature information is a comparable representation obtained by standardizing and encoding defects based on defect objects and target responsibility modules. Specifically, defect feature information may include at least one of the following: document structure, language script, object type, language pair, defect type, responsibility module, tool version, environmental constraints, and evidentiary features. Document structure, object type, language script, and language pair record the page layout topology of the page to which the defect object belongs, the quantity distribution of object types, and the textual system and translation direction of the source text. Defect type records the preset defect type corresponding to the defect object. Responsibility module records the identifier and processing version of the target responsibility module. Tool version and environmental constraints record the tool version and data structure version used for processing flow execution. Evidence features record the feature vectors of the defect object and its dependent processing objects in the processing flow record. Defect feature information can be used for comparison and retrieval between defects. Furthermore, topology and category fields in defect feature information can be used for deterministic filtering, vector fields can be used for similarity recall, and version fields can be used for compatibility checks.
[0179] In practical applications, generating defect feature information based on the defect object and the target responsibility module can be achieved through various methods.
[0180] One alternative approach is to generate defect feature information field-by-field based on the processing flow record and the object-level error cause-effect graph. Specifically, the layout topology, object type distribution, language script, and language pair of the page to which the defective object belongs can be queried from the processing flow record, and the query results can be written into the document structure field, object type field, language script field, and language pair field, respectively. The responsibility node corresponding to the processing object that the defective object depends on can be determined based on the object-level error cause-effect graph, and the identifier and processing version of the target responsibility module corresponding to the responsibility node can be written into the responsibility module field. The tool version and data structure version can be read from the environment snapshot information of the processing flow record and written into the tool version field and environment constraint field. The position, adjacency relationship, and content features of the defective object and its dependent processing objects on the page can be normalized and encoded to obtain the evidence feature field.
[0181] Another alternative approach is to normalize field values based on the distribution of defective objects within the target document, enabling comparison of defect feature information across different target documents. Specifically, defective objects can be grouped at the granularity of page, region, text line, and cell, and the quantity distribution of each type of processing object within the page to which the defective object belongs can be statistically analyzed and encoded as an object type field. Document structure fields can be encoded as discrete values of page layout topology, determined by at least one of the following: number of columns, region adjacency order, table density, and formula density. Evidence feature fields can be encoded as the relative position of the defective object on the page, the type and quantity of adjacent processing objects, and the content features of the processing objects upon which the defective object depends. Through normalization, defect feature information for the same type of defect in different target documents will have a consistent value range.
[0182] In addition, source information can be saved for each field in the defect feature information. The source information can include the record identifier in the processing flow record, the node identifier in the object-level error cause-effect graph, and the processing object identifier of the evaluation result. When there are multiple values for the same field, the value of the field is determined based on the source information.
[0183] After obtaining the defect feature information, target processing skills can be generated based on the target responsibility module and the defect feature information. The defect feature information provides the correspondence between the defect object and the target responsibility module in a comparable form, thus giving the generation of target processing skills a clear target and scope of application.
[0184] In practical applications, target processing skills can be generated based on the target responsibility module and defect feature information through various methods.
[0185] One alternative approach is to save defect feature information as part of the target processing skill along with the skill content, and to define the scope and target of the target processing skill according to the fields in the defect feature information. Specifically, the content of the target processing skill can be directed to the processing stage corresponding to the target responsibility module in the processing flow based on the identifier and processing version of the target responsibility module recorded in the responsibility module field; the document scope applicable to the target processing skill can be determined by the document structure field and object type field; the language scope applicable to the target processing skill can be determined by the language script field and language pair field; and the compatible processing module version, processing tool version, and data structure version can be determined by the version field.
[0186] Another alternative approach is to filter and recall the processing skills corresponding to historical defects based on defect feature information, and then generate target processing skills based on the recalled processing skills. Specifically, deterministic filtering can be performed on the processing skills corresponding to historical defects based on topology and category fields to exclude processing skills with inconsistent field values; similarity can be calculated between defect feature information and the defect feature information corresponding to the retained processing skills based on vector fields, and processing skills with similarity that meet preset similarity conditions can be recalled; compatibility checks can be performed on the recalled processing skills based on version fields to exclude processing skills with inconsistent versions; subsequently, the processing content corresponding to the recalled processing skills is combined with the processing behavior of the target responsibility module to generate target processing skills that act on the target responsibility module.
[0187] In addition, when generating target processing skills, the correspondence between defect feature information and target processing skills can be registered in the skill library, so that subsequent processing tasks can retrieve target processing skills according to the matching between the task's own characteristics and defect feature information, and perform compatibility checks according to the defect feature information it carries.
[0188] In an optional embodiment, the responsibility module field of the defect feature information can also be determined based on the responsibility distribution and the multiple responsibility assumption. Specifically, the meanings of responsibility distribution, structural evidence, and counterfactual contribution are as described in the previous embodiment regarding responsibility distribution, and will not be repeated here. Based on the fact that the reference processing result does not include the defect object, the responsibility value of the corresponding candidate processing module can be increased according to the structural evidence and counterfactual contribution, and the candidate processing module can be determined as the target responsibility module accordingly. The identifier and processing version of the target responsibility module are written into the responsibility module field. If any one of the structural evidence and counterfactual contribution does not meet the corresponding condition, multiple target responsibility modules can be retained, and defect feature information and target processing skills can be generated for each target responsibility module. The responsibility module field can thus record one or more target responsibility modules.
[0189] In the embodiments of this specification, defect feature information is generated based on the defect object and the target responsibility module, and a target processing skill is generated based on the target responsibility module and the defect feature information. This allows the defect object, the target responsibility module, and the document structure, language script, object type, and defect type of the target document to be encoded into comparable representations. The defect analysis conclusions obtained in one processing step can be applied to subsequent document processing steps with the same or similar features. Since the various fields in the defect feature information serve the purposes of filtering, recalling, and compatibility checking, the applicable scope and compatible processing versions of the target processing skill can be objectively defined, and the reuse scope of the target processing skill can be determined. At the same time, the defect feature information is saved along with the target processing skill, and the identification of similar defects in subsequent document processing can be directly compared according to the defect feature information, thereby improving the accuracy of defect location and the processing efficiency of defect analysis.
[0190] In one optional embodiment of this specification, a target processing skill is generated based on the target responsibility module and defect feature information, including: Obtain the current processing skills corresponding to the target responsibility module; Based on the target responsibility module and defect feature information, the current processing skills are updated to generate multiple candidate processing skills; Perform static checks on each candidate processing skill; If a candidate processing skill passes the static check, it will be identified as the target processing skill.
[0191] The current processing skill refers to the processing capabilities that the target responsibility module has already saved during the current processing. Specifically, the current processing skill can be represented as configuration information for the processing flow to read and execute. Its content points to the processing stage corresponding to the target responsibility module and carries a skill identifier, skill version, and registration status. For example, the current processing skill acting on the layout backfilling stage records the font selection rules and backfilling position rules for the layout backfilling stage. If the target responsibility module does not yet have a corresponding saved processing skill, the current processing skill can consist of the processing parameters, processing tools, and processing flow used in this processing process. The current processing skill can be used as the basis for updating processing behavior. Furthermore, the same target responsibility module corresponds to one current processing skill under the same processing version, and multiple candidate processing skills obtained from the update all use the current processing skill as a common starting point.
[0192] Candidate processing skills are processing capabilities obtained by updating the current processing skills and used to adjust the processing behavior of the target responsibility module. Specifically, candidate processing skills may include multiple configuration information for adjusting the processing behavior of the target responsibility module. Multiple candidate processing skills obtained in the same update may differ in the processing stages involved, the configuration items adjusted, and the processing tool parameters used. For example, one candidate processing skill may adjust the font selection rules in the layout backfilling stage, while another candidate processing skill may adjust the area merging rules in the layout analysis stage. Candidate processing skills can be read and executed by the processing flow, causing the processing behavior of the target responsibility module to change according to the configuration information carried by the candidate processing skills. Furthermore, candidate processing skills are not yet registered in the skill library. Candidate processing skills that pass the static check enter the subsequent process, while candidate processing skills that fail the static check do not enter the subsequent process and are retained along with the failed check items for future reference.
[0193] Optionally, the correspondence between target processing skills and defect objects is not limited to one-to-one. The reusable defect patterns and their repair strategies are used as the granularity to act on one processing module or coordinate multiple processing modules. The same defect pattern can generate multiple candidate processing skills, and the same processing module can also correspond to multiple target processing skills with different applicable conditions.
[0194] Static checking is a process of verifying the configuration information carried by a candidate processing skill item by item before it enters execution. Specifically, static checking can be performed during the compilation of the candidate processing skill into configuration information for the processing stream to read and execute. Check items may include, for example, data structure or data format, permissions, loops, resource limits, and dangerous calls. Data structure checking compares the consistency between the fields referenced by the candidate processing skill and the data structure version used by the processing stream. Permission checking compares whether the tool calls requested by the candidate processing skill are within the scope allowed by the least privilege sandbox. Loop checking determines whether the repeated execution process involved by the candidate processing skill has a termination condition. Resource limit checking compares the resource usage and resource quota declared by the candidate processing skill. Dangerous call checking identifies calls involving deletion, overwriting, outsourcing, or unauthorized access. Static checking can be used to intercept candidate processing skills carrying non-compliant configuration information before execution, preventing non-compliant candidate processing skills from entering subsequent processes. Furthermore, static checking does not execute the processing actions corresponding to the candidate processing skill; therefore, candidate processing skills that pass static checking are qualified to enter subsequent processes.
[0195] Optionally, static checks may also include required fields, interface compatibility, parameter range, node references, and loop and termination conditions. Specifically, the required field check compares whether all required fields declared by the candidate processing skill are present; the interface compatibility check compares whether the input / output interfaces between processing modules and processing tools are compatible; the parameter range check compares whether the parameter values declared by the candidate processing skill are within the allowed range; and the node reference check compares whether the nodes referenced by the candidate processing skill in the execution graph exist. For candidate processing skills based on code patches, their syntax tree and call dependencies can also be checked; for candidate processing skills based on workflow descriptions, their execution graph can also be checked. These checks can be performed by rule and type checks, or they can be assisted by model determination.
[0196] In practical applications, obtaining the current processing skills corresponding to the target responsibility module can be achieved through various methods.
[0197] One alternative approach is to search for the current processing skill in the skill library based on the identifier and processing version of the target responsibility module. Specifically, processing skills that apply to the target responsibility module can be searched in the skill library according to the skill identifier, skill version, target object, and registration status. Processing skills that are registered as published and are compatible with the processing module version, processing tool version, and data structure version currently used in the processing flow are identified as the current processing skill. If no processing skill for the target responsibility module exists in the skill library, the current processing skill can be constructed based on the processing parameters, processing tools, and processing flow used in this processing procedure.
[0198] Another alternative approach is to construct the current processing skill by reverse engineering the records corresponding to the target responsible module in the processing flow log. Specifically, the processing actions, parameters, tools, and order executed by the target responsible module during the current processing can be extracted from the processing flow log. The extracted content is then organized into the current processing skill, and the scope of the processing object affected by the current processing skill is determined according to the action node corresponding to the target responsible module in the object-level error cause-effect graph. For processing actions without recorded parameters, they can be supplemented according to the default configuration of the processing module. If there are multiple processing action records for the same processing module, these records can be merged into a single processing skill based on the processing object.
[0199] In addition, the processing skills registered in the skill library can be cross-validated with the processing behaviors extracted from the processing flow records. If the recorded processing parameters are inconsistent, the processing flow records shall be used to determine the current processing skill and the inconsistencies shall be recorded.
[0200] After obtaining the current processing skill corresponding to the target responsibility module, the current processing skill can be further updated based on the target responsibility module and defect feature information to generate multiple candidate processing skills. In practical applications, updating the current processing skill based on the target responsibility module and defect feature information to generate multiple candidate processing skills can also be achieved through various methods.
[0201] One alternative approach is to determine the configuration items that need adjustment based on the processing behavior of the target responsibility module and the defect object, and then generate multiple candidate processing skills for these configuration items. Specifically, the processing parameters used by the target responsibility module when processing the defect object can be compared with the encoding of the defect object in the defect feature information to identify the incompatible parts between the processing behavior and the defect. The configuration items corresponding to these incompatible parts are then designated as the configuration items that need adjustment. Multiple candidate processing skills can be obtained by applying different values, different adjustment ranges, or different adjustment positions to the configuration items that need adjustment.
[0202] Another alternative approach is to update the current processing skill according to the location where the update is applied, and generate multiple candidate processing skills accordingly. Specifically, the processing parameters can be updated within the processing stage corresponding to the target responsibility module to obtain candidate processing skills acting on the target responsibility module; updates can be performed at the connection between the processing stage corresponding to the target responsibility module and adjacent processing stages to obtain candidate processing skills acting on the connection relationship between processing stages; or updates can be performed at upstream or downstream processing modules in the processing flow that have a dependency relationship with the target responsibility module to obtain candidate processing skills acting on the dependency relationship.
[0203] In addition, the generation basis can be saved for each candidate processing skill during the process of generating multiple candidate processing skills. The generation basis can include the identifier and processing version of the target responsibility module, the identifier and defect type of the defect object, and the values of each field in the defect feature information. Candidate processing skills with the same generation basis can retain a portion of them according to their differences.
[0204] After generating multiple candidate processing skills, static checks can be performed on each candidate skill to filter out those that are not executable. In practical applications, static checks on each candidate processing skill can be implemented using various methods.
[0205] One alternative approach is to perform checks on each item separately and then summarize the results of each check into a static check conclusion. Specifically, the configuration information carried by the candidate processing skill can be checked item by item according to data structure or data format, permissions, loops, resource limits, and dangerous calls; a candidate processing skill that fails any check can be returned along with the failed check items.
[0206] Another alternative approach is to determine the execution method of static checks based on the risk level of the candidate processing skills. Specifically, for candidate processing skills with higher risk levels, additional checks can be made on the types of processing objects referenced in the configuration information and the declared resource quotas, in addition to the checks themselves. Furthermore, the configuration information can be required to provide a fallback path for situations where the processing action fails to meet the acceptance criteria.
[0207] In addition, if a static check fails, the failed check items can be returned along with the candidate processing skills, and the current processing skill can be updated again according to the failed check items to generate a new candidate processing skill; candidate processing skills that fail multiple static checks can be retained for future reference and the failed check items can be recorded.
[0208] After obtaining the conclusions of the static check, the target processing skill can be further determined based on the candidate processing skills that pass the static check. In practical applications, determining the target processing skill based on the candidate processing skills that pass the static check can also be achieved through various methods.
[0209] One alternative approach is to identify the candidate processing skills that pass the static inspection as target processing skills and record their corresponding target responsibility module, defect object, and defect feature information according to their generation basis. If there are multiple candidate processing skills that pass the static inspection, each candidate processing skill can be identified as a target processing skill and saved separately, so that each candidate processing skill can participate in subsequent verification.
[0210] Another alternative approach is to filter candidate processing skills that have passed the static check based on the correspondence between candidate processing skills and target responsibility modules. Specifically, the processing stage in which a candidate processing skill operates can be determined based on the generation basis recorded in the candidate processing skill, and candidate processing skills whose operating stage does not correspond to the processing stage of the target responsibility module can be excluded; the processing object targeted by a candidate processing skill can be determined based on the defect feature information on which the candidate processing skill is based, and candidate processing skills that do not involve defect objects can be excluded.
[0211] In addition, after the target processing skill is determined, the version relationship between the target processing skill and the current processing skill can be registered together. The version relationship can include the skill identifier and skill version corresponding to the target processing skill and the current processing skill, as well as the defect feature information on which this update is based, so that the generation process of the target processing skill can be traced according to the version relationship.
[0212] In an optional embodiment, candidate processing skills can also be generated through a reflexive approach, a mutation approach, and a genealogical merging approach. The reflexive approach generates candidate processing skills based on the processing object on which the defective object depends, the context data required to replay the defective situation, the responsibility distribution, and the judgment conditions and source confidence in the evaluation results. The mutation approach can apply perturbations according to at least one of the values of processing parameters, the selection of processing tools, and the execution order of processing modules. The genealogical merging approach merges existing candidate processing skills.
[0213] In an optional embodiment, a skill family can be saved for candidate processing skills, and the candidate processing skills can be merged according to the skill family. The skill family can record the parent version, generation path, merging ancestor, verification data digest, and version relationship of the candidate processing skills. Merging can be performed when the candidate processing skills participating in the merging have a common ancestor, the processing links or modified configuration items involved are complementary, there are no contradictory conflicts, and the versions of the processing modules and processing tools they depend on are compatible. The merged candidate processing skills need to undergo a complete static check and subsequent verification again, and the corresponding release certificate is re-determined according to the results of the re-verification, instead of using the existing release certificate; candidate processing skills that do not meet the merging conditions can be retained separately and participate in subsequent verification separately.
[0214] In this embodiment, the current processing skill corresponding to the target responsibility module is obtained, and the current processing skill is updated based on the target responsibility module and defect feature information to generate multiple candidate processing skills. The generation of processing skills starts from the existing processing capabilities of the target responsibility module, and the correspondence between the defect object and the target responsibility module is transmitted to the candidate processing skills through the defect feature information. Since each candidate processing skill performs a static check before entering the subsequent process, the candidate processing skills that fail the static check do not enter the subsequent process. Since the candidate processing skills that pass the static check are determined as target processing skills, there is a definite correspondence between the defect feature information on which the target processing skills are based and the current processing skills. When the target processing skills are retrieved and reused in the subsequent document processing process, they have a clear target and scope of application, thereby improving the accuracy of defect location and the processing efficiency of defect analysis.
[0215] In one optional embodiment of this specification, based on the target responsibility module and defect feature information, the current processing skill is updated to generate multiple candidate processing skills, including: Based on the processing behaviors and defect objects corresponding to the target responsibility module, determine the applicable conditions and execution modification information of the candidate processing skills; Based on applicable conditions and execution modification information, candidate processing skills are generated.
[0216] Processing behaviors refer to the actions performed by the target responsibility module on the processed objects during the execution of the processing flow, as well as the processing parameters, tools, and order used. Specifically, processing behaviors can be retrieved from the processing flow record according to the processing version of the target responsibility module. Their content may include, for example, the adjacency determination conditions used when merging regions in the layout analysis stage, the language settings and terminology used when translating text units in the translation stage, and the font selection rules and backfilling position rules used when writing back text in the layout backfilling stage. Processing behaviors have different values depending on whether they are processing defective or normal objects. Processing behaviors can be used to determine the processing stages where candidate processing skills are applied and the configuration items that need adjustment.
[0217] Applicability criteria are the basis for determining whether candidate processing skills are suitable for document processing tasks. Specifically, applicability criteria can be expressed as an applicability signature composed of predicate rules, structural patterns, vector representations, and version constraints. Predicate rules determine the existence and quantity of processing objects; structural patterns determine the adjacency and inclusion relationships between processing objects; vector representations determine the position and content characteristics of processing objects on the page; and version constraints determine the versions of processing modules, processing tools, and data structures. Applicability criteria also include hit conditions and exclusion conditions. Hit conditions specify the document processing tasks that should be triggered, while exclusion conditions specify the document processing tasks that should not be triggered. For example, a candidate processing skill requiring a table area to include cells could exclude a table area containing only images. Applicability criteria can be used to determine whether candidate processing skills are retrieved and bound during document processing.
[0218] Execution modification information refers to the information corresponding to the candidate processing skill, indicating what modifications should be applied to the current processing skill. Specifically, the scope of modifications covered by execution modification information may include, for example, prompt templates, output data formats, parsing or rendering parameters, model or tool selection, execution graph nodes and edges, thresholds, caching strategies, validators, preconditions and postconditions, fallback branches, and rollback targets. Prompt templates and output data formats point to the input data read and output data written by the target responsible module; parsing or rendering parameters, model or tool selection, and execution graph nodes and edges point to the connection relationship between the processing tool and the processing module; thresholds and caching strategies point to the reuse method of judgment conditions and processing results; and validators, preconditions and postconditions, fallback branches, and rollback targets point to the verification method and the handling method when the processing action does not meet the acceptance conditions. Execution modification information can be used to instruct the processing flow to read or modify configuration content when executing candidate processing skills.
[0219] In practical applications, the applicable conditions and execution modification information of candidate processing skills can be determined based on the processing behavior and defect objects corresponding to the target responsibility module, which can be achieved through various methods.
[0220] One alternative approach is to determine the applicable conditions based on the processing behavior of the target responsibility module and to determine the execution modification information based on the defect object. Specifically, the type, quantity, and adjacency relationships of the processing objects used by the target responsibility module when performing processing can be extracted from the processing behavior, and the extracted content can be encoded into predicate rules and structural patterns in the applicable conditions. Furthermore, starting from the encoding of the defect object in the defect feature information, the scope of the processing objects corresponding to the defect object and the defect type can be determined. Based on the defect type, the configuration items that need to be modified in the processing stage corresponding to the target responsibility module can be determined, and the configuration items that need to be modified and their values can be organized into execution modification information.
[0221] Another alternative approach is to determine the hit conditions in the applicable conditions based on the reproduction conditions of the defect object, and to determine the execution modification information based on the processing conditions required to eliminate the defect object. Specifically, the document structure, language script, and object type corresponding to historical defect objects with the same defect type as the defect object can be queried in the processing flow record. The common features of historical defect objects can be encoded as hit conditions, so that candidate processing skills are hit on document processing tasks with the same or similar features. The processing flow record can also be queried to see the processing stages that the defect object has gone through and the processing objects that have dependencies on the defect object in the stages. The configuration items that can change the processing results of the processing objects can be determined as the scope of modification for the execution modification information.
[0222] In addition, source information can be saved separately for applicable conditions and execution modification information. Source information can include record identifiers in the processing flow record and node identifiers in the object-level error cause-effect graph. The processing object, page area, and evaluation dimension corresponding to the difference between the reference processing result and the exception processing result can be located in the processing link corresponding to the target responsibility module. The configuration items that need to be changed at the located position are thus determined as execution modification information.
[0223] After obtaining the applicable conditions and execution modification information, candidate processing skills can be further generated. These candidate skills should carry a clear scope of application along with specific modifications for the defective object. In practical applications, generating candidate processing skills based on applicable conditions and execution modification information can be achieved through various methods.
[0224] One alternative approach is to modify the configuration information of the current processing skill record according to the execution modification information, and write the applicable conditions into the modified configuration information. Specifically, the configuration information of the current processing skill record can be read, and the values of the corresponding fields in the configuration information can be modified item by item according to the modification scope covered by the execution modification information. The applicable conditions can be written into the modified configuration information as the judgment criteria for candidate processing skills. The modified configuration information can retain the skill identifier, target responsibility module identifier, and processing version corresponding to the current processing skill, and allocate the skill version according to this update.
[0225] Another alternative approach is to organize the applicable conditions and execution modification information as separate parts within the candidate processing skill. The applicable conditions are organized as the applicability section of the candidate processing skill, and the execution modification information is organized as the modification section. These two parts, along with the rest of the candidate processing skill, are compiled into configuration information for the processing flow to read and execute. Specifically, the applicability section can be read during the skill retrieval phase and used for filtering and recall, while the modification section can be read during the execution phase and used to rewrite the configuration information of the target responsibility module. Both parts adopt the same field structure and compilation method as the rest of the candidate processing skill.
[0226] In addition, multiple candidate processing skills can be generated according to the same applicable conditions and the same execution modification information. Each candidate processing skill adopts different values or acts on different positions in the scope of modification covered by the execution modification information. Each candidate processing skill carries the same applicable conditions and its own execution modification information.
[0227] In an optional embodiment, version constraints and exclusion conditions in the applicable conditions can also be set according to the version of the processing stream. Specifically, version constraints can be given according to the versions of the processing modules, processing tools, and data structures that the candidate processing skill depends on. If the version used by the processing stream is inconsistent with the version recorded in the applicable conditions, it is determined as a miss. Exclusion conditions can be given according to document processing tasks that should not trigger the candidate processing skill. For example, for a candidate processing skill that requires the coverage of the target character to not meet the acceptance condition, a document processing task where the version of the font management module does not support the candidate font can be set as an exclusion condition. Difficult negative samples that are similar to the applicable conditions but should not be triggered can be used to determine the value of the exclusion conditions. Thus, the possibility of candidate processing skills being triggered erroneously is reduced.
[0228] In an optional embodiment, the content carried by candidate processing skills can be limited according to compliance and permission requirements. Specifically, the content of candidate processing skills may not carry the original content of customer documents and access credentials. The text content in the processing flow record can be replaced with object hashes and layout features in a way that de-identifies entities. The page area required for playback can be saved in a way that is encrypted and tenant-isolated. The reading and execution of candidate processing skills by the processing flow are carried out in a least privilege sandbox.
[0229] In an optional embodiment, candidate processing skills can also be organized according to a unified content composition. Specifically, the content of a candidate processing skill may include at least one of the following: skill identifier and version, applicable conditions, execution modification information, preconditions and postconditions, invariants, fallback mechanisms, rollback targets, dependent content, conflict declarations, verification plans, evidence, and telemetry strategies. The applicable conditions organization constitutes the applicability section, the execution modification information organization constitutes the modification section, the preconditions and postconditions, invariants, and fallback mechanisms respectively define the prerequisites, maintenance conditions, and exception handling methods for the execution process, the dependent content and conflict declarations respectively record the versions of the dependent processing modules and situations where they conflict with other processing skills, and the verification plan, evidence, and telemetry strategies respectively record the verification methods, verification conclusions, and data collection methods during the execution process. This content composition can be used to perform static checks, verification, release, and retrieval on each part of the candidate processing skill's content. Furthermore, the various parts of the candidate processing skill's content are organized according to a unified field structure, ensuring that the above-mentioned steps apply to the same content.
[0230] In this embodiment, the applicable conditions and execution modification information of candidate processing skills are determined based on processing behavior and defect objects. Candidate processing skills are then generated based on these conditions and modification information. This ensures that candidate processing skills carry a clear scope of application and modification content during the generation stage. There is a definite correspondence between the processing stage, modified configuration items, and applicable document processing tasks of the candidate processing skills. Since the applicable conditions include both hit and exclusion conditions, the hit range of candidate processing skills during subsequent document processing is limited to document processing tasks with the same or similar characteristics as the defect objects. Because the modification scope covered by the execution modification information involves both the prompting and execution levels, the accuracy of locating defect objects and the processing efficiency of defect analysis are both improved during subsequent document processing.
[0231] In one optional embodiment of this specification, a schematic diagram is provided for the generation of defect attribution, defect feature information, and candidate processing skills. Specifically, see [link to relevant documentation]. Figure 4 , Figure 4 This diagram illustrates a defect attribution, defect feature information, and candidate processing skill generation method according to an embodiment of this specification. Figure 4 As shown.
[0232] For detected defective objects, determine their location, severity, and evidence, and trace candidate processing modules and processing actions backward along the object-level error causal graph; perform counterfactual estimation by replacing or removing the output data of candidate processing modules to obtain the causal contribution of each candidate processing module, and determine the responsibility distribution and repairable boundary accordingly.
[0233] Based on the defect object and responsibility distribution, defect feature information is generated. The defect feature information includes the layout topology of the page to which the defect object belongs, object type, language script and language pair, as well as defect type, target responsibility module, tool version, environmental constraints and evidence features. Based on the defect feature information and target responsibility module, candidate processing skills are generated. The content of the candidate processing skills may include prompt templates and judgment rules, selection of processing tools and parameter values, nodes and edges of the execution plan and calling relationships of processing tools, preconditions and postconditions, invariants, and historical processing skills used for fault fallback and rollback processing.
[0234] In the embodiments of this specification, by tracing candidate processing modules and processing actions backward along the object-level error cause-effect graph, the scope of the cause of the defect object is narrowed from the entire processing flow to the candidate processing modules; by replacing or removing the output data of the candidate processing modules to perform counterfactual estimation, the causal contribution of each candidate processing module has a comparable quantitative basis, and the responsibility distribution and repairable boundary are thus determined; by generating defect feature information based on the defect object and responsibility distribution, the performance of the same type of defect in different target documents can be standardized and compared with each other; by generating candidate processing skills based on defect feature information and target responsibility modules, the prompts and judgment rules, processing tool parameters, execution plans and execution constraints each have adjustable objects. The above processing transforms the defect cause analysis conclusions into candidate processing skills that can be verified later, thereby improving the accuracy of defect location and the processing efficiency of defect analysis.
[0235] In one optional embodiment of this specification, a data structure diagram of a candidate processing skill is provided. Specifically, see [link to relevant documentation]. Figure 5 , Figure 5 A schematic diagram of a data structure for a candidate processing skill according to an embodiment of this specification is shown, such as... Figure 5 As shown.
[0236] Candidate processing skills include skill identifiers and versions, skill lineages and risk levels, and are divided into applicability, modification, execution constraints, fault fallback and rollback objectives, dependencies and conflict declarations, verification plans and evidence, and telemetry strategies according to their content composition. The applicability section carries applicable conditions, including hit conditions, exclusion conditions, and version constraints, used to compare with task characteristics to determine whether a candidate processing skill is retrieved and bound. The modification section carries execution modification information, pointing to processing parameters, the selection and execution order of processing tools, and the configuration content that needs to be adjusted in the target responsibility module. Execution constraints include preconditions and postconditions, as well as invariants, including object quantity conservation, protection object retention, and prohibition of silent success.
[0237] In addition, fault fallback and rollback objectives respectively carry the handling methods such as retaining source objects, readable overwrite, and manual review, as well as the historical processing skills used in rollback processing; dependency content and conflict declaration respectively record the versions of the processing modules, processing tools, and data structures that are relied upon, as well as situations where they conflict with other processing skills; verification plan and evidence respectively record the composition of four types of samples, evaluation vectors, verification sample range, and evidence hash; telemetry strategy records the hits, recurrences, costs, and latency collected during use, and serves as the basis for adjusting retrieval weights and ranking scores.
[0238] In this embodiment, by dividing candidate processing skills into an applicability section, a modification section, execution constraints, fault fallback and rollback objectives, dependency content and conflict declarations, verification plans and evidence, and telemetry strategies, the scope of application, modification content, execution constraints, and verification basis of candidate processing skills have a unified content composition. By comparing applicable conditions and task characteristics, candidate processing skills have a definite hit basis when they are retrieved and bound during document processing. By recording hits, recurrences, costs, and latency during use through telemetry strategies, retrieval weights and ranking scores have an objective basis for adjustment. The above processing enables static inspection, verification, release, and retrieval to act on the same content, thereby improving the accuracy of defect location and the processing efficiency of defect analysis.
[0239] In an optional embodiment of this specification, determining a candidate processing skill as a target processing skill after the candidate processing skill passes a static check includes: Candidate processing skills that pass static inspection are stratified according to at least one of the following dimensions: document type, defect type, and risk level, to obtain stratification results; Based on the stratification results, the candidate processing skills within each stratum are sorted according to preset evaluation dimensions to obtain the ranking results; Based on the ranking results, the target processing skills are determined.
[0240] Document type is a classification of a target document based on its layout and page source. Specifically, document type can be determined by whether the target document is composed of a mix of scanned and original pages, the number of columns, the density of tables and formulas, and whether it contains at least one of the following: text in images, rotated text, or special fonts. For example, a document type primarily composed of tables corresponds to documents where the table area occupies a large portion and the cell structure is regular; a document type primarily composed of scanned pages corresponds to documents where page images occupy the majority of the page and the text is obtained through optical character recognition. Document type can be used to stratify candidate processing skills.
[0241] The defect type is the category to which the defect declared to be covered by the candidate processing skill belongs on the classification criterion, and its value corresponds to the value of the preset defect type. Specifically, the meaning of the defect type is described in the foregoing embodiments regarding the preset defect type, and will not be repeated here; the same candidate processing skill can declare to cover multiple defect types. Defect types can be used to stratify candidate processing skills.
[0242] Risk level is a classification of the risks associated with the use of a candidate processing skill. Specifically, the risk level can be determined based on the scope of the objects processed by the candidate processing skill, the version of the processing module involved, and the requested tool calls. The evaluation criteria may include at least one of the following: silent omission of translation, object loss, modification of protected objects, and irreversible execution results. For example, a candidate processing skill that may affect the conservation of the number of processed objects may correspond to a higher risk level, while a candidate processing skill that only adjusts font rollback rules may correspond to a lower risk level. Risk level can be used to stratify candidate processing skills. Furthermore, the risk level is determined by the information declared by the candidate processing skill itself and is stored with the candidate processing skill.
[0243] The stratification result is a set of candidate processing skills that have passed static checks, divided according to stratification dimensions. Specifically, the stratification result may include the stratification identifier and stratification dimension values for each stratum, as well as the candidate processing skills assigned to that stratum. The stratification dimension can be taken from at least one of document type, defect type, language script, risk level, and tool version. For example, when stratified by defect type, the stratum corresponding to the omitted translation content may include all candidate processing skills that declare coverage of the omitted translation content. The stratification result can be used to indicate the affiliation of each candidate processing skill on the stratification dimension and is used for subsequent sorting and selection. Furthermore, candidate processing skills within the same stratum have the same stratification dimension value, and the value of a candidate processing skill within a certain stratum is not included in the comparison of other strata.
[0244] Preset evaluation dimensions are the comparative aspects used when ranking candidate processing skills within each stratum. Specifically, preset evaluation dimensions may include at least one of the following: defect closure degree, recurrence, processing quality, structure, visual, false triggering, latency, cost, resources, and risk. For example, defect closure degree can characterize the extent to which defective objects are eliminated on samples corresponding to the stratum after a candidate processing skill takes effect; false triggering can characterize the extent to which a candidate processing skill takes effect on samples that do not meet the applicable conditions; latency and cost can respectively characterize the processing time and computing resources consumed. Preset evaluation dimensions can be selected from the above dimensions according to document type and application scenario. The selected set of dimensions is saved along with the stratified dimensions, allowing candidate processing skills within the same stratum to be compared under the same set of dimensions. Preset evaluation dimensions can be used to compare candidate processing skills within the same stratum. Furthermore, each preset evaluation dimension has its own value source and value direction. The value source can be the verification results and telemetry records corresponding to the candidate processing skill.
[0245] The ranking result is the order in which candidate processing skills within each stratum are arranged according to preset evaluation dimensions. Specifically, the ranking result may include the stratum identifier corresponding to each stratum, the values of candidate processing skills in each stratum on each preset evaluation dimension, the ranking position of the candidate processing skills within the stratum, and the number of strata covered by the candidate processing skills. For example, a candidate processing skill may have ranking positions in multiple strata; if multiple candidate processing skills have the same value within the same stratum, the ranking position can be determined according to the amount of verification evidence. The ranking result can be used to determine the order in which candidate processing skills enter subsequent verification and selection.
[0246] After obtaining the candidate processing skills that pass the static check, further partitioning can be performed according to the hierarchical dimension, so that the comparison of candidate processing skills can be carried out under the same conditions.
[0247] In practical applications, candidate processing skills that pass static inspection can be stratified according to at least one dimension, such as document type, defect type, and risk level, to obtain stratification results. This can be achieved through various methods.
[0248] One alternative approach is to determine the tier to which a candidate processing skill belongs based on the applicable conditions declared by the skill itself. Specifically, the applicable document types, defect types covered, and risk levels can be read from the applicable conditions carried by the candidate processing skill. Candidate processing skills with the same values for each tier dimension in the applicable conditions can be grouped into the same tier. For candidate processing skills that do not declare a value for a certain tier dimension in the applicable conditions, they can be grouped into the general tier corresponding to the undeclared value, so that candidate processing skills without declared values are not excluded.
[0249] Another alternative approach is to determine the hierarchical dimension values based on the defect object and defect feature information, and then classify candidate processing skills accordingly. Specifically, the values of fields such as document structure, object type, language script, defect type, and responsibility module can be read from the defect feature information. The defect type recorded in the defect feature information is used as the hierarchical dimension value, and the candidate processing skills corresponding to this processing procedure are classified into layers with the same hierarchical dimension value. For cases where the responsibility module field records multiple target responsibility modules, the hierarchical dimension value can be determined separately for each target responsibility module, and the skills can be classified separately.
[0250] In addition, candidate processing skills can be divided into multiple strata according to the number of defect types covered by the candidate processing skills, and separate strata can be set up for candidate processing skills with higher risk levels, so that candidate processing skills that claim to cover multiple defect types can participate in the comparison within each stratum, instead of being compared with candidate processing skills of other risk levels in the same stratum.
[0251] After obtaining the stratification results, the candidate processing skills can be further sorted within each stratum according to preset evaluation dimensions, thus obtaining a ranking order for each stratum. In practical applications, sorting the candidate processing skills within each stratum according to preset evaluation dimensions based on the stratification results can also be achieved through various methods.
[0252] One possible approach is to determine the values of candidate processing skills according to each preset evaluation dimension, and then arrange the candidate processing skills according to these values. Specifically, the values of dimensions such as defect closure degree, false triggering, latency, cost, and risk can be read from the verification results corresponding to the candidate processing skills. Historical execution data can be read from the telemetry records of the candidate processing skills to fill in missing values. Within the same stratum, the candidate processing skills are arranged according to the superiority or inferiority of the values of each preset evaluation dimension, thus obtaining the arrangement position of the candidate processing skills within the stratum. The order of arrangement of each preset evaluation dimension can be determined according to the values of the stratified dimensions.
[0253] Another alternative approach is to merge multiple pre-defined evaluation dimensions into a single comprehensive value and then rank them within the same stratum. Specifically, the weights of each pre-defined evaluation dimension can be determined based on its importance under the stratified dimension values. The sum of the products of each dimension value and its weight is then used as the comprehensive value of the candidate processing skill. For evaluation dimensions with different value directions, directional normalization can be performed separately. For example, the degree of defect closure can be normalized according to a larger value, while false triggering can be normalized according to a smaller value. Subsequently, the candidate processing skills are ranked within the same stratum according to their comprehensive values, and if the comprehensive values are the same, the ranking position is determined by the amount of verification evidence.
[0254] In addition, the original values and ranking positions of each candidate processing skill on each preset evaluation dimension can be retained in the ranking results. Candidate processing skills with adjacent ranking positions and value differences less than the preset difference can also be retained for further comparison when determining the target processing skill.
[0255] After obtaining the sorting results, the target processing skill to be used can be determined based on these results. In practical applications, determining the target processing skill based on the sorting results can also be achieved through various methods.
[0256] One alternative approach is to select layers based on the correspondence between layer dimension values and the current processing scenario, and then determine the target processing skill from the selected layers. Specifically, the layer dimension values can be determined according to the defect type of the defect object and the risk level corresponding to the current processing task. Layers with layer dimension values consistent with the current processing scenario are selected, and the candidate processing skill that appears first in the selected layer is determined as the target processing skill. If no candidate processing skill exists in the selected layer, the target processing skill can be determined according to the layer with similar layer dimension values. The risk level corresponding to the current processing task can be determined according to the defect type of the defect object and the version of the tools used in the processing flow.
[0257] Another alternative approach is to assign each target processing skill to a pre-assigned layer. Specifically, when multiple candidate processing skills are ranked first in different layers, they can be designated as target processing skills, and their scope of application in subsequent document processing can be limited according to the layer they correspond to. When one candidate processing skill is ranked first in all layers involved by all candidate processing skills, it can be designated as a target processing skill, and its scope of application can be determined based on the matching between the layer dimension values and the task characteristics of the document to be processed.
[0258] In addition, after the target processing skills are determined, the stratification results, ranking results, skill identifiers and versions of the target processing skills can be saved together, so that the basis for determining the target processing skills can be reviewed along with the skill version.
[0259] In an optional embodiment, the target processing skill can also be determined according to the dominance relationship and promotion priority among candidate processing skills. Specifically, within the same stratum, if a candidate processing skill's value in each preset evaluation dimension is no worse than another candidate processing skill and its value in at least one dimension is better than another candidate processing skill, it can be determined that one candidate processing skill dominates another candidate processing skill. The dominated candidate processing skill is excluded from the stratum, and each stratum retains undominated candidate processing skills. The candidate processing skills retained in each stratum can be promoted according to the number of strata covered, the frequency of their ranking within the stratum, the amount of verification evidence, and the risk level. Candidate processing skills with more strata covered, higher frequency, larger amount of verification evidence, and lower risk level are ranked first in the promotion priority, and the target processing skill is determined according to the promotion priority. As an optional implementation, candidate processing skills that do not meet the preset release conditions can be excluded first, and undominated candidate processing skills in each stratum can be retained. Then, the promotion priority score is determined according to the following formula:
[0260] in, The proportion of the number of strata covered by the undominated set into which candidate processing skills are entered to the total number of predetermined strata. This refers to the proportion of batches in the validation batches of the fixed control group that meet the minimum improvement requirements relative to the baseline and whose other indicators do not exceed the allowable degradation range. The sufficiency of evidence is determined by the smaller of the ratio of the number of valid verification samples to the pre-set reference number and one. The normalized residual risk is the highest value among all applicable tiers; all weight coefficients are not less than zero and the sum of all weight coefficients is one, and can be determined in advance according to document type and risk level; the higher the score, the higher the priority of promotion arrangement, but the score does not offset the situation of not meeting the preset release conditions, the situation of accidentally triggering the situation of exceeding the allowable range, and the situation of insufficient evidence; the candidate processing skills that complement each other in different tiers can be retained separately.
[0261] In an alternative embodiment, multiple hierarchical dimensions can be combined. Specifically, hierarchical keys can be formed by combining document type with risk level, or defect type with document type, so that the same hierarchical level corresponds to both a document type and a risk level, or a defect type and a document type. Hierarchical dimensions can also be taken from at least one of the language script and tool version. Thus, the value changes of candidate processing skills in a few higher-risk formats or languages can be compared individually within the corresponding hierarchical level.
[0262] In this embodiment, candidate processing skills that pass static inspection are stratified according to at least one of the following dimensions: document type, defect type, and risk level. This stratification results allow for comparison of candidate processing skills within the same stratified dimension, ensuring that changes in values within one stratum do not affect their ranking in other strata, thereby improving the accuracy of defect localization. Furthermore, by sorting candidate processing skills within each stratum according to preset evaluation dimensions, a ranking result is obtained. This allows for comparison of dimensions such as defect closure degree, recurrence, false triggering, latency, and cost within the same stratum, thereby improving the efficiency of defect analysis. Finally, by determining target processing skills based on the ranking results, candidate processing skills have definite applicable scenarios and target objects before entering subsequent verification, thus improving the efficiency of document processing.
[0263] In an optional embodiment of this specification, after generating the target processing skill, the method further includes: Obtain the original sample corresponding to the defect object, similar samples with the same preset defect type as the defect object, difficult negative samples that should not be triggered relative to the applicable conditions of the target processing skill and correspond to preset interference conditions, and historical verification samples that have passed the verification of the same type of defect in the past. Based on the target processing skill, the processing flow is invoked to process each sample and obtain the execution result of each sample; Based on the execution results of each sample, the verification results of the target processing skills are determined.
[0264] The original sample is the sample corresponding to the defective object that enables the generation of the target processing skill. Specifically, the original sample may include the target document, the page or region where the defective object is located, processing parameters, processing tool version and language script, and is saved along with processing flow records and exception handling results, and registered according to sample identifier and category. The original sample can be used to determine whether the defective object has been eliminated under the processing conditions that caused it. Furthermore, the verification conclusion of the original sample corresponds to the degree of closure of the target defect and serves as the benchmark for the verification result. The original sample and the evidence on which the target processing skill is generated are of the same source, and together with samples of other categories, they form a verification queue.
[0265] Similar samples are samples with the same preset defect type as the defective object. Specifically, similar samples can include samples corresponding to processing objects with the same preset defect type in other target documents. The similar samples share similarities with the defective object in features such as layout topology, object type distribution, language script, language pairs, and processing tool version. They are obtained by performing deterministic filtering based on the topology and category fields in the defect feature information, and by performing similarity recall based on the vector field. The meaning of the defect feature information is described in the preceding embodiments and will not be repeated here. Similar samples can be used to determine the migration of target processing skills from the original sample to similar documents.
[0266] Difficult negative samples are samples that should not be triggered relative to the applicable conditions of the target processing skill and correspond to preset interference conditions. Specifically, difficult negative samples can include samples whose applicable conditions are similar to the target processing skill and therefore should not be triggered, or samples that may cause side effects after being triggered, such as samples with table areas but the table is an image without text, samples with character coverage meeting the acceptance criteria, and samples with similar layout structures but correct processing results. Preset interference conditions can include at least one of the following: similar applicable conditions, similar object types, similar layout topology, and similar processing tool versions. They can be determined according to the applicable conditions of the target processing skill and the execution modification information, that is, situations where the fields involved in the applicable conditions have values similar to the sample values but still do not meet the hit conditions are identified as interference conditions. Difficult negative samples can be used to determine the false triggering of the target processing skill on similar samples.
[0267] Historical verification samples are samples that have been verified during historical processing, i.e., samples that have historically passed verification for similar defects. Specifically, historical verification samples can include samples that have previously been verified by other processing skills or whose processing results have been manually confirmed as correct. Each historical verification sample can save its sample identifier, preset defect type, verification conclusion, and historical environment snapshot, and is selected from the historical verification record according to conditions associated with the processing objects or execution plan nodes that the target processing skill may affect. Historical verification samples can be used to determine whether the target processing skill has caused a change in the processing result on samples that were processed correctly in the past. Furthermore, the verification conclusions corresponding to the historical verification samples were generated before the target processing skill was generated, and the comparison between the execution results and the historical verification conclusions can reflect the scope of the target processing skill's influence.
[0268] The execution results are the processing outcomes obtained by calling the processing flow to process each sample based on the target processing skill. Specifically, the execution results for each sample may include the document, page images, and processed objects after processing by the processing flow, along with processing flow records, evaluation results, and an environment snapshot. The execution results can also be grouped and saved according to sample categories. The execution results can be used for comparisons between samples and versions. Furthermore, the execution results can have the same data format as the anomaly handling results, enabling the same evaluation method to provide evaluation conclusions for each sample.
[0269] The verification results are the verification conclusions of the target processing skill determined based on the execution results of each sample. Specifically, the verification results may include the values of multiple dimensions in the evaluation vector, as well as the sample range covered by the verification, the check conclusions of hard invariants, and the evidence hash. The values of each dimension can be recorded separately according to the sample category and summarized into the evaluation vector. The verification results can be used to determine the scope of the target processing skill on various types of samples and serve as the basis for determining whether it can enter the subsequent processing stage. Furthermore, the verification results are saved together with the sample range and environmental snapshots, so that the verification conclusions can be reviewed, and if the target processing skill or the version of the processing module changes, the samples that need to be re-executed can be determined according to the sample range.
[0270] In practical applications, obtaining the original sample corresponding to the defective object, similar samples with the same preset defect type as the defective object, difficult negative samples corresponding to preset interference conditions, and historical verification samples can be achieved through various methods.
[0271] One alternative approach is to determine the source of samples according to their categories. Specifically, the target document, the page and region where the defective object is located, and the processing parameters and tool versions can be extracted from the processing flow records and anomaly handling results corresponding to the defective object to form the original samples. Defect feature information can be compared item by item with registered samples. Samples with consistent topology and category fields and the same preset defect type are identified as similar samples, while samples with similar applicable conditions but different preset defect types are identified as difficult negative samples. Historical verification samples can be selected from historical verification records based on samples with a pass verification conclusion. These four types of samples can be used to test the repair effect of the target processing skill on the defective object, its transferability between different target documents, false triggering scenarios on samples that do not meet the applicable conditions, and side effects introduced during execution. Invariants can also be examined simultaneously with these tests.
[0272] Another alternative approach is to use the applicable conditions of the target processing skill as the retrieval criterion, and recall samples according to the hit conditions and exclusion conditions within the applicable conditions. Specifically, registered samples can be retrieved according to the hit conditions, and samples with the same preset defect type and defect object can be identified as similar samples; samples falling under the exclusion conditions can be retrieved according to the exclusion conditions, and samples with similar applicable conditions but not falling under the exclusion conditions can be identified as difficult negative samples; for samples configured with version constraints, the corresponding environment snapshots can be determined according to the processing module version, processing tool version, and data structure version.
[0273] In addition, samples can be supplemented by manual feedback and subsequent processing tasks. After registering sample identifiers, sample categories, preset defect types, preset interference conditions, environmental snapshots and evidence citations for each type of sample according to the organization method of the verification queue, they are submitted together.
[0274] After obtaining the four types of samples, the processing stream can be invoked based on the target processing skill to process each sample and obtain the execution result. In practical applications, the processing stream can be invoked to process each sample based on the target processing skill to obtain the execution result of each sample, which can also be achieved through various methods.
[0275] One alternative approach is to call the processing flow to process samples one by one according to their sample identifiers, and to perform each processing action on the sample in the order of the processing modules in the processing flow. The processing parameters, processing tools, and verifiers corresponding to the target processing skill take effect along with the processing flow. Specifically, after each sample is executed, a preset defect type can be found according to the corresponding processing object of the defect object in the sample. The search results, along with the processed document, page image, processing flow record, and evaluation results, are written into the execution results. The execution results of each sample are grouped and saved according to the sample category.
[0276] Another alternative approach is to execute candidate versions, baseline versions, and ablation versions within the same environment snapshot, and use the execution results of each version on each sample as the evaluation criterion. Specifically, the processing flow with the target processing skill applied can be used as the candidate version, the processing flow without the modifications included in the target processing skill applied can be used as the baseline version, and the processing flow with the corresponding modifications removed or replaced can be used as the ablation version. The environment snapshot can include at least one of the following: processing module version, processing tool version, font version, data structure version, and policy version, and the differences between the execution results of each version correspond to the modifications applied by the target processing skill.
[0277] In addition, each sample can be processed according to the description of partial playback and frozen products in the foregoing embodiments; before processing each sample, the environmental snapshot corresponding to the sample can be checked; for samples that are inconsistent with the version compatible with the target processing skill, the sample can be reconstructed according to the compatible version, or marked as a sample to be re-verified; for verification queues with missing sample categories, the missing sample categories can be added and the processing flow can be re-executed.
[0278] After obtaining the execution results of each sample, the verification results of the target processing skill can be further determined based on these results. In practical applications, determining the verification results of the target processing skill based on the execution results of each sample can also be achieved through various methods.
[0279] One alternative approach is to evaluate the execution results of each sample according to the multiple dimensions included in the evaluation vector and then summarize them into a verification result. Specifically, values can be assigned to each sample according to the judgment conditions corresponding to each dimension in the evaluation vector, and the conclusions of each dimension can be recorded separately according to the sample category.
[0280] Another alternative approach is to summarize the execution results separately according to sample categories and determine the verification results based on the corresponding decision conditions for each category. Specifically, the degree of target defect closure can be determined based on the execution results of the original samples, the scope of application on similar documents can be determined based on the execution results of similar samples, the situation of false triggering can be determined based on the execution results of difficult negative samples, and the retention status of originally correctly processed results can be determined based on the execution results of historical verification samples. Each sample category is configured with corresponding decision conditions. If the decision conditions of any sample category are not met, samples of the corresponding sample category can be added and the processing flow can be re-executed.
[0281] In addition, the correspondence between the corresponding modifications and the execution results can be determined by comparing the execution results of the candidate version with the baseline version and the ablation version, and the verification results, the sample range covered by the verification, the environment snapshot and the evidence hash can be saved together; for sample categories whose verification results do not meet the judgment conditions, the processing flow can be re-executed after supplementing the samples of the corresponding sample categories.
[0282] In an optional embodiment, the verification results of the target processing skills can also be organized according to an evaluation vector. The evaluation vector can include multiple dimensions corresponding to the aforementioned preset evaluation dimensions, namely, at least one of the following: defect closure degree, recurrence, processing quality, structure, visual, false triggering, latency, cost, resources, and risk. Defect closure degree can indicate whether the defective object has been eliminated in the sample; recurrence can indicate the reappearance of a claimed-coverage failure mode in a compatible environment and applicable samples; processing quality, structure, and visual can respectively represent the evaluation conclusions of the translated content, layout structure, and page image form; false triggering can indicate the side effects caused by a sample that should not have been hit; latency, cost, and resources can respectively represent the processing time, invocation cost, and computational resources consumed by the processing action; and risk can represent situations such as silent omission, object loss, sensitive information leakage, and irrecoverable failure. The number of dimensions included in the evaluation vector can be increased or decreased according to the document type and risk level. Since each dimension is characterized from the aspects of content, form, and risk, changes in the values of some dimensions can be identified individually.
[0283] In an optional embodiment, hard invariants can also be checked on the execution results of each sample, and the results of the hard invariant check can be used as part of the verification results. Hard invariants can include object quantity conservation, protected object retention, and prohibition of silent success. Object quantity conservation can represent the conservation relationship between the number of processed objects after processing and before processing. Protected object retention can represent that the protected objects and protected areas in the sample remain unchanged before and after the target processing skill takes effect. Prohibition of silent success can represent that processed objects are not marked as fully successful if the acceptance conditions are not met. Hard invariant checks can be performed separately on the execution results of each sample. If any hard invariant is not satisfied, the sample can be downgraded and explicitly recorded by means of preserving the source object, readable overwrite, or manual review, without including the corresponding sample in the scope of verification success.
[0284] In an optional embodiment, partial replay and frozen artifacts can also be reused during the verification process. The specific implementation methods and necessary context of partial replay and frozen artifacts are described in the foregoing embodiments and will not be repeated here. Specifically, partial replay can only repeat the processing actions within the affected subgraph. Pages, regions, and text lines outside the affected subgraph can be directly reused by searching for matching frozen artifacts in the artifact library according to content hashes. Candidate versions, baseline versions, and ablation versions are executed and reuse the same batch of frozen artifacts under the same environment snapshot, ensuring that comparisons between versions are performed under the same conditions.
[0285] In an optional embodiment, additional verification conditions can be added for target processing skills with higher risk levels. For target processing skills with a risk level reaching a preset risk level, the verification queue can add samples with different language scripts, samples with different processing tool versions, and samples under resource pressure conditions, in addition to the original samples, similar samples, difficult negative samples, and historical verification samples. The samples with different language scripts can be determined by the defective object from documents with different language scripts but similar page topologies. The samples with different processing tool versions can be constructed and configured with their respective environment snapshots according to the processing module version and the processing tool version. The samples under resource pressure conditions can be constructed according to the resource limit allowed by the processing action.
[0286] In this embodiment, by acquiring four types of samples and calling the processing flow to process each sample based on the target processing skill, the verification of the target processing skill is expanded from the execution of the original sample to the execution of multiple types of samples. Samples that should be hit and samples that should not be hit are evaluated in the same verification process. Since the candidate version, baseline version and ablation version are executed under the same environmental snapshot, the differences between the execution results of each version correspond to the modifications applied by the target processing skill. The effectiveness of the target processing skill and the role of each part of the modification can be determined by comparison. Therefore, when the target processing skill is reused in the subsequent document processing process, it has a definite applicable boundary and comparison basis, thereby improving the accuracy of defect location and the processing efficiency of document processing.
[0287] In one optional embodiment of this specification, after determining the verification result of the target processing skill, the method further includes: If the verification results meet the preset release conditions, a release certificate for the target processing skill carrying rollback version information is generated. Register target processing skills and certificate issuance to the skills library.
[0288] Preset release conditions are the conditions that the verification results must meet to allow a target processing skill to enter the release stage. Specifically, preset release conditions may include the inspection conclusions of hard constraints, improvement requirements, regression resistance conclusions, and sufficiency of evidence. The inspection conclusions of hard constraints are determined by the inspection results of hard invariants, the composition of which is described in the aforementioned embodiment and will not be repeated here. Improvement requirements can represent the improvement in the degree of defect closure compared to the baseline version. Regression resistance conclusions can represent whether the existing processing results are maintained. Sufficiency of evidence can represent whether the sample categories and number covered by the verification queue meet the requirements. Preset release conditions can be used to determine whether a target processing skill can enter the release stage.
[0289] Rollback version information is used to indicate the skill identifier and version of a historical processing skill. Specifically, rollback version information can establish a correspondence between version pointing relationships and historical processing skills in the skill library. Its content can include the skill identifier and version, as well as the applicable processing object scope and environment snapshot. When the target processing skill is generated by merging multiple candidate processing skills, the rollback version information can point to the parent version that has a common ancestor before the merge. When the target processing skill is the initial version, the rollback version information can point to the version of the processing module that originally performed the processing action in the processing flow. Rollback version information can be used to indicate the historical processing skill used for rollback processing when the declared overridden defect type reappears.
[0290] A release certificate is machine-verifiable data bound to a skill identifier and version and written into the skill library. Specifically, the fields of a release certificate may include at least one of the following: evidence hash, verification sample range, quality vector, hard constraint result, scope of application, risk level, dependent version, and rollback version information. The evidence hash and verification sample range can be determined based on the execution results and identifiers of each sample in the verification queue. The quality vector and hard constraint result can respectively record the values and inspection conclusions of the evaluation vector and hard invariants. The quality vector is the recording form of the evaluation vector in the release certificate, and its structure is described in the aforementioned embodiment and will not be repeated here. The scope of application, risk level, dependent version, and rollback version information can respectively record the applicable conditions and compatible processing module versions, risk classification, and historical processing skills used for rollback processing. The release certificate can be used to provide evidence when a target processing skill is retrieved, bound, or rolled back.
[0291] Issuance certificates are only issued to candidate processing skills that meet the preset issuance conditions, and are linked to the skill identifier, version, verification evidence, scope of application, dependent versions, and rollback version information of the candidate processing skill. The target processing skill resulting from the merger should undergo full verification again and be reissued with an issuance certificate, without inheriting the issuance certificate of the version before the merger.
[0292] A skill library is a storage medium that stores target processing skills and their release certificates, supporting task retrieval and binding. Specifically, the registration fields of the skill library may include at least one of the following: skill identifier, version, lineage, applicable conditions, risk level, dependencies, conflicts, release certificates, telemetry strategies, and rollback version information. The skill identifier and version can define the applicable processing module and version; the lineage can record parent versions and merged ancestors; the applicable conditions and risk level can record applicability and risk classification in terms of document type and defect type, respectively; the release certificate can record the verification conclusion when entering the skill library; the telemetry strategy can record hits, recurrences, and costs collected during use, and the collected records can serve as the source of evaluation dimensions; the rollback version information can record the skill identifier and version of historical processing skills used in rollback processing. The skill library can be used to perform filtering, recall, and sorting according to task characteristics.
[0293] In practical applications, generating a release certificate for the target processing skill that carries rollback version information can be achieved through various methods, provided that the verification results meet the preset release conditions.
[0294] One alternative approach is to verify the results item by item against the predefined release conditions, and then organize the comparison conclusions and verification evidence into the fields of the release certificate. Specifically, the verification results can be compared with the hard constraint inspection conclusions, improvement requirements, anti-regression conclusions, and evidence sufficiency. If all the judgment criteria are met, the verification results are determined to meet the predefined release conditions. The fields of the release certificate can be determined according to the inspection conclusions of the verification queue, evaluation vector, and hard invariants, respectively.
[0295] Another alternative approach is to issue release certificates in stages, following the sequence of release determination. Specifically, a threshold determination can be performed first based on the hard constraint check results, terminating the release determination if any hard invariant is not met. Next, an improvement requirement determination can be performed on the target processing skills that pass the threshold determination, comparing the improvement relative to the baseline version with the preset improvement requirements. Finally, an anti-regression determination and an evidence sufficiency determination can be performed on the target processing skills that pass the aforementioned determinations, using the results of historical validation samples and difficult negative samples to determine the retention of the original processing results and whether the validation evidence is sufficient.
[0296] In addition, additional verification and issuance of release certificates can be performed when the criteria are met, or the release certificate can be issued after the evidence is reviewed and verified manually. For target processing skills where the requirements are raised or the anti-regression conclusion is at the criteria boundary, samples that do not meet the criteria can be added and the processing flow can be re-executed; manually issued release certificates also record evidence hashes and rollback version information.
[0297] After obtaining the release certificate, the target processing skills and the release certificate can be further registered in the skill library, enabling subsequent processing tasks to be retrieved based on task characteristics. In practical applications, registering target processing skills and release certificates in the skill library can also be achieved through various methods.
[0298] One alternative approach is to write the target processing skill and issuance certificate field by field according to the registration fields of the skill library, and then create a retrieval index based on the field's purpose. Specifically, the skill identifier and version can be used as the primary key, the generation basis can be written into the genealogy, the applicable conditions and risk classification can be written into the applicable conditions and risk levels respectively, the dependencies and conflicts can be written into the dependencies and conflicts, the usage can be written into the telemetry strategy, the corresponding historical processing skills can be written into the rollback version information, and the issuance certificate can be written as an independent registration field. Subsequently, filtering indexes, recall indexes, and sorting indexes can be created according to the applicable conditions, the vector representation of the applicable conditions, and the registration time respectively.
[0299] Another alternative approach is to organize the registration content according to skill lineage and version relationships, and perform integrity checks after registration. Specifically, target processing skills can be registered as the new version corresponding to their parent version, and the parent-child and merging relationships between versions can be written in the lineage according to the mutation source or merging ancestor. The declared processing dependencies and mutual conflicts can be written into the skill library, and the skill conflict relationships in the skill library can be updated accordingly. After registration, it can be verified whether the registration content contains a release certificate, whether the historical processing skills indicated by the rollback version information can be parsed from the skill library, and whether the dependent versions are compatible. Registration content that fails the verification is recorded as temporarily excluded from retrieval. The update of target processing skills can be achieved by using the same skill identifier and a new version number. After the candidate processing skill is re-verified and a release certificate is reissued, it is registered as the new version. After the new version is registered, the original version is retained and can be used for rollback processing, compatibility with existing processing environments, and traceability of the verification process. If the original version is completely replaced, has not been hit for a long time, or the risk is unacceptable, the original version can be retired.
[0300] In addition, the registered content can be written into different components of the skill library according to its purpose. The structured fields carry the skill identifier, version, risk level and registration time, the version relationship fields carry the lineage, dependencies and conflicts, and the evidence fields carry the artifacts corresponding to the issued certificates and verification evidence. The components are associated with each other according to the skill identifier and version.
[0301] In an optional embodiment, the target processing skill can be advanced in the order of sandbox, shadow, grayscale, and formal states. Specifically, the target processing skill in the sandbox state can be executed in the least privilege sandbox, with tool calls based on whitelists and resource quotas, and verification performed on execution modification information and static check conclusions; the target processing skill in the shadow state can be executed separately from the skill already in the formal state on the same processing task, with the actual output generated by the skill already in the formal state, and the execution result recorded separately; the target processing skill in the grayscale state can select some processing tasks to actually take effect according to applicable conditions, and record the hit and recurrence situations according to applicable scenario clusters; if the recurrence situation does not exceed the limit, the target processing skill can enter the formal state.
[0302] In an optional embodiment, the correspondence between the release certificate and the rollback version information can also be maintained based on the immutability of the release certificate. Specifically, the field content of the release certificate remains unchanged after its generation. When the applicable conditions, execution modification information, or dependent versions change, the release certificate can be regenerated according to the new verification results and registered as a new version, while the original version's release certificate is retained in the skill library. The rollback version information carried by the release certificate maintains a pointing relationship with a historical processing skill in the skill library. After the target processing skill enters a grayscale state or a formal state, the rollback processing, adjustment and freezing of retrieval weights are all based on the version indicated by the release certificate.
[0303] In an optional embodiment, the skill library can also be carried on different implementation carriers. The implementation carriers of the skill library can be referred to in the embodiments described later, and will not be repeated here. If the implementation carrier changes, the registration content, release certificate and rollback version information can be migrated to the new implementation carrier according to the skill identifier and version.
[0304] In this embodiment, by comparing the verification results with preset release conditions and generating a release certificate carrying rollback version information when the preset release conditions are met, the target processing skill has hard constraints, improvement requirements, regression resistance, and evidence sufficiency as criteria for judgment before entering the skill library. Since the release certificate is bound to the skill identifier and version and remains unchanged, when the target processing skill encounters the declared covered defect type again in subsequent processing, it can be executed by the historical processing skill in the skill library. Since the release certificate is registered in the skill library according to the registration fields such as skill identifier, version, lineage, and applicable conditions, the registered target processing skills can be retrieved according to task characteristics. Thus, the accuracy of defect location and the processing efficiency of defect analysis are improved.
[0305] In one optional embodiment of this specification, a schematic diagram of hierarchical selection, skill sets, and release is provided, specifically, see [link to relevant documentation]. Figure 6 , Figure 6 This diagram illustrates a hierarchical selection, skill set, and release system according to one embodiment of this specification, such as... Figure 6 As shown.
[0306] Candidate processing skills include baseline versions, variant versions, and merged versions. These skills are stratified according to at least one dimension: document type, defect type, language / script, and risk level. Within each stratum, candidate processing skills are ranked according to preset evaluation dimensions. The ranking results and the dominance relationship between each candidate skill are determined. The target processing skill is determined if the ranking results meet preset release conditions, including hard constraints, improvement requirements, regression resistance, and sufficiency of evidence. The current processing skill serves as the parent version for updates and merging, represented by its skill identifier and version. Updates are performed on the current processing skill to obtain candidate processing skills for modifying missing table translations and font characters. Candidate processing skills with a common ancestor, complementary modification scope, and no conflicts are merged to obtain the merged candidate processing skill, which is then re-validated. The release certificate carries the skill identifier and version, evidence hash, scope of application, risk level, and rollback version information.
[0307] In this embodiment, candidate processing skills are stratified according to at least one of the following dimensions: document type, defect type, language script, and risk level. This allows for comparison of candidate processing skills under the same stratification dimension values. By sorting candidate processing skills within each stratum according to preset evaluation dimensions and obtaining dominance relationships, the selection of candidate processing skills has a definite ranking basis. By merging candidate processing skills with a common ancestor, complementary modification scope, and no conflicts, and then re-performing a complete verification, the merged candidate processing skills have a verification basis. The above processing provides a basis for the release and rollback of target processing skills before they enter the skill library, thereby improving the accuracy of defect location and the processing efficiency of defect analysis.
[0308] In one embodiment of this specification, an illustrative embodiment of a document processing method is also provided. Specifically, see [link to illustrative embodiment]. Figure 7 , Figure 7 A flowchart of a document processing method according to an embodiment of this specification is shown, such as... Figure 7 As shown, the method specifically includes the following steps.
[0309] Step 502: Obtain the document to be processed; Step 504: Perform pre-analysis on the document to be processed to obtain the task characteristics of the document to be processed; Step 506: Based on task characteristics, retrieve target processing skills from the skill base, wherein the target processing skills are generated according to the skill generation method described above; Step 508: Based on the target processing skills, perform processing actions on the document to be processed to obtain the processing result of the document to be processed.
[0310] A document to be processed is a document that needs to be processed by a document processing method. Specifically, a document to be processed can be a document containing at least one of the following: scanned and native mixed pages, multi-column layouts, tables, formulas, text in images, rotated text, special fonts, transparent layers, complex backgrounds, or nested objects. The pages, areas, text lines, cells, and images of the document to be processed constitute the processing objects within the document. The document to be processed can be obtained in the form of a file, a collection of files, or a data stream. The document to be processed can be used to provide processing objects for the document processing method and serve as the basis for retrieving target processing skills. Furthermore, the document to be processed and the target document processed when generating the target processing skill can be different documents, and there may be differences in layout topology, language scripts, and object types. Therefore, it is necessary to determine the appropriate processing skill based on the characteristics of the document to be processed itself.
[0311] Pre-profiling is the process of parsing and extracting features from a document before performing any processing actions. Specifically, pre-profiling can read the page structure, page images, font information, text layer information, and object composition of the document to obtain features such as the number of pages, scan ratio, layout topology, object type histogram, font and script coverage, and table and formula density. Pre-profiling can be used to generate task features for the document.
[0312] Task features are information that characterizes the document to be processed and the constraints imposed by the processing task. Specifically, task features can be organized in the form of document fingerprints, which represent the task features. These fingerprints may include at least one of the following: number of pages, scan ratio, layout topology, object type histogram, font and script coverage, table and formula density, target language, available tools, and quality and cost constraints. Each field reflects the document's size, degree of visualization, structural form, object composition, text processing, and distribution of structured content. Task features can be compared with the applicable conditions declared by each candidate processing skill in the skill library. Furthermore, numerical fields in task features can be used for filtering, vector features for similarity recall, and version fields for compatibility checks.
[0313] In practical applications, there are multiple methods to obtain the document to be processed.
[0314] One alternative approach is to obtain the document to be processed through the receiving interface provided by the document processing platform. Specifically, the receiving interface can receive the document to be processed in the form of a file, a collection of files, or a data stream. During the receiving process, it assigns a processing task identifier and a processing run identifier to the document to be processed, performs readability and integrity checks on the obtained document, and requests a resubmission of the document to be processed if the checks fail.
[0315] Another alternative approach is to retrieve the document to be processed based on the storage location indicated by the processing request. Specifically, the processing request may include a storage address, directory identifier, or storage object identifier. The document processing method can then read the document from object storage, a file system, or a content management system according to the storage location. During the reading process, read permissions and document integrity can be verified. If the document to be processed consists of multiple files, the reading order can be determined according to the relationships between the files, while maintaining page continuity.
[0316] In addition, documents to be processed can be passed to this processing process from the upstream processing stage, or documents to be processed can be obtained in the order of the processing task queue and the processing priority can be determined.
[0317] After obtaining the document to be processed, it can be pre-analyzed. In practical applications, pre-analyzing the document to obtain its task characteristics can be achieved through various methods.
[0318] One alternative approach is to combine structural analysis with page sampling to perform pre-analysis. Specifically, the page structure and text layer information of the document to be processed can be analyzed first to obtain count-type features such as the number of pages and the scanning ratio, as well as topological features such as the number of columns and the reading order. Then, a portion of the pages are extracted to perform layout analysis and object recognition, obtaining features such as object type histograms, table and formula density, and font and script coverage. The number of pages to be extracted can be determined based on the total number of pages and processing time constraints.
[0319] Another alternative approach is to sequentially obtain different types of features through multiple profiling stages and route the document to be processed to the corresponding profiling branch. Specifically, document metadata features can be obtained first, and the document type and script category of the document to be processed can be determined. Then, the document to be processed can be routed to the profiling branch corresponding to the document type and script category, from which textual features such as target language, font coverage, and script coverage can be obtained.
[0320] Another alternative method is to select a parsing path based on the object composition of the page and perform a structural integrity check on the parsing results. Specifically, structural parsing checks can be performed on the page and regions, with the results given in the form of parsability vectors and confidence scores. When the page mainly consists of native objects, characters, fonts, and vector objects are obtained according to the native parsing path. When the page includes both native and image objects, the objects obtained from native parsing are aligned with the objects obtained from text recognition according to the hybrid parsing path. When the page mainly consists of image objects, text, rotated text boxes, and visual styles are obtained according to the visual recognition path. Subsequently, a structural integrity check is performed on the parsed results, including the integrity of object coverage, reading order, table skeleton, and layout and style. If the check results do not meet the preset conditions, a partial re-examination or a switch to a different parsing path is performed.
[0321] Furthermore, task features generated during the historical processing of the same document can be reused. Specifically, historical processing records can be queried based on the content hash of the document to be processed. If the content hashes are the same, the historical task features are used as the result of the current pre-analysis. If the content hashes change, the analysis can be re-executed only on the pages that have changed, and the features obtained from the analysis can be merged with the historical task features.
[0322] After obtaining the task characteristics, target processing skills can be retrieved from the skill library based on these characteristics. The skill library can be used to register verified and released target processing skills and their version information. In practical applications, retrieving target processing skills from the skill library based on task characteristics can also be achieved through various methods.
[0323] One alternative approach is to progressively narrow down the range of candidate processing skills by following the order of filtering, recall, and sorting. Specifically, candidate processing skills that do not meet the applicable conditions or are incompatible with the processing version can be filtered out first based on the fields in the task features; then, recall can be performed based on the similarity between the task features and the applicable conditions of each candidate processing skill, and the candidate processing skills that rank high and carry a release certificate can be identified as the target processing skills; the specific implementation methods for filtering, recall, and sorting are described in the embodiments below.
[0324] Another alternative approach is to search according to different source dimensions of task characteristics and then take the intersection of the search results for each dimension. Specifically, the skill base can be searched according to document type, defect type, and risk level dimensions to obtain a set of candidate processing skills for each dimension; the intersection of multiple candidate processing skill sets can be taken; if the intersection is empty, some dimensions can be relaxed, and the target processing skill can be determined according to the number of dimensions hit.
[0325] In addition, the task characteristics used in this search, the applicable conditions for the hit, and the search basis can be recorded, and the search basis can be written into the execution record of the processing task along with the target processing skills.
[0326] After acquiring the target processing skills, one can perform processing actions on the document to be processed based on those skills. In practical applications, performing processing actions on the document to be processed based on the target processing skills to obtain the processing result can also be achieved through various methods.
[0327] One alternative approach is to execute the processing action according to the processing module pointed to by the target processing skill. Specifically, the skill identifier, version, processing parameters, and verification content of the target processing skill can be written into the execution node of the execution plan. The execution node then executes the processing action according to the modifications declared by the target processing skill and records the skill identifier, version, processing object identifier, and execution status. For a detailed implementation of writing the skill identifier and version into the execution plan node, please refer to the embodiments described later.
[0328] Another alternative approach is to first apply the processing action to a subset of pages in the document to be processed, and then determine whether to extend it to the entire document based on the execution results. Specifically, representative pages or objects in the document can be selected to perform the processing action, and the processing results can be evaluated. If the evaluation results meet preset conditions, the processing action can be extended to the remaining pages in the document. If the evaluation results do not meet the preset conditions, the processing parameters corresponding to the target processing skill can be adjusted.
[0329] In addition, after obtaining the processing result of the document to be processed, the target processing skill and processing result used in this execution can be recorded, and it can be determined whether the defect type declared to be covered by the target processing skill reappears in the processing result.
[0330] In an optional embodiment, data can be processed according to the principle of minimum necessity during the acquisition of the document to be processed, pre-analysis, and execution of processing actions. The text content in the document to be processed can be anonymized using entities, and object hashes and layout features can be used to replace the original text in the composition of task features and skill retrieval; the page area images required to execute processing actions can be saved using encrypted storage and tenant isolation; the execution of the target processing skill can be carried out in a minimum permission environment with resource quota restrictions.
[0331] In an optional embodiment, the skill base can be implemented as at least one of a relational database, graph database, vector database, and object storage, and the skill base records the skill identifier and version of the target processing skill. The processing of the document to be processed can be implemented by a fixed processing flow, a multi-strategy routing flow, an end-to-end multimodal model, or a manually participated flow. The target processing skill can be applied to the observable processing modules, thereby making the document processing method of the embodiments of this specification applicable to various underlying document processing system forms.
[0332] In an optional embodiment, the target processing skill used by the document processing method provided in this specification is the target processing skill generated and verified by the aforementioned skill generation method. It can be associated with the skill generation side through skill identifier, version, and release certificate. The processing result generated by the document processing method performing processing actions can be re-entered into the aforementioned defect analysis and skill generation process, so that the processing flow record and abnormal processing result corresponding to the defect object that appears in the processing process become the input for subsequent skill generation and iteration.
[0333] In the embodiments of this specification, by acquiring the document to be processed and pre-analyzing it to obtain task characteristics, the nature of the document to be processed and the conditions and constraints of the current processing task are determined before the processing action is executed. By retrieving the target processing skill from the skill library based on the task characteristics, the verified processing capability can be directly reused in subsequent document processing. The required processing action is directly determined by the task characteristics and skill retrieval, thereby improving the processing efficiency of document processing. By executing processing actions on the document to be processed based on the target processing skill and obtaining the processing result, a definite correspondence is established between the executed processing action and the task characteristics, thereby improving the processing accuracy of document processing.
[0334] In one optional embodiment of this specification, a flowchart illustrating the pre-profiling and parsing path selection is provided. Specifically, see [link to relevant documentation]. Figure 8 , Figure 8 This diagram illustrates a pre-profiling and parsing path selection process according to one embodiment of this specification. Figure 8 As shown.
[0335] The process pre-analyzes each page and region in the document to determine the corresponding processing object. Structural analysis is then performed on each processing object, with the results presented as a parsingability vector and confidence score. If the parsingability vector and confidence score indicate that the page primarily contains native objects, characters, fonts, and vector objects are obtained using the native parsing path. If the page includes both native and image objects, the objects obtained from native parsing are aligned with those obtained from text recognition using a hybrid parsing path. If the page primarily contains image objects, text, rotated text boxes, and visual styles are obtained using a visual recognition path. Structural integrity is assessed for the results obtained from each parsing path, including object coverage, reading order, table skeleton, and layout and style integrity. If the assessment results do not meet preset conditions, partial re-examination or a switch to a different parsing path is performed. The parsed features are organized into task features using standardized encoding, including fields such as page count, scan ratio, layout topology, and object type histogram.
[0336] In the embodiments of this specification, by performing pre-analysis and structural analysis on each page and region of the document to be processed, the appropriate parsing path for each page is determined before parsing. Different types of pages are processed through native parsing paths, hybrid parsing paths, and visual recognition paths, so that pages with different layouts can obtain parsing methods adapted to their object composition. Through structural integrity judgment and local re-examination or path switching, the parsing results have a basis for judgment in terms of object coverage, reading order, and table skeleton. The above processing enables the various features obtained from parsing to be organized into task features according to standardized coding, thereby improving the processing accuracy of document processing.
[0337] In one optional embodiment of this specification, retrieving target processing skills from a skill base based on task characteristics includes: Based on task characteristics, candidate processing skills in the skill base are filtered to obtain the filtering results. Based on the similarity between task features and the applicable conditions of each candidate processing skill in the filtering results, candidate processing skills are recalled from the filtering results to obtain the recall results. Sort the recall results to obtain the sorting results; Based on the ranking results, the target processing skills are determined.
[0338] The filtering result is a set of candidate processing skills retained after filtering the candidate processing skills in the skill base. Specifically, filtering compares each field in the task features with the applicable conditions declared by each candidate processing skill, filtering out candidate processing skills whose hit conditions are not met or whose exclusion conditions are met, and filtering out candidate processing skills whose dependent processing module version, processing tool version, or data structure version is incompatible with the currently available version; the composition of task features is described in the previous embodiments and will not be repeated here. The filtering result can be used to limit the candidate range for similarity calculation and ranking score calculation. Furthermore, the filtering result can be represented as a list of candidate processing skill identifiers and versions, and can carry the criteria for determining whether each candidate processing skill is retained or filtered out, so that the computing resources consumed by the retrieval process decrease as the candidate range is narrowed.
[0339] The recall result is the set of candidate processing skills obtained after recalling candidate processing skills from the filtering results. Specifically, recall can determine the feature vector corresponding to the task features and the vector representation corresponding to the applicable conditions of each candidate processing skill in the filtering results, calculate the similarity between the feature vector and the vector representation, and include candidate processing skills with similarity reaching a preset threshold in the recall result. The recall result can be used to provide a candidate set for ranking. Furthermore, the recall result can be organized in descending order of similarity and carry the similarity value of each candidate processing skill for use in calculating the ranking score.
[0340] In practical applications, the candidate processing skills in the skill library can be filtered based on task characteristics, applicable conditions, and processing module versions to obtain the filtering results. This can be achieved through various methods.
[0341] An alternative approach is to perform filtering based on the hit and exclusion criteria declared in the applicable conditions. Specifically, the fields in the task features can be compared item by item with the hit criteria of each candidate processing skill, and candidate processing skills can be filtered out if any hit criterion is not met; similarly, the task features can be compared with the exclusion criteria, and candidate processing skills can be filtered out if the exclusion criteria are met. For example, if a candidate processing skill requires the presence of a table area in the document to be processed, candidate processing skills can be filtered out for documents to be processed where no table area is detected.
[0342] Another alternative approach is to perform filtering based on the version constraints declared in the applicable conditions. Specifically, the versions of the processing modules, processing tools, data structures, and fonts that the candidate processing skills depend on can be read, and the read version information can be compared with the available versions for this processing task. Candidate processing skills can be filtered out if they are incompatible. If the version constraints are expressed as version ranges, retention and filtering can be determined based on whether the available versions fall within the version range.
[0343] In addition, the comparison order of hit conditions, exclusion conditions and version constraints can be set to compare fields with discrete values first and fields with continuous values later, and the exclusion conditions can be relaxed and the filtering can be re-executed if the filtering result is empty.
[0344] After obtaining the filtering results, candidate processing skills can be recalled from the filtering results based on similarity. In practical applications, recalling candidate processing skills from the filtering results based on the similarity between task features and the applicable conditions of each candidate processing skill in the filtering results can also be achieved through various methods.
[0345] One alternative approach is to convert the task features and the applicability conditions of candidate processing skills in the filtering results into vector representations, and determine the similarity based on the distance or angle between the vectors. Specifically, task feature vectors can be formed according to layout topology, object type histograms, font and script coverage, and evidence features. The calculated similarity can be compared with a preset similarity threshold, and candidate processing skills with similarity greater than the preset threshold can be included in the recall results.
[0346] Another alternative approach is to calculate similarity separately for each of the multiple feature dimensions and then perform a weighted fusion. Specifically, dimensional similarity can be calculated separately for document type, object type, language / script, and evidence feature dimensions, and the dimensional weights can be determined according to the importance of each dimension. The sum of the products of each dimension's similarity and its weight is then used as the fused similarity. If a dimension field is missing, the missing dimension can be excluded from the fusion calculation, and the dimensional weights of the remaining dimensions can be normalized.
[0347] In addition, candidate processing skills with similarity can be included in the recall results, and the similarity value and recall source of each candidate processing skill can be recorded.
[0348] After obtaining the recall results, the candidate processing skills in the recall results can be ranked according to their ranking scores. In practical applications, ranking the recall results and obtaining the ranking results can also be achieved through various methods.
[0349] One alternative approach is to rank the candidate processing skills in the recall results according to their ranking scores. Specifically, the similarity, expected benefit, risk, cost, and drift corresponding to each candidate processing skill in the recall results can be determined separately. The ranking scores are then combined according to the weight coefficients of each sub-item to obtain the ranking results.
[0350] Another alternative approach is to perform a two-stage ranking based on the hit rate of candidate processing skills under applicable conditions. Specifically, the candidate processing skills in the recall results can first be divided into multiple groups based on the comparison between the number of hits under applicable conditions and the exclusion conditions, and the order of each group can be determined according to the applicability of the group. Within each group, the candidate processing skills can be arranged according to the ranking score, and the group order and the order within each group can be used as the ranking result.
[0351] In addition, the sorting process can retain the arrangement position of multiple candidate processing skills and the value of each item, and record the sorting results in list form.
[0352] After obtaining the sorting results, the target processing skill to be used for this processing task can be determined based on the sorting results. In practical applications, determining the target processing skill based on the sorting results can also be achieved through various methods.
[0353] One alternative approach is to select the top-ranked candidate processing skills with release certificates from the sorting results as the target processing skills. Specifically, candidate processing skills can be read sequentially according to the sorting results, and it can be determined whether the candidate processing skills have release certificates and whether their applicable scope covers the task characteristics. If the applicable scope covers the task characteristics, the candidate processing skill is determined as the target processing skill. If the top-ranked candidate processing skills do not have release certificates, the candidate processing skills ranked later are read sequentially.
[0354] Another alternative approach is to determine the number of skills to retain based on the ranking results, and then identify the target processing skills from the retained candidate processing skills. Specifically, the top-ranked candidate processing skills can be selected from the ranking results according to a preset number of skills to retain, and the target processing skills can be determined according to their risk levels. If there are processing dependencies between the selected candidate processing skills, all candidate processing skills with processing dependencies can be identified as target processing skills.
[0355] In addition, after determining the target processing skill, the skill identifier, version, and sorting result of the target processing skill can be written into the execution record of the processing task.
[0356] For example, the ranking score can be determined by the following formula:
[0357] The ranking score is used to quantitatively compare candidate processing skills. Similarity represents the degree of matching between task features and the applicable conditions of the candidate processing skill, and its value is derived from the similarity calculated during the recall phase. Expected benefit represents the degree of improvement in defect closure and processing quality of the candidate processing skill, and its value is derived from the historical execution and verification results of the candidate processing skill. Risk represents the degree of processing quality degradation that the candidate processing skill may cause, and its value is derived from the risk level declared by the candidate processing skill and the hard constraints in the issued certificate. Cost represents the processing time and computing resources consumed by the candidate processing skill, and its value is derived from the telemetry records corresponding to the candidate processing skill. Drift represents the degree of difference between the applicable conditions of the candidate processing skill and the current operating environment, and its value is derived from the comparison results between the version on which the candidate processing skill depends and the currently available version. α, β, γ, δ, and η are the weight coefficients corresponding to similarity, expected benefit, risk, cost, and drift, respectively. Each weight coefficient can be set according to at least one dimension of document type, defect type, and risk level.
[0358] In an optional embodiment, the registration information of candidate processing skills in the skill base can also be used as a common basis for filtering, recall, and ranking. The registration information may include at least one of the following: skill identifier, version, lineage, applicable conditions, risk level, dependencies, conflicts, release certificate, telemetry strategy, and rollback version information of the candidate processing skill; filtering can determine the retention and removal of candidate processing skills based on the applicable conditions and dependencies in the registration information, and ranking can determine the value of each item based on the risk level and telemetry strategy in the registration information; filtering, recall, and ranking can be performed in a progressively narrowing order.
[0359] In this embodiment, candidate processing skills in the skill base are filtered based on task characteristics to obtain filtering results. This eliminates candidate processing skills with inconsistent applicable conditions or incompatible processing versions before similarity calculation, thereby improving document processing efficiency. Candidate processing skills are recalled from the filtering results based on the similarity between task characteristics and the applicable conditions of each candidate processing skill in the filtering results. This recall results allow candidate processing skills with similar layout and object composition to be included in the candidate set, thereby improving document processing accuracy. The recall results are sorted to obtain ranking results, and target processing skills are determined based on these ranking results. This allows similarity, expected benefits, risks, costs, and drift to be comprehensively considered in the same ranking process, further improving document processing accuracy.
[0360] In one optional embodiment of this specification, processing actions are performed on the document to be processed based on the target processing skill, including: When there are multiple target processing skills, the skill conflict outcome is determined based on the processing dependencies between these skills. Based on the skill conflict results, constraint solving is performed on multiple target processing skills to obtain skill binding results; Execute processing actions according to the skill binding results, and verify the execution conditions and invariants of each target processing skill during the execution of processing actions; For target processing skills whose verification results meet preset abnormal conditions, bypass processing is performed, or rollback processing is performed based on the historical processing skills corresponding to the target processing skills.
[0361] Processing dependencies are the relationships between multiple target processing skills in terms of the execution order of processing actions and the data source. Specifically, processing dependencies can include order dependencies and data dependencies. Order dependencies indicate that the processing action of one target processing skill must be executed after the processing action of another target processing skill is completed. Processing dependencies can be used to determine the binding order of multiple target processing skills in a processing task. Furthermore, processing dependencies can form a chain of relationships through intermediate processing skills; in the case of a circular requirement, the execution order cannot be simultaneously satisfied.
[0362] Skill conflict results are determinations that characterize the mutual inconsistencies between multiple target processing skills. Specifically, skill conflict results can include at least one of the following: mutual exclusion tool conflict, conflict of covering the same parameter, sequential dependency conflict, and resource contention conflict. Mutually exclusive tool conflict indicates that two target processing skills require the invocation of tools that cannot be used simultaneously; conflict of covering the same parameter indicates that two target processing skills require setting the same processing parameter to different values; sequential dependency conflict indicates that the execution order declared by two target processing skills conflicts with each other; and resource contention conflict indicates that the sum of the resource usage of two target processing skills exceeds the quota allowed by the task. Skill conflict results can be used to determine the constraints for constraint solving.
[0363] Skill binding results determine the target processing skills that can be executed together and their execution order. Specifically, skill binding results may include the skill identifier and version of each target processing skill, the location of the skill identifier and version in the execution plan node, processing parameters, verification content, and execution order. The execution order can be determined according to processing dependencies. Target processing skills not included are recorded as unbound skills. Skill binding results can be used to instruct the processing flow to execute processing actions according to the determined set of target processing skills and their execution order.
[0364] Execution conditions are the conditions that a target processing skill must meet before it can perform a processing action. Specifically, execution conditions may include at least one of the following: document structure conditions, existence of the processing object, availability of the processing tool, processing parameter value conditions, and compatibility with the processing version. For example, the execution conditions for a target processing skill related to table cell placeholder conservation may include the existence of the table area and compatibility with the structure version. Execution conditions can be used to determine whether a target processing skill meets the prerequisites for taking effect.
[0365] Invariants are conditions that must remain true throughout the execution of a target processing skill's actions. Specifically, invariants can include at least one of the following: object quantity conservation, protected object retention, and prohibition of silent success. Object quantity conservation indicates that the number of processed objects remains the same after the target processing skill's execution. Protected object retention indicates that processed objects marked as protected are not modified during execution. Prohibition of silent success indicates that if the processing action has not actually taken effect, the processing result is not recorded as successfully executed. Invariants can be used to determine whether the execution of a target processing skill has changed the original relationships between processed objects.
[0366] Preset anomaly conditions are used to determine when an anomaly occurs during the execution of a target processing skill and requires intervention. Specifically, preset anomaly conditions can include at least one of the following: execution conditions not met, invariants not established, processing action execution timeout, resource usage exceeding quota, and the appearance of a new defect type in the processing result. The absence of established invariants indicates that the execution has altered the original relationship between the processing objects. Preset anomaly conditions can be used to trigger intervention on the target processing skill. Furthermore, preset anomaly conditions are determined based on verification conclusions during execution, and the defect type in the processing result is determined based on evaluation conclusions after the processing action is completed.
[0367] Bypass processing is a processing method that skips the processing actions declared by a target processing skill and continues to execute the remaining processing actions when the target processing skill meets preset abnormal conditions. Specifically, bypass processing can preserve the data form of the processing object affected by the target processing skill before execution, such as retaining the original source text content or page position of the processing object; bypass processing can record the skill identifier and version of the skipped target processing skill, the bypass reason, and the identifier of the processing object involved. Bypass processing can be used to prevent the execution abnormality of a single target processing skill from propagating to other processing actions.
[0368] Historical processing skills are the earlier versions of the target processing skill in the skill library. Specifically, historical processing skills can be indicated by the rollback version information carried in the release certificate of the target processing skill. The applicable conditions and execution modification information declared by the historical processing skill may differ from those of the target processing skill. Historical processing skills can be used to provide prior processing behavior in the event of an execution exception in the target processing skill.
[0369] Rollback processing is a method of re-determining the processing result based on historical processing skills. Specifically, rollback processing can include at least one of the following: restoring the processed object to its state before execution, re-executing the processing action according to the historical processing skills, and restoring the processing result to the state of the last successful verification. Rollback processing can be used to keep the processing result within the scope of verified processing behavior. Furthermore, rollback processing can be applied to a portion of the processed objects that meet preset abnormal conditions, while the remaining processed objects retain the processing result already executed by the target processing skill.
[0370] When there are multiple target processing skills, the processing actions declared by the multiple target processing skills may act on the same processing object or call the same tool, so it is necessary to determine the conflicting situations in advance.
[0371] In practical applications, determining the outcome of skill conflicts based on the processing dependencies between multiple target processing skills can be achieved through various methods.
[0372] One alternative approach is to compare the records of multiple target processing skills in terms of execution modification information and dependencies according to the conflict type, and identify the matching skill combinations as the skill conflict results. Specifically, the processing tools, processing parameters, execution order requirements, resource consumption, and resource quotas declared by each target processing skill can be compared according to four categories: mutually exclusive tools, covering the same parameter, sequential dependency, and resource competition; the matching skill combinations are recorded along with the conflict type.
[0373] Another alternative approach is to construct a skill conflict graph using multiple target processing skills as nodes and conflicting skill combinations as edges. Specifically, the skill conflict graph can record the conflict type, the processing tools involved, the processing parameters or resource names, and the degree of conflict for each edge. Then, it retrieves the circular path and the set of strongly related nodes. For the target processing skills that form the circular path, the edges on the circular path can be recorded as sequential dependency conflicts, and the skill combinations corresponding to the strongly related sets of nodes can be recorded as resource competition conflicts.
[0374] In addition, the conflict items in the skill conflict results can be sorted according to the degree of conflict and the scope of the objects involved in the conflict, with the conflict items involving a wider scope of objects being placed first.
[0375] After determining the skill conflict outcome, the set of skills that can be executed together and the execution order of each target processing skill can be determined. In practical applications, based on the skill conflict outcome, constraint solving is performed on multiple target processing skills to obtain the skill binding result, which can also be achieved through various methods.
[0376] One alternative approach is to convert skill conflict outcomes into constraints and then progressively filter multiple target processing skills according to these constraints. Specifically, mutual exclusion tool conflicts, conflicts that cover the same parameter, sequential dependency conflicts, and resource contention conflicts can be converted into four types of constraints: at most one target processing skill is retained in the same binding set, only one target value is used for the same processing parameter, the order of execution of each target processing skill, and the sum of resource usage does not exceed the task resource quota.
[0377] Another alternative approach is to divide multiple target processing skills into nodes based on a skill conflict graph. Specifically, nodes can be divided according to the absence of conflicting edges in the skill conflict graph, forming multiple candidate processing skill sets. Then, one set is selected based on the number of defect types covered by each candidate processing skill set, expected benefits, risk levels, and execution costs. The execution order of each target processing skill within the set is determined according to processing dependencies. Target processing skills that are not selected are recorded as unbound skills.
[0378] Another alternative approach is to include multiple target processing skills into the binding set one by one according to a preset order. Specifically, the inclusion order can be determined based on the risk level, expected benefits, and ranking results of the retrieval phase of the target processing skills. The inclusion order can be further determined based on the skill conflict results to see if there is a conflict between the target processing skills to be included and those already included. If there is no conflict, the target processing skills are included in the binding set and inserted into the corresponding execution order position according to processing dependencies. If there is a conflict, the target processing skills are skipped.
[0379] In addition, if the constraint solving cannot obtain a skill combination that satisfies the constraint conditions, the relaxation order can be determined according to the conflict type, and the relaxed constraint conditions and the abandoned target processing skills can be recorded in the skill binding results.
[0380] After obtaining the skill binding results, processing actions can be executed according to the skill set and execution order indicated by the skill binding results. In practical applications, executing processing actions according to the skill binding results, and verifying the execution conditions and invariants of each target processing skill during the execution of processing actions, can also be achieved through various methods.
[0381] One alternative approach is to write the skill identifier and version from the skill binding result into the execution plan node, and have the scheduling component of the processing flow read the execution conditions before the execution plan node is executed and the invariants during execution. Specifically, the scheduling component can verify the execution conditions item by item before calling the execution plan node, verify the invariants item by item after the call, and write the verification results into the processing flow record; if the execution conditions are not met or the invariants are not valid, the target processing skill is handled according to the preset exception conditions.
[0382] Another alternative approach is to divide the processing actions declared by the target processing skill into multiple batches based on the processing object, and to verify the execution conditions and invariants after each batch is completed. Specifically, batches can be divided according to the categories of page, region, text line, or cell. After each batch of processing objects is completed, it is determined whether the invariants are true. If the invariants are not true, the processing results corresponding to the batches that have passed the verification are retained.
[0383] In addition, the execution conditions, invariants, data sources, and verification conclusions used in the verification process can be recorded during the verification process, and the verification records can be associated with the skill identifier and version of the target processing skill.
[0384] If the verification result indicates the existence of preset abnormal conditions, action can be taken against the target processing skill. In practical applications, for target processing skills whose verification results meet the preset abnormal conditions, bypass processing can be performed, or rollback processing can be performed based on the historical processing skills corresponding to the target processing skill. This can also be achieved through various methods.
[0385] One alternative approach is to select between bypass processing and rollback processing based on the exception type corresponding to the preset exception conditions. Specifically, if the execution conditions of the target processing skill are not met, bypass processing can be performed while maintaining the data state of the processing object before execution; if the invariant is not met and the processing object can be restored, rollback processing can be performed based on the historical processing skill to restore the processing object to its state before execution.
[0386] Another alternative approach is to sequentially execute fallback and rollback actions based on the handling details declared by the target processing skill. Specifically, the target processing skill can declare fallback handling details and historical processing skills to be used in the skill library in case of execution exceptions. If the verification result meets the preset exception conditions, the fallback handling details can be followed first, and invariants can be verified after the fallback handling details are executed. If the invariants are still not met, the rollback handling can be executed according to the historical processing skills indicated by the target processing skill.
[0387] In addition, after the disposal is completed, the disposal method, disposal reason, disposal object identifier and post-disposal verification conclusion can be recorded to the processing flow record.
[0388] In an optional embodiment, partial degradation can also be employed when the processing object affected by the target processing skill fails to meet the acceptance conditions. Specifically, partial degradation may include at least one of the following: preserving the source object, readable overlay, and manual review. Preserving the source object can maintain the data form of the processing object before execution; readable overlay can cover and display readable content in the original position; and manual review can submit the processing object and processing result to the review stage. When partial degradation is adopted, the degradation method, processing object identifier, and degradation reason can be recorded without marking the processing result as fully effective.
[0389] In an optional embodiment, the skill binding result can also be written into the execution plan. Specifically, the execution plan may include multiple execution plan nodes. The skill identifier and version of the target processing skill determined by the skill binding result can be written into the corresponding execution plan node. The written content may include at least one of the following: skill identifier, version, processing parameters, verification content, and execution order position. The execution plan nodes corresponding to target processing skills that are not included retain their original default processing parameters.
[0390] In an optional embodiment, the skill binding result can be compared with the execution conditions of each target processing skill before the processing action is performed, and the target processing skill can be prohibited from changing the processing result of the document to be processed if the execution conditions do not match the current processing task.
[0391] In the embodiments of this specification, skill conflict results are determined based on the processing dependencies between multiple target processing skills, ensuring that conflicting situations are identified before processing actions are executed. By solving for constraints on multiple target processing skills and obtaining skill binding results, the skill set, execution order, and target objects are determined. During the execution of processing actions, the execution conditions and invariants of each target processing skill are verified, ensuring that the execution of processing actions is contingent upon the fulfillment of execution conditions. By performing bypass or rollback processing on target processing skills that meet preset exception conditions, execution exceptions are limited to the processing objects affected by the target processing skill that caused the exception, thereby improving the accuracy and efficiency of document processing.
[0392] In one optional embodiment of this specification, a flowchart illustrating the binding of skill retrieval, conflict resolution, and execution plan is provided. Specifically, see [link to relevant documentation]. Figure 9 , Figure 9 The diagram illustrates a process flow for skill retrieval, conflict resolution, and execution plan binding according to one embodiment of this specification. Figure 9 As shown.
[0393] The process involves acquiring the document to be processed and performing pre-analysis to determine its task characteristics. Based on these characteristics, target processing skills are retrieved from the skill base. The retrieval process is as follows: Candidate processing skills in the skill base are filtered based on task characteristics and applicable conditions and processing module versions. Candidate skills with incompatible applicable conditions or incompatible processing module, tool, and data structure versions are removed, and a filtering result is obtained. Based on the similarity between the task characteristics and the applicable conditions of each candidate processing skill in the filtering result, candidate processing skills are recalled from the filtering result, and a recall result is obtained. The recall result is then sorted, and a ranking result is obtained. The target processing skill is determined based on the ranking result.
[0394] When there are multiple target processing skills, the skill conflict results are determined based on the processing dependencies between them. Constraint solving is then performed on these skills based on the conflict results to obtain skill binding results. Processing actions are executed according to the skill binding results. During the execution of these actions, the execution conditions and invariants of each target processing skill are verified. The skill identifier and version of each target processing skill are written into the nodes of the execution plan. If the verification results meet preset exception conditions, bypass processing or rollback processing is performed.
[0395] In the embodiments of this specification, candidate processing skills in the skill base are filtered, recalled, and sorted based on task characteristics, so that verified processing capabilities are retrieved according to the situation of the document to be processed; skill conflict results are determined by determining the processing dependencies between multiple target processing skills and constraint solving is performed, so that the target processing skills that can be executed together and their execution order are determined; by verifying the execution conditions and invariants during the execution of processing actions and writing the skill identifier and version into the nodes of the execution plan, the execution of processing actions is based on the premise that the execution conditions are met. The above processing enables the processing capabilities registered in the skill base to directly affect the processing of the document to be processed, thereby improving the processing efficiency and accuracy of document processing.
[0396] In one optional embodiment of this specification, a schematic diagram of the overall architecture for skill generation and iterative optimization is provided. Specifically, see [link to relevant documentation]. Figure 10 , Figure 10 A schematic diagram of the overall architecture for skill generation and iterative optimization according to an embodiment of this specification is shown, such as... Figure 10 As shown.
[0397] The processing flow comprises multiple processing modules, each sequentially performing processing actions on the processing objects in the target document. The processing flow record is generated and recorded in an append-only manner, including input references, output references, and processing versions for each processing module. An evaluation component evaluates the processing results and compares them with preset defect types to identify defective objects. An object-level error cause-effect graph is constructed using processing objects as nodes and generation relationships and input dependencies as edges. Candidate processing modules are identified by traversing the object-level error cause-effect graph backwards from the defective object. The output data of the candidate processing module is replaced with reference output data, and downstream processing modules are called to process the target document and obtain reference processing results. If the reference processing results do not include the defective object, the candidate processing module is determined as the target responsible module.
[0398] Based on the defect object and target responsibility module, defect feature information is generated. The current processing skill is updated to generate candidate processing skills, and static checks are performed. Candidate processing skills that pass the static check are stratified and sorted to determine the target processing skills. Four types of samples are obtained, and the processing flow is invoked to process each sample and obtain verification results according to the evaluation vector. If the verification results meet the preset release conditions, a release certificate with rollback version information is generated, and the target processing skill and release certificate are registered in the skill library. The document to be processed is pre-analyzed to obtain task features. Based on the task features, the target processing skill is retrieved from the skill library and the processing action is performed on the document to be processed. During the processing action, the execution conditions and invariants of each target processing skill are verified. If preset abnormal conditions occur, bypass processing or rollback processing is performed. Defect objects that reappear during the processing are entered into the defect analysis and skill generation process.
[0399] In the embodiments of this specification, by accessing the processing flow records, narrowing the scope of defect object causes, verifying candidate processing modules, generating and verifying target processing skills, and registering and retrieving the skill library, the analysis conclusions of defects are transformed into reusable processing skills and applied to subsequent document processing processes. By verifying four types of samples and generating certificates, target processing skills have verification and rollback bases before entering the skill library. By having defect objects re-enter the defect analysis and skill generation process, the use, adjustment, and updating of processing skills are completed within the same closed loop. The above processes enable the analysis conclusions of defects and the corresponding processing capabilities to continue between processing tasks, thereby improving the accuracy of defect location and the processing efficiency of document processing.
[0400] In one optional embodiment of this specification, after obtaining the processing result of the document to be processed, the method further includes: If the processing results contain a defect type corresponding to the target processing skill, reduce the retrieval weight of the target processing skill in the skill library. Alternatively, rollback can be performed based on the historical processing skills corresponding to the target processing skills.
[0401] Retrieval weights are the weights used by the skill library to rank candidate processing skills when retrieving target processing skills. Specifically, retrieval weights can be applied to the ranking score in the form of numerical coefficients, which are determined based on similarity, expected benefit, risk, cost, and drift. Alternatively, they can be used to limit the recall position in the form of levels. Retrieval weights can be used to adjust the recall scope and ranking results of candidate processing skills, and can be adjusted according to the hit and recurrence situation in the historical processing process, as described later. Furthermore, retrieval weights are applied to the retrieval and binding process of the skill library without changing the declared applicable conditions and version information, allowing the retrieval weights to be adjusted to narrow the scope of application when defect types occur.
[0402] In practical applications, when the processing results contain a defect type corresponding to the target processing skill, reducing the retrieval weight of the target processing skill in the skill library can be achieved through various methods.
[0403] One alternative approach is to determine the reduction in weight based on a comparison between the processing results and the declared covered defect types, and then adjust the search weight accordingly. Specifically, the processing results can be analyzed at the granularity of page, region, cell, and text line, comparing the defect types that appear with the declared covered defect types. If a match is found, the number of objects, pages, and distribution of the defect types can be determined, and the reduction in weight can be determined based on this. A larger reduction in weight is used when the number of matches and the number of objects being processed are high. The adjusted search weight, along with the object identifier and the defect types that appear, is then written into the skill library.
[0404] Another alternative approach is to adjust the search weights according to the applicable scenario clusters. Specifically, the processing task can be divided into multiple applicable scenario clusters based on at least one dimension: document type, defect type, language script, and risk level. If the defect type belongs to a specific applicable scenario cluster, the search weight is reduced only within that cluster; if it belongs to multiple clusters, the search weight is reduced in each cluster; if the reduction accumulates to a preset level within a specific cluster, the defect can be moved to a lower ranking position or excluded from the recall scope.
[0405] In addition, the search weight can be adjusted to a preset lower limit, or the target processing skill can be marked as not participating in the search in the skill library, and the processing flow record and processing result generated in this processing process can be saved as new evidence.
[0406] After a defect type is identified, the processing actions for the receiving document can be taken over by the historical processing skills in the skill library corresponding to the target processing skill, ensuring continuity of the processing during the adjustment period. In practical applications, rollback processing based on the historical processing skills corresponding to the target processing skill can also be achieved through various methods.
[0407] One alternative approach is to identify the historical processing skill based on the rollback version information indicated by the target processing skill's release certificate, and then replace the skill identifier and version in the execution plan with the skill identifier and version of the historical processing skill. Specifically, the release certificate can be read from the skill library, and the rollback version information can indicate the historical processing skill corresponding to the target processing skill. Subsequently, the processing action on the document to be processed can be re-executed according to the processing parameters and verification content declared by the historical processing skill, while retaining the environment snapshot and processing object identifier of the current processing task.
[0408] Another alternative approach is to determine the rollback scope based on the processing objects exhibiting the defect type. Specifically, by tracing the dependencies between processing objects in the processing flow record upstream from the processing object exhibiting the defect type to the processing object affected by the target processing skill, the set of processing objects affected by the rollback can be determined. This set includes the processing object exhibiting the defect type, its dependent processing objects, and processing objects after the node affected by the target processing skill. The processing actions can be re-executed on the processing objects within the set according to the historical processing skills. During the re-execution of the processing actions, the execution conditions and invariants declared by the historical processing skills are verified, and the rollback is terminated if preset exception conditions are met.
[0409] In addition, the rollback execution method can be selected according to the scope of the defect type. If the defect type only appears in a single processing object, the rollback will be performed only on the processing step corresponding to that single processing object. If the defect type appears in multiple pages or multiple object types, the entire processing task will be rolled back, and the historical processing skills used will be recorded and saved along with the processing flow.
[0410] In an optional embodiment, the usage of the target processing skill can be recorded according to the applicable scenario cluster, and the occurrence of defect types can be determined accordingly to determine whether they constitute a recurrence. Specifically, the number of hits, the number of successful processing, the number of recurrences, the number of false triggers, the processing latency, and the processing cost can be recorded separately according to the applicable scenario cluster. The number of hits represents the number of times the skill was retrieved and bound, the number of successful processing represents the number of times the corresponding defect type did not appear, and the number of false triggers represents the number of times the skill took effect in processing tasks that did not meet the applicable conditions. A recurrence can be determined based on three criteria: the processing task meets the declared applicable conditions, the processing module version and the processing tool version are compatible, and the declared covered defect type reappears in the processing result.
[0411] In an optional embodiment, the statistical results of recurrence counts can be judged according to the execution order to distinguish between occasional noise and continuous degradation. Specifically, recurrence can be statistically analyzed using a sliding window, where the sliding window is divided based on the number of processing tasks. If the recurrence rate exceeds a preset ratio, it is judged as continuous degradation. Confidence intervals can be calculated for the recurrence ratio within the applicable scenario cluster. If the lower limit of the confidence interval exceeds a preset boundary, it is judged as continuous degradation. If it crosses the preset boundary, observation continues. Alternatively, a sequential test can be used to accumulate evidence according to the execution order. When the accumulated evidence reaches the judgment boundary, the observation ends and a judgment result is given. As an optional implementation, statistics can be collected separately according to skill version and applicable scenario cluster. Only processing tasks that have been actually bound and executed with the target processing skill, meet the execution conditions, are compatible with the processing environment, and have completed evaluation are included. If the same processing task recurs with a defect type declared to be covered by the target processing skill, it is counted as a recurrence. Processing tasks without evaluation are not counted as successful. The recurrence ratio and the one-sided confidence lower bound of the recurrence ratio are determined according to the following formulas:
[0412]
[0413] in, To count the number of tasks that are effectively processed within the window, To count the number of recurrences within the window, The recurrence rate, Budget the false alarm probability corresponding to this inspection. The lower bound of the one-sided confidence level is used as the recurrence rate. The false alarm probability budget can be set according to the inspection order as the ratio of the total budget to the product of the inspection order and its adjacent orders, so that the sum of the false alarm probability budgets of each inspection does not exceed the total budget. If the number of effective processing tasks is less than the preset minimum sample size, observation continues. If the recurrence rate is greater than the preset upper limit of the recurrence rate but the lower bound of the one-sided confidence level is not greater than the preset upper limit of the recurrence rate, it is recorded as a suspected abnormality and samples are added. If the lower bound of the one-sided confidence level is greater than the preset upper limit of the recurrence rate for a preset number of consecutive effective inspections, it is judged as a continuous degradation and control actions are executed. Repeated replay processing actions and multiple processing objects within the same processing task are not accumulated as independent processing tasks. In the case of incompatible processing environments, the processing to be re-examined is executed separately. In the case of missing processing objects and silent omissions, etc., the failure to meet invariants directly triggers fault handling without waiting for statistical judgment.
[0414] In an optional embodiment, multiple control actions can be performed on the target processing skill when the recurrence rate or false trigger rate exceeds the limit. Specifically, the control actions may include stopping the gray-scale advancement of the target processing skill, rolling back the processing action to the specified version according to the rollback version information indicated by the release certificate, freezing the target processing skill so that it does not participate in the retrieval and binding of the skill library, and sending the processing flow record to the regression and candidate generation stage; the multiple control actions can be executed sequentially or in parallel according to the degree of exceeding the limit, and recorded according to the applicable scenario cluster.
[0415] In an optional embodiment, target processing skills can be marked as pending re-verification when applicable conditions are uncertain due to changes in the environment version, and retired if they are not matched for an extended period. Specifically, target processing skills pending re-verification are retained in the skill library with limited search criteria, rather than being directly invalidated, for re-verification after the environment version is determined. If a new version performs better than the target processing skill in multiple evaluation dimensions, or if the risk level of the target processing skill exceeds an acceptable range, the target processing skill can be retired and removed from the skill library's search scope, while its issuance certificate and skill lineage are retained for traceability.
[0416] In the embodiments of this specification, when a defect type corresponding to the target processing skill appears, the defect type is used as a recurrence signal of the target processing skill, and the retrieval weight of the target processing skill in the skill library is reduced. This allows the ranking of candidate processing skills to be continuously adjusted during the processing process, and the processing skills retrieved by subsequent processing tasks are more consistent with the situation, thereby improving the accuracy of defect localization. By performing rollback processing based on historical processing skills, the processing actions of the document to be processed can be continued by verified historical processing skills, and the processing process remains continuous during the adjustment period, thereby improving the processing efficiency of document processing. Combined with the statistics of usage by applicable scenario clusters and the distinction between occasional noise and continuous degradation, the use, adjustment and updating of processing skills are completed within the same processing closed loop, thereby improving the processing efficiency of defect analysis.
[0417] In one optional embodiment of this specification, a schematic diagram of a closed loop for skill lifecycle and relapse monitoring is provided. Specifically, see [link to documentation]. Figure 11 , Figure 11 A schematic diagram of a closed loop for skill lifecycle and relapse monitoring according to one embodiment of this specification is shown, such as... Figure 11 As shown.
[0418] Target processing skills progress in the following order: draft, sandbox, shadow, grayscale, formal, and retired. Target processing skills in the sandbox execute within a restricted sandbox, and their advancement is determined by verification results. Target processing skills in the shadow and formally-established skills execute separately on the same processing task, with the actual output generated by the formally-established skill. Target processing skills in the grayscale are used for a subset of processing tasks based on applicable conditions. If recurrence does not exceed limits, the target processing skill enters the formal state, and unused target processing skills are retired. Telemetry records include hits, recurrences, costs, latency, and environmental drift. Usage is statistically analyzed and sequentially verified according to applicable scenario clusters to distinguish between occasional noise and continuous degradation. Control actions include hold, demotion, rollback, freeze, pending verification, and retirement. After being registered in the skill library with preset release conditions and release certificates, target processing skills are applied to subsequent processing tasks. Telemetry records and control actions continuously adjust the processing capabilities in the skill library as the processing progresses.
[0419] In the embodiments of this specification, the target processing skills are advanced in the order of draft, sandbox state, shadow state, grayscale state, formal state, and retirement. This allows the target processing skills to determine whether to continue progressing in each state based on verification conclusions and recurrence situations. Through telemetry recordings and statistical and sequential verification according to applicable scenario clusters, occasional noise and continuous degradation are distinguished. By applying control actions such as maintaining, downgrading, rolling back, freezing, awaiting re-verification, and retirement to the target processing skills in the skill library, the use, adjustment, and updating of processing skills are completed within the same closed loop. These processes continuously adjust the processing capabilities registered in the skill library as the processing progresses, thereby improving the accuracy of defect localization and the efficiency of document processing.
[0420] In one embodiment of this specification, an illustrative embodiment of a skill deployment method is also provided. Specifically, see [link to illustrative embodiment]. Figure 12 , Figure 12 A flowchart of a skill deployment method according to an embodiment of this specification is shown, such as... Figure 12 As shown, the method specifically includes the following steps.
[0421] Step 1202: Obtain the target processing skill and the release certificate of the target pr...
Claims
1. A skill generation method, comprising: The system retrieves processing flow records and exception handling results generated by calling the processing flow to process the target document. The processing flow includes multiple processing modules, and the exception handling results include the defect object of the target document. Based on the dependencies between processing objects in the processing stream record, a candidate processing module corresponding to the defect object is determined from the plurality of processing modules; Based on the reference output data of the candidate processing module, the downstream processing module is called to process the target document to obtain a reference processing result; If the reference processing result does not include the defective object, the candidate processing module is determined as the target responsibility module, and a target processing skill is generated based on the target responsibility module.
2. The method according to claim 1, further comprising, before obtaining the processing stream record and the exception handling result: The processing flow is invoked to perform processing actions on the processing objects in the target document to obtain the original processing results; An evaluation is performed on each processed object in the original processing result to obtain the evaluation result of the processed object; If the evaluation result indicates that the processing result of the processing object is defective, the processing object is identified as the defective object, and the original processing result including the defective object is identified as the abnormal processing result.
3. The method according to claim 1, further comprising, after acquiring the processing stream record and the exception handling result: Based on stable object identifiers, cross-module alignment is performed on the processing objects processed by the multiple processing modules to obtain the dependencies between each processing object.
4. The method according to claim 1, wherein determining the candidate processing module corresponding to the defective object from the plurality of processing modules based on the dependency relationship between processing objects in the processing stream record includes: Obtain an object-level error cause-effect graph based on the dependencies between various processing objects; Along the object-level error cause-effect graph, retrieve the processing objects that the defective object depends on from the defective object in reverse order; The processing module that performs processing actions on the processing object on which the defective object depends is determined as the candidate processing module.
5. The method according to claim 1, wherein the step of calling a downstream processing module to process the target document based on the reference output data of the candidate processing module includes: Replace the output data of the candidate processing module with the reference output data; Based on the reference output data, the downstream processing module is invoked to process the target document and obtain the reference processing result.
6. The method according to any one of claims 1-5, wherein generating target processing skills based on the target responsibility module comprises: Based on the defect object and the target responsibility module, defect feature information is generated; Based on the target responsibility module and the defect feature information, the target processing skill is generated.
7. The method according to claim 6, wherein generating the target processing skill based on the target responsibility module and the defect feature information includes: Obtain the current processing skill corresponding to the target responsibility module; Based on the target responsibility module and the defect feature information, the current processing skill is updated to generate multiple candidate processing skills; Perform static checks on each candidate processing skill; If a candidate processing skill passes the static check, the target processing skill is determined based on the candidate processing skills that pass the static check.
8. The method according to claim 7, wherein updating the current processing skill based on the target responsibility module and the defect feature information to generate multiple candidate processing skills includes: Based on the processing behavior corresponding to the target responsibility module and the defect object, determine the applicable conditions and execution modification information of the candidate processing skills; Based on the applicable conditions and the execution modification information, the candidate processing skills are generated.
9. The method according to claim 7, wherein determining the candidate processing skill as the target processing skill when the candidate processing skill passes the static check includes: The candidate processing skills that pass the static inspection are stratified according to at least one of the following dimensions: document type, defect type and risk level, to obtain the stratification results; Based on the stratification results, the candidate processing skills within each stratum are sorted according to preset evaluation dimensions to obtain the sorting results; Based on the ranking results, the target processing skill is determined.
10. The method according to any one of claims 1-5, further comprising, after generating the target processing skill: Obtain the original sample corresponding to the defect object, similar samples with the same preset defect type as the defect object, difficult negative samples that should not be triggered relative to the applicable conditions of the target processing skill and correspond to preset interference conditions, and historical verification samples that have passed the verification of the same type of defect in the past. Based on the target processing skill, the processing flow is invoked to process each sample to obtain the execution result of each sample; Based on the execution results of each sample, the verification result of the target processing skill is determined.
11. The method of claim 10, further comprising, after determining the verification result of the target processing skill: If the verification result meets the preset release conditions, a release certificate for the target processing skill carrying rollback version information is generated. Register the target processing skill and the release certificate to the skill library.
12. A document processing method, comprising: Get the document to be processed; The document to be processed is pre-analyzed to obtain its task characteristics; Based on the task characteristics, a target processing skill is retrieved from the skill library, wherein the target processing skill is generated according to the method described in claim 1; Based on the target processing skill, a processing stream is invoked to perform processing actions on the document to be processed, and the processing result of the document to be processed is obtained.
13. The method according to claim 12, wherein retrieving the target processing skill from the skill base based on the task characteristics comprises: Based on the task characteristics, the candidate processing skills in the skill library are filtered according to the applicable conditions and the processing module version to obtain the filtering results; Based on the similarity between the task features and the applicable conditions of each candidate processing skill in the filtering results, candidate processing skills are recalled from the filtering results to obtain the recall results; The recall results are sorted to obtain a sorting result; Based on the ranking results, the target processing skill is determined.
14. The method according to claim 12, wherein performing processing actions on the document to be processed based on the target processing skill includes: When there are multiple target processing skills, the skill conflict result is determined based on the processing dependencies between the multiple target processing skills. Based on the skill conflict results, constraint solving is performed on multiple target processing skills to obtain skill binding results; The processing action is executed according to the skill binding result, and the execution conditions and invariants of each target processing skill are verified during the execution of the processing action. If the verification result meets the preset abnormal conditions, bypass processing is performed on the corresponding target processing skill, or rollback processing is performed based on the historical processing skill corresponding to the target processing skill.
15. The method according to claim 12, further comprising, after obtaining the processing result of the document to be processed: If the processing result shows a defect type that is claimed to be covered by the target processing skill, the defect type is used as a recurrence signal of the target processing skill, and the retrieval weight of the target processing skill in the skill library is reduced. Alternatively, rollback processing can be performed based on the historical processing skills corresponding to the target processing skill.
16. A skill deployment method, comprising: Obtain the target processing skill generated according to the method described in claim 1 and the release certificate of the target processing skill; According to the applicable conditions and version indicated by the release certificate, the target processing skill is registered to the skill library, and a binding relationship is established between the target processing skill and the corresponding processing module in the processing flow; The skill library and the processing stream are deployed on the learning control plane and task data plane of the document processing platform, respectively. The skill library and the processing stream are interconnected through stable object identifiers and versioned data structures. When the task characteristics of the document processing task meet the applicable conditions, the processing flow is invoked to perform the processing action according to the binding relationship, and the retrieval weight of the target processing skill in the skill library is updated according to the processing result generated by the execution of the processing action.
17. A method for displaying defect tracing information, comprising: Acquire the processing stream records and exception handling results generated by the processing stream processing the target document, wherein the exception handling results include the defect object of the target document; Based on the dependencies between processing objects in the processing stream record, an object-level error cause-effect graph is constructed, and along the object-level error cause-effect graph, the candidate processing module corresponding to the defective object and the responsibility value corresponding to each candidate processing module are determined. A display interface is generated based on the page image of the target document. The display interface includes the page image, the position of the defective object in the page image, the candidate processing module, the dependency relationship between the defective object and the candidate processing module, and the responsibility value. In response to the selection operation of the target processing module in the display interface, the processing flow record corresponding to the target processing module, the evidence of the defect object, and the target processing skill corresponding to the target processing module are displayed.
18. A document processing platform, comprising a learning control plane and a task data plane; The learning control plane includes a skill generation module, which is used to obtain the processing flow records and exception handling results generated by calling the processing flow to process the target document, determine the candidate processing module based on the dependency relationship between the processing objects in the processing flow record, call the downstream processing module to obtain the reference processing result based on the reference output data of the candidate processing module, generate the target processing skill based on the target responsibility module determined therefrom, and register the target processing skill and the release certificate of the target processing skill to the skill library. The task data plane includes a document processing module, which is used to acquire a document to be processed, pre-analyze the document to be processed to obtain task features, retrieve target processing skills from the skill library based on the task features, and perform processing actions on the document to be processed based on the target processing skills to obtain the processing result of the document to be processed. The learning control plane and the task data plane are interconnected through stable object identifiers and versioned data structures.
19. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 17.
20. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 17.
21. A computer program product comprising computer-executable instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 17.
