A business rule reply receipt abnormality registration system

CN123011645APending Publication Date: 2026-10-30GUANGDONG CAIFENG LOGISTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611316826.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种业务规则回单签收异常登记系统,旨在解决现有技术中在网络抖动、高并发重复上报或终端时钟偏移的情况下,难以准确区分真实签收动作与瞬时噪声事件而易导致伪异常登记,以及在外部规则接口断开连接或网络异常时缺乏稳定的降级与后备控制机制,降低业务处理连续性和异常登记准确性的问题;本发明的技术方案包括:

Benefits of technology

[0044]1.本发明通过将多通道回单签收事件按回单唯一标识路由至同一消息队列分区,并结合终端本地序列号和到达顺序进行串行读取,能够将并发、乱序的原始输入整理为按处理顺序排列的事件流,避免不同通道事件交叉覆盖,提升事件顺序的一致性和后续校验基础的可靠性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011645A_ABST
    Figure CN123011645A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of enterprise business process exception monitoring and rule verification, in particular to a business rule return receipt exception registration system; containing event collection and reception, time window confirmation, state transition verification, exception registration and degradation control units; the system routes multiple channel events to message queue partition serial reading, and dynamically calculates window length according to terminal network round trip delay to confirm event statistics; the core is to verify and classify the confirmed events by combining state machine engine and legal state transition table, and to dynamically adjust the reference window according to the review feedback by structuring registration persistence record; the present application avoids static time window and simple external rule dependence, uses delay self-adaptation and state causal constraint to distinguish real exception and transient noise, effectively reduces the probability of false exception registration and ensures the continuous operation of main business.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of enterprise business process anomaly monitoring and rule verification technology, specifically a business rule return receipt anomaly registration system. Background Technology

[0002] Business rule receipt signing anomaly registration refers to the sequential sorting, time window confirmation, state transition verification, and anomaly persistence recording of receipt signing events generated by multi-channel terminals, in order to identify abnormal receipt signing behavior in the business flow process; the current receipt signing anomaly handling methods usually include processing events one by one in the order of receipt, using a fixed time window for duplicate suppression, and relying on external rule interfaces to perform receipt verification.

[0003] However, when handling receipt signing anomalies based on existing technologies, on the one hand, it is difficult to accurately distinguish between genuine receipt actions and instantaneous noise events under conditions of network jitter, high-concurrency repeated reporting, out-of-order arrival, or terminal clock offset, which can easily lead to false anomaly registration, incorrect state migration, or distorted anomaly judgment; on the other hand, when external rule interfaces are disconnected, terminal network is abnormal, or computing power is limited, the existing processing links lack stable degradation and backup control mechanisms, which will also reduce the accuracy of anomaly registration and the continuity of business processing. Summary of the Invention

[0004] The purpose of this invention is to provide a business rule receipt confirmation anomaly registration system, aiming to solve the problems in existing technologies where it is difficult to accurately distinguish between genuine receipt actions and instantaneous noise events under conditions of network jitter, high-concurrency repeated reporting, or terminal clock skew, easily leading to false anomaly registrations; and the lack of stable degradation and backup control mechanisms when external rule interfaces are disconnected or network anomalies occur, reducing the continuity of business processing and the accuracy of anomaly registration. The technical solution of this invention includes:

[0005] A business rule-based receipt confirmation anomaly registration system, the system comprising a state machine engine, a structured register, a message queue partition, an event acquisition and reception unit, a time window confirmation unit, a state transition verification unit, an anomaly registration unit, and a degradation control unit, wherein:

[0006] The state machine engine stores a valid state transition table;

[0007] The event acquisition and reception unit is used to route multi-channel receipt receipt events carrying unique receipt identifiers, local terminal timestamps, and terminal network round-trip delays to the message queue partition and read them serially, and output the event stream.

[0008] The time window confirmation unit is used to calculate the window duration based on the terminal network round-trip latency in the event stream, and to perform statistical confirmation within the window duration to obtain the proportion of confirmed events and actions.

[0009] The state transition verification unit is used to perform legality verification based on the confirmation event and the proportion of actions, combined with the legal state transition table, and output the abnormality level judgment result and the corresponding abnormal event.

[0010] The anomaly registration unit is used to write the anomaly event into the structured register according to the anomaly level determination result;

[0011] The degradation control unit is used to monitor the status of terminal devices and network links and output control results. Preferably, the time window confirmation unit has a built-in baseline window duration as an initial window parameter; the anomaly registration unit is also used to organize the abnormal events and context data into the structured register, the context data including associated event trajectories and state machine snapshots, and adjust the baseline window duration based on the received external review feedback statistical results; the degradation control unit calculates the control result for abnormal network states or abnormal states where terminal performance parameters reach preset performance parameter thresholds, including at least one of entering the cooling queue, switching to local backup rules in the local backup rule storage module, or skipping business rule verification.

[0012] Preferably, the event acquisition and reception unit specifically includes:

[0013] The message generation module is used to output an event message containing the unique identifier of the receipt, the type of receipt action, the local timestamp of the terminal, the local serial number of the terminal, and the round-trip time of the terminal network when the receipt receipt event occurs.

[0014] The partition routing module is used to perform hash calculation on the event message based on the unique identifier of the return receipt, and route event messages with the same unique identifier to the same message queue partition;

[0015] The serial reading module is used to serially read event messages in the message queue partition by a single-threaded consumer according to the terminal local sequence number and arrival order, and output the event stream arranged in the processing order.

[0016] Preferably, the time window confirmation unit specifically includes:

[0017] The window management module dynamically determines the window duration of the current terminal based on the distribution characteristics of historical sampling data of the terminal network round-trip delay within a preset number of consecutive samplings and a preset delay amplification coefficient.

[0018] The buffer writing module is used to write events in the event stream into a built-in circular buffer using the unique identifier of the receipt as the key, and to use the window duration as the duration of a time window; the statistics confirmation module is used to, after the time window is closed, count the most frequent signing action type in the event sequence of the same unique identifier of receipt within the time window and calculate the corresponding action ratio, and confirm valid events or open an extended window based on the relationship between the action ratio and a preset consistency threshold.

[0019] Preferably, the statistical confirmation module is specifically used for:

[0020] When the total number of the event sequence is greater than or equal to the preset minimum number of samples, and the proportion of the action is greater than or equal to the consistency threshold, the most frequent signing action type is taken as the confirmation event and the proportion of the action is output.

[0021] When the percentage of the actions is less than the consistency threshold, or the total number of the event sequences is less than the preset minimum number of samples, the state is determined to be uncertain, and the extended window is opened for resampling.

[0022] If the percentage of actions calculated at the end of the extended window is still less than the consistency threshold, a forced manual review flag is output, along with a preset invalid flag value.

[0023] Preferably, the state transition verification unit specifically includes:

[0024] The state transition control module is used to perform direct state transition on the confirmation event when the proportion of the action is greater than or equal to a preset first threshold; when the proportion of the action is less than the first threshold but greater than or equal to a preset second threshold, add the confirmation event to a built-in delayed processing queue for execution; and issue a state verification instruction when the proportion of the action is less than the second threshold, wherein the first threshold is greater than the second threshold.

[0025] The legality verification module is used to compare the confirmation event of the execution state transition with the legal state transition table to obtain abnormal transition events that deviate from the legal state transition table;

[0026] The anomaly level determination module is used to classify the abnormal flow events based on the statistically obtained number of state deviations, duration, proportion of actions, or degree of rule conflict; wherein, when the flow is legal but the business rule verification returns a rejection, it is determined to be a major anomaly.

[0027] When a state deviates from a previous state by a reverse transition and the number of deviations is greater than or equal to 1, it is considered a serious anomaly. For other lateral deviations that are not reverse transitions, if no new event that can automatically correct the state is received within the duration and the proportion of actions is lower than the preset confidence level, it is considered a warning anomaly. If a new event is received within the duration that automatically corrects the state back to a legal path, it is considered a transient anomaly, and the anomaly level determination result is output.

[0028] Preferably, the anomaly registration unit specifically includes:

[0029] The data organization module is used to extract the abnormal events that are determined to be serious or important abnormalities, and obtain the unique abnormality identifier, abnormality level, abnormality type code, associated event trajectory, window duration, total number of samples, and state machine snapshot output by the state machine engine;

[0030] The writing module is used to splice and organize the extracted data and write it into the structured register to obtain the abnormal data registration results;

[0031] The feedback correction module is used to increase or decrease the duration of the reference window by a preset compensation step size or a preset decay step size, based on the comparison result between the abnormal misjudgment rate determined in the review feedback statistics and the preset tolerance threshold.

[0032] Preferably, the degradation control unit specifically includes:

[0033] The offline processing module is used to switch the terminal to offline processing mode when the network round-trip delay of the terminal is continuously detected to be greater than the preset offline trigger delay threshold or the network is disconnected. It enables the built-in local simplified state machine to perform state transitions in the order of preset legal states and persists the events to the built-in local queue.

[0034] The frequency limiting module is used to force the subsequent events corresponding to the unique identifier of the single receipt into the built-in cooling queue when the number of events arriving within a set time window is greater than the preset threshold for the number of events per unit time. After the preset cooling duration ends, the last event of the queue is taken as a valid input and the preceding events are discarded.

[0035] The rule degradation module is used to switch to loading the local backup rules in the local backup rule storage module when the external business rule engine is disconnected for more than a set time. When the preset local rule lifespan is exceeded, the business rule verification is skipped and only the legality of the state machine transition is verified.

[0036] The clock correction module is used to obtain the network time protocol synchronization offset from the terminal or an external clock synchronization module, and to correct the terminal local timestamp based on the terminal local timestamp carried in the event message and the network time protocol synchronization offset.

[0037] Preferably, the clock correction module corrects the local timestamp of the terminal, specifically for:

[0038] Obtain the terminal local timestamp and the network time protocol synchronization offset from the event message;

[0039] The corrected real timestamp is determined based on the synchronization offset between the terminal's local timestamp and the network time protocol.

[0040] Determine whether the absolute value of the network time protocol synchronization offset is greater than a preset clock offset tolerance threshold;

[0041] If the absolute value of the network time protocol synchronization offset is greater than the preset clock offset tolerance threshold, the terminal's time window triggering mechanism will be switched to the server arrival time mode, and a clock anomaly alarm will be output.

[0042] If the absolute value of the network time protocol synchronization offset is less than or equal to the preset clock offset tolerance threshold, the time window triggering mechanism based on the corrected real timestamp is maintained.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] 1. This invention routes multi-channel receipt receipt events to the same message queue partition according to the unique identifier of the receipt, and performs serial reading by combining the terminal's local serial number and arrival order. This can organize concurrent and out-of-order raw inputs into an event stream arranged in the processing order, avoid cross-over of events from different channels, improve the consistency of event order and the reliability of subsequent verification basis.

[0045] 2. This invention dynamically determines the duration of the time window based on the round-trip time of the terminal network, and performs frequency statistics and action percentage confirmation within the window. This can suppress the interference of repeated reporting, network latency peaks and short-cycle jitter on the signing judgment, transform unstable inputs into verifiable statistical results, and reduce the probability of false abnormal registrations.

[0046] 3. This invention uses a state machine engine and a legal state transition table to verify the legality of confirmed events. It also combines the hierarchical execution of direct transition, delayed processing, or state verification based on the proportion of actions, which can distinguish between real state transition anomalies and transient noise events, thereby improving the accuracy and granularity of anomaly judgment. Attached Figure Description

[0047] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. The drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0048] Figure 1 This is a structural block diagram of a business rule return receipt abnormality registration system according to this application. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] Please see Figure 1 A business rule return receipt abnormality registration system, the system includes a state machine engine, a structured register, a message queue partition, as well as an event acquisition and reception unit, a time window confirmation unit, a state transition verification unit, an abnormality registration unit and a degradation control unit, wherein: the state machine engine stores a valid state transition table;

[0051] The event acquisition and reception unit is used to route multi-channel receipt receipt events carrying unique receipt identifiers, local terminal timestamps, and terminal network round-trip delays to message queue partitions and read them serially, and output the event stream.

[0052] The time window confirmation unit is used to calculate the window duration based on the terminal network round-trip latency in the event stream, and to perform statistical confirmation within the window duration to obtain the proportion of confirmed events and actions.

[0053] The state transition verification unit is used to perform legality verification based on the proportion of confirmed events and actions, combined with the legal state transition table, and output the abnormality level judgment result and the corresponding abnormal event.

[0054] The anomaly registration unit is used to write abnormal events into a structured register according to the anomaly level determination results;

[0055] The degradation control unit monitors the status of terminal devices and network links, and outputs control results. The time window confirmation unit has a built-in baseline window duration as an initial window parameter; the anomaly registration unit is also used to organize and write abnormal events and context data into a structured register. The context data includes related event trajectories and state machine snapshots, and adjusts the baseline window duration based on the received external review feedback statistics.

[0056] The degradation control unit calculates control results for abnormal network conditions or abnormal conditions where terminal performance parameters reach preset performance parameter thresholds. These results include at least one of the following: entering the cooling queue, switching to local backup rules in the local backup rule storage module, or skipping business rule verification.

[0057] This embodiment provides a business rule return receipt signing anomaly registration system; the system receives return receipt signing events from multi-channel terminals, organizes the events carrying the terminal's local timestamp and terminal network round-trip delay into an event stream arranged in processing order, completes statistical confirmation within the time window, and outputs the confirmed events and action percentages; then, it performs state transition verification on the confirmed events according to the legal state transition table to obtain the anomaly level judgment result and the anomaly event;

[0058] For abnormal events that meet the registration criteria, they are written into a structured register along with contextual data such as associated event trajectories and state machine snapshots. At the same time, the baseline window duration is adjusted based on feedback from manual review. When terminal devices or network links malfunction, the system also performs degradation control on the business rule verification path to ensure the continuity of main business processing and reduce the probability of false anomaly registration.

[0059] In practical implementation, the system can be divided into several processing stages: event entry, time window confirmation, state transition verification, anomaly registration, and degradation control. The event entry stage mainly completes the aggregation and orderly processing of events from multiple channels. The time window confirmation stage mainly performs statistical filtering on repeated, out-of-order, or conflicting events within a short period.

[0060] The state transition verification stage mainly uses a state machine engine to identify legal and illegal transitions; the anomaly registration stage mainly performs structured and persistent recording of anomalies that meet the severity requirements; the degradation control stage mainly maintains the processing chain to continue running when there are network anomalies, disconnection of rule interfaces, or limited terminal computing power; through the above sequence, the system output is not an unfiltered raw event set, but a valid registration result after time suppression, state constraints, and anomaly filtering.

[0061] Based on the above embodiments, multi-channel receipt receipt events are obtained. According to the unique receipt identifier, terminal local timestamp and terminal network round-trip delay carried in the receipt receipt event, message queue partitioning and serial reading are performed on the receipt receipt event, and the event stream is output in the order of processing.

[0062] Among them, the receipt signing event refers to the signing action record generated in the counter terminal, mobile device or interface channel, such as initiating signing, confirming signing, withdrawing or retrying; the terminal network round-trip latency refers to the link round-trip latency between the terminal and the server within one sampling period, which is used to characterize the current link jitter and the fluctuation state of the current network latency parameter deviating from the standard benchmark value, such as network fluctuation with latency offset within the first preset range, or network latency peak with a duration less than the preset judgment period;

[0063] This embodiment processes events from each channel independently. First, events of the same business object are aggregated into a unified partition and then read serially. This organizes the concurrent physical inputs that are susceptible to interference into a verifiable logical sequence input. This embodiment can achieve the ordering of event streams based on message queue partitioning and serial reading, avoiding cross-over of the same order event in different channels. Ultimately, it solves the technical defect of the existing technology that causes the subsequent verification results to be distorted due to the lack of a unified event sequence basis.

[0064] Based on the above embodiments, an event stream is acquired, and the event stream is statistically confirmed within a time window according to the terminal network round-trip latency in the event stream. The proportion of confirmed events and actions is then output. Here, the baseline window duration refers to the initial window parameter built into the time window confirmation unit, which is used to limit the sampling duration range of the same transaction within a statistical period, for example, to cover the repeated reporting interval under normal network conditions. The window duration refers to the actual statistical window calculated based on the baseline window duration and the terminal network round-trip latency.

[0065] Action percentage refers to the ratio of the most frequent signature action within the same window to the total number of events in the window, used to reflect whether the current actions are sufficiently consistent; the calculation process of window duration is based on matching the current link latency level to prevent the same business action from being broken up or unrelated actions from being mixed in, and the specific calculation method is as follows:

[0066]

[0067] In this calculation method, the window duration corresponding to the current terminal The baseline window duration characterizes the duration of the terminal's ability to perform anti-interference statistics under current network conditions. The characterization system reserves a minimum acknowledgment period for normal network environments to prevent the window from being compressed to the point where it cannot cover repeated reports. (The last preset value is likely a typo and can be left as is.) The 95th percentile of network round-trip time in the second sample This characterizes the terminal's latency level near the upper bound within the current operating cycle, reflecting occasional high-latency transient fluctuations rather than average latency; the latency amplification factor is used. This is a compensation constant that covers additional time lost due to network retransmissions and queuing; its value is a preset value greater than 1. To obtain the maximum value function; after the window is closed, frequency statistics are performed on the event sequence corresponding to the unique identifier of the same order to obtain the most frequent action and its frequency. Then, the ratio of this frequency to the total number of events in the window is calculated to form the action percentage:

[0068]

[0069] In this calculation process, the proportion of actions The degree of concentration of dominant actions within the representation window, and the number of events corresponding to the most frequent actions. The number of actions within the current window that most likely represent the true business intent, and the total number of events within the window. This represents the total number of samples actually received within the window period for this receipt;

[0070] If the percentage of actions reaches the consistency threshold and the total number of samples reaches the preset minimum number of samples, the most frequent action is identified as a confirmed event; if the percentage of actions is insufficient or the total number of samples is insufficient, an extended window is opened for recounting; if the consistency threshold is still not reached after the extended window ends, an invalid flag value is output with a forced manual review mark.

[0071] This embodiment adopts a fixed window or single-event determination method with unified fixed parameters. It dynamically balances the window width based on network round-trip latency and identifies real actions and jitter actions through an action proportion quantification evaluation mechanism. It transforms repetitive and out-of-order inputs in high-latency environments into verifiable statistical results. This embodiment can extract confirmed events based on dynamic windows and voting statistics, avoiding network jitter from directly interfering with business determination. Ultimately, it solves the technical defect of existing technologies that lead to a high incidence of false anomalies due to the lack of a latency adaptive confirmation mechanism.

[0072] Based on the above embodiments, the proportion of confirmed events and actions is obtained, and the legality of state transitions of confirmed events is verified according to the legal state transition table. The abnormality level judgment result and the corresponding abnormal event are output. The legal state transition table refers to the set of state transition constraints pre-stored in the state machine engine. For example, pending receipt can only flow to receipt, and already signed should not directly revert to pending receipt.

[0073] A confirmation event refers to a signature action that is recognized as valid input after being confirmed within a time window; the anomaly level judgment result refers to the anomaly classification result obtained based on the degree of state deviation, duration, action ratio, or rule conflict degree, such as severe anomaly, important anomaly, warning anomaly, and instantaneous anomaly; instead of simply marking based on business rule results, this embodiment uses state machine constraints in conjunction with action ratio: for confirmation events with a high action ratio, state transition is directly executed; for confirmation events with an action ratio in the middle range, they are entered into a delayed processing queue; and for confirmation events with a low action ratio, a state verification instruction is issued.

[0074] Only when the state transition deviates from the legal state transition table after the state transition will the abnormal event and abnormal level be output. This can distinguish the surface abnormality caused by network retransmission from the real state transition abnormality. This embodiment can realize abnormality identification based on the state machine engine and the legal state transition table, avoid misjudgment based on a single event or a single rule return, and finally solve the technical defect of the existing technology that the granularity of abnormality judgment is coarse due to the lack of state causal constraints.

[0075] Based on the above embodiments, the anomaly level determination result and anomaly events are obtained. According to the anomaly level determination result, the anomaly events that meet the registration requirements are organized and written into data, and a structured registration result is output. Among them, the associated event trajectory refers to the event chain that is temporally and state-related to the anomaly event before it is triggered, such as multiple preceding confirmation events and their corresponding timestamps and action percentages; the state machine snapshot refers to the current state, the state before migration, or the expected legal path information output by the state machine engine at the time of anomaly determination; the structured register refers to the structured data storage body used to save the anomaly registration results.

[0076] Instead of simply recording exception codes or brief descriptions, this embodiment organizes and writes the unique exception identifier, exception level, exception type code, associated event trajectory, window duration, total number of samples, and state machine snapshot together. This allows subsequent manual review to directly correspond to the complete context before and after the exception occurred, rather than facing a single exception identifier lacking associated information. This embodiment can achieve structured exception registration based on contextual data organization, avoiding the inability to review and trace due to missing exception information, and ultimately solving the technical defect of existing technologies that affect the efficiency of handling due to the lack of complete exception context.

[0077] Based on the above embodiments, the review feedback statistics obtained after manual review of abnormal registration are obtained, the baseline window duration is adjusted according to the review feedback statistics, and the updated baseline window duration is output.

[0078] Among them, the review feedback statistics refer to the statistical data on whether abnormal events were misjudged after manual review, such as the number of misjudgments and the total number of reviews; the abnormal misjudgment rate is the ratio between the number of misjudgments and the total number of manual reviews, used to reflect whether the current window parameters are too tight, thus registering repetitive or jittery events that should be considered normal as abnormal; when the abnormal misjudgment rate Greater than the preset tolerance threshold When using the formula

[0079]

[0080] The baseline window duration is compensated and adjusted, among which, The duration of the baseline window characterizing the current cycle. Characterizes the adjusted next cycle baseline window duration, where To preset the compensation step size, The maximum allowable baseline window duration; when the anomaly false positive rate... Less than or equal to the preset tolerance threshold Furthermore, when the current reference window duration is greater than the initial reference window parameter, the formula is used.

[0081]

[0082] The baseline window duration is decayed and reduced, where To preset the decay step size, This is the system's built-in initial baseline window parameter; this tolerance threshold The compensation step size is used to limit the acceptable level of misjudgment in the system and to control the window width adjustment range to prevent excessively large adjustments from causing the confirmation cycle to be extended.

[0083] In this embodiment, instead of using static parameters that are fixed for a long time, the window parameters are adaptively adjusted through verification feedback, so that high-misjudgment terminals gradually obtain a wider confirmation range, thereby suppressing abnormal noise caused by duplicate messages. This embodiment can adjust the baseline window duration based on the verification feedback statistical results, avoiding the accumulation of misjudgments caused by fixed parameters remaining unchanged for a long time, and ultimately solving the technical defect of the prior art that the noise of the abnormal register continues to increase due to the lack of feedback correction mechanism.

[0084] Based on the above embodiments, the operating status of the terminal device and network link is obtained, and network anomalies are identified using the formula.

[0085]

[0086] The quantified computing load assessment value, of which This refers to the average utilization rate of the terminal's central processing unit. This represents the percentage of available memory. and Let be the weight coefficient, and satisfy... Its specific value is pre-calibrated based on the actual impact of the terminal CPU and memory on the computing power bottleneck. Both the computing power load assessment value and the preset computing power alarm threshold are dimensionless percentage constants. When the continuously set time period exceeds the preset computing power alarm threshold, it is determined that the computing power limitation condition is met, and the status of the terminal device and network link is monitored, and at least one control result is output, such as entering the cooling queue, switching to the local backup rule, or skipping the business rule verification.

[0087] Among them, the cooling queue refers to the buffer queue that temporarily stores and delays the processing of subsequent events when the number of events increases abnormally within a unit of time, such as when a large number of duplicate reports of the same order occur continuously within a statistical period; local backup rules refer to the snapshot of backup rules stored locally, which is used to maintain basic verification capabilities when the external business rule engine is unavailable; skipping business rule verification means that when the local rules also exceed the available range, only the legality judgment of state machine transition is retained.

[0088] In handling network anomalies that block the main process, this embodiment employs cooling, rule switching, and verification degradation methods for different fault types. This ensures that the main link remains available under abnormal conditions and records degradation results separately from normal judgment results. This embodiment can achieve processing continuity under abnormal conditions based on the degradation control unit, avoiding the main business process from being blocked due to rule interface disconnection or network anomalies. Ultimately, it solves the technical defects of existing technologies that lack backup control mechanisms, resulting in a large number of missed judgments or blockages in high-concurrency environments.

[0089] In response to the technical defects of distributed business systems, such as false anomaly registration and false state triggering, under network latency fluctuations and high-concurrency repeated reporting conditions, this embodiment focuses not on whether a single event can be read, but on whether the system can still distinguish between real anomalies and systemic transient failures under extreme conditions such as network jitter, high-concurrency repeated reporting, and occasional unavailability of rule interfaces.

[0090] Conventional solutions often use static time thresholds or synchronous rule calls, which have limitations and insufficient sensitivity: when the window is fixed, even a slight transient fluctuation in the link will split a real action into multiple anomalies; when heavily dependent on external rule interfaces, once the connection is broken, a large number of normal processes will be backed up as unprocessed anomalies.

[0091] This implementation method uses event stream serialization, dynamic window confirmation based on network round-trip latency, legal state transition table constraints, and degradation control under abnormal conditions to work together to keep the main process running while separating duplicate or out-of-order pseudo-events eliminated in the first window from abnormal events that are actually deviating from the state machine path. Therefore, it is more suitable for business environments with multiple network points, high concurrency, and unstable network conditions.

[0092] In the application examples, the system can be deployed in a processing environment consisting of a terminal-side acquisition component, a message queue, a server-side state machine engine, and a structured register. Newly generated receipt receipt events are written to the message queue partition by the terminal side. The server performs serial reading of the events corresponding to the unique identifier of the same receipt, calculates the window duration based on the terminal network round-trip latency, and outputs the confirmation events and action percentages after the window is closed.

[0093] The state transition verification unit performs verification based on the valid state transition table, and writes serious or important anomalies into the structured register. The manual review results are then fed back to the anomaly registration unit to update the baseline window duration. When the terminal experiences continuous high link latency, disconnection of the rule interface, or event concurrency overload, the degradation control unit triggers the corresponding control results to ensure that subsequent new events can continue to flow in and be processed. Through this deployment method, the system can continuously receive new data, complete anomaly registration, and use the review results to correct parameters during actual business operations.

[0094] A business rule-based receipt confirmation anomaly registration system, the event collection and receiving unit specifically includes:

[0095] The message generation module is used to output an event message containing the unique identifier of the receipt, the type of receipt action, the local timestamp of the terminal, the local serial number of the terminal, and the round-trip time of the terminal network when the receipt receipt event occurs.

[0096] The partition routing module is used to perform hash calculations on event messages based on the unique identifier of the return receipt, and to route event messages with the same unique identifier to the same message queue partition;

[0097] The serial read module is used to serially read event messages in the message queue partition by a single-threaded consumer according to the terminal local sequence number and arrival order, and output the event stream arranged in the processing order;

[0098] A business rule-based return receipt anomaly registration system, the time window confirmation unit specifically includes:

[0099] The window management module dynamically determines the window duration of the current terminal based on the distribution characteristics of historical sampling data of the terminal network round-trip delay within a preset number of consecutive samplings and the preset delay amplification coefficient.

[0100] The buffer writing module is used to write events in the event stream to the built-in circular buffer using the unique identifier of the receipt as the key, and uses the window duration as the duration of a time window; the statistics confirmation module is used to count the most frequent signing action type in the event sequence of the same unique identifier of receipt within the time window after the time window is closed, calculate the corresponding action ratio, and confirm valid events or open an extended window based on the relationship between the action ratio and the preset consistency threshold.

[0101] A business rule return receipt abnormality registration system, the statistical confirmation module is specifically used to: when the total number of event sequences is greater than or equal to the preset minimum sampling number, and the action ratio is greater than or equal to the consistency threshold, take the most frequent receipt action type as the confirmation event, and output it along with the action ratio;

[0102] When the percentage of actions is less than the consistency threshold, or the total number of event sequences is less than the preset minimum number of samples, the state is determined to be uncertain, and an extended window is opened for resampling; if the percentage of actions calculated at the end of the extended window is still less than the consistency threshold, a forced manual review flag is output, and a preset invalid flag value is output.

[0103] This implementation describes the event acquisition and reception unit and the time window confirmation unit in detail. The processing objective of this part is to first organize the original input of the same order into a traceable and sortable event stream, and then complete the frequency statistics and consistency confirmation within the corresponding window, and output the confirmation events and action proportions that can be used by the subsequent state machine. After this processing, what enters the subsequent verification stage is not the unfiltered original message, but the event results that have been filtered out of most of the duplicate, out-of-order and jitter interference.

[0104] Based on the above embodiments, the receipt receipt event is obtained, and according to the terminal collection information when the receipt receipt action occurs, the receipt receipt event is output as a message, and the output message includes the unique receipt identifier, receipt action type, terminal local timestamp, terminal local serial number and terminal network round-trip delay.

[0105] Among them, the unique identifier of the receipt refers to the identification information used to uniquely correspond to a business receipt. For example, each initiation, confirmation, and withdrawal action in the same receipt process corresponds to the same identifier; the receipt action type refers to the type of business action represented by the event message, such as initiation, confirmation, withdrawal, timeout, and retry; the terminal local sequence number refers to the sequence value that increases sequentially in the same terminal, used to reflect the original sequence of actions on the terminal side; the terminal network round-trip delay refers to the link round-trip delay collected within the corresponding period of the event, used to reflect the current network conditions;

[0106] Instead of simply uploading action results or recording only the server's receiving time, this embodiment synchronously writes the terminal's local timestamp, local serial number, and network round-trip latency during the message output stage. This enables subsequent time window confirmation, sequence verification, and delay assessment. This embodiment can achieve standardized expression of the original business actions based on complete event message fields, avoiding the inability to carry out subsequent window confirmation and status analysis due to missing key information. Ultimately, it solves the technical defect of existing technologies that lack sufficient event interpretation capabilities due to the single data collection dimension.

[0107] Based on the above embodiments, the event message is obtained, and a hash value is obtained by hashing the event message using a non-encrypted hash algorithm according to the unique identifier of the receipt. Furthermore, the formula is applied...

[0108]

[0109] Determine the corresponding message queue partition, where Physical index for the target partition, For hash value, This represents the total number of current message queue partitions. The modulo operator is used to precisely route event messages with the same unique identifier to the corresponding record. The same message queue partition;

[0110] Among them, hash calculation refers to the partition calculation method of distributing and mapping the unique identifier of the return receipt, which is used to fix the events of the same business object into the same processing channel; message queue partition refers to the logical segmentation within the message queue for concurrently carrying the event stream, such as one partition among multiple parallel partitions; the processing method of queuing according to the terminal source or access channel, in this embodiment, the unique identifier of the return receipt is used as the routing basis, so that all events of the same return receipt are concentrated in the same partition before entering the statistical confirmation, avoiding the time sequence disorder of actions caused by cross-partition concurrent consumption;

[0111] This embodiment can achieve unified queuing of the same business object based on the unique identifier of the return receipt, avoid the order drift caused by concurrent and distributed processing, and ultimately solve the technical defect of the existing technology that makes it difficult to uniformly confirm the same return receipt event due to inconsistent routing standards.

[0112] Based on the above embodiments, event messages in the message queue partition are obtained, and the event messages are read serially according to the terminal local sequence number and arrival order, and an event stream arranged in processing order is output; wherein, the arrival order refers to the order in which the event messages enter the message queue partition; the event stream arranged in processing order refers to the set of events extracted sequentially by a single-threaded consumer, which retains both the original sequence relationship on the terminal side and the information on the order in which they enter the server processing chain;

[0113] In implementing the sorting logic, to eliminate the potential timing uncertainty between the terminal's local serial number and the arrival order, the system has a built-in priority determination rule: the terminal's local serial number is used as the first priority for ascending order reordering; when a discontinuous break in the serial number is detected, the subsequent arrival events are temporarily stored in the disordered reordering buffer.

[0114] If the missing sequence number event is filled in within the preset reordering waiting time, it is inserted and output in order; if it still has not arrived after the reordering waiting time, the events in the buffer are forcibly output with the arrival order of the message queue partition as the second priority; in the method of multi-threaded parallel reading of the same business object event, this embodiment adopts a single-threaded consumer to perform serial reading of the same partition, so that events with the same unique identifier of the receipt maintain a single-channel processing relationship before entering the window confirmation, thereby reducing the reordering error introduced by concurrency competition;

[0115] This embodiment can achieve stable output of events in a serial reading order, avoiding the disorder of processing order of the same order in a high-concurrency environment, and ultimately solving the timing distortion problem caused by concurrent consumption in the existing technology;

[0116] Based on the above embodiments, the event stream is obtained, and the most recent event stream in the terminal network round-trip latency is selected. The 95th percentile network round-trip time of the next sample and the preset delay amplification factor are used to calculate the window duration of the current terminal and determine the duration of the corresponding window; among which, the most recent Sub-sampling refers to the continuous set of samples used by the time window confirmation unit to characterize the current terminal network status, where The preset threshold for the number of consecutive samples is used to control the stability and sensitivity of the statistics. For example, a preset number can be selected to take into account both recent fluctuations and the overall trend.

[0117] The 95th percentile network round-trip time refers to the network time in the most recent period. The round-trip delay values ​​at the high end of the sample are used to reflect the peak network latency level near the tail end; the preset delay amplification factor is a parameter used to compensate for and amplify the high-end round-trip delay, covering additional delays such as retransmission and queuing; the window duration is dynamically calculated by following the current network quality changes of the corresponding terminal, and the specific calculation method is as follows:

[0118]

[0119] In this calculation method, the current terminal's window duration The baseline window duration represents the statistical period used by this terminal to aggregate the same service action under the current link conditions. The characterization system reserves a minimum acknowledgment period for normal network environments to prevent the window from being compressed to the point where it cannot cover a single repeated report. The 95th percentile network round-trip delay in the second sample This characterizes the network round-trip latency distribution data of the terminal within a preset operating cycle and within a set high threshold range, with a preset latency amplification factor. Characterized by compensation measures for duplicate transmissions, link fluctuations, and protocol backoff reservations. This is a function to find the maximum value.

[0120] In practice, the number of samples The preferred value range is... For example, a value of 20 can be used to ensure... The statistics possess sufficient statistical significance without causing a lag in response to transient network degradation due to excessively long sampling periods; regarding the time delay amplification factor... The specific calibration criteria can be set based on the terminal's historical retransmission count and average network jitter distribution, under normal network conditions. The preferred value range is... This is to fully cover the time consumed by a standard transmission control protocol retransmission and the local queuing time.

[0121] In this fixed-window approach, the window length is driven by the network round-trip time, enabling low-latency terminals to maintain faster confirmation and high-jitter terminals to obtain more sufficient aggregation time. This embodiment can adaptively determine the window duration based on the 95th percentile network round-trip time and the delay amplification factor, avoiding missed aggregation or erroneous aggregation caused by a single window parameter. Ultimately, it solves the technical defect of unstable confirmation caused by the disconnect between the window and the network state in the existing technology.

[0122] Based on the above embodiments, an event stream is obtained, and events in the event stream are buffered according to the unique identifier of the return receipt, and the event sequence in the window with the unique identifier of the return receipt as the key is output.

[0123] The circular buffer refers to a circular write storage area within the time window confirmation unit used to temporarily store short-cycle events of the same order, such as for handling short-cycle actions like continuous retries and resending after withdrawal. The unique identifier of the order is used as the key to write events corresponding to the same order into the same logical buffer unit, thereby ensuring that statistics are only applied to the same business object. In terms of physical data structure implementation, in order to avoid the overload of event concurrency under high concurrency conditions, which would cause uncounted valid events to be overwritten by the circular write pointer, the total number of slots in the circular buffer is set to a fixed capacity that can accommodate the expected highest concurrency frequency, and the slots are mapped to discrete time scales in conjunction with the window duration.

[0124] When a write pointer is detected to be about to catch up with the read pointer, potentially causing data overwriting, the system automatically triggers the in-situ accumulation and merging of events based on the same signature action type, instead of continuously occupying new slots. This ensures the integrity of business action statistics within limited physical memory. By accumulating all events uniformly and then filtering them according to conditions afterward, this embodiment isolates and stores events by unique identifiers during the write phase, supplemented by a collision merging mechanism. This allows statistical confirmation to directly address the local event sequence of a single business object, without being affected by high-concurrency traffic from irrelevant receipts.

[0125] This embodiment can achieve short-cycle aggregation of the same order event based on a circular buffer, avoiding statistical deviation and memory overflow caused by the mixing of different order events, and ultimately solving the technical defect of the prior art that the sampling object is impure due to the coarse buffer granularity.

[0126] Based on the above embodiments, the event sequence after the window is closed is obtained. According to the frequency of the signing action type in the event sequence, the event sequence is statistically confirmed, and a confirmation event is output or an extended window is opened. Among them, the most frequent action refers to the signing action type that appears most often in the window, which physically corresponds to the action that is most likely to reflect the true business intention.

[0127] The consistency threshold refers to a preset proportion threshold used to determine whether the most frequent action is stable enough, such as a threshold set to be greater than or equal to a preset proportion; the extended window refers to a statistical window that is opened again after the original window ends based on a preset compensation duration, used to add sampling to uncertain environments.

[0128] In actual system configuration, the minimum sample size is set based on the conventional concurrent retry limit of the receipt signing channel, for example, it can be set to 3, to ensure that the event sequence participating in the statistics is not an isolated single jitter; the consistency threshold is set to a range of 65% to 85%, with a preferred ratio of 70%. If the proportion of actions is greater than or equal to the consistency threshold, it can be considered that the highest frequency actions have eliminated concurrent interference and have high confidence; the preset compensation duration... The value of is obtained through the system's periodic sliding sampling algorithm, specifically using the formula...

[0129]

[0130] Among them, the historical average retry latency is calculated. This represents the most recently set total number of historical samples. For sampling index, and The first The retry timestamp and the initial failure timestamp for this event. For the summation function, for example, a cutoff value of 500 milliseconds is set for the calculation result; the process of statistically confirming the event sequence involves selecting the dominant action from multiple conflicting actions and using the action percentage to characterize the credibility of the action. The specific calculation method for the action percentage is as follows:

[0131]

[0132] In this calculation, the proportion of actions This represents the proportion of the dominant action within the current window relative to all samples, and the number of events corresponding to the most frequent action. The number of times the most concentrated action within the representation window is observed, and the total number of events within the window. This represents the total number of action samples received within the window.

[0133] In specific implementation, the following logic can be used for judgment: when the total number of event sequences is greater than or equal to the preset minimum sampling number, and the action proportion is greater than or equal to the consistency threshold, the most frequent action is used as the confirmation event and the action proportion is output; when the action proportion is less than the consistency threshold, or the total number of event sequences is less than the preset minimum sampling number, the state is determined to be uncertain and an extended window is opened for resampling; if the action proportion is still less than the consistency threshold when the extended window ends, a forced manual review mark is output, and a preset invalid flag value is output for subsequent state transition verification unit to identify.

[0134] This embodiment confirms the event as soon as the first event is received, or uses a rough filtering method based on a total number threshold. It also considers the total number of samples and the proportion of dominant actions, which can distinguish between occasional withdrawals, duplicate reports, or out-of-order resending within a short period and truly stable confirmation actions. This embodiment can realize the output of confirmation events or extend the window for resampling based on frequency statistics and consistency judgment, avoiding low-quality samples from directly entering the state machine for processing. Ultimately, it solves the technical defect of the existing technology that causes frequent pseudo-state flips due to the lack of a voting confirmation mechanism.

[0135] Comparative analysis shows that in high-concurrency event streams and signal processing environments, a common evaluation benchmark is to observe whether the system can stably extract dominant events without being disturbed by a small amount of noise under conditions of repeated reporting, out-of-order arrival, and peak network latency.

[0136] If a fixed window and first-release-decision mode is adopted, a few duplicate confirmations or delayed withdrawals can easily mask the real business actions within a short period. If completely independent processing is adopted, the server can only see discrete inputs and cannot recover the concentrated trend of actions in the same order. This implementation method uses a combination of unified partitioning of the same order, serial reading, key buffering, and consistency threshold confirmation to stitch the originally scattered samples into a statistically significant short-cycle event sequence. Therefore, it is easier to maintain the stability of the confirmation results under link jitter and high concurrency conditions.

[0137] In this application example, the terminal outputs an event message each time a receipt action occurs and writes it to a message queue partitioned according to the unique identifier of the receipt; the server-side consumer serially reads the event message from the corresponding partition and writes it to a circular buffer according to the unique identifier of the receipt; the window management module reads the most recent... The network round-trip delay is sampled, the current window duration is calculated, and after the window is closed, the statistics confirmation module calculates the most frequent action and the percentage of actions.

[0138] If the consistency threshold and minimum sampling number conditions are met, an acknowledgment event is output; if not, the process enters an extended window for resampling; if still not met, a preset invalid flag value and a forced manual review flag are output. In this way, the subsequent state transition verification unit receives event results that have been filtered through short-cycle statistics.

[0139] A business rule-based return receipt anomaly registration system, wherein the state transition verification unit specifically includes:

[0140] The state transition control module is used to perform direct state transition on the confirmation event when the proportion of actions is greater than or equal to a preset first threshold; when the proportion of actions is less than the first threshold but greater than or equal to a preset second threshold, the confirmation event is added to the built-in delayed processing queue for execution; when the proportion of actions is less than the second threshold, a state verification command is issued, where the first threshold is greater than the second threshold.

[0141] The legality verification module is used to compare the confirmation event of the execution state transition with the legal state transition table to obtain abnormal transition events that deviate from the legal state transition table;

[0142] The anomaly level determination module is used to classify and grade abnormal flow events based on the number of state deviations, duration, action ratio, or rule conflict degree of the statistically obtained abnormal flow events; among them, when the flow is legal but the business rule verification returns rejection, it is determined to be a major anomaly.

[0143] When a state deviates from a previous state by a reverse transition and the number of deviations is greater than or equal to 1, it is considered a serious anomaly. For other lateral deviations that are not reverse transitions, if no new event that can automatically correct the state is received within the duration and the proportion of actions is lower than the preset confidence level, it is considered a prompt anomaly. If a new event is received within the duration that automatically corrects the state back to a legal path, it is considered a transient anomaly, and the anomaly level judgment result is output.

[0144] A business rule-based receipt signing exception registration system, wherein the exception registration unit specifically includes:

[0145] The data organization module is used to extract abnormal events that are determined to be serious or important, and obtain the unique identifier of the abnormality, the abnormality level, the abnormality type code, the associated event trajectory, the window duration, the total number of samples, and the state machine snapshot output by the state machine engine; the writing module is used to splice and organize the extracted data and write it into the structured register to obtain the abnormal data registration results.

[0146] The feedback correction module is used to increase or decrease the base window duration by a preset compensation step size or a preset decay step size, based on the comparison between the abnormal misjudgment rate determined in the review feedback statistics and the preset tolerance threshold.

[0147] A business rule-based receipt confirmation anomaly registration system, the degradation control unit specifically includes:

[0148] The offline processing module is used to switch the terminal to offline processing mode when the terminal network round-trip delay is continuously detected to be greater than the preset offline trigger delay threshold or the network is disconnected. It enables the built-in local simplified state machine to perform state transitions in the preset legal state sequence and persists the events to the built-in local queue.

[0149] The frequency limiting module is used to force subsequent events corresponding to a single unique order identifier into a built-in cooling queue when the number of events arriving within a set time window exceeds a preset threshold for the number of events per unit time. After the preset cooling duration ends, the module takes the last event of the queue as a valid input and discards the preceding events.

[0150] The rule degradation module is used to switch to loading local backup rules in the local backup rule storage module when the external business rule engine is disconnected for more than a set time. When the preset local rule lifespan is exceeded, the business rule verification is skipped and only the legality of the state machine transition is verified.

[0151] The clock correction module is used to obtain the network time protocol synchronization offset from the terminal or an external clock synchronization module, and to correct the terminal's local timestamp based on the terminal's local timestamp carried in the event message and the network time protocol synchronization offset.

[0152] A business rule receipt signing exception registration system includes a clock correction module, which is specifically used to obtain the terminal local timestamp and network time protocol synchronization offset in the event message; determine the corrected real timestamp based on the terminal local timestamp and network time protocol synchronization offset; and determine whether the absolute value of the network time protocol synchronization offset is greater than a preset clock offset tolerance threshold.

[0153] If the absolute value of the network time protocol synchronization offset is greater than the preset clock offset tolerance threshold, the terminal's time window triggering mechanism will be switched to the server arrival time mode, and a clock anomaly alarm will be output; if the absolute value of the network time protocol synchronization offset is less than or equal to the preset clock offset tolerance threshold, the time window triggering mechanism based on the corrected real timestamp will be maintained.

[0154] This implementation describes the coordination of state transition verification, anomaly registration, and degradation control. The key processing point of this part is: performing hierarchical processing on confirmed events according to the proportion of actions, identifying abnormal flows based on the legal state transition table, and writing anomalies that meet the level requirements into the structured register; at the same time, in the event of network anomalies, external rule interface anomalies, or terminal clock anomalies, ensuring that the system still has operability through offline processing, rate limiting, rule degradation, and clock correction.

[0155] Based on the above embodiments, the proportion of confirmed events and actions is obtained, and state transition control is performed on the confirmed events according to the action proportion, and the direct state transition result, delayed processing result or state verification instruction is output.

[0156] The first threshold refers to the upper-level judgment threshold used to determine whether the confirmed event has high stability; the second threshold refers to the lower-level judgment threshold used to determine whether the confirmed event is below the level that can be directly adopted, and the first threshold is greater than the second threshold; the delayed processing queue refers to the internal queue used to temporarily store events in the intermediate confidence interval, such as waiting for possible additional withdrawal signals or supplementary events.

[0157] In practical applications, the specific criteria for determining the first and second thresholds are the historical business confirmation pass rate and the system's tolerance for state deviations. For example, the first threshold can be set to 80%. When the action percentage is greater than or equal to 80%, it indicates that the confirmation event occupies a significant proportion within the sampling window and is considered a high-confidence event, thus directly executing the state transition. The second threshold can be set to 50%. If the action percentage is within... If the interval is within a certain range, it indicates that there are some concurrent conflicts, so it is temporarily added to the delayed processing queue.

[0158] If the action percentage is less than 50%, it means the system cannot currently determine the dominant action, so a status verification command must be issued to require the terminal to resend; in this embodiment, all confirmed events are migrated immediately, and layered control is implemented according to the action percentage.

[0159] When the percentage of actions is greater than or equal to the first threshold, a direct state transition is executed.

[0160] When the percentage of actions is less than the first threshold but greater than or equal to the second threshold, the action is added to the delayed processing queue for execution.

[0161] When the percentage of actions is less than the second threshold, a state verification command is issued. For the preset invalid flag value with a mandatory manual review mark output by the preceding time window confirmation unit that still cannot determine the status after the extended window ends, the state transition control module will directly identify the flag value and implement bypass interception, without executing the regular state transition drive, and directly pass it as a suspended state. In this way, high consistency events, boundary events, low consistency events and invalid input events are isolated and processed, reducing the direct impact of unstable inputs on the state machine.

[0162] This embodiment can achieve state transition control based on the hierarchical structure of actions, avoiding low-reliability events from directly driving state transitions, and ultimately solving the technical defect of existing technologies that cause erroneous state transitions due to a single processing strategy.

[0163] Based on the above embodiments, confirmation events for execution state transitions are obtained. According to the legal state transition table, the confirmation events are compared and verified, and abnormal transition events that deviate from the legal state transition table are output. Here, the legal state transition table refers to the set of legal transition constraints preset in the state machine engine, such as the allowed path from pending receipt to receipt in progress, and from receipt in progress to receipt. Abnormal transition events refer to events that are inconsistent with the constraint set during execution state transitions, such as transitions without going through intermediate states or rollbacks after completing a state.

[0164] This embodiment focuses solely on whether business rules are approved, ignoring the causal relationships between states. After confirming that an event has entered the state machine, it first checks whether the current state and the target state conform to the legal transition table. Only events that deviate from the legal path are extracted as abnormal transition events. This embodiment can implement the legality verification of the transition based on the legal state transition table, avoiding the situation where broken state paths are still treated as normal business and ultimately solving the technical defect of existing technologies where the lack of state constraints causes real anomalies to be masked.

[0165] Based on the above embodiments, abnormal flow events are obtained, and the abnormal flow events are classified and graded according to the number of state deviations, duration, action ratio or rule conflict degree, and the abnormality level judgment result is output; wherein, the number of state deviations refers to the cumulative number of times the same order deviates from the legal state transition table within several processing cycles, which is used to characterize the abnormal repetition.

[0166] Duration refers to the length of time an abnormal state persists, used to characterize whether the impact of the abnormality is short-lived; rule conflict level refers to the degree of inconsistency between the confirmed event and the business rule verification result, such as a legal state transition but a failure of the business rule; in specific implementation, the abnormality level can be divided into severe abnormalities, important abnormalities, alert abnormalities, and transient abnormalities; severe abnormalities can correspond to obvious illegal transitions or significant state rollbacks; important abnormalities can correspond to situations where the process can proceed but there is a conflict with the business rules; alert abnormalities can correspond to situations where the system recovers to normal after secondary confirmation but the alert information needs to be retained;

[0167] Transient anomalies can correspond to deviations that, after entering the state machine engine for verification, trigger an anomaly flow judgment within a short period of time but are automatically corrected back to the legal path by subsequent supplementary actions. To clarify the anomaly level judgment, it is based on the execution of a preset logical decision tree. The specific process is as follows: assess the degree of rule conflict. If the flow is legal but the business rule verification returns rejection, it is directly judged as an important anomaly.

[0168] If there are no rule conflicts, the number of state deviations and the duration are evaluated. When an event causes a reverse transition to a completed previous state and the number of state deviations is greater than or equal to 1, it is judged as a serious anomaly. For other lateral deviations that are not reverse transitions, the duration observation window is activated. If no new event that can automatically correct the state is received within the duration, and the proportion of actions of the original confirmed event is lower than the preset proportion confidence level, it is judged as a prompt anomaly.

[0169] If a new event is received within this duration and causes it to automatically correct back to a valid path, it is determined to be a transient anomaly. Here, the objects participating in the state machine comparison and being classified are valid logical inputs that have been confirmed through the time window, eliminating the original communication noise suppressed in the initial window stage to ensure the accuracy of the anomaly determination. Only a coarse approach of uniform anomaly labeling is given. This embodiment further subdivides the anomaly by factors such as the number of deviations, duration, and degree of rule conflict, making subsequent registration and handling more targeted.

[0170] This embodiment can determine the anomaly level based on multi-factor grading, avoiding the redundant consumption of system processing resources caused by treating all anomalies equally, and ultimately solving the technical defect of the existing technology that causes an imbalance in handling priorities due to excessively coarse anomaly granularity.

[0171] Based on the above embodiments, abnormal events that are determined to be serious or important abnormalities are obtained. According to the context information of the abnormal events, the abnormal events are extracted and data is organized to obtain the unique identifier of the abnormality, the abnormality level, the abnormality type code, the associated event trajectory, the window duration, the total number of samples, and the state machine snapshot.

[0172] Among them, the unique identifier of an anomaly refers to the unique number used to distinguish each anomaly registration record; the anomaly type code refers to the coding information used to identify the anomaly category, such as illegal migration or rule conflict; the associated event trajectory refers to the event sequence that has a causal relationship with the current anomaly event, such as multiple confirmation events that triggered the anomaly and their corresponding time information and action percentages; the window duration and total number of samples are used to indicate under what confirmation conditions the anomaly event was screened out; and the state machine snapshot refers to the state information output by the state machine engine at the decision moment.

[0173] In anomaly logs that only save error codes, this embodiment extracts the key context on which the anomaly determination depends before registration, so that the registration result has a basis for review. This embodiment can organize anomaly data based on context extraction, avoiding the inability of subsequent manual review to reconstruct the anomaly occurrence process, and ultimately solving the technical defect of existing technology that makes traceability difficult due to overly simplistic registration information.

[0174] Based on the above embodiments, the extracted abnormal data are obtained, and the data are spliced ​​and organized according to the structured registration format and written into the structured register, and the abnormal data registration results are output. The structured registration format refers to the pre-defined field organization method, which is used to ensure that data such as abnormal level, abnormal type code, associated event trajectory, window duration, total number of samples and state machine snapshot can be uniformly stored and queried later.

[0175] The abnormal data registration result refers to the abnormal registration record after the writing is completed; the log-style text stacking recording method, in this embodiment, is stored in the database according to structured fields, so that different abnormalities have a unified format that is comparable, searchable and statistical; this embodiment can realize the persistent recording of abnormal results based on structured writing, avoiding the abnormal records being scattered in unstructured logs and difficult to query, and finally solving the technical defects of the existing technology that are inefficient in review and statistics due to loose registration form;

[0176] Based on the above embodiments, the review feedback statistics are obtained. The abnormality misjudgment rate is calculated based on the number of abnormal events judged as misjudged by manual review and the total number of manual reviews. When the abnormality misjudgment rate is greater than the preset tolerance threshold, the baseline window duration is adjusted to obtain the updated baseline window duration.

[0177] Among them, the review feedback statistics result refers to the statistical data on whether abnormal events were misjudged after manual review, such as the number of misjudgments and the total number of reviews; the abnormal misjudgment rate refers to the ratio between the number of misjudgments and the total number of manual reviews, which is used to reflect whether the current window parameters are too tight, thereby registering repetitive or jittery events that should be considered normal as abnormal.

[0178] The adjustment process of the baseline window duration is used to adapt to the actual network environment. The specific calculation method is as follows: the abnormality misjudgment rate is calculated by dividing the number of misjudged abnormal events by the total number of manual reviews. In this process, the abnormality misjudgment rate represents the proportion of the current registration results that are manually identified as misjudged, the number of misjudged abnormal events represents the number of abnormalities that were registered but were later confirmed to be not to be registered, and the total number of manual reviews represents the total number of abnormal records that have entered the scope of manual review.

[0179] When the false positive rate exceeds the preset tolerance threshold, the baseline window duration is increased by a preset compensation step size to obtain the updated baseline window duration. This compensation step size is used to control the window adjustment rhythm and avoid excessively widening the window at one time, which would affect the timeliness of confirmation. Instead of manually correcting errors without feeding back the parameters, this embodiment applies the results of manual review to the time window parameter correction, so that the environment with frequent false positives can gradually obtain more stable confirmation conditions.

[0180] This embodiment can correct window parameters based on the error rate calculation, avoiding the result of manual review remaining at the result level and failing to improve subsequent judgments, and ultimately solving the technical defect of the existing technology that causes the same type of misjudgment to occur repeatedly due to the lack of feedback correction.

[0181] Based on the above embodiments, the terminal network round-trip time and network connectivity status are obtained, and the terminal is controlled offline according to the continuous detection results. The state transition results and local queue persistence results in the offline processing mode are output.

[0182] Among them, the offline trigger latency threshold refers to the preset condition used to determine whether the terminal has entered a state of obvious network degradation; the offline processing mode refers to the local processing method adopted by the terminal when it cannot reliably rely on the server-side rule verification; the local simplified state machine refers to the simplified state transition model enabled on the terminal side, which only retains the preset legal state sequence; the local queue refers to the event persistent storage queue built into the terminal, which is used to retain events generated during disconnection; the method of stopping processing or discarding events after network disconnection is as follows: in this embodiment, when the terminal network round-trip latency is continuously detected to be greater than the preset offline trigger latency threshold or network disconnection is detected, the terminal is switched to the offline processing mode, the built-in local simplified state machine is enabled to perform state transitions according to the preset legal state sequence, and the events are persisted to the built-in local queue;

[0183] This embodiment can achieve basic business continuity in a disconnected environment based on the offline processing module, avoiding business interruption and event loss caused directly by network anomalies, and ultimately solving the technical defect of existing technologies that cause edge terminals to be unusable due to the lack of offline autonomous capabilities.

[0184] Based on the above embodiments, the number of events arriving with the same unique identifier within a set time window is obtained, and the subsequent events are subject to flow control according to a preset threshold for the number of events per unit time, and the cooling queue processing results are output.

[0185] Among them, the set time window refers to the statistical window used to observe the event density within a unit period; the preset threshold for the number of events per unit time refers to the boundary condition for determining whether the same order has abnormal concurrency overload; the cooling queue refers to the internal queue used to temporarily store subsequent events when the number of events rises abnormally; in the actual underlying data structure management, if there is no limit to queuing concurrent overload events, it is easy to cause the system memory exhaustion anomaly. Therefore, the cooling queue is designed as a storage unit structure with a maximum depth limit and a last-place overwrite mechanism.

[0186] When the queue is full, newly arriving events will directly overwrite the last element of the queue. In this embodiment, when the number of events arriving within a set time window for a single unique identifier of a receipt exceeds a preset threshold for the number of events per unit time, the subsequent events of that receipt are forcibly pushed into a built-in cooling queue. After the preset cooling duration ends, the last event of the queue is taken as valid input and the preceding events are discarded. In this way, dense and repetitive reports can be compressed into a single representative input under the condition of constant physical memory.

[0187] This embodiment can suppress event concurrency overload based on the frequency limiting module, suppress the excessive occupation of system computing resources by high-frequency retransmission requests, and also avoid repeated messages in the same short cycle of the same order crowding out processing resources, ultimately solving the technical defects of the existing technology that cause system entry congestion and memory overflow due to lack of concurrency overload control.

[0188] Based on the above embodiments, the connection status of the external business rule engine is obtained, and the rule verification path is switched according to the disconnection duration condition, and the local rule verification result is output or the business rule verification result is skipped.

[0189] Among them, local backup rules refer to rule snapshots stored in the local backup rule storage module, which are used to perform alternative verification when the external rule interface is unavailable; local rule lifespan refers to the effective period conditions under which local rules can continue to be used; skip business rule verification means that when local rules no longer meet the usage conditions, only the state machine transition legality verification is retained.

[0190] By treating the external rule engine as a single point of dependency, this embodiment switches to loading the local backup rules in the local backup rule storage module when the external business rule engine disconnects for more than a set time. When the preset local rule lifespan is exceeded, the business rule verification is skipped, and only the legality of the state machine transition is verified.

[0191] This embodiment can implement a backup processing mechanism for rule interface failure based on the rule degradation module, avoiding the interruption of the entire abnormal judgment chain due to external engine abnormalities, and ultimately solving the technical defect of insufficient system availability caused by excessive rule dependence in the existing technology.

[0192] Based on the above embodiments, the terminal local timestamp and network time protocol synchronization offset in the event message are obtained. According to the combination relationship between the two, the terminal local timestamp is corrected, the corrected real timestamp is output, and the time window triggering mechanism is determined.

[0193] Among them, the network time protocol synchronization offset refers to the offset value between the terminal's local time reported by the terminal or provided by the external clock synchronization module and the unified network time; the corrected real timestamp refers to the time result obtained by superimposing the synchronization offset on the terminal's local timestamp, which is used to more accurately reflect the actual occurrence sequence of events; the clock offset tolerance threshold refers to the acceptable range of terminal clock offsets for the system, which is used to determine whether the terminal clock can still participate in window triggering.

[0194] The timestamp correction process is used to eliminate errors caused by the splitting of events within the same statistical window or the merging of events from different periods due to the drift of the terminal's local clock. The specific calculation method is as follows: the terminal's local timestamp and the network time protocol synchronization offset are algebraically added to obtain the corrected real timestamp. In this correction process, the corrected real timestamp represents the time of occurrence of the corrected event used by the time window confirmation unit, the terminal's local timestamp represents the original action time recorded by the terminal device, and the network time protocol synchronization offset represents the correction difference between the terminal clock and the unified network time.

[0195] In the specific implementation, the terminal's local timestamp and network time protocol synchronization offset are first obtained from the event message, and then the two are added together to obtain the corrected real timestamp. It is then determined whether the absolute value of the network time protocol synchronization offset is greater than the preset clock offset tolerance threshold. If its absolute value is greater than the preset clock offset tolerance threshold, the terminal's time window triggering mechanism is switched to the server arrival time mode, and a clock anomaly alarm is output. If its absolute value is less than or equal to the preset clock offset tolerance threshold, the time window triggering mechanism based on the corrected real timestamp is maintained.

[0196] By fully trusting the terminal's local clock, this embodiment no longer uses the terminal time as the window triggering reference when the clock offset exceeds the tolerance range. Instead, it switches to the server arrival time mode, thereby suppressing the interference of severe clock drift on window statistics. This embodiment can realize terminal time correction and trigger mode switching based on the clock correction module, avoiding errors in event sorting and window triggering caused by terminal clock inaccuracy. Ultimately, it solves the technical defect of the existing technology that the statistical basis is unreliable due to the lack of a clock drift handling mechanism.

[0197] Comparative analysis shows that in distributed business systems, key benchmarks for evaluating the reliability of anomaly detection typically include: whether the state is mistakenly driven by low-confidence events, whether anomalies can be distinguished by severity, and whether the system can still maintain basic operation when network or external dependency anomalies occur. If a conventional unified migration strategy is adopted, boundary events may cause erroneous state migration, and minor noise and serious violations may be mixed in the same set of anomalies.

[0198] If relying entirely on an external rule engine or the terminal's local clock, interface disconnection and clock drift will directly disrupt all subsequent judgments. This implementation method uses a combination of action proportion layering, legal state transition table constraints, structured registration, offline processing, rate limiting, rule degradation, and clock correction to form a unified work chain for state transition, anomaly registration, and backup protection mechanisms under abnormal conditions. This makes it more suitable for order receipt environments with unstable network conditions, a large number of terminals, and high concurrency.

[0199] In the application embodiment, after the time window confirmation unit outputs the confirmation event and action ratio, the state transition control module first divides the processing path according to the first threshold and the second threshold; for the confirmation event entering the state transition, the legality verification module checks the flow path according to the legal state transition table, and the abnormal flow event is divided into serious abnormality, important abnormality, prompt abnormality or instantaneous abnormality by the abnormality level judgment module.

[0200] For serious and important anomalies, the data organization module extracts the unique anomaly identifier, anomaly level, anomaly type code, associated event trajectory, window duration, total number of samples, and state machine snapshot, and the writing module writes them into the structured register; the results of manual review are then used by the feedback correction module to calculate the anomaly misjudgment rate, which is used to adjust the baseline window duration;

[0201] Meanwhile, if the terminal experiences continuous high network latency or network outages, the offline processing module switches to offline processing mode and persists the local queue; if the concurrent events in the same order are overloaded within a short period, the frequency limiting module pushes subsequent events into the cooling queue.

[0202] If the external business rule engine disconnects, the rule degradation module switches to local backup rules or further skips business rule verification; if the terminal clock offset exceeds the tolerance range, the clock correction module switches to the time window trigger mechanism; through the above deployment method, the system can continuously receive new events, complete status verification and anomaly registration in actual operation, and maintain a processable state in abnormal environments.

[0203] It should be noted that the above 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 preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A business rule-based receipt signing exception registration system, characterized in that, The system includes a state machine engine, a structured registry, a message queue partition, an event acquisition and reception unit, a time window confirmation unit, a state transition verification unit, an anomaly registration unit, and a degradation control unit, wherein: The state machine engine stores a valid state transition table; The event acquisition and reception unit is used to route multi-channel receipt receipt events carrying unique receipt identifiers, local terminal timestamps, and terminal network round-trip delays to the message queue partition and read them serially, and output the event stream. The time window confirmation unit is used to calculate the window duration based on the terminal network round-trip latency in the event stream, and to perform statistical confirmation within the window duration to obtain the proportion of confirmed events and actions. The state transition verification unit is used to perform legality verification based on the confirmation event and the proportion of actions, combined with the legal state transition table, and output the abnormality level judgment result and the corresponding abnormal event. The anomaly registration unit is used to write the anomaly event into the structured register according to the anomaly level determination result; The degradation control unit is used to monitor the status of terminal devices and network links and output control results.

2. The business rule receipt signing exception registration system according to claim 1, characterized in that, The time window confirmation unit has a built-in baseline window duration as an initial window parameter; the anomaly registration unit is also used to organize the anomaly event and context data into the structured register, the context data including associated event trajectories and state machine snapshots, and adjust the baseline window duration based on the received external review feedback statistical results; the degradation control unit calculates the control result for network anomalies or anomalies where terminal performance parameters reach a preset performance parameter threshold, including at least one of entering the cooling queue, switching to local backup rules in the local backup rule storage module, or skipping business rule verification.

3. The business rule receipt signing exception registration system according to claim 1, characterized in that, The event acquisition and reception unit specifically includes: The message generation module is used to output an event message containing the unique identifier of the receipt, the type of receipt action, the local timestamp of the terminal, the local serial number of the terminal, and the round-trip time of the terminal network when the receipt receipt event occurs. The partition routing module is used to perform hash calculation on the event message based on the unique identifier of the return receipt, and route event messages with the same unique identifier to the same message queue partition; The serial reading module is used to serially read event messages in the message queue partition by a single-threaded consumer according to the terminal local sequence number and arrival order, and output the event stream arranged in the processing order.

4. The business rule receipt signing exception registration system according to claim 2, characterized in that, The time window confirmation unit specifically includes: The window management module dynamically determines the window duration of the current terminal based on the distribution characteristics of historical sampling data of the terminal network round-trip delay within a preset number of consecutive samplings and a preset delay amplification coefficient. The buffer writing module is used to write events in the event stream into a built-in circular buffer using the unique identifier of the receipt as the key, and to use the window duration as the duration of a time window. The statistics confirmation module is used to count the most frequent signature action type in the event sequence with the same unique identifier within the time window after the time window is closed, calculate the corresponding action percentage, and confirm valid events or open an extended window based on the relationship between the action percentage and a preset consistency threshold.

5. A business rule receipt signing anomaly registration system according to claim 4, characterized in that, The statistical confirmation module is specifically used for: When the total number of the event sequence is greater than or equal to the preset minimum number of samples, and the proportion of the action is greater than or equal to the consistency threshold, the most frequent signing action type is taken as the confirmation event and the proportion of the action is output. When the proportion of the actions is less than the consistency threshold, or the total number of the event sequences is less than the preset minimum number of samples, the state is determined to be uncertain, and the extended window is opened for resampling. If the percentage of actions calculated at the end of the extended window is still less than the consistency threshold, a forced manual review flag is output, along with a preset invalid flag value.

6. A business rule receipt signing anomaly registration system according to claim 2, characterized in that, The state transition verification unit specifically includes: The state transition control module is used to perform direct state transition on the confirmation event when the proportion of the action is greater than or equal to a preset first threshold; when the proportion of the action is less than the first threshold but greater than or equal to a preset second threshold, add the confirmation event to a built-in delayed processing queue for execution; and issue a state verification instruction when the proportion of the action is less than the second threshold, wherein the first threshold is greater than the second threshold. The legality verification module is used to compare the confirmation event of the execution state transition with the legal state transition table to obtain abnormal transition events that deviate from the legal state transition table; The anomaly level determination module is used to classify the abnormal flow events based on the statistically obtained number of state deviations, duration, proportion of actions, or degree of rule conflict; wherein, when the flow is legal but the business rule verification returns a rejection, it is determined to be a major anomaly. When a state deviates from a previous state by a reverse transition and the number of deviations is greater than or equal to 1, it is considered a serious anomaly. For other lateral deviations that are not reverse transitions, if no new event that can automatically correct the state is received within the duration and the proportion of actions is lower than the preset confidence level, it is considered a warning anomaly. If a new event is received within the duration that automatically corrects the state back to a legal path, it is considered a transient anomaly, and the anomaly level determination result is output.

7. A business rule receipt signing anomaly registration system according to claim 6, characterized in that, The anomaly registration unit specifically includes: The data organization module is used to extract the abnormal events that are determined to be serious or important abnormalities, and obtain the unique abnormality identifier, abnormality level, abnormality type code, associated event trajectory, window duration, total number of samples, and state machine snapshot output by the state machine engine; The writing module is used to splice and organize the extracted data and write it into the structured register to obtain the abnormal data registration results; The feedback correction module is used to increase or decrease the duration of the reference window by a preset compensation step size or a preset decay step size, based on the comparison result between the abnormal misjudgment rate determined in the review feedback statistics and the preset tolerance threshold.

8. A business rule receipt signing anomaly registration system according to claim 1, characterized in that, The degradation control unit specifically includes: The offline processing module is used to switch the terminal to offline processing mode when the network round-trip delay of the terminal is continuously detected to be greater than the preset offline trigger delay threshold or the network is disconnected. It enables the built-in local simplified state machine to perform state transitions in the order of preset legal states and persists the events to the built-in local queue. The frequency limiting module is used to force the subsequent events corresponding to the unique identifier of the single receipt into the built-in cooling queue when the number of events arriving within a set time window is greater than the preset threshold for the number of events per unit time. After the preset cooling duration ends, the last event of the queue is taken as a valid input and the preceding events are discarded. The rule degradation module is used to switch to loading the local backup rules in the local backup rule storage module when the external business rule engine is disconnected for more than a set time. When the preset local rule lifespan is exceeded, the business rule verification is skipped and only the legality of the state machine transition is verified. The clock correction module is used to obtain the network time protocol synchronization offset from the terminal or an external clock synchronization module, and to correct the terminal local timestamp based on the terminal local timestamp carried in the event message and the network time protocol synchronization offset.

9. A business rule receipt signing anomaly registration system according to claim 8, characterized in that, The clock correction module corrects the local timestamp of the terminal, specifically for: Obtain the terminal local timestamp and the network time protocol synchronization offset from the event message; The corrected real timestamp is determined based on the synchronization offset between the terminal's local timestamp and the network time protocol. Determine whether the absolute value of the network time protocol synchronization offset is greater than a preset clock offset tolerance threshold; If the absolute value of the network time protocol synchronization offset is greater than the preset clock offset tolerance threshold, the terminal's time window triggering mechanism will be switched to the server arrival time mode, and a clock anomaly alarm will be output. If the absolute value of the network time protocol synchronization offset is less than or equal to the preset clock offset tolerance threshold, the time window triggering mechanism based on the corrected real timestamp is maintained.