A bill processing method and system based on reversible processing and abnormal driving reconstruction
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG YUEXIHU TECH CO LTD
- Filing Date
- 2026-05-15
- Publication Date
- 2026-08-07
AI Technical Summary
在异常检测方面,仅依靠简单记录的关键信息难以全面、精准地定位异常,容易出现误判或漏判情况;异常处理时,人工排查与手动调整效率低下,且难以准确把握各环节间的依赖关系,可能导致处理不彻底的问题
[0010] In this embodiment, rollback and path reconstruction driven by anomaly detection are used to achieve reversibility and automatic error correction in ticket processing, thereby improving processing accuracy, completeness and system robustness.
Smart Images

Figure CN122528811A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of bill processing technology, specifically relating to a bill processing method and system based on reversible processing and exception-driven reconstruction. Background Technology
[0002] With the continuous expansion of the bill business, the volume of bills processed has increased dramatically and the types of bills have become increasingly complex. Ensuring efficient, accurate, and stable bill processing, and guaranteeing smooth connections between all stages, is crucial for the normal operation of the business. Therefore, it is imperative to improve the monitoring and anomaly handling mechanisms of the bill processing process.
[0003] The process begins by acquiring the invoice data, which is then processed sequentially through various pre-defined steps. Key information is recorded during processing. Once processing is complete, the result is output directly. If any anomalies occur, the process is typically handled manually by identifying the cause. The affected step and any subsequent steps are then manually adjusted or reprocessed before the entire process is executed again to obtain the final result.
[0004] Existing technologies have significant shortcomings when dealing with complex invoice processing scenarios. In terms of anomaly detection, relying solely on simply recorded key information is insufficient for comprehensively and accurately locating anomalies, easily leading to misjudgments or omissions. During anomaly handling, manual investigation and adjustment are inefficient and make it difficult to accurately grasp the dependencies between various steps, potentially resulting in incomplete processing. Summary of the Invention
[0005] This application provides a method and system for processing invoices based on reversible processing and anomaly-driven reconstruction, addressing the significant shortcomings of existing technologies in handling complex invoice processing scenarios. Regarding anomaly detection, relying solely on simply recorded key information is insufficient for comprehensive and accurate anomaly localization, easily leading to misjudgments or omissions. In anomaly handling, manual investigation and adjustment are inefficient and struggle to accurately grasp the dependencies between different stages, potentially resulting in incomplete processing.
[0006] In a first aspect, embodiments of this application provide a ticket processing method based on reversible processing and exception-driven reconstruction, the method comprising: Acquire target invoice data, perform phased processing on the target invoice data based on a preset processing flow, and record the status information during the processing to obtain complete processing trajectory data; Based on the processing trajectory data, a processing node sequence relationship is constructed to obtain a processing node sequence. Based on the processing node sequence, node filtering and state consistency analysis are performed, and anomaly determination is performed based on preset anomaly classification rules. If an anomaly is determined to exist, an anomaly detection result is generated in the ticket processing process. Based on the abnormal state detection results and the processing node sequence, abnormal propagation analysis and source localization processing are performed to obtain the target processing node and rollback control information corresponding to the abnormal source. Based on the rollback control information, selective rollback processing is performed on the target processing node and its dependent processing nodes in the processing node sequence to obtain the intermediate processing state after rollback. Based on the abnormal state detection results and intermediate processing states, a target processing strategy corresponding to the abnormal state detection results is determined from the preset processing strategy library, and an alternative processing path is generated and executed based on the target processing strategy to obtain the reconstructed processing result. Based on the parsing of the processing trajectory data, the processing result data corresponding to the original processing path is obtained, and the processing result data and the reconstructed processing result are fused to obtain the optimized ticket processing result; If the optimized bill processing result meets the preset processing requirements, the bill processing result will be transmitted to the control center.
[0007] Secondly, embodiments of this application provide a ticket processing system based on reversible processing and exception-driven reconstruction, the system comprising: The data acquisition module is used to acquire target ticket data, perform staged processing on the target ticket data based on a preset processing flow, and record the status information during the processing to obtain complete processing trajectory data. The processing trajectory construction module is used to construct the processing node sequence relationship based on the processing trajectory data to obtain the processing node sequence, perform node screening and state consistency analysis based on the processing node sequence, and determine anomalies based on preset anomaly classification rules. If an anomaly is determined to exist, an anomaly detection result is generated in the ticket processing process. An anomaly source analysis module is used to perform anomaly propagation analysis and source localization processing based on the anomaly state detection results and the processing node sequence, to obtain the target processing node and rollback control information corresponding to the anomaly source. The rollback processing module is used to selectively roll back the target processing node and its dependent processing nodes in the processing node sequence based on the rollback control information, so as to obtain the intermediate processing state after rollback. The alternative path generation module is used to determine the target processing strategy corresponding to the abnormal state detection result from the preset processing strategy library based on the abnormal state detection result and the intermediate processing state, and generate and execute the alternative processing path based on the target processing strategy to obtain the reconstruction processing result. The result fusion module is used to parse the processing trajectory data to obtain the processing result data corresponding to the original processing path, and to fuse the processing result data and the reconstructed processing result to obtain the optimized ticket processing result. The result transmission module is used to transmit the optimized bill processing result to the control center if the optimized bill processing result meets the preset processing requirements.
[0008] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0010] In this embodiment, rollback and path reconstruction driven by anomaly detection are used to achieve reversibility and automatic error correction in ticket processing, thereby improving processing accuracy, completeness and system robustness. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating a ticket processing method based on reversible processing and exception-driven reconstruction provided in Embodiment 1 of this application. Figure 2 This is a flowchart illustrating a ticket processing method based on reversible processing and exception-driven reconstruction provided in Embodiment 2 of this application. Figure 3 This is a schematic diagram of the structure of a ticket processing system based on reversible processing and exception-driven reconstruction provided in Embodiment 3 of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in Embodiment 4 of this application. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0013] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0014] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0015] The following description, in conjunction with the accompanying drawings, details a ticket processing method and system based on reversible processing and exception-driven reconstruction provided in this application, through specific embodiments and application scenarios.
[0016] Example 1 Figure 1 This is a flowchart illustrating a ticket processing method based on reversible processing and exception-driven reconstruction provided in Embodiment 1 of this application. Figure 1 As shown, the specific steps include the following: S101, acquire target ticket data, perform phased processing on the target ticket data based on a preset processing flow and record the status information during the processing to obtain complete processing trajectory data.
[0017] The target bill data refers to the summary of all bill information that needs to be processed, covering business attribute data such as bill number, transaction amount, transaction time, issuer information, and payee information.
[0018] The preset processing flow is a standardized business processing procedure specification that is formulated in advance for the target invoice data. It clarifies the operating principles, execution order, data transmission methods between nodes, and specific requirements for status recording for each processing node.
[0019] Processing trajectory data is a complete process record generated as the target ticket data progresses according to the preset processing flow. It includes the input and output information, execution status, time record, dependencies between nodes, exception indicators, and other relevant status details for each processing node.
[0020] Multi-table joins are performed using database middleware. Core business attributes such as invoice number, amount, issuer, and payee are extracted from the production environment, and a missing value imputation algorithm is synchronously invoked to repair incomplete fields in real time. Using a Python time series plugin, various business times are uniformly converted into high-precision standard timestamps, and sensitive account information is then anonymized using MD5 or obfuscation algorithms. Before the data is stored in the distributed cache, invalid records with abnormal amounts or duplicate invoice numbers are filtered out using Boolean logic validation functions, ultimately resulting in target invoice data with complete attributes and a uniform format.
[0021] Driven by a pre-defined processing flow, the microservice orchestration engine processes target invoice data according to the execution order defined in the YAML script. At the data verification node, a JSONSchema validator performs data compliance checks; at the account matching node, Redis hash retrieval is used to quickly complete the information of the counterparty. The system automatically collects input and output data from each node using AOP aspect-oriented programming, generates unique node identifiers using the Snowflake algorithm, records precise execution status using NTP time synchronization, and pushes fine-grained processing information to the message flow engine in real time, forming a phased processing record.
[0022] Leveraging the topology analysis capabilities of the streaming computing framework, the input / output identifiers and jump IDs in the staged processing records are parsed to reconstruct the business execution logic path. A depth-first search algorithm is used to determine node dependencies and data flow, and attribute mapping is used to extract constraints and criticality indicators for each node. Dynamic execution processes and static configuration attributes are integrated, and standardized execution path data is formed through DAG modeling, providing structured support for constructing processing trajectory data containing anomaly markers and dependency information.
[0023] By sorting and analyzing the association matrix, the execution sequence of nodes is reorganized according to the timeline and logical dependencies, and a set of nodes to be verified on the core execution chain is selected using preset weights. Cosine similarity or consistency measurement methods are used to compare the deviation of each node's actual state from the standard trajectory. When the deviation exceeds a threshold, an anomaly classification engine is automatically activated for pattern matching. Combined with Logback stack tracing and anomaly labeling, detailed detection results are generated to ensure accurate location of anomaly types and associated nodes in the processed trajectory data.
[0024] For identified anomalies, the system matches corresponding remediation solutions from the policy configuration library and generates alternative processing flows using dynamic proxy technology. After the alternative logic is executed, a data fusion algorithm is used to compare the reconstruction results with the original records, and data overwriting is completed according to timestamp order and state consistency rules. Finally, the Protobuf serialization protocol is used to complete information normalization processing, generating complete processing trajectory data containing input / output, execution status, time information, dependencies, and anomaly identifiers.
[0025] Based on the above technical solution, optionally, the target ticket data can be processed in stages according to a preset processing flow, and the status information during the processing can be recorded to obtain complete processing trajectory data, including: The target invoice data is formatted and cleaned to obtain standardized input data; Based on a preset processing flow, standardized input data is parsed and features are extracted at multiple levels to obtain the processing results at each stage. Based on the processing results of each stage, state transition tracking and data storage are performed to obtain complete processing trajectory data.
[0026] In this solution, standardized input data is data generated after formatting, cleaning, and verification of the target invoice data, possessing a unified structural specification and coding standard. It includes all core content such as invoice number, transaction amount, transaction time, and information on the issuer and payee. Redundant information has been cleaned up, missing data has been supplemented, and sensitive information has been anonymized.
[0027] The stage processing result is a summary of all data output after each processing node or segment in the preset processing flow has completed its operation. It includes backups of the input data for that node, specific operational results, running status, time records, and any possible anomaly markers.
[0028] Raw target invoice data, including invoice number, amount, and payee / payer information, is collected from various business systems. Distributed ETL tools are used to perform data cleaning. Redundant special characters in the fields are identified and cleaned using regular expression matching algorithms, while mean imputation or business logic inference algorithms are simultaneously called to fill in missing transaction times and key business attributes. Next, sensitive account information is anonymized using AES symmetric encryption or masking techniques, and all values are converted to a unified encoding standard and ISO date structure using Python's data warping functions. This process removes noise from the raw data, ultimately generating standardized input data with a unified structure in a high-performance cache.
[0029] The standardized input data is fed into a microservice-based process execution engine, strictly adhering to the operational guidelines defined in the pre-defined processing flow. The engine uses tag-based routing technology to perform multi-level data parsing and distributes tasks to specific processing nodes such as data verification, account matching, and limit review according to the execution order. At each processing stage, feature extraction algorithms are used to extract key decision variables from the invoice attributes, and transaction processing logic is invoked to complete the specific operations. After each node completes its operation, the system synchronously backs up the input data using object persistence technology and records the running status, specific operation results, and nanosecond-level time records. If logical deviations occur, exception handling is used to mark exceptions, thereby generating detailed stage processing results.
[0030] While each node produces its processing results, distributed tracing technology is used to track its state transitions. The system uses the TraceID association mechanism to capture the data transmission methods between nodes and dynamically constructs a dependency graph between nodes by parsing the parent-child dependency identifiers of each processing stage. An asynchronous message queue persistence mechanism is used to write the operation results, time records, and anomaly identifiers of each stage to the distributed graph database in real time, ensuring the logical continuity of the processing. A data aggregation engine summarizes and archives the state details of all stages, ultimately forming a complete processing trajectory data that records the information and dependencies of each node from the initial input to the final output.
[0031] This solution enables standardized and phased processing of invoice data, as well as full-process status tracking, thereby improving data quality and processing controllability.
[0032] S102, construct the processing node sequence relationship based on the processing trajectory data to obtain the processing node sequence, perform node screening and state consistency analysis based on the processing node sequence, and determine the anomaly based on the preset anomaly classification rules. If an anomaly is determined to exist, generate the anomaly state detection result in the ticket processing process.
[0033] The processing node sequence is a list of nodes organized according to the execution order of the bill processing flow. Each node corresponds to a specific operation step in the processing flow, such as data verification, account matching, payment confirmation, etc., and also includes the input and output data, execution status, time record, and logical relationship information between the node and the preceding and following nodes.
[0034] Pre-defined anomaly classification rules are pre-established anomaly judgment standards. Their core function is to classify and define abnormal behaviors or states based on the execution results and state consistency detection data of each node. These rules cover various forms, including threshold judgment, pattern matching, and business logic constraints, such as judging excessive amounts, judging duplicate invoice numbers, and matching abnormal status codes.
[0035] Anomaly detection results are generated by filtering nodes in the processing node sequence, analyzing state consistency, and determining anomalies based on preset anomaly classification rules. These results are specifically used to describe various anomalies occurring during ticket processing. They include the anomaly type (the specific anomaly category determined according to preset classification rules) and anomaly state details, including deviations in input / output data, state consistency detection values, and anomaly-specific identifiers.
[0036] Scattered process records are extracted from the processed trajectory data. A timestamp sorting algorithm is used to align all records temporally, ensuring that each specific operation step is arranged according to its actual execution order. To establish the logical connections between each step, a directed acyclic graph (DAG) traversal technique is used to link operations such as data verification and account matching into a logical chain by matching the jump markers of preceding and following nodes in the trajectory data. Simultaneously, a JSON parsing library is used to extract the input and output data, execution status, and time records corresponding to each node. Finally, this information, possessing temporal sequence and logical topology, is organized into a structured sequence of processing nodes.
[0037] Based on the generated processing node sequence, filtering operators in streaming data processing are used to perform node screening, eliminating redundant and non-critical steps, and retaining only the node list involving core business attributes such as amount calculation and payment confirmation. For the screened nodes, a hash verification algorithm is used to compare the feature values of the data before and after transmission at each stage to detect whether there is any unexpected tampering or loss. Next, a difference comparison tool is used to compare the input data of the current node with the output data of the previous node, and calculate and record the consistency metric value between the nodes. This process completes a deep scan of the sequence and produces an intermediate dataset containing deviation metrics and core link information.
[0038] After obtaining the state consistency metric, pre-defined anomaly classification rules, defined in YAML format, are introduced for real-time judgment. Using Boolean logic operations in the rule engine, the execution results of each node are compared with pre-defined threshold judgment criteria, outputting the logical judgment result. For cases of duplicate ticket numbers or abnormal status codes, a regular expression matching engine is used to identify whether they conform to pre-defined pattern matching criteria or business logic constraints. If any step violates the rule red line, the system automatically triggers conditional branch jump logic, defining the specific category of the anomaly according to the rule base definition, ensuring that every deviation behavior is accurately linked to the pre-defined classification rules.
[0039] If an abnormal state is determined, the system immediately uses metadata mapping technology to encapsulate the determination result into a final abnormal state detection result. Based on the rule-based determination result, the system assigns a precise abnormal type label to the record and integrates the input-output data deviation extracted by the difference comparison function through an object serialization protocol. Finally, this information, along with the previously calculated state consistency detection value and the abnormal-specific identifier, is written into a persistent abnormal state record.
[0040] S103, based on the abnormal state detection results and the processing node sequence, perform abnormal propagation analysis and source localization processing to obtain the target processing node and rollback control information corresponding to the abnormal source.
[0041] A target processing node is a node in the ticket processing node sequence that is directly affected by an abnormal state and requires rollback, correction, or alternative processing. It is typically a critical downstream node in the propagation path of the anomaly source node, including nodes whose processing results or status may be altered by the anomaly. A target processing node can be a single node or a set of multiple nodes, identifying the specific processing stage affected by the anomaly.
[0042] Rollback control information is a collection of rules and parameters for the entire rollback operation, used to standardize the undo process of the target processing node and its associated dependent nodes. It covers various triggering conditions, execution order requirements, and parameter configuration standards. It determines the start time based on state deviation ranges and exception type matching conditions, defines the sequential execution logic according to business dependencies, and defines state recovery methods and intermediate data retention strategies.
[0043] By utilizing the anomaly-specific identifiers in the anomaly detection results, reverse index retrieval technology is used to pinpoint the starting point of the anomaly within the processing node sequence. To analyze the anomaly's propagation path in the business chain, a depth-first traversal algorithm using a graph database is employed to trace downstream along the logical connections recorded in the sequence. Through simulated data flow deduction techniques, it is observed how input-output deviations in the anomaly details propagate along dependencies, identifying subsequent stages where the processing results may have logically shifted due to the anomaly source. This process reconstructs isolated anomaly points into dynamic propagation paths, thereby initially narrowing down the range of affected target processing nodes.
[0044] For the identified propagation path, a business impact assessment algorithm is used to scan each link in the path. By invoking data shadow comparison technology, the originally expected processing result of each node is cross-compared with the predicted state after the anomaly, filtering out nodes whose state consistency metric values exceed the safety threshold. These nodes identify the specific processing links affected by the anomaly; whether it is a single payment confirmation point or a set of multiple account matching, they are all marked as objects requiring rollback or correction using Boolean logic decision functions. Finally, object serialization technology is used to integrate the identifiers of these links with their impact levels, resulting in a list of target processing nodes that clearly reflects the endpoint of the anomaly propagation.
[0045] After identifying the affected stages, rollback control information was constructed to standardize the reversal process. Utilizing the logical definition capabilities of the rule orchestration engine, exception type matching conditions and state deviation ranges were set as trigger conditions for the rollback operation, clarifying the initiation timing. Next, using a topology sorting algorithm, the execution order of the target processing node and its associated dependent nodes was calculated based on the business dependencies defined in the processing node sequence. This ordering requirement ensures that, during reversal, downstream affected stages are cleaned up before upstream stages, thus defining the execution order through logical sorting technology and preventing secondary conflicts in data state during recovery.
[0046] Finally, to refine the execution standards of the rollback process, parameter mapping technology is used to configure standard parameters for each rollback step. By invoking database snapshot recovery technology or log rollback functionality, the state recovery method for each node is clearly defined to ensure accurate restoration to the legitimate state before the anomaly occurred. Simultaneously, asynchronous data persistence technology is used to formulate a retention strategy for intermediate data, writing state changes during the rollback process to backup storage in real time, forming a complete parameter configuration standard. Ultimately, these triggering conditions, execution order, parameter configurations, and retention strategies are aggregated into a complete rollback control information set.
[0047] S104, based on the rollback control information, selective rollback processing is performed on the target processing node and its dependent processing nodes in the processing node sequence to obtain the intermediate processing state after rollback.
[0048] Dependent processing nodes are processing nodes in a sequence of processing nodes whose execution result or status depends on the data output or operation completion status of their preceding nodes. These nodes may affect the correctness or integrity of the target processing node, therefore, when performing a rollback operation, their rollback needs to be considered before or simultaneously with it.
[0049] Intermediate processing status is a real-time snapshot of the status and data of each relevant processing node during the rollback operation, covering the target processing node and all its dependent processing nodes. It fully records the input and output content, current execution status, time information, and association details with related dependent nodes for each node.
[0050] Based on the triggering conditions defined in the rollback control information, a recursive graph traversal algorithm is used to perform reverse tracing in the processing node sequence. By retrieving the preceding dependencies in the adjacency matrix, those dependent processing nodes whose data output or operation completion directly determines the correctness and integrity of the target processing node are accurately identified. Logical association matching technology is used to group these dependent nodes with the target node, ensuring that all nodes at critical positions in the data link are included in the selective rollback candidate range during rollback, thereby identifying the accurate operation targets for subsequent operation steps.
[0051] After locking down the node range, the system invokes workflow orchestration logic to initiate the rollback procedure strictly according to the execution order required by the rollback control information. Utilizing the Saga pattern's compensatory transaction technology, corresponding state reversal operations are performed for each target processing node and its dependent processing nodes. By invoking the database's Savepoint management function and transaction rollback commands, the affected business data is restored to its valid image before the anomaly occurred, and preset parameter configuration standards are applied to ensure data format consistency during the recovery process. This selective rollback process eliminates interference from irrelevant links, ensuring that the reversal action only affects critical nodes in the anomaly propagation path.
[0052] At the instant the rollback action is executed, AOP interceptor technology is used to capture the dynamic changes of each node in real time. Whenever a dependent or target processing node completes a state change, the system triggers the object serialization protocol to encapsulate the node's current input / output content, execution state, and time information into a data snapshot. Unique identifiers generated by distributed tracing technology are used to bind these snapshots to the association details of the associated dependent nodes. Using high-performance log persistence tools, this real-time captured data is written to the cache at high speed, ensuring that every tiny change during the rollback process is accurately recorded.
[0053] Finally, the various snapshots generated during the rollback process are summarized through a data aggregation pipeline to generate an intermediate processing state. Metadata integration technology is used to uniformly model the real-time status, data snapshots, and logical details of related dependent nodes for each relevant processing node. By applying the JSON structured storage protocol, it is ensured that the state record fully covers the input / output offsets and timestamp information of each node.
[0054] S105, based on the abnormal state detection result and the intermediate processing state, determine the target processing strategy corresponding to the abnormal state detection result from the preset processing strategy library, and generate and execute the alternative processing path based on the target processing strategy to obtain the reconstruction processing result.
[0055] The pre-built handling strategy library is a collection of pre-built solutions that includes standardized handling methods for various abnormal scenarios. Each strategy in the library clearly defines the operation process, node execution order, data processing rules, and related requirements for rollback and alternative handling in the corresponding abnormal scenario.
[0056] The target handling strategy is a customized solution derived from a pre-defined handling strategy library by matching and filtering the current anomaly detection results with the intermediate handling status. This strategy clearly defines the node operations that need adjustment and correction, the overall execution sequence, and the implementation method.
[0057] The refactoring process results in a complete set of data and status information regenerated after the alternative process has been run according to the target processing strategy. The content fully reflects the operational status of the invoice business after the anomaly repair is completed, covering the input and output content, operational status, time records, and data dependencies of each node.
[0058] The system retrieves suitable handling solutions from a pre-defined handling strategy library. Using pattern matching-based search technology, it indexes the anomaly types and unique identifiers from anomaly detection results and performs logical conditional comparisons within the library. Simultaneously, combining real-time data snapshots recorded in intermediate processing states with the current execution status of each node, a multi-dimensional vector matching algorithm is used to filter out solutions that conform to the current business constraints in terms of operation flow, node execution order, and data processing rules. Through conditional logic filtering functions, strategies that do not meet the current rollback and alternative handling requirements are eliminated, ultimately locking in a target handling strategy within the library that clearly defines adjustment and correction actions, the overall execution order, and the implementation method.
[0059] After determining the strategy, the system begins to transform the target processing strategy into an executable instruction set. Utilizing dynamic process orchestration technology, the logical paths in the processing node sequence are automatically adjusted according to the node operation requirements defined in the strategy, thereby generating alternative processing paths for anomaly repair. Through API call mapping technology, the original fault logic is redirected to the alternative nodes defined in the strategy, and the input / output content of the nodes and their business dependencies are reconfigured using a data mapping plugin. This process utilizes a code hot-loading mechanism to ensure that the new execution order takes effect in real time, enabling the invoice business to bypass the anomaly source and resume operation on the new logical path.
[0060] After the alternative processing path is generated, the system drives the business flow into the execution phase. Utilizing distributed transaction coordination technology, each affected ticket is reprocessed strictly according to the node execution order required by the target processing strategy. During the execution of each node, real-time data capture technology dynamically records the post-operation status, input / output results, and nanosecond-level time records. A distributed locking mechanism is applied to ensure data consistency during the alternative processing, preventing logical conflicts caused by multi-node concurrency, and ensuring that the business logic of each node is fully reproduced in the corrected environment.
[0061] Finally, by summarizing and verifying the data generated from the alternative process, the final refactoring result is formed. Using a metadata integration protocol, the complete set of data and status information generated after the repair is unified and encapsulated, fully reflecting the actual operation of the ticket business after the anomaly handling. By invoking data tracing technology, the dependency mapping between each node is re-established, and JSON serialization persistence technology is used to store the complete dataset containing the input and output content, operating status, time records, and data dependency associations of each node into the database.
[0062] Based on the above technical solution, optionally, based on the abnormal state detection result and the intermediate processing state, a target processing strategy corresponding to the abnormal state detection result is determined from a preset processing strategy library, and an alternative processing path is generated and executed based on the target processing strategy to obtain a reconstructed processing result, including: Based on the abnormal state detection results and intermediate processing states, a strategy matching and retrieval is performed from the preset processing strategy library to obtain the target processing strategy. Based on the target processing strategy, alternative processing paths are planned for the intermediate processing state to obtain alternative processing paths. The processing node is reconstructed based on the alternative processing path to obtain the reconstruction processing result.
[0063] In this solution, the alternative processing path is a new node execution sequence and operation plan planned according to the target processing strategy when some nodes become abnormal due to anomalies or rollbacks in the original processing flow. It is used to replace or correct the original abnormal path to ensure the continuity of business logic and the achievement of processing objectives.
[0064] The system retrieves the anomaly type and anomaly state details recorded in the anomaly state detection results, and simultaneously retrieves the intermediate processing state snapshot generated after the rollback operation. Using multi-dimensional feature mapping technology or semantic index matching algorithms, it performs a global search in a preset processing strategy library, using the anomaly-specific identifier, input / output deviation values, and real-time data features of the current node as input vectors. By calculating the logical correlation or similarity score between the current anomaly feature cluster and the standardized handling solutions in the library, it selects the solution that best matches the current business scenario and anomaly pattern. This process involves in-depth analysis and benchmarking of the operation flow, node order, and data rules of each handling method in the strategy library, thereby accurately identifying the specific solution that can correct the current deviation and meet business continuity requirements, ultimately resulting in a target processing strategy with a clear adjustment and correction scope and execution time.
[0065] Based on the established target processing strategy, a secondary scan is performed on the execution environment of processing nodes in the intermediate processing state. Utilizing dynamic routing planning techniques or directed acyclic graph reconstruction algorithms, and taking the rollback-after-safety checkpoint as the logical starting point, the logical topology of affected nodes is rearranged according to the node execution order and data processing rules defined in the target processing strategy. During the rearrangement process, logical branch prediction and resource conflict detection techniques are introduced to logically replace and correct previously failed or contaminated execution branches, ensuring that the newly generated execution logic can bypass the root cause of the anomaly and achieve the predetermined business objectives. This process integrates discrete repair actions into a set of node execution sequences and operation schemes with strict temporal relationships, thereby obtaining alternative processing paths that ensure the continuity of business logic.
[0066] The automated script engine or state machine execution mechanism is invoked to drive each processing node in the alternative processing path into the reconstruction execution phase. According to the execution logic and parameter configuration set in the path, the recalculation of specific business operators such as data verification, account matching, or payment confirmation is triggered sequentially. During execution, transaction-level compensation technology or idempotent execution guarantee mechanisms are used to capture and verify each data interaction in the alternative process in real time, ensuring that the output of each stage meets the rules required by the target processing strategy. By fully digitizing the input and output content, running status, timestamps, and newly formed dependencies of each node, and using data structuring encapsulation technology to integrate the above-mentioned restored business panorama information, a complete reconstruction processing result reflecting the restored operation of the invoice business is finally generated.
[0067] In this solution, by using alternative processing paths, the execution order of nodes can be quickly adjusted in case of anomalies or rollbacks, ensuring the continuity of ticket processing and improving system fault tolerance and business recovery efficiency.
[0068] S106, based on the processing trajectory data, the processing result data corresponding to the original processing path is obtained, and the processing result data and the reconstructed processing result are fused to obtain the optimized ticket processing result.
[0069] The original processing path is a complete node operation chain formed by the normal execution of the target invoice data according to the preset processing flow. It covers the execution order, data flow logic and real-time running status of all processing nodes.
[0070] The processing result data consists of various data and status records accumulated after the business completes the entire process along the original processing path. It includes the input and output content of each node, execution status, time log, data change records, and anomaly marker information.
[0071] The invoice processing results integrate the processing results from the original path with the reconstructed processing results after anomaly repair, and belong to the final business data after integration and summarization. It comprehensively reflects the overall status of the invoice after rollback correction and alternative process operation, and gathers node operation records, data consistency status, time information, and anomaly handling markers.
[0072] All log carriers related to the initial business logic are extracted from the processing trajectory data. Using timeline linear reconstruction technology, the discrete node records are rearranged according to the original trigger order. By matching the process definition identifiers in the logs, a topology mapping algorithm is used to outline the complete node operation chain formed when the target ticket data is executed normally according to the preset processing flow, establishing the execution order and data flow logic of each node. On this basis, structured data extraction tools are used to capture the input and output content, execution status, and time ledger of each node in the chain, and database change tracking technology is used to capture every data change record. If there are error interruptions in the trajectory, the exception capture handle is used to automatically extract the exception marker information, thereby accumulating the processing result data reflecting the complete picture of the original business in memory.
[0073] After acquiring the processing results and the reconstructed processing results generated from anomaly repair, the system aligns the two datasets using multi-version concurrency control logic. Utilizing primary key index matching technology, the system uses the ticket number and unique node identifier as anchor points to associate the affected node data in the original processing path with the repaired data in the reconstructed path. Through a data version conflict algorithm, the system automatically identifies failed records with anomaly markers in the original processing results and uses atomic overwrite operations to update the corresponding node positions with the new state after rollback correction and replacement process execution in the reconstructed results. This process ensures that, at the data level, the repaired nodes accurately replace the faulty nodes while preserving the undisturbed normal node records in the original path.
[0074] After data replacement, the merged dataset is scanned using end-to-end consistency verification technology. Logical consistency checks are performed to verify whether data dependencies between nodes still meet business constraints after merging. Timestamp synchronization correction technology is used to calibrate the time logs of the original processing path with the time information of the replacement process. The system utilizes a metadata merging protocol to deeply integrate node operation records, data change information, and final anomaly handling markers, ensuring logical continuity of the merged data flow. This step eliminates data silos generated at different processing stages, providing logical verification support for generating final business data covering the entire lifecycle of invoices.
[0075] Finally, data serialization and persistence technology is used to encapsulate the integrated full information into a ticket processing result. By calling the document integration function of a non-relational database, the inputs and outputs, execution status, time information, and anomaly repair details of each processing node are compiled into a complete final business file. Visual tracking and modeling technology is used to structurally annotate the overall state differences before and after rollback correction, ensuring that every business change is traceable.
[0076] Based on the above technical solution, optionally, the processing result data and the reconstruction processing result are fused to obtain an optimized invoice processing result, including: Based on the processing result data and the reconstruction processing result, result consistency alignment and deviation analysis are performed to obtain the fused input dataset; Based on the fused input dataset, the results are fused to obtain the optimized invoice processing results.
[0077] In this solution, the fusion input dataset refers to the unified dataset after aligning the processing result data corresponding to the original processing path with the reconstructed processing result according to node order, status and business attributes, and combining it with deviation analysis.
[0078] The system acquires the processing result data accumulated along the original processing path and the reconstructed processing results generated according to the alternative process, and initiates a structured alignment procedure for the cross-source data. Using primary key mapping technology or multi-dimensional feature matching algorithms, it performs high-precision alignment of node identifiers, input / output content, and business attributes in the two sets of results, ensuring that the originally discrete original path records and the repaired reconstructed records are consistent on the logical spatiotemporal axis. Subsequently, it introduces difference comparison technology or logical conflict detection algorithms to perform in-depth deviation analysis on the aligned data items, quantifying the degree of deviation of each node in data change records, execution status, and anomaly markers. Through data normalization and format normalization techniques, it logically aggregates the effective baseline data of the original path and the repaired data of the reconstructed path according to the node execution order, thereby obtaining a fused input dataset that integrates the deviation analysis conclusions, covers the status of all nodes, and has unified business attributes.
[0079] The fusion input dataset is acquired, and the process proceeds to the global data decision-making and state integration stage. Using a weighted fusion algorithm or a conflict resolution mechanism based on a rule engine, the optimal execution records for each processing node are dynamically filtered and extracted from the dataset according to preset business priorities and data confidence weights. For nodes with deviations or marked as abnormal, data reconciliation technology or state compensation logic is employed to seamlessly overwrite the repaired data in the reconstructed processing results onto the original abnormal locations. Simultaneously, referential integrity checking technology is used to ensure that the fused node operation records, time information, and abnormal handling markers are logically closed-loop throughout the entire process. Finally, through data aggregation and encapsulation technology or structured summarization algorithms, these corrected and verified node states and time ledgers are fully integrated to generate an optimized invoice processing result that gathers all corrected information and comprehensively reflects the overall operation of the invoice after rollback and replacement processing.
[0080] This solution integrates the original and reconstructed results, eliminates data discrepancies, ensures processing consistency, and improves the accuracy and reliability of invoice processing results.
[0081] S107, if the optimized ticket processing result meets the preset processing requirements, the ticket processing result is transmitted to the control center.
[0082] Pre-defined processing requirements are standardized criteria established in advance for bill processing, used to measure whether the overall processing results meet business standards and operational objectives. These requirements cover aspects such as consistency of node status, accurate closure and classification of various anomalies, complete and error-free core business fields, and compliant time recording throughout the process.
[0083] The control center is the core management module in the entire bill business system, and plays a key role in unified management, real-time monitoring and process scheduling.
[0084] The system retrieves preset processing requirements from the configuration storage and uses automated audit scripts to verify the optimized invoice processing results across multiple dimensions. By invoicing data quality detection algorithms, it verifies the completeness and accuracy of core business fields such as invoice number, transaction amount, and invoice issuance and payment information. Logical consistency verification rules are applied to compare the state transitions between processing nodes against business specifications. For deviations during processing, state machine closed-loop analysis technology is used to confirm that all anomalies have been rolled back or substituted and accurately categorized. Simultaneously, timestamp difference calculation logic is used to determine whether the entire time record falls within the compliance range set by operational objectives, generating a compliance assessment report representing the achievement of processing standards.
[0085] After confirming that the processing results fully meet the preset processing requirements, the optimized ticket processing results are structured and encapsulated using Protobuf serialization technology, transforming them into high-density binary data packets. To ensure data security during transmission, the critical payload is encrypted using the RSA asymmetric encryption algorithm, and a tamper-proof digital signature is generated using the SHA-256 digest algorithm. By invoking distributed globally unique identifier generation technology, a unique transaction serial number is assigned to this transmission task, ensuring that the final business data, encompassing node operation records and anomaly handling markers, has unique traceability during the transfer process, preparing the data for entry into the control center.
[0086] Subsequently, a communication link with the control center was established using the high-throughput Kafka message middleware. A producer pattern was employed to push the encapsulated ticket processing results to the receiving queue. During transmission, a sliding window flow control protocol and automatic retransmission technology were used to monitor data packet delivery feedback in real time, ensuring that process scheduling instructions and business data could still be transmitted completely even under network fluctuations.
[0087] In this embodiment, rollback and path reconstruction driven by anomaly detection are used to achieve reversibility and automatic error correction in ticket processing, thereby improving processing accuracy, completeness and system robustness.
[0088] Example 2 Figure 2 This is a flowchart illustrating a ticket processing method based on reversible processing and exception-driven reconstruction provided in Embodiment 2 of this application. Figure 2 As shown, the specific steps include the following: S201, construct a processing node dependency graph based on the processing trajectory data, parse the data transmission and processing dependencies between processing nodes in the processing node dependency graph, and obtain the execution path and node dependency data of each processing node.
[0089] S202, parse the attribute information of each processing node in the processing node dependency graph to obtain the node attribute data of each processing node.
[0090] S203, based on the execution path, perform node order sorting and association analysis to obtain a processing node sequence containing each processing node.
[0091] S204. Based on the processing node sequence, perform node criticality analysis to select a set of nodes to be verified that are located in the critical execution link and meet the preset importance criteria.
[0092] S205, perform consistency verification based on the set of nodes to be verified and the preset consistency verification standard to obtain the state consistency measure of each node in the set of nodes to be verified.
[0093] S206, based on the state consistency measurement of each node to be verified, node attribute data and preset abnormal classification rules, anomaly determination is performed. If an abnormal state is determined to exist, an abnormal state detection result is generated in the ticket processing process.
[0094] In this embodiment, the processing node dependency graph is a graph structure that reflects the data transmission and processing dependencies between processing nodes during the ticket processing process. Nodes represent specific processing steps, and edges represent data flows or dependency constraints between nodes.
[0095] A processing node is a single operational step or business step in the bill processing flow, such as data verification, account matching, payment confirmation, etc. Each node includes input data, output data, and execution status.
[0096] An execution path is a sequence of continuous paths formed by processing nodes in a dependency graph according to business logic and data transmission order. It is used to depict the complete operation process of a ticket from its initial state to its final processing completion.
[0097] Node dependency data describes the specific information about the dependencies between nodes, including predecessor nodes, successor nodes, and dependency types.
[0098] Node attribute data records the inherent characteristics or meta-information of each processing node, such as node type, processing rules, key weight, data validation rules, etc.
[0099] Preset importance standards are reference rules used to measure the degree of influence or criticality of processing nodes in the entire business process, including the weight threshold or business priority of nodes in key execution links.
[0100] The set of nodes to be verified is a set of processing nodes that need to be checked for state consistency, selected based on node criticality analysis and preset importance standards.
[0101] The preset consistency verification standard is a reference specification or threshold set for the input and output data, execution status and data transmission integrity of the processing node, and is used to determine whether the node status meets the process requirements.
[0102] State consistency metric is a numerical indicator calculated by comparing the actual state of a node with a preset consistency standard. It is used to quantify the degree of state deviation or anomaly of a node during the processing.
[0103] The processing trajectory data is acquired, and using the directed acyclic graph (DAG) construction technique from graph theory, each operation recorded in the trajectory is abstracted as a vertex, and directed edges are established according to the data flow logic. During the construction process, an adjacency list storage structure is used to physically map the parent-child relationships between nodes and data flow constraints, thereby constructing a processing node dependency graph. Subsequently, a depth-first search algorithm is used to traverse all connected branches in the graph structure to extract the execution path representing the entire lifecycle of the ticket. Simultaneously, by scanning the logical constraint information carried by each edge in the graph, the preceding trigger items and subsequent response items of each node are recorded, generating node dependency data containing dependency types.
[0104] For each vertex in the processing node dependency graph, a feature vector corresponding to the node identifier is retrieved from the system's pre-set static configuration library using metadata retrieval technology. By performing attribute field mapping operations, the processing rules, key weights, and pre-set validation logic of the nodes are extracted in a structured manner, thereby matching precise node attribute data for each processing stage. By associating and aggregating the topological nodes in the graph structure with business metadata, a quantitative characterization of the inherent features of each processing stage is achieved.
[0105] The extracted execution path is obtained, and the discrete nodes on the path are linearly sorted using a timestamp serialization sorting algorithm. During the sorting process, logical association analysis technology is introduced. By examining the data pointer pointers between nodes and the business flow status, the input and output data streams and execution status records of the nodes are reconstructed into causal chains. This method can integrate the originally scattered path information into a sequence of processing nodes with a strict execution order, containing details of the input and output of each stage and logical association information.
[0106] For the generated processing node sequence, a weighted evaluation technique is initiated to analyze the criticality of each node. Specifically, the weight coefficients in the node attribute data are combined with the node's traffic contribution in the execution path for calculation. Based on this, Boolean filtering logic is invoked to compare the calculation results with a preset importance standard threshold, eliminating nodes in non-core execution links or with low weight levels. Through this multi-dimensional feature filtering method, nodes located in critical execution links and meeting the importance requirements are accurately extracted from the processing node sequence, forming a set of nodes to be verified.
[0107] All members in the set of nodes to be verified are obtained, and the preset consistency verification standard is loaded synchronously. Using data difference comparison technology, the actual execution state snapshot, input data volume, and output data value of each node are compared item by item with the expected values in the standard specification. By applying the deviation quantification calculation method, the numerical deviation or logical mismatch between the actual observed vector and the standard vector is calculated, thereby deriving a state consistency measure characterizing the degree of deviation of each node to be verified during the processing.
[0108] The consistency metrics of each node to be verified, node attribute data, and preset anomaly classification rules are mapped using a multi-dimensional tensor. A rule engine is used to execute pattern matching technology, logically judging the execution data of nodes based on preset rules such as exceeding amount limits, duplicate numbering, or abnormal status codes. If the current consistency metric is determined to exceed the tolerance range of business constraints, an anomaly encapsulation mechanism is automatically triggered. This mechanism structurally records the judged anomaly type, details of input / output data deviations, and anomaly-specific identifiers, ultimately generating anomaly state detection results representing various abnormal situations during the invoice processing.
[0109] In this embodiment, by constructing a node dependency graph and processing sequence, key nodes are accurately screened and state consistency is verified. This enables rapid identification of anomalies, guidance for rollback and reconstruction, and improvement of the accuracy, reliability and traceability of invoice processing, effectively reducing business risks.
[0110] Based on the above technical solution, optionally, anomaly propagation analysis and source localization processing are performed based on the anomaly detection results and the processing node sequence to obtain the target processing node corresponding to the anomaly source and rollback control information, including: Based on the abnormal state detection results and the processing node sequence, the propagation path of the abnormal state between each node is analyzed to obtain the abnormal propagation path. Based on the aforementioned anomaly propagation path and the processing node dependency graph, reverse tracing is performed to determine the anomaly source node and locate its specific position in the processing node sequence. Based on the specific location of the anomaly source node in the processing node sequence and the node dependency data, the anomaly impact range is deduced to obtain the target processing node corresponding to the anomaly source. Based on the target processing node and the preset rollback control strategy, the rollback trigger conditions are determined and the rollback parameters are configured to obtain rollback control information.
[0111] In this scheme, the anomaly propagation path is the logical path and data flow sequence of the anomaly state spreading from the occurrence node to the subsequent processing node, describing the diffusion trajectory and impact chain of the anomaly in the processing node sequence.
[0112] An anomaly source node is the initial processing node that triggers an abnormal state; that is, the node where the earliest abnormal behavior or deviation occurs, and it is the starting point of the abnormal event. It is used to locate the root cause of the anomaly and is a key node for analyzing the cause of the anomaly. Unlike the target processing node, the anomaly source node is mainly used to discover problems, while the target processing node is the object to perform rollback or remedial operations, and may include the anomaly source node or its affected dependent nodes.
[0113] The specific location is the sequential index or time-series position of the anomaly source node in the processing node sequence, used to accurately identify the stage in the entire processing flow where the anomaly source is located.
[0114] The preset rollback control strategy is a predefined rollback triggering condition, rollback scope, rollback method and parameter configuration rule for the target processing node and its dependent nodes, used to guide the selective rollback operation of the system after an anomaly occurs.
[0115] The input / output data deviations and anomaly-specific identifiers recorded in the anomaly detection results are extracted and used as feature vectors mapped onto the logical timeline of the processing node sequence. Using data flow tracing technology, the logical connections between nodes in the sequence are sequentially retrieved to capture the real-time propagation of data packets with deviation characteristics between nodes. By comparing the timestamp differences of each node's execution state and the evolution trends of data indicators, the nodes affected by the anomaly are topologically connected according to their execution order. This depicts the logical path and data flow sequence of the anomaly propagating from the originating node to subsequent processing nodes, ultimately generating an anomaly propagation path that characterizes the anomaly propagation trajectory and the chain of influence.
[0116] The anomaly propagation path is obtained, and the directed edge constraints and data transfer logic between nodes in the dependency graph of processing nodes are retrieved to initiate a reverse tracing algorithm. Using reverse path search technology, starting from the terminal node of the anomaly propagation path, the algorithm traces backward level by level along the dependency constraints between nodes, comparing the expected behavior of each node in the trajectory record with the actual deviation. When tracing back to the first stage where an inconsistency occurs and all its preceding nodes are normal under the verification rules, the root cause localization technology is used to identify it as the initial processing node that triggered the abnormal behavior, i.e., the anomaly source node. Subsequently, by retrieving the index position or time log of the processing node sequence, the node's sequence number in the entire process is accurately calculated, thereby determining the specific location of the anomaly source node in the processing flow.
[0117] Based on the identified location of the anomaly source node, the list of subsequent nodes and the dependency type matrix in the node dependency data are invoked to perform a positive impact diffusion simulation. Recursive traversal techniques are used to simulate the propagation path of erroneous data output by the anomaly source node in the processing node dependency graph, analyzing the degree of penetration of this anomaly characteristic into the execution results of downstream processing stages. Based on the strong coupling of data dependencies or business logic constraints between nodes, all downstream stages that directly or indirectly cause unreliable results due to the occurrence of an anomaly are identified, and these stages are logically clustered to determine the target processing node requiring remedial operations due to the anomaly.
[0118] The system retrieves the target processing node set and associates it with a preset rollback control strategy, entering the stage of rollback logic determination and parameterization configuration. Using rule matching technology, the abnormal state details of each target processing node are automatically matched with the trigger conditions in the preset strategy. The timing of the rollback operation is determined based on the state deviation range and the abnormality type matching condition. Simultaneously, the execution order requirements and parameter configuration standards defined in the strategy are used to map the rollback method parameters for each target processing node, such as setting the physical depth of state recovery, defining the retention strategy for intermediate data, and defining the order of execution logic. By integrating and encapsulating these preset rules and real-time execution parameters, a set of rollback control information is finally generated to standardize the rollback process of target processing nodes and their associated dependent nodes.
[0119] This solution can quickly locate the origin and scope of anomalies, accurately generate rollback control information, improve anomaly handling efficiency, and reduce business interruption and risk propagation.
[0120] Based on the above technical solution, optionally, selective rollback processing is performed on the target processing node and its dependent processing nodes in the processing node sequence based on the rollback control information to obtain the intermediate processing state after rollback, including: Based on the target processing node and the node dependency data, determine the dependent processing nodes of the target processing node in the processing node sequence, and generate a rollback node set based on the target processing node and the dependent processing nodes. Based on the rollback node set and node dependency data, the dependency relationships between each node are analyzed and the rollback execution order and dependency constraints are determined to obtain the rollback execution sequence. Based on the rollback execution sequence and rollback control information, rollback operations are executed sequentially to restore the processing state of each node and obtain the intermediate processing state after rollback.
[0121] In this scheme, the rollback node set is a collection of target processing nodes and their dependent processing nodes associated in the processing node sequence. It is used to uniformly manage nodes that need to be rolled back, so as to ensure data consistency and logical integrity during anomaly handling.
[0122] The rollback execution sequence is the order of operations formed by reordering the nodes in the rollback node set according to their dependencies and execution constraints. It is used to guide the system to execute rollback operations in the correct order, thereby avoiding data conflicts or business logic disruptions.
[0123] Once the target processing node is identified and its associated node dependency data is extracted, a deep dependency tracing process is initiated. Using reachability analysis algorithms or recursive traversal techniques from graph theory, a reverse scan is performed along the paths of preceding nodes recorded in the dependency data to identify all logically supporting steps in data output or operation completion for the target processing node, thus defining them as dependent processing nodes. During this identification process, by comparing the impact of each node's execution results on the integrity of subsequent steps, set aggregation techniques are used to logically merge and deduplicate the target processing node and all its corresponding dependent processing nodes, thereby generating a space for unified management of rollback objects—the rollback node set—ensuring a complete data baseline during anomaly handling.
[0124] The generated rollback node set is ingested and associated with topological constraints in the node dependency data, entering the rollback logic reorganization and orchestration stage. Using reverse mutation processing of topological sorting algorithms or dependency tree parsing techniques, the data transfer direction and dependency types between each processing stage in the rollback node set are analyzed. By introducing a priority weight allocation mechanism and logical conflict detection technology, the execution order and dependency constraints of each node's rollback actions are precisely defined while satisfying business dependencies, ensuring that the rollback operation does not disrupt the original business logic structure. Finally, the nodes, after order optimization, are linearly arranged to generate a rollback execution sequence to guide the system in executing rollback actions in the correct order.
[0125] The rollback execution sequence is acquired and preset rollback control information is loaded, initiating the physical state recovery process for each processing node. Following the execution order defined in the rollback execution sequence, transaction-level compensation mechanisms or mirror rollback technology are used to sequentially trigger the undo operation of each node, restoring the node's processing state to a safe baseline before the anomaly. During execution, real-time state capture and snapshot storage technologies are used synchronously to record the input / output content, real-time execution state, and time information of each target processing node and its dependent processing nodes. By structurally encapsulating and integrating the associated details of these dynamically changing node snapshots, a complete record of the intermediate processing state throughout the rollback process is obtained.
[0126] This solution ensures that rollback operations are executed in the order of dependencies, avoiding data conflicts and logical interruptions, while accurately restoring the processing status of abnormal nodes and related dependent nodes, thus improving system stability and business continuity.
[0127] Example 3 Figure 3 This is a schematic diagram of the structure of a ticket processing system based on reversible processing and exception-driven reconfiguration, provided in Embodiment 3 of this application. Figure 3 As shown, it specifically includes: The data acquisition module 301 is used to acquire target ticket data, perform staged processing on the target ticket data based on a preset processing flow, and record the status information during the processing to obtain complete processing trajectory data. The processing trajectory construction module 302 is used to construct the processing node sequence relationship based on the processing trajectory data, obtain the processing node sequence, perform node screening and state consistency analysis based on the processing node sequence, and perform anomaly determination based on preset anomaly classification rules. If an anomaly is determined to exist, an anomaly state detection result is generated in the ticket processing process. Anomaly source analysis module 303 is used to perform anomaly propagation analysis and source localization processing based on the anomaly state detection results and the processing node sequence, to obtain the target processing node and rollback control information corresponding to the anomaly source. The rollback processing module 304 is used to selectively roll back the target processing node and its dependent processing nodes in the processing node sequence based on the rollback control information, so as to obtain the intermediate processing state after rollback. The alternative path generation module 305 is used to determine the target processing strategy corresponding to the abnormal state detection result from the preset processing strategy library based on the abnormal state detection result and the intermediate processing state, and generate and execute the alternative processing path based on the target processing strategy to obtain the reconstruction processing result. The result fusion module 306 is used to parse the processing trajectory data to obtain the processing result data corresponding to the original processing path, and to fuse the processing result data and the reconstructed processing result to obtain the optimized ticket processing result. The result transmission module 307 is used to transmit the optimized bill processing result to the control center if the optimized bill processing result meets the preset processing requirements.
[0128] The ticket processing system based on reversible processing and exception-driven reconstruction provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0129] Example 4 like Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401, a memory 402, and a program or instructions stored in the memory 402 and executable on the processor 401. When the program or instructions are executed by the processor 401, they implement the various processes of the above-described method embodiment of a ticket processing method based on reversible processing and exception-driven reconstruction, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0130] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0131] Example 5 This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described embodiment of a ticket processing method based on reversible processing and exception-driven reconstruction, and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0132] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0133] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element. Furthermore, it should be noted that the scope of the methods and systems in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0135] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0136] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.
Claims
1. A ticket processing method based on reversible processing and exception-driven reconstruction, characterized in that, The method includes: Acquire target invoice data, perform phased processing on the target invoice data based on a preset processing flow, and record the status information during the processing to obtain complete processing trajectory data; Based on the processing trajectory data, a processing node sequence relationship is constructed to obtain a processing node sequence. Based on the processing node sequence, node filtering and state consistency analysis are performed, and anomaly determination is performed based on preset anomaly classification rules. If an anomaly is determined to exist, an anomaly detection result is generated in the ticket processing process. Based on the abnormal state detection results and the processing node sequence, abnormal propagation analysis and source localization processing are performed to obtain the target processing node and rollback control information corresponding to the abnormal source. Based on the rollback control information, selective rollback processing is performed on the target processing node and its dependent processing nodes in the processing node sequence to obtain the intermediate processing state after rollback. Based on the abnormal state detection results and intermediate processing states, a target processing strategy corresponding to the abnormal state detection results is determined from the preset processing strategy library, and an alternative processing path is generated and executed based on the target processing strategy to obtain the reconstructed processing result. Based on the parsing of the processing trajectory data, the processing result data corresponding to the original processing path is obtained, and the processing result data and the reconstructed processing result are fused to obtain the optimized ticket processing result; If the optimized bill processing result meets the preset processing requirements, the bill processing result will be transmitted to the control center.
2. The ticket processing method based on reversible processing and exception-driven reconstruction according to claim 1, characterized in that, in, The target ticket data is processed in stages based on a preset processing flow, and the status information during the processing is recorded to obtain complete processing trajectory data, including: The target invoice data is formatted and cleaned to obtain standardized input data; Based on a preset processing flow, standardized input data is parsed and features are extracted at multiple levels to obtain the processing results at each stage. Based on the processing results of each stage, state transition tracking and data storage are performed to obtain complete processing trajectory data.
3. The ticket processing method based on reversible processing and exception-driven reconstruction according to claim 1, characterized in that, in, Based on the processing trajectory data, a processing node sequence relationship is constructed to obtain a processing node sequence. Node filtering and state consistency analysis are performed based on the processing node sequence, and anomaly determination is made based on preset anomaly classification rules. If an anomaly is determined, anomaly detection results are generated during the ticket processing process, including: Based on the processing trajectory data, a processing node dependency graph is constructed. The data transmission and processing dependencies between processing nodes in the processing node dependency graph are analyzed to obtain the execution path and node dependency data of each processing node. Parse the attribute information of each processing node in the dependency graph to obtain the node attribute data of each processing node; Based on the execution path, the nodes are sorted and associated to obtain a sequence of processing nodes containing each processing node. Based on the processing node sequence, a node criticality analysis is performed to filter out a set of nodes to be verified that are located in critical execution links and meet the preset importance criteria. Based on the set of nodes to be verified and the preset consistency verification standard, a consistency verification is performed to obtain the state consistency measure of each node to be verified in the set of nodes to be verified. Anomalies are determined based on the consistency measurement of the state of each node to be verified, the node attribute data, and the preset anomaly classification rules. If an anomaly is determined, an anomaly detection result is generated during the ticket processing.
4. The ticket processing method based on reversible processing and exception-driven reconstruction according to claim 3, characterized in that, in, Based on the abnormal state detection results and the processing node sequence, anomaly propagation analysis and source localization are performed to obtain the target processing node corresponding to the anomaly source and rollback control information, including: Based on the abnormal state detection results and the processing node sequence, the propagation path of the abnormal state between each node is analyzed to obtain the abnormal propagation path. Based on the aforementioned anomaly propagation path and the processing node dependency graph, reverse tracing is performed to determine the anomaly source node and locate its specific position in the processing node sequence. Based on the specific location of the anomaly source node in the processing node sequence and the node dependency data, the anomaly impact range is deduced to obtain the target processing node corresponding to the anomaly source. Based on the target processing node and the preset rollback control strategy, the rollback trigger conditions are determined and the rollback parameters are configured to obtain rollback control information.
5. The ticket processing method based on reversible processing and exception-driven reconstruction according to claim 4, characterized in that, in, Based on the rollback control information, selective rollback processing is performed on the target processing node and its dependent processing nodes in the processing node sequence to obtain the intermediate processing state after rollback, including: Based on the target processing node and the node dependency data, determine the dependent processing nodes of the target processing node in the processing node sequence, and generate a rollback node set based on the target processing node and the dependent processing nodes. Based on the rollback node set and node dependency data, the dependency relationships between each node are analyzed and the rollback execution order and dependency constraints are determined to obtain the rollback execution sequence. Based on the rollback execution sequence and rollback control information, rollback operations are executed sequentially to restore the processing state of each node and obtain the intermediate processing state after rollback.
6. The ticket processing method based on reversible processing and exception-driven reconstruction according to claim 1, characterized in that, in, Based on the anomaly detection results and intermediate processing states, a target processing strategy corresponding to the anomaly detection results is determined from a preset processing strategy library. An alternative processing path is then generated and executed based on the target processing strategy to obtain a reconstructed processing result, including: Based on the abnormal state detection results and intermediate processing states, a strategy matching and retrieval is performed from the preset processing strategy library to obtain the target processing strategy. Based on the target processing strategy, alternative processing paths are planned for the intermediate processing state to obtain alternative processing paths. The processing node is reconstructed based on the alternative processing path to obtain the reconstruction processing result.
7. The ticket processing method based on reversible processing and exception-driven reconstruction according to claim 1, characterized in that, in, The processed data and the reconstructed data are fused together to obtain the optimized invoice processing result, including: Based on the processing result data and the reconstruction processing result, result consistency alignment and deviation analysis are performed to obtain the fused input dataset; Based on the fused input dataset, the results are fused to obtain the optimized invoice processing results.
8. A ticket processing system based on reversible processing and exception-driven reconfiguration, characterized in that, The system includes: The data acquisition module is used to acquire target ticket data, perform staged processing on the target ticket data based on a preset processing flow, and record the status information during the processing to obtain complete processing trajectory data. The processing trajectory construction module is used to construct the processing node sequence relationship based on the processing trajectory data to obtain the processing node sequence, perform node screening and state consistency analysis based on the processing node sequence, and determine anomalies based on preset anomaly classification rules. If an anomaly is determined to exist, an anomaly detection result is generated in the ticket processing process. An anomaly source analysis module is used to perform anomaly propagation analysis and source localization processing based on the anomaly state detection results and the processing node sequence, to obtain the target processing node and rollback control information corresponding to the anomaly source. The rollback processing module is used to selectively roll back the target processing node and its dependent processing nodes in the processing node sequence based on the rollback control information, so as to obtain the intermediate processing state after rollback. The alternative path generation module is used to determine the target processing strategy corresponding to the abnormal state detection result from the preset processing strategy library based on the abnormal state detection result and the intermediate processing state, and generate and execute the alternative processing path based on the target processing strategy to obtain the reconstruction processing result. The result fusion module is used to parse the processing trajectory data to obtain the processing result data corresponding to the original processing path, and to fuse the processing result data and the reconstructed processing result to obtain the optimized ticket processing result. The result transmission module is used to transmit the optimized bill processing result to the control center if the optimized bill processing result meets the preset processing requirements.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein when the program or instructions are executed by the processor, they implement the steps of a ticket processing method based on reversible processing and exception-driven reconstruction as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the steps of a ticket processing method based on reversible processing and exception-driven reconstruction as described in any one of claims 1-7.