An efficient mass postal logistics data ETL system

By introducing a contract repository and a state storage module into the data processing system, combined with a streaming processing engine and an asynchronous verification module, the problem of insufficient identification of business time sequence logic in the processing of massive delivery and logistics data in existing technologies has been solved, achieving efficient data quality assurance and fault diagnosis.

CN121301453BActive Publication Date: 2026-04-24湖南斯耐浦科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
湖南斯耐浦科技有限公司
Filing Date
2025-09-26
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing data processing systems lack the ability to perceive the continuity of business processes when processing massive amounts of delivery and logistics data. They are unable to identify and prevent data errors that violate the business time sequence logic, resulting in lagging data quality assurance and huge consumption of computing resources.

Method used

By employing a contract repository and a state storage module, and defining the state set and state transition rules of process instances in the form of a finite state machine, combined with a streaming processing engine and an asynchronous verification module, we can realize the contextual correlation determination and timeliness monitoring of data events, and intercept data pollution that violates the business process sequence in advance.

Benefits of technology

It enables proactive interception of data pollution that violates business timing logic, improves data quality assurance capabilities, reduces computing resource consumption, and provides upstream fault diagnosis capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121301453B_ABST
    Figure CN121301453B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of mass data processing systems, and discloses an efficient mass registered delivery logistics data ETL system, which comprises a contract storage library, a state storage module and a stream processing engine; the stream processing engine is constrained to make real-time judgment and shunting on data events according to the current state of a process instance read from the state storage module and the bound state machine contract; the system further comprises an only-appending audit log and an asynchronous verification module for guaranteeing the final consistency of the current state in a distributed environment; the application changes data verification from static rules depending on no context into dynamic state judgment driven by the history of the data flow itself, thereby converting the logical correctness of a business process from a quality attribute that needs to be verified after data warehousing into an embedded constraint in a data processing flow, and realizing the pre-interception of data pollution violating business timing logic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a high-efficiency ETL system for massive delivery and logistics data, belonging to the technical field of massive data processing systems. Background Technology

[0002] Currently, the mainstream data processing systems in this field are designed around atomic operations on a single data record. That is, the processing unit of the system is an independent record, and its verification logic is strictly limited to the field structure, data format and value range of the record itself. This approach is stable when processing data sources with good structure consistency.

[0003] However, when processing massive amounts of data related to postal and logistics services, which have strong temporal sequence characteristics, the data flow often exhibits temporal overlap and logical conflicts due to the large number and heterogeneity of data source systems. In such applications, the system's approach of processing individual records does not utilize the contextual position information of the business event described by the record within its entire lifecycle when verifying any data record. For example, for the same waybill number, a pickup record from a collection point and a dispatch record from a subsequent distribution center may both be completely compliant in terms of data format and content if independently reviewed. The system would treat them as two separate valid data sets and store them in the data warehouse. However, from the objective reality of the entire business process, the dispatch event cannot occur earlier than the pickup event. This kind of data error based on process temporal logic is not detectable by the existing processing mechanism in principle.

[0004] Specifically, existing technologies suffer from the following shortcomings: 1. The system lacks the ability to perceive the continuity of business processes. Its verification logic is limited to the discrete data record level, failing to identify logical errors that violate business sequence across multiple records; 2. Data quality assurance is delayed. For logically erroneous data, the system can only passively receive it, relying on downstream applications to discover and clean it during analysis. This increases the cost of data governance, and the erroneous data may have already impacted business decisions; 3. The system's operation is overly dependent on the format stability of upstream data sources. When the fields of the data source change, even if the type of business event it carries remains unchanged, processing may be interrupted. Industry attempts have tried periodically scanning and repairing data after it is entered into the database using batch processing rule engines. However, this delayed data repair method not only has high processing latency but also consumes enormous computational resources as the total amount of data increases, making it difficult to scale. Therefore, a new technical solution is needed to change this record processing method, enabling the system to perceive the continuity of business processes, thereby achieving pre-emptive prevention and interception of data pollution that violates the business process sequence logic. This is the technical problem that this invention aims to solve. Summary of the Invention

[0005] This invention provides a high-efficiency ETL system for massive delivery and logistics data. Its main purpose is to solve the problem that existing data processing systems, due to their context-independent atomic record processing method, cannot detect and prevent data quality violations that violate the temporal logic of business processes.

[0006] To achieve the above objectives, this invention provides a high-efficiency ETL system for massive express delivery and logistics data, comprising:

[0007] The contract repository is configured to store contract templates in the form of a finite state machine, which are used to define the complete set of states for process instances and all predefined state transition rules between states.

[0008] The state storage module is a key-value store indexed by the process identifier of the process instance. It is configured to record the current state of the process instance and the contract identifier dynamically bound to the process instance.

[0009] The streaming engine, connected to the contract repository and state storage module, is constrained to perform the following atomic operations on each input data event: parse out the process identifier contained within the data event, and forcibly read the current state and contract identifier of the process instance from the state storage module based on the process identifier; according to the event type of the data event, and starting from the read current state, retrieve the predefined state transition rule corresponding to the contract identifier in the contract repository; when a matching predefined state transition rule is found, the streaming engine is further configured to first write a successful transition record containing the target state to an append-only audit log, and then update the target state to the state storage module; when no matching predefined state transition rule is found, the streaming engine routes the data event to the exception data processing module.

[0010] The asynchronous verification module is configured to operate independently of the streaming engine. It periodically compares the successful transfer record with the current state recorded in the state storage module based on the audit log. If the two are inconsistent, it corrects the current state in the state storage module based on the successful transfer record.

[0011] Preferably, the streaming engine is further configured to: upon receiving an initial data event representing the start of the process instance's lifecycle, extract a business type identifier from the data content of the initial data event; and based on the business type identifier, select a contract template for the process instance from multiple contract templates stored in the contract repository, bind the contract identifier corresponding to the selected contract template to the process identifier of the process instance, and write this binding relationship along with the initial state of the process instance into the state storage module.

[0012] Preferably, when the state storage module records the current state of a process instance, it also records the start timestamp of that state. The system also includes an independent asynchronous timeliness monitoring module, which is configured to periodically scan the state storage module. It calculates the duration of the current state of each process instance by comparing the current time with the start timestamp, and obtains the maximum allowed duration preset for the current state from the contract repository based on the contract identifier bound to the process instance. When the duration exceeds the maximum allowed duration, a timeliness exception event is generated.

[0013] Preferably, the abnormal data processing module is configured to: extract the source information and violation details of each data event routed to it, and generate a set of context metadata as the feature vector of the data event; perform an online streaming clustering algorithm on the feature vector to automatically group multiple abnormal data events with similar feature vectors into a unified abnormal cluster, and generate a fault diagnosis report of the upstream data source based on the abnormal cluster.

[0014] Preferably, the atomic operations executed by the streaming engine determine whether a data event is compliant based entirely on the current state of the process instance forcibly read from the state storage module, rather than relying on preset static rules independent of the data stream.

[0015] Preferably, the asynchronous timeliness monitoring module calculates a timeliness deviation D for each generated timeliness anomaly event. t D t =(T current -T timestamp )-T max , among which, T current T is the current system time. timestamp T is the start timestamp of the current state recorded in the state storage module. max The preset maximum allowed duration for the current state retrieved from the contract repository; the asynchronous timeliness monitoring module is also configured to monitor based on the timeliness deviation D. t The numerical values ​​are used to prioritize time-sensitive abnormal events.

[0016] Preferably, the append-only audit log is an immutable data structure. The streaming engine's write operation on the audit log is only to append new records, without modifying or deleting existing records, to ensure that all successful state transition intentions are persistently and immutably recorded.

[0017] Preferably, the state storage module is a distributed key-value storage system; the asynchronous verification module compares the audit logs with the state data of multiple replicas in the distributed key-value storage system to achieve automatic reconciliation of eventual consistency after the distributed system loses synchronization due to network partitions or momentary node failures.

[0018] Preferably, the contract templates stored in the contract repository are defined for different types of delivery and logistics services. These service types include express delivery services with time-definite commitments, regular mail services without time-definite commitments, and return services with reverse processes. The streaming processing engine achieves differentiated control over different business processes in terms of both logical order and execution time by binding different contract templates to process instances of different business types.

[0019] Preferably, the finite state machine includes: a set of state nodes, each state node corresponding to a specific business segment in the lifecycle of the process instance; a set of state transition arcs, each state transition arc defining a one-way transition path triggered by an event type connecting two state nodes; and attributes attached to each state node, the attributes defining the maximum allowed duration of the state and the data verification operation to be performed when entering the state.

[0020] Compared with the prior art, the beneficial effects of the present invention are:

[0021] 1. Upon receiving any data event, the streaming engine does not directly process the event itself. Instead, it uses the process identifier contained within the event as an index to retrieve the current state recorded by the process instance from the state storage module. This retrieved current state then becomes the direct basis for determining the subsequent processing logic. This transforms the verification of the compliance of the business logic of the data event from relying on static rules unrelated to the data flow to a dynamic judgment driven by the history of the data flow itself. The logical correctness of the business process is no longer a quality attribute that needs to be checked after the data is entered into the database, but rather an embedded constraint in the data processing flow.

[0022] 2. When processing the initial data event of a process instance, the system extracts the business type identifier from the data content of the event and selects one from multiple contract templates to bind to the process instance. Furthermore, the system not only records the new state when a state transition occurs, but also records the timestamp of that transition. An independent asynchronous monitoring module periodically compares the current time with the recorded timestamp to calculate the duration of the state and identifies timeliness anomalies based on the maximum allowed duration preset for different states in the contract template bound to the instance. Through the combination of business type identification and asynchronous timeliness monitoring mechanisms, the system achieves differentiated control over different business processes in terms of both logical order and execution timeliness without affecting the performance of the main real-time data processing path.

[0023] 3. For data events identified as anomalous, the system does not simply isolate them as isolated erroneous data. Instead, it generates a set of contextual metadata containing source information and violation details as feature vectors. By performing online streaming clustering on these feature vectors, multiple anomalous events with similar characteristics are automatically grouped into a unified anomalous cluster. At the same time, before attempting to update the state storage module, the system first writes a successful state transition intention as a record to an append-only audit log. An asynchronous verification module then uses this audit log as a benchmark to periodically check and correct the data in the state storage module to avoid state update out-of-sync issues caused by transient failures inherent in distributed systems. These two mechanisms, one for external data anomalies and the other for internal state anomalies, work together to enable the entire system to not only extract and report the root cause of upstream failures from massive amounts of scattered anomaly manifestations, but also to provide diagnostic capabilities. Attached Figure Description

[0024] Figure 1 This is a diagram of the state-driven ETL core process architecture of the present invention.

[0025] Figure 2 This is a 24-hour performance monitoring chart of the system of the present invention;

[0026] Figure 3 This is a diagram of the distributed deployment layered architecture of the system of this invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are only some embodiments of this invention, not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0028] This invention provides a high-efficiency ETL system for massive express delivery and logistics data. Its overall architecture consists of functional components such as a contract repository, a state storage module, a streaming engine, an exception data processing module, an append-only audit log, and an asynchronous verification module. These components work together to transform the data verification unit from isolated single data records to context-based judgment based on the current state of a process instance. This enables pre-emptive interception of data pollution that violates business sequence logic. In express delivery and logistics data processing applications, due to the diversity of data source systems, data flows often exhibit temporal overlap. To address this, the system's workflow begins with the streaming engine receiving an external data event. The engine does not directly judge the event's format or value range but uses the process identifier contained within the event as an index to retrieve the current state recorded for that process instance from the state storage module. The retrieved current state then becomes the direct basis for determining subsequent processing logic. Through this dynamic judgment method driven by the history of the data flow itself, the logical correctness of the business process is internalized as a pre-constraint in the data processing flow. The contract repository provides a stable and maintainable set of rules for the system's logical verification. To address the issue of variable fields in upstream data sources, the contract repository is configured as a Finite State Machine (FSM) to store contract templates that define the complete set of states for process instances and all predefined state transition rules between states. A contract template's data structure includes a set of states, such as {NULL, CREATED, COLLECTED, IN_TRANSIT, DELIVERED, EXCEPTION}; an initial state, such as NULL; and a set of state transition arcs. Each arc defines a unidirectional transition path connected to two state nodes, triggered by an event type. For example, a rule defined as (CREATED, collect_event)->COLLECTED indicates that an event of type collect_event is considered compliant and its state transitions to COLLECTED only if the current state of a process instance is CREATED. Thus, by transforming the field validation problem into a validation of business process state transitions, the system's validation logic is decoupled from the specific format of the upstream data source.

[0029] The state storage module provides a persistent state record for each business process instance. This module is a key-value store indexed by the process identifier of each process instance, such as a distributed key-value store system, configured to record the current state of the process instance and the contract identifier dynamically bound to it. In the postal and logistics network, business processes exhibit heterogeneity; for example, the legal lifecycles of domestic standard express and international expedited shipments differ, leading to a mismatch between contract rigidity and business flexibility. To address this, the streaming engine is further configured to extract a business type identifier from the data content of the initial data event representing the start of the process instance's lifecycle upon receiving the initial data event (e.g., parsing `service_type: international` from the data field). Based on this business type identifier, it selects a contract template for the process instance from multiple contract templates stored in the contract repository and binds the contract identifier corresponding to the selected template to the process identifier of the process instance. For example, binding the instance with process ID PKG456 to the `international_contract_v2` contract. Finally, this binding relationship, along with the initial state of the process instance, is written to the state storage module, thereby achieving differentiated control over different business processes.

[0030] In a large-scale distributed system, transient failures such as network jitter or node overload may cause the state storage module to lose update instructions, resulting in the risk of state update misalignment. To ensure the eventual consistency of the system's core state, this system introduces an asynchronous state resolution mechanism based on event sourcing. In this mechanism, when the streaming engine retrieves a matching predefined state transition rule, it does not directly update the state storage module. Instead, it is further configured to first write a successful transition record containing the target state to an append-only audit log, which is an immutable data structure. This audit log ensures that all successful state transition intentions are persistently and immutably recorded. Simultaneously, a mechanism independent of the streaming engine... The asynchronous verification module is configured to periodically compare the successful transfer record with the current state recorded in the state storage module, using the audit log as a benchmark. For example, the asynchronous verification module reads an audit record of {process_id: PKG789, new_state: COLLECTED}, but finds that the current state of PKG789 is still CREATED when querying the state storage module. At this point, it is confirmed that a state update failure has occurred. The asynchronous verification module then uses the record in the audit log as a basis to correct the current state in the state storage module to COLLECTED. In this way, the system has the operational robustness to automatically correct and resolve its own core state data.

[0031] To monitor the timeliness and health of business processes, the state storage module records the start timestamp of the current state of a process instance along with the current state's start timestamp. Furthermore, the contract template allows for the attachment of attributes to state nodes, which define the maximum allowable duration of the state; for example, setting Tmax to 72 hours for the IN_TRANSIT state. An independent asynchronous timeliness monitoring module is configured to periodically scan the state storage module, calculating the duration of the current state of each process instance by comparing the current system time Tcurrent with the state's start timestamp Ttimestamp. When the duration exceeds the preset maximum allowable duration, a timeliness anomaly event is generated. To quantify the urgency of the anomaly, this asynchronous timeliness monitoring module also calculates a timeliness deviation D for each generated timeliness anomaly event. t D t =(T current -T timestamp )-T max And based on the timeliness deviation D t The numerical values ​​are used to prioritize timeliness-related abnormal events, thereby adding a dimension of timeliness health insight to the system without affecting the performance of the main real-time data processing path. For data events routed to the anomaly data processing module by the streaming engine when no matching predefined state transition rule is found, the system aims to prevent operations personnel from being affected by a massive number of scattered anomalies during an anomaly storm caused by upstream systemic failures. To this end, the anomaly data processing module is configured to extract the source information (e.g., source_system: API_Partner_X) and violation details (e.g., violation_type: InvalidStateTransition) for each anomaly data event, and generate a set of contextual metadata as the feature vector of the data event. Subsequently, an online streaming clustering algorithm is performed on the feature vector to automatically group multiple anomaly data events with similar feature vectors into a unified anomaly cluster. When the number of events absorbed by an anomaly cluster exceeds a preset threshold (e.g., 100) in a short period of time, the system generates a unique aggregated fault diagnosis report of the upstream data source based on the common features of the anomaly cluster. This enables the entire system not only to isolate erroneous data, but also to have the diagnostic capability to extract and report the cause of the fault from a massive number of anomalies.

[0032] Example 1: In a continuously running, massive-volume logistics data ETL system, the system's data sources include multiple heterogeneous upstream business systems. Due to network transmission delays or asynchronous local clocks in each business system, the order in which data events arrive at the system may not match their objective timeline in the physical world. At a certain moment, the system receives two data events related to the same process identifier, i.e., waybill number PKG123. The first arriving data event, of type transit_event, originates from distribution center A, indicating that the package has been dispatched. Shortly after, the second data event arrives, of type collect_event, originating from collection point B, indicating that the package has been collected. For a data processing system that does not rely on process status for verification, since the field structures and values ​​of these two data events both conform to the format, they are considered as two valid data records and are sequentially stored in the downstream data warehouse. A logical conflict arose in the data warehouse where a package was recorded as being dispatched before being picked up, affecting the accuracy of subsequent end-to-end timeliness analysis that relies on this data. When the technical solution of this invention addresses this situation, when the first `transit_event` data event enters the streaming processing engine, the engine parses its process identifier PKG123 and uses it as an index to query the state storage module. Assuming that the waybill number already has a creation record, the state storage module returns the current state as `CREATED`. The streaming processing engine, starting from the read current state `CREATED`, searches the contract template bound to this process instance for a transition rule triggered by `transit_event`. Because the rule defined in the contract template only allows `transit_event` to occur from the `COLLECTED` state, the engine did not find a matching transition rule, and therefore determined that the data event violated business timing, directly routing it to the abnormal data processing module.

[0033] Subsequently, when the second `collect_event` data event enters the streaming engine, the engine again queries the state storage module using the process identifier PKG123, and the current state obtained is still `CREATED`. Starting from the `CREATED` state, the engine searches the contract template for the transition rule triggered by `collect_event`, and finds a matching transition rule of `(CREATED, collect_event)->COLLECTED`. Based on this, the streaming engine determines that the event is valid, first writes a successful transition record containing the target state `COLLECTED` to the append-only audit log, then updates the current state of PKG123 in the state storage module to `COLLECTED`, and outputs the processed data downstream. Finally, the downstream data warehouse only contains data that conforms to the business logic order, where the state of PKG123 is recorded as `COLLECTED`. The `transit_event` event isolated in the abnormal data processing module serves as a record of upstream data time-series anomalies, which can be used for subsequent diagnosis and tracing.

[0034] Example 2: To verify the effectiveness of the present invention's technical solution in intercepting data that violates business timing logic, a comparative test environment was established. This environment was configured with a data event generation module, a test group processing link using the present invention's technical solution, and a control group processing link using existing stateless verification technology. The test group's system composition included a streaming processing engine, a state storage module based on distributed key-value storage, and a contract storage repository. The control group's processing link only performed independent verification on the field structure, format, and value range of a single data record. The data source used in the experiment was generated by the data event generation module, and the dataset contained 10,000,000 data records. The event corresponds to 1,000,000 independent package process instances. To simulate the working condition of disordered data timing, the time sequence of related events for 0.5% of the process instances, i.e., 5,000 packages, was reversed in the dataset, and the timestamp of their collect_event event was set to be later than the timestamp of their corresponding transit_event event. The evaluation metrics for the experiment were set as data contamination rate and abnormal data identification rate. The former measures the percentage of logical error events that enter the downstream data warehouse out of the total number of injected errors, and the latter measures the percentage of logical error events that are identified and isolated by the system out of the total number of injected errors.

[0035] During the experiment, the same synthetic dataset was simultaneously input into both the experimental and control groups. In the control group, because its validation logic did not depend on the historical state of the process instances, all 5,000 transit_event events with reversed time sequences were judged as valid data and stored in the data warehouse due to their compliant format, resulting in 5,000 process instance records that did not conform to business logic. In the experimental group, when the 5,000 transit_event events with reversed time sequences arrived, the streaming engine could not match the valid state transition rules because the current state obtained from the state storage module was CREATED. Therefore, all these events were judged as abnormal and routed to the abnormal data processing module. Table 1 records the key performance indicators of this experiment.

[0036] Table 1: Comparison of performance indicators between the experimental group and the control group.

[0037]

[0038] Referring to the data in Table 1, the data contamination rate of the control group was 100%, and its abnormal data identification rate was 0%; the data contamination rate of the experimental group was 0%, and its abnormal data identification rate was 100%. The difference in these results is that the verification mechanism of the experimental group has context awareness by introducing a state storage module to record the historical state of process instances and having the streaming engine perform contract verification based on the current state. In contrast, the stateless verification of the control group does not have the ability to perceive the logical relationship across data events.

[0039] Example 3: This example combines Figures 1 to 3 This section describes a high-efficiency ETL system for handling massive amounts of delivery and logistics data, such as... Figure 1 As shown, data events from multiple heterogeneous upstream systems first enter the streaming processing engine. This engine, based on the current state of the process instance obtained from the state storage module, the bound contract, and the start timestamp, and referring to the contract templates and state transition rules stored in the contract repository in the form of finite state machines, performs real-time judgment and routing of data events. When a matching predefined state transition rule is found, the system first records the successful state transition intent in an append-only audit log, then updates the target state to the state storage module, and finally outputs clean data conforming to the business timeline to the downstream data warehouse. The asynchronous verification module, based on the audit log, periodically verifies and corrects the core state to ensure eventual consistency. If no predefined state transition rule is found, the data event is routed to the abnormal data processing module. This module performs online streaming clustering of abnormal events and generates an aggregated upstream data source fault diagnosis report. In addition, an independent asynchronous timeliness monitoring module periodically scans the state storage module to identify and report business process timeout anomalies.

[0040] like Figure 2 As shown, the horizontal axis represents time in hours, the left vertical axis represents processing throughput in events per minute, and the right vertical axis represents percentage (%). The three curves in the figure represent: processing throughput, which fluctuates between 8,000 and 13,000 events per minute; state transition success rate, which remains stable at a level close to 100%; and anomaly detection rate, which remains constant at around 0%. These data together verify that the system can efficiently and accurately perform state transitions and anomaly identification while processing massive amounts of data.

[0041] like Figure 3 As shown, the architecture is divided into multiple logical layers from top to bottom. First is the access and logging layer, where data from the upstream business system cluster is appended to audit logs via a message queue cluster. Below that is the real-time computing layer, which consists of a real-time computing cluster with multiple worker nodes, each running a streaming engine instance. Next is the state and rule storage layer, which consists of a distributed key-value storage cluster as the state storage module and a highly available database cluster as the contract storage module. Parallel to the main processing path is an asynchronous processing layer, which includes an asynchronous verification module and an asynchronous timeliness monitoring module. Finally, there is the service and output layer, which consists of an application service cluster. Its exception data processing module and data output and reporting service are responsible for generating diagnostic reports and sending clean data to the downstream data warehouse, respectively.

[0042] Example 4: This example aims to provide a standardized calibration procedure for a key parameter in the asynchronous timeliness monitoring module, namely the maximum allowable duration preset for a specific state in the contract template. In data engineering applications, when configuring asynchronous timeliness monitoring for a new delivery service, such as fresh food cold chain services, a reasonable T value needs to be set for key business processes, such as the IN_TRANSIT state. max The value is crucial; if set too low, false alarms may occur due to normal fluctuations in transportation time; if set too high, abnormal transportation delays may not be detected in time, rendering the monitoring function ineffective. To calibrate this parameter, a workflow based on historical data analysis is provided. The first step is data extraction, querying and extracting process instance data for all completed fresh food cold chain operations within the past quarter from the data warehouse. The second step is state duration calculation, calculating the actual dwell time in the IN_TRANSIT state for each process instance, using the difference between the start and end timestamps of this state as the sample point. The third step is statistical distribution calculation, summarizing all duration sample points and calculating the 98th percentile of its statistical distribution, i.e., the P98 value. This workflow uses the calculated P98 value as the basis for determining T. maxThe basis for this decision is that selecting the P98 value can cover 98% of normal transportation scenarios while identifying long-duration situations with a probability of less than 2% as potential timeliness anomalies, thus achieving a balance between the sensitivity and accuracy of the alarm. In a specific calibration operation, after analyzing the IN_TRANSIT status duration of 10,000 historical fresh food cold chain process instances, its P98 value was calculated to be 28.5 hours. Correspondingly, the T value of the IN_TRANSIT status in the contract template for this business is... max The parameter was then set to 28.5 hours.

[0043] By executing this calibration procedure, the maximum allowable duration of each state in the asynchronous timeliness monitoring module is no longer determined by subjective judgment, but rather transformed into a reproducible engineering parameter supported by historical data. This ensures that the timeliness anomalies generated by the system have statistical basis, providing data input for subsequent operational interventions. In another application scenario, the system needs to handle both fresh food cold chain and ordinary mail services simultaneously. When the initial data event of a process instance (waybill number PKG789) with a business type of ordinary mail enters, the streaming processing engine selects and binds an ordinary mail contract template from the contract repository based on the business type identifier contained in its data content. The T value of the IN_TRANSIT state in this template... max The value was determined to be 360 ​​hours using the same calibration procedure as in Example 3; when the system detects that both the fresh cold chain parcel with waybill number PKG456 and the ordinary mail parcel with waybill number PKG789 have timeliness abnormalities, the asynchronous timeliness monitoring module will calculate the timeliness deviation D for each of them. t If the current state of PKG456 lasts for 30 hours (exceeding its T...), max If the value is 28.5 hours, then its D t =30-28.5=1.5 hours; if the current state of PKG789 lasts for 361 hours (exceeding its T... max If the value is 360 hours, then its D t =361-360=1 hour; the system is based on D t The calculation results will set a higher processing priority for PKG456 time-sensitive abnormal events.

[0044] Example 5: This example describes the response method of the internal operating procedures of the abnormal data processing module when facing a systemic failure of the upstream data source. When a high-load system generates thousands of data events that violate business timing in a short period of time due to an internal failure of an upstream data source, the abnormal data processing module of the system will receive a dense abnormal data stream. At this time, it is necessary to automatically aggregate the fault mode from the massive number of seemingly independent abnormal events in order to avoid the operation and maintenance personnel being disturbed by a large number of repetitive alarm messages.

[0045] To address this situation, the anomaly data processing module executes a standardized feature extraction and online clustering procedure for each data event routed to it. The first step of this procedure is to generate a feature vector for each anomaly event, composed of several contextual metadata fields. These fields include the source system identifier, source geographic location code, contract violation type code, current status code at the time of the event, and the event type code that triggered the violation. The second step is to perform online streaming clustering. For each newly generated feature vector, its distance to the centroids of all existing anomaly clusters is calculated. If the minimum distance is less than a preset similarity threshold, the event is assigned to the corresponding anomaly cluster, and the cluster's statistics are updated. If all distances are greater than the threshold, a new anomaly cluster is created. The similarity threshold here is set to allow only one dimension of the feature vector to be different, thus identifying events with the same source and violation pattern. The events are summarized; the third step of this procedure is to generate a fault diagnosis report for the upstream data source. The trigger condition is that an anomaly cluster contains more than 100 events within a continuous 60-second time window. Once triggered, the system no longer sends independent anomaly notifications, but generates a unique fault diagnosis report that summarizes the common characteristics of the anomaly cluster. The report content is structured as follows: Large-scale process contract violation detected; the fault mode is that the source system API_Partner_X continuously sends collect_event type events when the process instance is in the IN_TRANSIT state; 15,234 related events have been intercepted. Through this procedure, the anomaly data processing module transforms the raw, atomic anomaly data event stream into a diagnostic report that extracts the cause of the fault, providing operations and maintenance personnel with a decision-making basis pointing to the source of the problem when facing anomaly storms from the upstream data source.

[0046] Example 6: This example describes the pre-deployment procedure for ensuring the eventual consistency of the system's core state data when the asynchronous verification module itself fails in a distributed environment. When deploying the technical solution of this invention in applications with high requirements for data state consistency, such as financial document circulation data processing, in addition to dealing with the update failure of the state storage module, it is also necessary to consider the boundary situation where the asynchronous verification module itself fails for a long time due to node failure or network partition. If there is no corresponding mechanism in this case, the successful transfer intention recorded in the audit log cannot be resolved to the state storage module in a timely manner.

[0047] To address this scenario, the system executes a configuration procedure for self-healing and reconciliation capabilities before deployment. This procedure first sets a periodic task for the asynchronous verification module: every 60 seconds, it writes the current timestamp as its activity beacon to a preset key-value pair in the state storage module. Correspondingly, a monitoring logic is configured in the streaming engine, which periodically reads the timestamp of this activity beacon with low priority. The core of this procedure is setting a decision threshold for the monitoring logic: when the difference between the read activity beacon timestamp and the current system time exceeds 300 seconds, the monitoring logic determines that the asynchronous verification module has failed and triggers a temporary fault-tolerant handling mode. In this mode, before processing each data event, the streaming engine first queries the append-only key-value pair. The audit log checks for successful transfer records related to the process identifier of the event, with timestamps later than those recorded in the state storage module. If such a record exists, the streaming engine first performs a reconciliation operation on that record, updates the state storage module to the latest state, and then continues processing the current data event. When the asynchronous verification module resumes operation and updates its activity beacon, the monitoring logic of the streaming engine automatically detects this change and stops its temporary reconciliation operation, restoring the system's state consistency guarantee to the normal mode executed by the independent asynchronous verification module. Through this pre-deployment procedure, the system establishes a primary-backup combined state reconciliation mechanism to address potential failures of its internal verification components, thereby improving the overall robustness of operation.

[0048] To further quantify and verify the essential differences between the technical solution of this invention and existing technologies from the perspective of engineering indicators in real business scenarios, the following comparative examples have been specifically established.

[0049] Comparative Example 1: To verify the processing capability of the technical solution of this invention in handling common real-world scenarios of data timing disorder caused by network latency and multi-source asynchronous writes, this comparative example adopts the same control group design idea as Example 2, but the test data source is replaced with a de-identified typical 24-hour real dataset containing 86,400 data events. This dataset corresponds to 12,000 independent package process instances, which are known to include 855 time-reversed package instances generated by an upstream partner (South China business data interface) due to its system characteristics (the physical occurrence time of their transit_event events). (Later than the collect_event event, but due to transmission link issues, it arrives at this system before the collect_event event); In contrast to the processing link of Example 1, the conventional stateless ETL verification technology consistent with the background technology is adopted. The core of this link is a stateless verification module, whose verification rules are strictly limited to the field structure, data format and value range of a single record. For example, it verifies whether the waybill number format is compliant, whether the event type is a predefined value, and whether the timestamp format is correct. However, its design principle does not have the ability to perform context association across data events. The experimental group adopts the technical solution of this invention.

[0050] During the experiment, the 24-hour real dataset was simultaneously input into the processing chains of both the experimental group and Comparative Example 1. In Comparative Example 1, the 855 transit_event events with reversed time sequence were all deemed valid by the stateless validation module and directly written to the downstream data warehouse because all fields within each record conformed to the preset format and value range. The subsequent 855 collect_event events were also deemed valid and written for the same reason. This directly resulted in 855 erroneous process instances in the downstream data warehouse, where the data was sent first and received later in terms of business logic. Further analysis... It was found that these logically erroneous data directly triggered 42 time-sensitive business alerts in subsequent downstream applications, causing data analysts to spend approximately 4 extra hours manually tracing, cleaning, and correcting reports. In the test group, when the 855 transit_event events with reversed time sequences arrived, the streaming engine retrieved the current state as CREATED from the state storage module based on its process identifier. Since no valid state transition rule could be matched in the contract template, all these events were judged as abnormal data that did not conform to the business time sequence logic and were routed to the abnormal data processing module. Only when the corresponding collect_event event arrived were the state correctly transitioned from CREATED to COLLECTED. Table 2 records the key performance indicator data of this comparative experiment.

[0051] Table 2: Performance comparison table of the experimental group and control group 1 based on real dataset.

[0052]

[0053] Experimental results show that conventional stateless verification mechanisms, in their design principles, are indeed unable to handle business sequence errors that require logical association across event contexts, leading to 100% data pollution. The technical solution of this invention introduces a collaborative mechanism between a state storage module and a streaming processing engine, enabling it to have context awareness of the business process, thereby intercepting such logical errors in advance and ensuring the cleanliness of downstream data and the accuracy of business analysis.

[0054] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0055] Finally, 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 high-efficiency ETL system for massive express delivery and logistics data, characterized in that, include: The contract repository is configured to store contract templates in the form of a finite state machine, which are used to define the complete set of states for process instances and all predefined state transition rules between states. The state storage module is a key-value store indexed by the process identifier of the process instance. It is configured to record the current state of the process instance and the contract identifier dynamically bound to the process instance. The streaming engine, connected to the contract repository and state storage module, is constrained to perform the following atomic operations on each input data event: parse out the process identifier contained in the data event, and forcibly read the current state and contract identifier of the process instance from the state storage module based on the process identifier; according to the event type of the data event, and starting from the read current state, retrieve the predefined state transition rule corresponding to the contract identifier in the contract repository; when a matching predefined state transition rule is found, the streaming engine is further configured to first write a successful transition record containing the target state to an append-only audit log, and then update the target state to the state storage module. If no matching predefined state transition rule is found, the streaming engine routes the data event to the exception data processing module. The asynchronous verification module is configured to operate independently of the streaming engine. It periodically compares the successful transfer record with the current state recorded in the state storage module based on the audit log. If the two are inconsistent, it corrects the current state in the state storage module based on the successful transfer record.

2. The efficient ETL system for massive express delivery and logistics data according to claim 1, characterized in that, The streaming processing engine is further configured to: upon receiving an initial data event that represents the start of the process instance's lifecycle, extract a business type identifier from the data content of the initial data event; and based on the business type identifier, select a contract template for the process instance from multiple contract templates stored in the contract repository, bind the contract identifier corresponding to the selected contract template to the process identifier of the process instance, and write this binding relationship along with the initial state of the process instance into the state storage module.

3. The efficient ETL system for massive express delivery and logistics data according to claim 1, characterized in that, When the state storage module records the current state of a process instance, it also records the start timestamp of that state. The system also includes an independent asynchronous timeliness monitoring module, which is configured to periodically scan the state storage module. It calculates the duration of the current state of each process instance by comparing the current time with the start timestamp, and obtains the maximum allowed duration preset for the current state from the contract repository based on the contract identifier bound to the process instance. When the duration exceeds the maximum allowed duration, a timeliness exception event is generated.

4. The efficient ETL system for massive express delivery and logistics data according to claim 1, characterized in that, The abnormal data processing module is configured to: extract the source information and violation details of each data event routed here, and generate a set of context metadata as the feature vector of the data event; An online streaming clustering algorithm is performed on the feature vectors to automatically group multiple abnormal data events with similar feature vectors into a unified abnormal cluster, and a fault diagnosis report of the upstream data source is generated based on the abnormal cluster.

5. A high-efficiency ETL system for massive express delivery and logistics data according to claim 3, characterized in that, The asynchronous timeliness monitoring module calculates a timeliness deviation D for each generated timeliness anomaly event. t D t =(T current -T timestamp )-T max , among which, T current T is the current system time. timestamp T is the start timestamp of the current state recorded in the state storage module. max The preset maximum allowed duration for the current state retrieved from the contract repository; the asynchronous timeliness monitoring module is also configured to monitor based on the timeliness deviation D. t The numerical values ​​are used to prioritize time-sensitive abnormal events.

6. The efficient ETL system for massive express delivery and logistics data according to claim 1, characterized in that, The append-only audit log is an immutable data structure. The streaming engine's write operation on the audit log is only to append new records, and does not perform operations to modify or delete existing records.

7. A high-efficiency ETL system for massive express delivery and logistics data according to claim 2, characterized in that, The contract templates stored in the contract repository are defined for different types of delivery and logistics services, including express delivery services with time guarantees, regular mail services without time guarantees, and return services with reverse processes.

8. The efficient ETL system for massive express delivery and logistics data according to claim 1, characterized in that, A finite state machine includes: a set of state nodes, each corresponding to a specific business stage in the lifecycle of a process instance; a set of state transition arcs, each defining a one-way transition path connected to two state nodes, triggered by an event type; and attributes attached to each state node, which define the maximum allowed duration of the state and the data verification operation to be performed when entering the state.

Citation Information

Patent Citations

  • Dynamic mode judgment method for high-dimensional data consistency analysis

    CN110647915A

  • Logistics receipt detection method and device, electronic equipment and storage medium

    CN117217674A