A multi-invoice time sequence sorting method and system based on least conflict backtracking
By establishing original evidence anchor points and time-series constraint graphs in the time-series sorting of multiple invoices, extracting the minimum conflict constraint set, locally re-analyzing new evidence versions and performing incremental recalculation, the problem of evidence location and repair loop in the time-series sorting of multiple invoices is solved, and the accuracy and efficiency of sorting are improved.
Patent Information
- Application Number
- CN202611685430.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-29
- Publication Date
- 2026-11-27
AI Technical Summary
In the time-series sorting of multiple invoices, existing technologies struggle to accurately locate the original evidence. Directly correcting time values leads to evidence distortion, repeated model calls create loops, and the entire graph is recalculated after evidence updates, making it impossible to form an effective repair loop.
By establishing original evidence anchor points, using a large language model to generate business event candidates and performing anchor point location verification, business event records with evidence versions are formed. A time series constraint graph is constructed and the minimum conflict constraint set is extracted. The new evidence version is locally re-parsed, and incremental recalculation is performed only on the affected subgraphs to avoid directly rewriting time values.
It enables the location of original evidence and partial re-analysis when the precise date, month, and relative time expressions are inconsistent in multi-source vouchers, reducing repeated parsing and full recalculation, and ensuring the accuracy and efficiency of the evidence.
Smart Images

Figure CN123178481A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a multi-invoice time-series sorting method and system that combines the extraction results of business events from a large language model with localizable original evidence, temporal constraint solving, and incremental recalculation, based on minimum conflict backtracking. Background Technology
[0002] Travel expense reimbursements, procurement settlements, supply chain reconciliations, and project cost verification typically involve multiple invoices, order screenshots, itineraries, bills, and approval records. The invoice dates, transaction dates, check-in periods, order times, and payment times on different documents do not have the same meaning and may be expressed as precise dates, date ranges, or relative times. Sort only by invoice date or file name, it is easy to confuse the order of business events with the order in which the documents were generated.
[0003] Optical character recognition (OCR) or large language models can generate event candidates from images and text, but the model output may contain errors such as misidentification, cross-regional splicing, or mistaking adjacent fields for time fields. If the system only saves the structured results without saving page numbers, region coordinates, original text literals, and content summaries, it cannot determine which original document should be re-verified when time-series conflicts occur.
[0004] Existing time-series verification methods can represent event time as an interval and perform constraint propagation, or directly adjust the time data of abnormal nodes according to cost. However, in the invoice review scenario, directly modifying the time value will cause the sorting result to deviate from the original voucher; re-calling the model for the entire batch will repeatedly process a large number of unchanged pages, and may change the originally verified sorting relationship due to fluctuations in the model output.
[0005] Furthermore, simply returning conflicting nodes or a subset of unsatisfiable constraints is insufficient to form an executable repair loop. The system also needs to clarify which version of evidence generated the conflicting constraints, in which image region the evidence is located, whether the same conflicting state has been handled, which propagation results must be revoked after updating an evidence version, and which unaffected ordering relationships can remain unchanged.
[0006] Therefore, a multi-invoice sorting scheme is needed that does not directly tamper with the original time values, can accurately trace back the minimum conflict constraints to the original evidence region, generates a new evidence version through local re-analysis, and performs incremental recalculation only on affected subgraphs that depend on the old version. Summary of the Invention
[0007] In view of the shortcomings of the prior art, the present invention aims to provide a multi-invoice time-series sorting method and system based on minimum conflict backtracking, so as to solve the problems of difficulty in locating the original evidence when the time semantics of multiple source vouchers are inconsistent, evidence distortion caused by directly correcting the time value, looping caused by repeated model calls, and full recalculation after evidence update.
[0008] To achieve the objectives of this invention, the technical solution adopted is: a multi-invoice time-series sorting method based on minimum conflict backtracking, comprising: To obtain multiple invoices and associated business vouchers from the same business batch, firstly, an original evidence anchor point is established for the business voucher, including a document content summary, page number, area coordinates, and area original text. Then, a large language model is called to form business event candidates within the voucher area corresponding to the original evidence anchor point. Anchor point positioning verification is performed on the business event candidates, and the time literal that passes the verification is converted into a time domain to form a business event evidence record with an evidence version. A time-series constraint graph is established using the time variables of business events as nodes and the time difference constraints between business events as constraint edges. Interval propagation is performed on the time domain of the nodes, and the constraint edges and evidence versions on which the time domain tightening is based are recorded. When interval propagation produces an empty time domain or does not satisfy the loop, extract the minimum conflict constraint set based on the business event evidence record and map the evidence constraints in it to the original evidence anchor point; when the minimum conflict constraint set only contains hard rule constraints generated by pre-configured business time boundaries or process sequence relationships that do not depend on the credential recognition result, output the rule configuration conflict and stop evidence re-parsing. When the minimum conflict constraint set contains evidence constraints, the processed original evidence anchor points are excluded according to the conflict state signature, and the unprocessed original evidence anchor points are selected for local re-parsing; after the new time literal is verified by anchor point positioning, a new evidence version is generated, the original evidence version is retained, and the constraint edges referencing the new evidence version are updated. Based on the evidence version dependency, the propagation result corresponding to the original evidence version is revoked. Only the affected subgraphs are re-performed for interval propagation, and the time domain and verified ordering relationship of the unaffected subgraphs are preserved. When the time sequence constraint graph satisfies or does not have any unprocessed original evidence anchor points, the partial or full order of multiple invoices and their evidence chains are output.
[0009] As an optimized solution of the present invention, the business event evidence record E with evidence version is provided. i Represented as: E i = <eid,type,sub,obj,literal,D i,bid,anchor,digest,ver,state>; where eid is the event identifier, type is the event type, sub is the business subject, obj is the business object, literal is the time literal, D i For the time domain, bid is the business batch identifier, anchor is the original evidence anchor point, digest is the anchor point content summary, ver is the evidence version, and state is the verification status. When the time literal cannot be located within the original evidence anchor point, the business subject is inconsistent, or the business identifier is inconsistent, the corresponding business event candidate will be set to the isolated state and no temporal constraint edge will be generated.
[0010] As an optimized solution of the present invention, for candidates that pass the verification, the deterministic time parser converts time literals into time domains, exact dates into single-point closed intervals, time literals containing only month or date ranges into intervals, and relative time expressions into intervals based on benchmark events with original evidence anchors; for constraint edge c ij = <i,j,l ij ,u ij ,kind,sourceRef,ruleVer>, according to D' j =D j ∩(D i ⊕[l ij ,u ij Update the time domain of the endpoint and write the constraint edges referenced in this update, the time domains before and after the update, the parent evidence version, and the predecessor identifier pointing to the previous propagation record into the propagation record; where i and j are the starting event node identifier and the ending event node identifier of the constraint edge, respectively, and l ij and u ij These represent the lower and upper bounds of the difference between the endpoint event time and the start event time, respectively; kind is the constraint type; sourceRef is the constraint source reference; ruleVer is the rule version; and D... i and D j These represent the starting and ending time domains before propagation, respectively, D' j This refers to the endpoint time domain after propagation.
[0011] As an optimized solution of the present invention, the extraction of the minimum conflict constraint set includes: taking the node that generates the empty time domain or the constraint edge on the unsatisfied loop as the backtracking starting point, collecting candidate conflict constraints along the predecessor relationship determined by the predecessor identifier pointing to the previous propagation record in the propagation record; temporarily deleting candidate conflict constraints in turn and re-performing interval propagation on the corresponding subgraph after temporarily deleting constraints, and determining whether there is a satisfaction check for the empty time domain or the unsatisfied loop. If it is still not satisfied after deletion, the candidate conflict constraint is permanently removed until deleting any constraint in the remaining constraints restores the corresponding subgraph to satisfaction; and classifying the remaining constraints according to the hard rule source and evidence source generated by the business time boundary or process sequence relationship and not dependent on the credential recognition result.
[0012] As an optimization scheme of the present invention, the original evidence anchor points with more constraints and lower processing costs in the minimum conflict constraint set are reviewed and covered. The selection score of the original evidence anchor point a is calculated according to R(a)=coverage(a) / [cost(a)×(1+repeat(a))], where: coverage(a) is the minimum number of conflict constraints covered by the original evidence anchor point, cost(a) is the local re-parsing cost determined by the area of the clipping region, the number of page loads and the length of adjacent text, and repeat(a) is the number of times the same anchor point content summary and local parsing parameter combination has been processed; the original evidence anchor points with larger R(a) are preferentially selected, and the next original evidence anchor point is selected when a conflict state signature already exists.
[0013] As an optimized solution of the present invention, the conflict state signature H is: H=Hash(batchId,conflictSetDigest,anchorDigest,evidenceVersion,domains,parseParams); Where: batchId is the business batch identifier, conflictSetDigest is the digest calculated after sorting the constraint edge identifiers in the minimum conflict constraint set, anchorDigest is the content digest of the original evidence anchor point to be re-parsed, evidenceVersion is the current evidence version identifier, domains is the current time domain of the nodes involved in the minimum conflict constraint set, and parseParams includes the trimming extension range, rotation angle, and neighboring text range. If H already exists in the processing record, the system will not use the same state and parameters to process the anchor point, but will select the next anchor point, adjust the local parsing parameters, or output the manual review identifier. The local parsing parameters adjust the pre-defined trimming extension range, optional rotation angle, and adjacent text window, and the local parsing parameters are only selected from the defined range.
[0014] As an optimization of the present invention, the input for local re-parsing is limited to the enlarged cropped image, rotation-corrected image, adjacent text, business subject, and allowed event types of the anchor point to be re-parsed; the output of the large language model includes candidate time literals and their regional positioning information; when the candidate time literal passes the regional positioning verification, its deterministic parsing result is used as the time domain of the new evidence version; when the regional positioning verification fails or the deterministic parsing fails, the original evidence version is retained, and the process moves to the next original evidence anchor point or outputs a manual review identifier.
[0015] As an optimization of the present invention, after the evidence version is switched, if the propagation record directly or indirectly depends on the replaced original evidence version, the boundary tightening result formed by the propagation record is revoked, and the corresponding node and adjacent constraint edge are added to the incremental propagation queue. The incremental propagation queue receives nodes and constraint edges that meet the following conditions: The set of parent evidence versions of the propagation record contains the original evidence version that was replaced, or is connected to the aforementioned nodes through constraint edges and whose time domain is affected by the revocation result; for connected components consisting of a group of event nodes connected by constraint edges that do not meet the aforementioned conditions, their time domain and ordering relationship remain unchanged; for invoices whose time domains still overlap after propagation and for which there are no verifiable sequential constraints, an indeterminate sequential relationship is output, and a stable order for display purposes is generated using a fixed key composed of invoice code, invoice number and document identifier, while marking this order as not an evidence verification result.
[0016] As an optimized solution of the present invention, the sorting output includes the invoice order, each evidence chain verifying the sorting relationship, the minimum set of unresolved conflict constraints, evidence version update records, processed conflict state signatures, and affected subgraph identifiers; the evidence chain is located in reverse from the sorting relationship to the constraint edge, evidence version, and original evidence anchor point according to the propagation record.
[0017] To achieve the objectives of this invention, the system technical solution adopted is: a system for multi-invoice time-series sorting based on minimum conflict backtracking, comprising: The voucher collection and evidence anchoring module is used to acquire multiple invoices and related business vouchers from the same business batch, and to establish original evidence anchor points that include document content summaries, page numbers, and area coordinates. The event candidate generation and verification module is used to call the large language model to generate business event candidates, perform anchor point positioning verification and deterministic time parsing on time literals, and generate versioned business event evidence records that retain the original version. The constraint propagation module is used to establish a temporal constraint diagram that records the anchor point identifiers and evidence versions, perform interval propagation, and generate a propagation record containing the set of parent evidence versions. The conflict backtracking module is used to extract the minimum conflict constraint set when an empty time domain or an unsatisfiable loop is generated, and to map the evidence constraints in it to the original evidence anchor point. The local re-parse module is used to select unprocessed original evidence anchors based on coverage, local re-parse cost and conflict state signature, perform local re-parse and generate new evidence versions; The incremental recalculation module is used to undo propagation results that depend on the original evidence version, repropagating only to the affected subgraphs and retaining the verified ordering relationships of the unaffected subgraphs; The sorting output module is used to output the partial or full order of multiple invoices, the chain of evidence, the minimum conflict constraint set, the evidence version update record, and the affected subgraph identifier.
[0018] The present invention has the following technical effects: 1) To address the inconsistencies in the semantics of precise dates, months, date ranges, and relative time expressions in multi-source vouchers, as well as the problem that the order of business events is easily confused with the order of voucher generation, this invention utilizes a deterministic time parser to form a repeatable time domain and outputs a verifiable partial or full order through a time-series constraint graph with sources. 2) To address the issues of being unable to locate the original evidence after model misidentification and the distortion of evidence caused by directly correcting time values, this invention establishes original evidence anchor points using document summaries, page numbers, regional coordinates, and regional original text. It maps the minimum conflict constraint set to the corresponding anchor points and creates a new evidence version through local re-parsing without overwriting the original evidence. This allows for retrospective verification of each correction, avoids evidence distortion caused by directly rewriting time values, and reduces repeated parsing and full-map recalculation. 3) To address the issues of only returning conflict nodes or unsatisfiable subsets of constraints without forming a repair loop, repeatedly calling the model for the same conflict, and recalculating the entire graph after evidence updates, this invention obtains the minimum set of conflict constraints by deleting verifications, suppresses repeated processing by using conflict state signatures, and revokes old version dependencies based on the parent evidence version set and the predecessor propagation record chain, performing incremental recalculation only on the affected subgraphs, while retaining unaffected evidence, time domains, and verified sorting relationships. Attached Figure Description
[0019] The present invention will now be described in further detail with reference to the accompanying drawings and practical examples.
[0020] Figure 1 This is a schematic diagram of the overall process of the multi-invoice time-series sorting method based on minimum conflict backtracking of the present invention; Figure 2 This is a schematic diagram illustrating the data association between the evidence version, constraint edges, and propagation records of this invention; Figure 3 This is a schematic diagram illustrating the extraction and splitting of the minimum conflict constraint set in this invention; Figure 4 This is a schematic diagram illustrating local re-parsing, state signature, and cycle suppression in this invention; Figure 5 This is a schematic diagram of the system structure of the present invention and the incremental processing of the affected subgraphs. Detailed Implementation
[0021] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 This invention provides a method and system for sequential sorting of multiple invoices based on minimum conflict backtracking. The method includes: S101: Retrieve multiple invoices from the same business batch, along with associated business documents in the form of orders, itineraries, bills, and approval records. The system calculates a content summary for each document and establishes original evidence anchors using document identifiers, page numbers, region coordinates, and region content summaries, enabling subsequent structured fields to be traced back to specific original text or image regions.
[0022] S102, perform layout partitioning and text recognition on the business vouchers, inputting the region image and its adjacent text into the large language model to obtain business event candidates. Each business event candidate includes at least the event type, business subject, business object, business identifier, and time literal. Anchor point positioning verification verifies whether the time literal can be located within the output original evidence anchor points, and verifies whether the business subject and business identifier are consistent with the current batch; candidates that fail the verification are isolated and do not participate in subsequent constraint graph construction.
[0023] For candidates that pass the validation, the deterministic temporal parser converts the time literals into a time domain according to fixed rules, forming a business event evidence record with an evidentiary version. Precise dates correspond to single-point closed intervals, date ranges correspond to start and end closed intervals, expressions containing only the month correspond to the date range of that month, and relative time expressions must reference a baseline event with an original evidentiary anchor. The large language model is responsible for forming candidate semantics, while the deterministic parser is responsible for generating repeatable time domains; the output boundaries of the two are mutually separated.
[0024] Business event evidence record E with evidence version i Represented as: E i = <eid,type,sub,obj,literal,D i ,bid,anchor,digest,ver,state>; Where eid is the event identifier, type is the event type, sub is the business subject, obj is the business object, literal is the time literal, and D iIn the time domain, bid is the business batch identifier, anchor is the original evidence anchor point, digest is the anchor point content summary, ver is the evidence version, and state is the verification status. New parsing results are written to a new ver, while the original record remains unchanged. For ease of representation, the original evidence anchor point record of file f is denoted as A(f), and the business event evidence record of file f under evidence version v is denoted as E(f,v); A represents the construction of the original evidence anchor point record, and E represents the construction of the versioned business event evidence record. Candidates that fail verification enter an isolated state and do not generate temporal constraint edges.
[0025] S103, with event time variable t i Nodes are used to construct a timing constraint graph. Constraint edges are used to describe the range of differences between the times of two events: l ij ≤t j -t i ≤u ij ; The data structure representation of the constraint edges is as follows: c ij = <i,j,l ij ,u ij ,kind,sourceRef,ruleVer>; Where: i and j are the starting event node identifier and ending event node identifier of the constraint edge, respectively, and t i and t j These are the time variables for the corresponding events, l ij and u ij t j -t i The lower and upper bounds of the difference are defined. `kind` is used to distinguish between hard rule constraints and evidential constraints. `sourceRef` is the source reference for the constraint. In evidential constraints, `sourceRef` points to the original evidence anchor point and evidence version; in hard rule constraints, it points to the rule identifier. `ruleVer` is the rule version. Hard rule constraints are generated by the boundaries of the same business batch and the defined process sequence, while evidential constraints are generated by the time literals in the voucher and event associations.
[0026] When performing interval propagation on the constrained edges, the endpoint time domain is updated according to the following formula: D' j =D j ∩(D i ⊕[l ij ,u ij ]); Each time the time domain is tightened, it is written into the propagation record. : ; Where m is the propagation record identifier, edgeId is the constraint edge identifier that triggered this time domain tightening, oldDomain and newDomain are the time domain before and after the update, parentVersionSet is the set of parent evidence versions that this tightening directly or indirectly depends on through predecessor propagation records, and predecessor is the identifier of the previous propagation record that formed the current boundary. Propagation records are used both to interpret ordering relationships and for selective revocation after evidence version changes.
[0027] S104. When interval propagation causes a certain time domain to become empty, or when an unsatisfied loop is formed in the temporal constraint graph, candidate conflict constraints are collected in reverse along the predecessor, starting from the corresponding node or loop. Then, candidate constraints are temporarily deleted one by one, and the satisfiability of the corresponding subgraph is rechecked. If the subgraph is still unsatisfiable after deleting a constraint, then the constraint is not necessary for the current conflict and is removed from the candidate set. The above operation is repeated to obtain the minimum set of conflict constraints K that can be restored to satisfiability by deleting any one of the constraints.
[0028] The constraints in the minimum conflict constraint set K are categorized into hard rule constraints and evidence constraints based on their source. When K consists entirely of hard rule constraints, it indicates that the conflict originates from the rule configuration itself. The system outputs the rule version, the identifiers of the conflicting rules, and the involved nodes, without invoking the large language model to avoid invalid re-parsing of rule conflicts that cannot be resolved through evidence. The system only proceeds to evidence anchor point selection when K contains evidence constraints.
[0029] S105, map each evidence constraint in K to the original evidence anchor point via sourceRef. An original evidence anchor point can simultaneously generate time domain constraints, event type constraints, and subject association constraints; therefore, anchor points with more constraints in K and lower processing costs are prioritized for review. The selection score R(a) for anchor point a is: R(a)=coverage(a) / [cost(a)×(1+repeat(a))]; Let AK be the set of candidate anchor points obtained by mapping the evidence constraints in K to sourceRef, and Ke be the set of evidence constraints in K. coverage(a) = |{c∈Ke: sourceRef(c) points to a}|. Let S(a), P(a), L(a), and Q(a) be the pixel area of the extended cropping region, the number of pages loaded, the number of adjacent text characters, and the number of preprocessing parameter combinations, respectively; let Smax, Pmax, Lmax, and Qmax be the maximum values of the corresponding quantities in AK, and not less than 1. Define cost(a) = 1 + S(a) / Smax + P(a) / Pmax + L(a) / Lmax + Q(a) / Qmax. repeat(a) is the number of times the same anchor content summary, evidence version, and local parsing parameter combination have been processed. This formula is only used to determine the re-parsing order and is not used to change the evidence content. Where: more constraints mean a larger coverage(a) in AK; lower processing cost means a smaller cost(a). The system selects anchor points in descending order of R(a); when R(a) are the same, it selects anchor points with smaller P(a), smaller S(a), and smaller lexicographical order of anchor point identifiers in that order.
[0030] To suppress repeated calls to the model due to the same conflict, the system generates a conflict state signature H: H=Hash(batchId,conflictSetDigest,anchorDigest,evidenceVersion,domains,parseParams); Wherein, batchId is the business batch identifier, conflictSetDigest is the digest calculated after sorting the constraint edge identifiers in the minimum conflict constraint set, anchorDigest is the content digest of the original evidence anchor point to be re-parsed, evidenceVersion is the current evidence version identifier, domains is the current time domain set of the nodes involved in the minimum conflict constraint set, and parseParams is the pruning expansion range, rotation angle, and adjacent text window used in this local re-parse. If H already exists in the processing record, the system selects the next anchor point, changes the local parsing parameters within the pre-configured allowed range, or outputs a manual review identifier, and does not process the same anchor point again with the same state and parameters.
[0031] S106 performs local processing on the anchor points to be parsed. Local processing can expand the cropped area of the original region to include the complete date field, perform rotation correction to restore character orientation, and concatenate adjacent text in the same field to supplement the year or month. The input to the large language model is limited to the processed local region, adjacent text, business subject, and allowed event types; the output must include candidate time literals and their region location information.
[0032] The candidate time literals are then subjected to regional location verification and deterministic time parsing. Upon successful verification, the system establishes a new evidence version E. i (v+1), and write the new time domain and the new regional content summary into this version; original evidence version E i (v) Continue to retain. If verification fails, the original evidence record is not modified, and the process moves to the next anchor point or manual review. Constraint edges generated by the new version reference v+1; old constraint edges can still be used for auditing but are no longer included in the current valid graph.
[0033] S107, after the evidence version switch, the system queries the parentVersionSet (parent evidence version set) in the propagation record. When parentVersionSet directly contains the replaced original evidence version, the propagation record constitutes a direct dependency; when the current propagation record chain can trace back to the above directly dependent record, the propagation record constitutes an indirect dependency. If a propagation record directly or indirectly depends on the replaced original evidence version, the boundary tightening result formed by the propagation record is revoked, and the corresponding node and adjacent constraint edges are added to the incremental propagation queue; connected components that do not have dependencies on the old version and whose time domain is not affected by the revocation result remain in their original state. The system re-executes interval propagation, conflict detection, and necessary local re-parsing in the incremental queue.
[0034] The aforementioned dependency failure mechanism ensures that the impact boundary of evidence updates is determined by propagation dependencies, rather than by the number of files or batch size. Incremental propagation is performed on affected subgraphs, while the evidence versions, time domains, and verified ordering relationships of unaffected subgraphs remain unchanged, thus avoiding output drift caused by full batch re-parsing.
[0035] S108: When the time sequence constraint graph is satisfied, generate a partial or full order of invoices based on the reachability of the constraint edges and the time domain boundaries. If the time domains of the events corresponding to two invoices still overlap and there are no verifiable sequential constraints, output an indeterminate sequential relationship. To ensure stable interface display, a fixed key can be formed using invoice code, invoice number, and file identifier for display sorting, but this display order must be marked as a rule disambiguation result rather than an evidence verification result.
[0036] The sorting output includes the invoice order, the evidence chain for each verifiable sorting relationship, the minimum unresolved conflict constraint set, evidence version update records, processed conflict state signatures, and affected subgraph identifiers. The evidence chain can be traced back from the sorting relationship to the constraint edges, evidence versions, and original evidence anchors according to the propagation record.
[0037] The date, pixel extension amount, and batch identifier in the following embodiments are used to illustrate the data flow and conflict handling process and do not constitute a limitation on the scope of protection.
[0038] Example 1: Establishment of versioned evidence and timing constraint graph; like Figure 1 and Figure 2 As shown, the processor receives service batch B202606-TRIP-017. This batch contains railway e-ticket F1, ride-hailing invoice F2, ride-hailing order screenshot F3, accommodation invoice F4, hotel bill F5, and restaurant invoice F6. The example trip boundary is determined by departure and return records with original evidence anchors as June 2, 2026 to June 7, 2026.
[0039] The system saves a file identifier and content summary for each file, and a page number and region coordinates for each candidate field. A(f) is the construction of the aforementioned original evidence anchor record, and E(f,v) is the construction of the aforementioned versioned business event evidence record. For example, F2 is the file identifier of a ride-hailing invoice, and the original evidence anchor record for the date region in F2 is A(F2) =<F2,page1,(x1,y1,x2,y2),digestA> In this system, page1 represents the page number, (x1, y1, x2, y2) represent the coordinates of the top-left and bottom-right corners of the region, and digestA represents the content summary of the region. Both the initial character recognition and the large language model candidate identified "2026-06-03" in the region as "2026-06-08". The system writes the candidate literal values, location information, and initial time domain into E(F2, v1), where v1 is the first evidence version identifier, but does not overwrite the file image.
[0040] The system generates versioned evidence records for each of the following events: F1 (ride-hailing), F3 (order placement), F4 and F5 (check-in and check-out), and F6 (consumption). The system associates F2's ride-hailing event with F3's order placement event based on the same order number, associates F4 with F5 based on the hotel name and billing number, and establishes a hard rule constraint that each consumption event falls between June 2nd and June 7th, 2026, based on the trip boundaries.
[0041] For F2, the initial evidence domain is D(F2,v1)=[2026-06-08,2026-06-08], and the travel boundary hard constraint requires D(F2) to be located in [2026-06-02,2026-06-07]. During propagation, the intersection of the two is empty, and the propagation record simultaneously saves the evidence constraint edge that generated the empty domain, the hard rule constraint edge, the respective version source, and the time domain before and after the update.
[0042] Example 2: Minimal Conflict Backtracking and Local Re-analysis; like Figure 3As shown, the system collects candidate constraints in reverse along the propagation record from the spacetime domain of F2. After performing deletion verification on each candidate constraint, the minimum conflict constraint set K={c(F2,v1),c(travel boundary)} is obtained. Here, c(F2,v1) is the evidence constraint referencing E(F2,v1), and c(travel boundary) is the travel boundary hard rule constraint. Deleting either constraint will restore the current subgraph to satisfiability; therefore, both are necessary constraints for the current conflict.
[0043] Since the minimum conflict constraint set K contains evidence constraints, the system maps the evidence constraint c(F2,v1) to the original evidence anchor point A(F2), where c(F2,v1) represents the constraint edge generated by the first evidence version of F2. Assuming that K also contains association constraints generated by adjacent text of F3, and A(F2) covers two conflict constraints and only requires loading a single-page area of F2, the system calculates the anchor point selection score R(a) and prioritizes A(F2). The system uses the current K summary, the content summary of A(F2), v1 (the first evidence version identifier), the relevant time domain, and local parsing parameters to generate a state signature H1, where H1 represents the conflict state signature generated for the first time in this embodiment.
[0044] like Figure 4 As shown, the system extends A(F2) by 24 pixels on each side as example cropping parameters, performs rotation correction based on the text direction, and concatenates the label text to the left of the date field. The re-parsed input only contains this local image, the business entity, the order number, and the ride event type. The model returns the candidate literal "2026-06-03" and its new region coordinates. After the region positioning verification and deterministic parsing both pass, the system establishes E(F2,v2), whose time domain is [2026-06-03, 2026-06-03].
[0045] E(F2,v1) remains in the evidence version table, and c(F2,v1) is converted into a historical constraint edge; the system establishes a valid constraint edge c(F2,v2) referencing E(F2,v2). If H1 is formed again using the same K, anchor content summary, evidence version, time domain, and local parsing parameters, the system recognizes that it has been processed and will not repeatedly call the model with the same state.
[0046] If local reanalysis still fails to locate the new time literal from the anchor region, the system does not generate a new evidence version. If other evidence anchors exist, select the next anchor by pressing R(a); if no unprocessed anchors exist, retain the current conflict kernel and output a manual review flag. This failure path ensures that the model output cannot enter the constraint graph without the support of the original region.
[0047] Example 3: Dependency Failure, Incremental Propagation, and Ordered Output; like Figure 5As shown, the version dependency failure and incremental recalculation module assigns propagation records that reference the old evidence version to the affected subgraph and propagation records that do not reference the old evidence version to the unaffected subgraph. Specifically, in this embodiment, after E(F2) switches from v1 to v2, the system retrieves the parent evidence version set field in the propagation records to determine the propagation records containing E(F2,v1); the propagation results generated by the association of orders F2 and F3 are assigned to the affected subgraph, and after being revoked, they enter the incremental propagation queue; the propagation records containing F1, F4, F5, and F6 that do not reference v1 are assigned to the unaffected subgraph and are not revoked.
[0048] After the affected subgraph enters the incremental propagation queue, the system uses c(F2,v2) to update the time domain of F2 to June 3, 2026, and verifies that it is within the trip boundary and compatible with the order event constraints of F3. In the unaffected subgraphs, the time domains and verified sorting relationships of F1, F4, F5, and F6 remain unchanged, with the verified check-in / check-out relationships between F4 and F5, and the relationships between F6 and other events remaining intact. The system does not need to read the original pages of F1, F4, F5, and F6 again.
[0049] After propagation is complete, the system generates an invoice order based on reachability (whether it is possible to reach another point from a point along a path). For invoices whose order can be proven by a constraint chain, the verified order is output, along with an evidence chain from the constraint edge to the propagation record, evidence version, and original evidence anchor point. For invoices with overlapping time domains and no verifiable order constraints, an indeterminate order is output; the interface can display the order stably using a fixed key, but the fixed key order will not be written as the evidence conclusion.
[0050] When the minimum conflict constraint set consists entirely of hard rule constraints, such as when the same rule version simultaneously stipulates that an event must be earlier than and later than another event, the system outputs a rule configuration conflict, lists the rule identifier and rule version, and stops evidence re-parsing. After the rule administrator corrects the rule version, only the constraint edges referencing the old rule version become invalid and trigger the recalculation of the corresponding subgraph.
[0051] Example 4: A system implementation of a multi-invoice time-series sorting method based on minimum conflict backtracking; like Figure 5 As shown, the multi-invoice time-series conflict backtracking and sorting system includes a voucher collection and evidence anchoring module, an event candidate generation and verification module, a constraint propagation module, a conflict backtracking module, a local re-parsing module, an incremental recalculation module, and a sorting output module. Each module can be deployed in the same server process, or it can transmit batch identifiers, evidence version identifiers, and incremental propagation tasks through a message queue.
[0052] The credential collection and evidence anchoring module saves the original file, file content summary, page image, and region index.
[0053] The event candidate generation and verification module saves the model input region, model output candidates, x-anchor point location verification results, and deterministic analysis results. Only evidence versions with valid verification status can generate the currently valid constraint edges.
[0054] The constraint propagation module establishes a temporal constraint graph that records the anchor point identifiers and evidence versions of the original evidence, and maintains the node time domain, constraint edges, and propagation records containing the parent evidence version set and predecessor identifiers.
[0055] The conflict backtracking module extracts the minimum conflict constraint set when an empty time domain or an unsatisfiable loop occurs, and maps the evidence constraints in it to the original evidence anchor point according to sourceRef.
[0056] The local re-parsing module selects unprocessed anchor points based on coverage, local re-parsing cost, and conflict state signatures, performs local re-parsing, and generates a new version of evidence.
[0057] The incremental recalculation module removes old version dependencies based on the reverse index from the evidence version to the propagation record, and only repropagates to the affected subgraphs.
[0058] The sorting output module outputs a partial or full order of multiple invoices, and marks the verified order, the indeterminate order, and the rule-disambiguated order used only for display. The output record includes at least the batch identifier, invoice identifier, sorting relationship type, constraint edge identifier, evidence version, original evidence anchor point, propagation record identifier, minimum conflict constraint set identifier, and affected subgraph identifier to support subsequent review.
[0059] Those skilled in the art can configure event type tables, hard rule constraints, and deterministic time parsing rules according to specific credential types without altering the processing relationships between versioned evidence, minimum conflict backtracking, local re-parsing, and dependency failure incremental recalculation. The above embodiments are used to illustrate the technical solution of the present invention and are not intended to limit the scope of protection of the present invention.
[0060] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-invoice sequential sorting method based on minimum conflict backtracking, characterized in that, include: To obtain multiple invoices and associated business vouchers from the same business batch, firstly, establish original evidence anchor points for the business vouchers, including document content summary, page number, area coordinates, and area original text; then, within the voucher area corresponding to the original evidence anchor points, call the large language model to form business event candidates, perform anchor point positioning verification on the business event candidates, and convert the verified time literals into the time domain to form business event evidence records with evidence versions. A time-series constraint graph is established using the time variables of business events as nodes and the time difference constraints between business events as constraint edges. Interval propagation is performed on the time domain of the nodes, and the constraint edges and evidence versions on which the time domain tightening is based are recorded. When interval propagation produces an empty time domain or does not satisfy the loop, extract the minimum conflict constraint set based on the business event evidence record and map the evidence constraints in it to the original evidence anchor point; when the minimum conflict constraint set only contains hard rule constraints generated by pre-configured business time boundaries or process sequence relationships that do not depend on the credential recognition result, output the rule configuration conflict and stop evidence re-parsing. When the minimum conflict constraint set contains evidence constraints, the processed original evidence anchor points are excluded according to the conflict state signature, and the unprocessed original evidence anchor points are selected for local re-parsing; after the new time literal is verified by anchor point positioning, a new evidence version is generated, the original evidence version is retained, and the constraint edges referencing the new evidence version are updated. Based on the evidence version dependency, the propagation result corresponding to the original evidence version is revoked. Only the affected subgraphs are re-performed for interval propagation, and the time domain and verified ordering relationship of the unaffected subgraphs are preserved. When the time sequence constraint graph satisfies or does not have any unprocessed original evidence anchor points, the partial or full order of multiple invoices and their evidence chains are output.
2. The multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 1, characterized in that, Business event evidence record E with evidence version i Represented as: E i = <eid,type,sub,obj,literal,D i ,bid,anchor,digest,ver,state>; where eid is the event identifier, type is the event type, sub is the business subject, obj is the business object, literal is the time literal, D i For the time domain, bid is the business batch identifier, anchor is the original evidence anchor point, digest is the anchor point content summary, ver is the evidence version, and state is the verification status. When the time literal cannot be located within the original evidence anchor point, the business subject is inconsistent, or the business identifier is inconsistent, the corresponding business event candidate will be set to the isolated state and no temporal constraint edge will be generated.
3. The multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 2, characterized in that, For candidates that pass the validation, the deterministic time parser converts time literals into time domains, exact dates into single-point closed intervals, time literals containing only month or date ranges into intervals, and relative time expressions into intervals based on benchmark events with original evidence anchors; for constraint edges c ij = <i,j,l ij ,u ij ,kind,sourceRef,ruleVer>, according to D' j =D j ∩(D i ⊕[l ij ,u ij Update the time domain of the endpoint and write the constraint edges referenced in this update, the time domains before and after the update, the parent evidence version, and the predecessor identifier pointing to the previous propagation record into the propagation record; where i and j are the starting event node identifier and the ending event node identifier of the constraint edge, respectively, and l ij and u ij These represent the lower and upper bounds of the difference between the endpoint event time and the start event time, respectively; kind is the constraint type; sourceRef is the constraint source reference; ruleVer is the rule version; and D... i and D j These represent the starting and ending time domains before propagation, respectively, D' j This refers to the endpoint time domain after propagation.
4. The multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 3, characterized in that, The extraction of the minimum conflict constraint set includes: using nodes that generate empty time domains or constraint edges on unsatisfied loops as backtracking starting points, collecting candidate conflict constraints along the predecessor relationships determined by the predecessor identifiers pointing to the previous propagation record in the propagation record; temporarily deleting candidate conflict constraints in turn and re-performing interval propagation on the corresponding subgraphs after the temporary deletion of constraints, and determining whether there are any empty time domains or unsatisfied loops for satisfaction checks. If they are still unsatisfied after deletion, the candidate conflict constraint is permanently removed until deleting any constraint from the remaining constraints restores the corresponding subgraph to satisfaction; and classifying the remaining constraints according to the hard rule source and evidence source generated by business time boundaries or process sequence relationships and not dependent on the credential recognition results.
5. A multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 4, characterized in that: The original evidence anchor points with more constraints and lower processing costs in the minimum conflict constraint set are reviewed. The selection score R(a) of the original evidence anchor point a is calculated according to R(a)=coverage(a) / [cost(a)×(1+repeat(a))], where: coverage(a) is the minimum number of conflict constraints covered by the original evidence anchor point, cost(a) is the local re-parsing cost determined by the cropped area, page load times and adjacent text lengths, and repeat(a) is the number of times the same anchor point content summary and local parsing parameter combination has been processed; the original evidence anchor points with larger R(a) are selected first, and the next original evidence anchor point is selected when a conflict state signature already exists.
6. A multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 5, characterized in that: The conflict state signature H is: H=Hash(batchId,conflictSetDigest,anchorDigest,evidenceVersion,domains,parseParams); Where: batchId is the business batch identifier, conflictSetDigest is the summary calculated after sorting the constraint edge identifiers in the minimum conflict constraint set, anchorDigest is the content summary of the original evidence anchor point to be re-parsed, evidenceVersion is the current evidence version identifier, domains is the current time domain of the nodes involved in the minimum conflict constraint set, and parseParams includes the trimming extension range, rotation angle, and neighboring text range; if H already exists in the processing record, the system will not use the same state and parameters to process the anchor point, but will select the next anchor point, adjust the local parsing parameters, or output the manual review identifier; the local parsing parameter adjustment includes the pre-defined trimming extension range, optional rotation angle, and adjacent text window.
7. A multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 6, characterized in that: The input for local re-parsing is limited to the enlarged cropped image of the anchor point to be re-parsed, the rotation-corrected image, adjacent text, business subject, and allowed event types; the output of the large language model includes candidate time literals and their regional location information; when the candidate time literal passes the regional location verification, its deterministic parsing result is used as the time domain of the new evidence version; when the regional location verification fails or the deterministic parsing fails, the original evidence version is retained, and the process moves to the next original evidence anchor point or outputs a manual review identifier.
8. A multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 7, characterized in that: After the evidence version is switched, if the propagation record directly or indirectly depends on the replaced original evidence version, the boundary tightening result formed by the propagation record is revoked, and the corresponding node and adjacent constraint edges are added to the incremental propagation queue. The incremental propagation queue receives nodes and constraint edges that meet the following conditions: The set of parent evidence versions of the propagation record contains the original evidence version that was replaced, or is connected to the aforementioned nodes through constraint edges and whose time domain is affected by the revocation result; for connected components consisting of a group of event nodes connected by constraint edges that do not meet the aforementioned conditions, their time domain and ordering relationship remain unchanged; for invoices whose time domains still overlap after propagation and for which there are no verifiable sequential constraints, an indeterminate sequential relationship is output, and a stable order for display purposes is generated using a fixed key composed of invoice code, invoice number and document identifier, while marking this order as not an evidence verification result.
9. A multi-invoice time-series sorting method based on minimum conflict backtracking according to claim 8, characterized in that: The sorting output includes the invoice order, each chain of evidence verifying the sorting relationship, the minimum set of unresolved conflict constraints, evidence version update records, processed conflict state signatures, and affected subgraph identifiers; the evidence chain is located in reverse from the sorting relationship to the constraint edge, evidence version, and original evidence anchor point according to the propagation record.
10. A system employing the multi-invoice time-series sorting method based on minimum conflict backtracking as described in claim 1, characterized in that, include: The voucher collection and evidence anchoring module is used to acquire multiple invoices and related business vouchers from the same business batch, and to establish original evidence anchor points that include document content summaries, page numbers, and area coordinates. The event candidate generation and verification module is used to call the large language model to generate business event candidates, perform anchor point positioning verification and deterministic time parsing on time literals, and generate versioned business event evidence records that retain the original version. The constraint propagation module is used to establish a temporal constraint diagram that records the anchor point identifiers and evidence versions, perform interval propagation, and generate a propagation record containing the set of parent evidence versions. The conflict backtracking module is used to extract the minimum conflict constraint set when an empty time domain or an unsatisfiable loop is generated, and to map the evidence constraints in it to the original evidence anchor point. The local re-parse module is used to select unprocessed original evidence anchors based on coverage, local re-parse cost and conflict state signature, perform local re-parse and generate new evidence versions; The incremental recalculation module is used to undo propagation results that depend on the original evidence version, repropagating only to the affected subgraphs and retaining the verified ordering relationships of the unaffected subgraphs; The sorting output module is used to output the partial or full order of multiple invoices, the chain of evidence, the minimum conflict constraint set, the evidence version update record, and the affected subgraph identifier.
