Subscription management methods, devices and electronic devices

By constructing a subscription lifecycle management system coupled with the maritime container transportation process, the collection of trajectory data from the maritime logistics information system is dynamically scheduled, solving the problem of long-term container queuing and improving resource utilization and data service quality.

CN123123853APending Publication Date: 2026-11-17YIHAILAN (BEIJING) DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611241599.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing maritime container logistics information systems, the collection mechanism for container trajectory data lacks global lifecycle awareness, leading to resource waste and low data service quality. In particular, the system continues to collect data at high frequency and perform full data parsing even in invalid subscription scenarios, resulting in serious waste of bandwidth and computing resources.

Method used

By constructing a subscription lifecycle management system that is strongly coupled with the physical transportation process of ocean shipping containers, a unique subscription fingerprint is generated based on container identifiers, destination ports, and data source identifiers. The system dynamically determines the transportation lifecycle stage and adaptively matches the collection period with the effective tracking period. Combined with multi-dimensional termination condition determination, the system realizes dynamic scheduling and automatic termination of subscription tasks.

Benefits of technology

Effective elimination of invalid subscriptions reduced the proportion of invalid collection requests, improved the timeliness and resource utilization of trajectory data for high-value containers in transit, and enhanced the data service quality of the maritime logistics information system under high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123853A_ABST
    Figure CN123123853A_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a subscription management method, apparatus, and electronic device. The subscription management method includes: acquiring a trajectory data collection subscription request for a target container; determining a unique subscription identifier; determining, based on the unique subscription identifier, whether an existing trajectory collection subscription corresponding to the target container exists; if no existing trajectory collection subscription exists, creating a trajectory collection subscription task corresponding to the target container; determining the transportation lifecycle stage of the target container; determining the collection period corresponding to the trajectory collection subscription task; determining the transportation event change status corresponding to the target container; determining, based on the transportation event change status, whether the target container meets the trajectory collection termination condition; and stopping subsequent trajectory data collection for the target container when any trajectory collection termination condition is met. Through the solution of the present invention, the proportion of invalid collection requests is reduced, and the resource utilization rate of the maritime logistics information system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of maritime logistics technology, and more specifically, to a subscription management method, apparatus, and electronic device. Background Technology

[0002] With the continuous upgrading of global trade digitalization and supply chain visualization needs, maritime container logistics information systems have become a key infrastructure supporting end-to-end tracking and intelligent decision-making in international logistics by aggregating multi-source data from shipping companies, terminals and port regulatory authorities.

[0003] However, current container tracking data collection and subscription mechanisms generally employ a fixed-period polling strategy. Each collection task is independently scheduled and lacks global lifecycle awareness. This fails to differentiate the varying data density requirements of different stages, such as transport preparation, maritime navigation, and delivery at the destination port. Consequently, the system continues high-frequency collection and full-data parsing even in invalid subscription scenarios with incorrect tracking numbers, vessels not yet arriving, or long periods without tracking updates. This inefficient resource scheduling not only results in severe waste of collection bandwidth and computing resources, forcing the backend system to repeatedly process invalid messages, but also, due to the lack of accurate determination of the subscription's final state, causes a large number of containers that have already completed transport to occupy the scheduling queue for extended periods, severely restricting the data service quality and resource utilization efficiency of the maritime logistics information system. Summary of the Invention

[0004] The purpose of this invention is to provide a subscription management method, apparatus, and electronic device that can solve the problem of a large number of containers that have completed transportation occupying the scheduling queue for a long time, which seriously restricts the data service quality and resource utilization efficiency of the maritime logistics information system.

[0005] In view of this, an embodiment of the first aspect of the present invention provides a subscription management method.

[0006] An embodiment of a second aspect of the present invention provides a subscription management device.

[0007] An embodiment of the third aspect of the present invention provides an electronic device.

[0008] To achieve the above objectives, an embodiment of the first aspect of the present invention provides a subscription management method for a maritime container logistics information system. The maritime container logistics information system collects transportation trajectory data during container transportation through multiple data sources. The subscription management method includes: obtaining a trajectory data collection subscription request for a target container; determining a unique subscription identifier based on the container identifier, destination port information, and data source identifier in the trajectory data collection subscription request; determining whether an existing trajectory collection subscription corresponding to the target container exists based on the unique subscription identifier; if no existing trajectory collection subscription exists, creating a trajectory collection subscription task corresponding to the target container and initializing the trajectory collection subscription task to a pending collection state; determining the transportation lifecycle stage of the target container based on the transportation trajectory data corresponding to the target container; determining the collection period corresponding to the trajectory collection subscription task based on the transportation lifecycle stage; performing trajectory data collection on the target container according to the collection period, and determining the transportation event change status corresponding to the target container based on the collected transportation trajectory data; determining whether the target container meets the trajectory collection termination condition based on the transportation event change status; and when any trajectory collection termination condition is met, setting the trajectory collection subscription task to an ended state and stopping subsequent trajectory data collection on the target container.

[0009] The trajectory collection termination conditions include: determining that the target container has arrived at the destination port or completed delivery at the destination port based on the transportation trajectory data; determining that the transportation completion event corresponding to the target container has been generated based on the transportation trajectory data; determining that the tracking time corresponding to the target container has reached the preset maximum tracking period based on the duration of the trajectory collection subscription task; determining that the target container is in a state of no valid transportation event based on the duration of no valid transportation trajectory event acquired within the continuous collection period, and reaching the preset termination threshold.

[0010] This invention constructs a subscription lifecycle management system tightly coupled with the physical transportation process of maritime containers. At the subscription entry point, a unique subscription fingerprint is generated based on container identifier, destination port, and data source identifier to achieve deduplication. At the execution end, the transportation lifecycle stage of the container is dynamically determined based on transportation trajectory data, and the collection period and effective tracking period are adaptively matched. During operation, the changing status of transportation events is identified by comparing effective transportation trajectory events within continuous collection periods. This status drives the determination of multi-dimensional termination conditions, including destination port delivery, transportation completion, maximum tracking period, and no-event idle threshold. Finally, when any termination condition is met, the subscription task is removed from the scheduling queue and the collection resources are released, thus realizing closed-loop control of the entire process from subscription creation and dynamic scheduling to automatic termination.

[0011] Understandably, by precisely anchoring the input of collection resources to the actual physical displacement and state transition process of containers, the system effectively eliminates the waste of computing power caused by invalid subscriptions such as incorrect order numbers, containers not yet on board, and containers with no dynamic updates for a long time. This solves the problem of dirty data accumulation and rising storage costs caused by containers that have completed transportation being stuck in the scheduling queue for a long time. It significantly reduces the proportion of invalid collection requests, improves the timeliness of trajectory data of high-value containers in transit, and greatly improves the resource utilization and data service quality of the maritime logistics information system in high-concurrency scenarios.

[0012] In some technical solutions, optionally, determining whether an existing trajectory collection subscription corresponding to the target container exists based on the subscription unique identifier includes: obtaining the trajectory collection subscription record associated with the subscription unique identifier; determining whether the target container is in an active tracking period based on the subscription status in the trajectory collection subscription record; if the subscription status is terminated, determining that no active trajectory collection subscription exists; if the subscription status is pending collection, in the process of collection, or waiting to be collected, determining that an existing trajectory collection subscription exists; when an existing trajectory collection subscription exists, reusing the task configuration and collection scheduling parameters of the existing trajectory collection subscription, and identifying this subscription request as a duplicate subscription request.

[0013] In this solution, trajectory collection subscription records are retrieved from distributed storage using a unique subscription identifier. The subscription status field determines whether the target container is in an active tracking period. The system categorizes the completed state into pending, collecting, and waiting states. If it is the former, it is determined that there is no active subscription; if it is the latter, it is determined that an existing subscription exists and its task configuration and scheduling parameters are directly reused, marking the current request as a duplicate subscription.

[0014] Understandably, by using state machine-driven existence verification, redundant data collection tasks targeting the same container are intercepted at the source, ensuring the continuity and consistency of the subscription lifecycle.

[0015] In some technical solutions, optionally, the transportation lifecycle stage of the target container can be determined based on the transportation trajectory data corresponding to the target container. This includes: extracting transportation event type, event location, container status, and event time data from the transportation trajectory data; mapping the transportation event type, event location, and container status to a unified container transportation node type according to preset maritime node mapping rules; and matching the unified container transportation node type with preset transportation stage sequence constraints to determine the transportation lifecycle stage of the target container.

[0016] The transportation lifecycle includes at least the transportation preparation stage, the maritime transportation stage, the transshipment port operation stage, the destination port operation stage, and the destination port delivery stage.

[0017] In this solution, four-dimensional data—event type, location, status, and time—are extracted from transportation trajectory data and input into a pre-defined maritime node mapping rule engine to transform heterogeneous data source messages into a unified container transportation node type. Based on pre-defined transportation stage sequence constraints, the standardized node sequence is logically matched with five progressive stages: transportation preparation, maritime transportation, transshipment operations, destination port operations, and delivery, thereby accurately determining the current physical transportation lifecycle stage of the target container.

[0018] Understandably, by accurately identifying key nodes such as transshipment port operations and destination port delivery, the system can dynamically adjust its data collection strategy to avoid excessive resource consumption during static or inefficient phases, while ensuring high-frequency monitoring during critical operation windows, thus significantly improving the timeliness of trajectory data and the utilization rate of system resources.

[0019] In some technical solutions, optionally, the collection period corresponding to the trajectory collection subscription task is determined according to the transportation lifecycle stage, including: determining the baseline collection period corresponding to the transportation lifecycle stage by querying the preset stage collection parameter mapping relationship according to the transportation lifecycle stage; determining the effective tracking period corresponding to the target container by querying the preset transportation stage time constraints according to the transportation lifecycle stage; determining the maximum allowable tracking deadline based on the effective tracking period and the start time of the trajectory collection subscription task; and updating the collection scheduling parameters of the trajectory collection subscription task based on the baseline collection period, the effective tracking period, and the maximum allowable tracking deadline.

[0020] In this scheme, the baseline collection period and the effective tracking period are determined by mapping the stage collection parameters to a pre-defined stage index based on the time constraints of the transportation stage. The system then superimposes the effective tracking period with the subscription start time to generate the maximum allowable tracking deadline, and dynamically updates the collection scheduling configuration based on the above parameters. This process transforms the physical transportation patterns of containers into digital scheduling instructions, enabling the collection frequency to be dynamically adjusted according to the transportation stage and ensuring that the tracking duration covers the entire voyage, thus realizing a shift from static polling to flexible scheduling based on the transportation process.

[0021] Understandably, by dynamically setting an effective tracking period based on route characteristics, the problem of premature termination of short-haul transportation or long-haul transportation running idle due to fixed lifecycles is solved. The flexible scheduling strategy maximizes the utilization of data collection resources and the stability of the system under high-concurrency scenarios while ensuring the timeliness of data at critical operation nodes.

[0022] In some technical solutions, optionally, the target container is determined to be in a state without valid transportation events based on the duration of the absence of valid transportation trajectory events within a continuous acquisition period. This includes: counting valid transportation trajectory events that characterize changes in the physical location or transportation status of the container within a continuous acquisition period; when no valid transportation trajectory events are acquired for multiple consecutive acquisition periods, determining the idling level based on the cumulative duration of the absence of valid transportation trajectory events; extending the baseline acquisition period according to the idling level and preset segmented backoff rules to obtain a backoff acquisition period; and updating the next acquisition time of the trajectory acquisition subscription task according to the backoff acquisition period.

[0023] Among them, the preset segmented retreat rule is configured with different retreat growth coefficients at different stages of the transportation life cycle.

[0024] In this scheme, the cumulative duration of missing valid transportation trajectory events is calculated by statistically analyzing the number of missing events within a continuous data collection period, and then mapped to discrete idling levels. Based on preset segmented backoff rules and the differential growth coefficient configured for the current transportation lifecycle stage, the baseline data collection period is dynamically extended to generate a backoff data collection period and update the next scheduling time. This process deeply couples event-driven monitoring results with time-dimensional resource scheduling, enabling adaptive switching from high-frequency detection to low-frequency dormancy.

[0025] Understandably, by configuring differentiated backoff coefficients at different stages of transportation, oversampling is avoided in low-dynamic phases such as maritime transport, while maintaining response sensitivity in high-risk phases such as port operations. This non-linear backoff mechanism greatly improves the system's resource utilization and long-term operational stability in high-concurrency scenarios, ensuring that no key nodes are missed.

[0026] In some technical solutions, optionally, trajectory data is collected from the target container according to the collection cycle, and the change status of the transportation event corresponding to the target container is determined based on the collected transportation trajectory data, including: obtaining the execution result and failure type of the current trajectory data collection; when the execution result indicates that the collection has failed, the retry time interval is determined according to the failure type and the number of consecutive failures; the next collection time of the trajectory collection subscription task is rearranged according to the retry time interval; when the next collection time is later than the maximum allowed tracking deadline, the maximum tracking cycle condition in the trajectory collection termination condition is triggered.

[0027] In this scheme, the system collects the execution results of the current round of trajectory data acquisition from the executor, analyzes the failure type, and queries a preset retry strategy mapping table based on the number of consecutive failures. It then dynamically calculates the retry time interval to rearrange the next acquisition time. During execution time rearrangement, the system compares the rearranged time with the maximum allowed tracking deadline. If the rearranged time exceeds the effective lifecycle boundary, the maximum tracking cycle termination condition is triggered.

[0028] Understandably, by dynamically adjusting the retry rhythm based on failure frequency, both data recovery capability under network jitter is ensured, and dead tasks are promptly cleaned up through hard time boundaries. This resilient scheduling strategy significantly improves the system's stability and resource utilization in complex network environments, while reducing operational intervention costs.

[0029] In some technical solutions, optionally, the trajectory acquisition subscription task includes a pending acquisition state, an in-process acquisition state, a waiting acquisition state, and a terminated state. The subscription management method further includes: when the trajectory acquisition subscription task is in the pending acquisition state, triggering trajectory data acquisition through a timer and switching the task state to the in-process acquisition state; when the current round of trajectory data acquisition is completed and no trajectory acquisition termination condition is met, switching the task state to the waiting acquisition state according to the next acquisition time; when any trajectory acquisition termination condition is met, switching the task state to the terminated state; when the trajectory acquisition subscription task is in the terminated state, removing the trajectory acquisition subscription task from the scheduling queue and releasing the data acquisition resources corresponding to the target container and data source identifier.

[0030] This solution achieves closed-loop management of the entire lifecycle of trajectory acquisition subscription tasks by constructing state machines corresponding to pending data collection, data collection in progress, data collection awaiting completion, and completion. The system drives the task to atomically transition between each state based on timer triggers and termination conditions, and synchronously releases network connections, data source quotas, and memory caches upon switching to the completion state. This mechanism strictly binds acquisition resources to task states, ensuring real-time consistency between the scheduling queue and resource usage.

[0031] Understandably, the proactive resource reclamation mechanism based on termination conditions completely solves the ghost task and memory leak problems, significantly reducing resource fragmentation rates in the later stages of system operation. State machine-driven elastic scheduling improves system stability while greatly optimizing the utilization of data source interface quotas and network bandwidth.

[0032] In some technical solutions, optionally, trajectory data is collected from the target container according to the collection cycle, and the change state of the transportation event corresponding to the target container is determined based on the collected transportation trajectory data. This includes: determining the effective transportation trajectory events that characterize the progress of the target container's transportation process based on a preset set of effective transportation trajectory events; determining the transportation event change state as a first change state when a new effective transportation trajectory event occurs between adjacent collection cycles; determining the transportation event change state as a second change state when only time data updates are obtained for multiple consecutive collection cycles without obtaining new effective transportation trajectory events; and re-determining the transportation lifecycle stage corresponding to the target container based on the first change state.

[0033] In this scheme, non-essential data is filtered out by pre-setting a set of valid transportation trajectory events. The event increments within adjacent collection periods are compared to determine the change status of transportation events. When a new valid event appears in an adjacent period, it is marked as the first change status, triggering a recalculation and update of the transportation lifecycle stage. When only timestamp updates exist in consecutive periods without new events, it is marked as the second change status, maintaining the status quo or initiating a backoff. This mechanism transforms the raw data stream into a high signal-to-noise ratio state signal, driving the dynamic correction of the stage model.

[0034] Understandably, by accurately identifying the substantial progress of the transportation process, the system can switch its data collection strategy in real time when critical nodes occur, ensuring high-frequency monitoring of important operational processes. Simultaneously, accurate determination of the quiet period supports the execution of the segmented backoff mechanism, significantly reducing the resource overhead of invalid data collection and improving the accuracy and efficiency of end-to-end tracking.

[0035] A second aspect of the present invention provides a subscription management device, comprising: a request acquisition module for acquiring a trajectory data collection subscription request for a target container; an identifier generation module for determining a unique subscription identifier based on the container identifier, destination port information, and data source identifier in the trajectory data collection subscription request; a deduplication module for determining whether an existing trajectory collection subscription corresponding to the target container exists based on the unique subscription identifier; if no existing trajectory collection subscription exists, a trajectory collection subscription task corresponding to the target container is created, and the trajectory collection subscription task is initialized to a pending collection state; a stage determination module for determining the transportation lifecycle stage of the target container based on the transportation trajectory data corresponding to the target container; a cycle configuration module for determining the collection cycle corresponding to the trajectory collection subscription task based on the transportation lifecycle stage; a collection execution module for performing trajectory data collection on the target container according to the collection cycle, and determining the transportation event change state corresponding to the target container based on the collected transportation trajectory data; a condition determination module for determining whether the target container meets the trajectory collection termination condition based on the transportation event change state; and a subscription management module for setting the trajectory collection subscription task to an ended state and stopping subsequent trajectory data collection on the target container when any trajectory collection termination condition is met.

[0036] The trajectory collection termination conditions include: determining that the target container has arrived at the destination port or completed delivery at the destination port based on the transportation trajectory data; determining that the transportation completion event corresponding to the target container has been generated based on the transportation trajectory data; determining that the tracking time corresponding to the target container has reached the preset maximum tracking period based on the duration of the trajectory collection subscription task; determining that the target container is in a state of no valid transportation event based on the duration of no valid transportation trajectory event acquired within the continuous collection period, and reaching the preset termination threshold.

[0037] An embodiment of the third aspect of this application provides an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the subscription management method as described in the first aspect.

[0038] Additional aspects and advantages of the technical solutions of the present invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description

[0039] Figure 1 One of the flowcharts of the subscription management method according to this application is shown;

[0040] Figure 2 A second flowchart illustrating the subscription management method according to this application is shown;

[0041] Figure 3The third flowchart of the subscription management method according to this application is shown;

[0042] Figure 4 The fourth flowchart illustrating the subscription management method according to this application is shown;

[0043] Figure 5 Fifth of the flowcharts illustrating the subscription management method according to this application is shown;

[0044] Figure 6 A flowchart of the subscription management method according to this application is shown in diagram six;

[0045] Figure 7 A schematic block diagram of the structure of a subscription management device according to this application is shown;

[0046] Figure 8 A schematic block diagram of the structure of an electronic device according to this application is shown;

[0047] Figure 9 A flowchart illustrating the full lifecycle management process for container data subscriptions according to this application is shown;

[0048] Among them, 900: subscription management device; 902: request acquisition module; 904: identifier generation module; 906: deduplication module; 908: stage determination module; 910: period configuration module; 912: acquisition execution module; 914: condition determination module; 916: subscription management module;

[0049] 1000: Electronic device; 1109: Memory; 1110: Processor. Detailed Implementation

[0050] To better understand the above-described objectives, features, and advantages of the embodiments of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0051] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, embodiments of the invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.

[0052] The subscription management method, apparatus, and electronic device provided in this application will be described in detail below with reference to specific embodiments and application scenarios.

[0053] This embodiment provides a subscription management method for a maritime container logistics information system. The system collects transportation trajectory data during container transport from multiple data sources, such as... Figure 1 As shown, subscription management methods include:

[0054] Step S100: Obtain a trajectory data acquisition subscription request for the target container;

[0055] Step S102: Determine the unique subscription identifier based on the container identifier, destination port information, and data source identifier in the trajectory data collection subscription request;

[0056] Step S104: Determine whether there is an existing trajectory collection subscription corresponding to the target container based on the subscription unique identifier;

[0057] Step S106: If there is no existing trajectory acquisition subscription, create a trajectory acquisition subscription task corresponding to the target container and initialize the trajectory acquisition subscription task to the pending acquisition state;

[0058] Step S108: Determine the transportation lifecycle stage of the target container based on the transportation trajectory data corresponding to the target container;

[0059] Step S110: Determine the collection period corresponding to the trajectory collection subscription task based on the transportation lifecycle stage;

[0060] Step S112: Collect trajectory data of the target container according to the collection cycle, and determine the change status of the transportation event corresponding to the target container based on the collected transportation trajectory data;

[0061] Step S114: Determine whether the target container meets the trajectory acquisition termination conditions based on the change status of the transportation event;

[0062] Step S116: When any trajectory acquisition termination condition is met, set the trajectory acquisition subscription task to the end state and stop the subsequent trajectory data acquisition of the target container.

[0063] The trajectory acquisition termination conditions include:

[0064] Based on transportation trajectory data, it is determined whether the target container has arrived at the port of destination or has been delivered to the port of destination.

[0065] Based on the transportation trajectory data, it has been determined that the transportation completion event corresponding to the target container has been generated;

[0066] The tracking time for the target container is determined based on the duration of the trajectory acquisition subscription task, reaching the preset maximum tracking period;

[0067] The target container is determined to be in a state of no valid transportation events based on the duration of no valid transportation trajectory events within the continuous collection period, and the preset termination threshold is reached.

[0068] This invention constructs a subscription lifecycle management system tightly coupled with the physical transportation process of maritime containers. At the subscription entry point, a unique subscription fingerprint is generated based on container identifier, destination port, and data source identifier to achieve deduplication. At the execution end, the transportation lifecycle stage of the container is dynamically determined based on transportation trajectory data, and the collection period and effective tracking period are adaptively matched. During operation, the changing status of transportation events is identified by comparing effective transportation trajectory events within continuous collection periods. This status drives the determination of multi-dimensional termination conditions, including destination port delivery, transportation completion, maximum tracking period, and no-event idle threshold. Finally, when any termination condition is met, the subscription task is removed from the scheduling queue and the collection resources are released, thus realizing closed-loop control of the entire process from subscription creation and dynamic scheduling to automatic termination.

[0069] Understandably, by precisely anchoring the input of collection resources to the actual physical displacement and state transition process of containers, the system effectively eliminates the waste of computing power caused by invalid subscriptions such as incorrect order numbers, containers not yet on board, and containers with no dynamic updates for a long time. This solves the problem of dirty data accumulation and rising storage costs caused by containers that have completed transportation being stuck in the scheduling queue for a long time. It significantly reduces the proportion of invalid collection requests, improves the timeliness of trajectory data of high-value containers in transit, and greatly improves the resource utilization and data service quality of the maritime logistics information system in high-concurrency scenarios.

[0070] Specifically, the subscription management method provided by the present invention uses a set of subscription key fields consisting of a preset container identifier, destination port information, and data source identifier to select target containers and their historical transportation trajectory data that meet the collection conditions from the subscription scheduling pool of the maritime container logistics information system.

[0071] By processing transportation trajectory data, the system identifies state transition events of the target container between the transportation preparation stage, the maritime transportation stage, the transshipment port operation stage, the destination port operation stage, and the destination port delivery stage. It also integrates and judges the changes in transportation events from multiple collection periods to reconstruct a closed loop for tracking the entire lifecycle of the target container from booking and shipment to delivery at the destination port.

[0072] The trajectory collection termination conditions of multiple dimensions are associated with the change status of transportation events and stored, thereby constructing a dynamic and adaptive subscription lifecycle management path. The subscription lifecycle management path includes differentiated collection cycles and termination thresholds configured based on different transportation stages, rather than a single fixed collection strategy.

[0073] The process of generating a unique subscription identifier relies on the standardized processing and hashing of container identifiers, destination port information, and data source identifiers.

[0074] The container identifier first undergoes checksum verification and letter case normalization, removing leading and trailing spaces and illegal characters. It is then combined with the standard port code of the destination port and the unique identifier of the data source according to preset concatenation rules to form a raw key-value pair. This raw key-value pair is converted into a fixed-length string using a hash algorithm, serving as the unique subscription identifier. This unique subscription identifier is used to uniquely map the tracking task of the target container under a specific data source in a distributed scheduling environment, preventing duplicate subscriptions of the same container under the same data source from the outset.

[0075] The process of determining the stages of the transportation lifecycle is based on a combined mapping of event types, event locations, and container status in transportation trajectory data.

[0076] The system has pre-defined maritime node mapping rules, which define the correspondence between heterogeneous representations of physical transportation events such as loading, departure, arrival, unloading, and container pickup from different data sources and a unified standard node type. The system extracts transportation trajectory data acquired within the current collection period, inputs the event descriptions, geographical coordinates, and container status codes into the node mapping rules for matching, and outputs standardized transportation node types.

[0077] The system determines the current stage of the target container's transportation lifecycle by comparing a continuous sequence of standardized node types with the boundary conditions of the transportation preparation stage, maritime transportation stage, transshipment port operation stage, destination port operation stage, and destination port delivery stage, based on preset transportation stage sequence constraints. This determination process does not rely on a single event in isolation, but is derived through temporal logic deduction of node types.

[0078] The process of determining the collection period and the effective tracking period is strongly correlated with the transportation lifecycle stage.

[0079] The system has a pre-defined phased acquisition parameter mapping relationship, which records the baseline acquisition frequency corresponding to different transportation lifecycle stages.

[0080] For example, during the maritime transport phase, due to the slow changes in vessel position and low data update frequency, the system is configured with a longer baseline data collection cycle; during the destination port operation phase, due to the intensive loading, unloading, and container pick-up operations, the system is configured with a shorter baseline data collection cycle.

[0081] Meanwhile, the system calculates the effective tracking period based on the baseline sailing time between the port of departure and the port of destination, combined with a preset buffer coefficient. This period defines the maximum time span during which the system should continuously track the trajectory, starting from the subscription creation start time.

[0082] The maximum allowed tracking deadline is calculated by summing the subscription start time and the effective tracking period, and serves as a hard time boundary for subsequent termination condition determination.

[0083] The process of determining the changing state of transportation events is based on comparative analysis of valid transportation trajectory events within a continuous data collection period.

[0084] The system has a pre-set set of valid transportation trajectory events, which includes event types that can characterize the substantial progress of the physical transportation of containers, such as loading, departure, arrival at transit port, departure from transit port, arrival at destination port, unloading, and container pickup.

[0085] The system parses the transportation trajectory data acquired in the current collection cycle and performs a differential comparison with the trajectory data stored in the previous valid collection cycle.

[0086] If a new event belonging to the above set of valid transportation trajectory events occurs within the current cycle, the transportation event change status is determined to have changed. At this time, the system will trigger a reassessment of the transportation lifecycle stage and may appropriately increase the collection frequency to obtain more intensive operational data.

[0087] If there are only timestamp updates without new valid transportation trajectory events in multiple consecutive collection cycles, the transportation event change status is determined to be unchanged. At this time, the system will start a segmented backoff mechanism based on the duration of no valid events, gradually extending the collection interval to reduce resource consumption.

[0088] The determination process for the termination condition of trajectory acquisition adopts a logical architecture of multi-condition parallel monitoring.

[0089] The first termination condition is based on the identification of the destination port delivery event. When the system detects the generation of a container pickup node or an empty container return node, it determines that the container has been physically delivered.

[0090] The second termination condition is based on the recognition of the transportation completion event. When the data source returns the waybill status as closed or the transportation task has been completed, the transportation process is determined to be over.

[0091] The third termination condition is based on a hard constraint of time boundaries. When the system detects that the current time is later than the aforementioned maximum allowable tracking deadline, tracking will be forcibly terminated regardless of whether a delivery event has been obtained.

[0092] The fourth termination condition is based on the soft constraint of no valid transportation events. The system counts the cumulative duration of the events for which no valid transportation trajectory has been acquired within the continuous collection period. When the cumulative duration exceeds the preset termination threshold and the termination threshold matches the current transportation lifecycle stage, the subscription is determined to be an idle and invalid subscription and terminated.

[0093] When any one of the above four conditions is met, the system will set the subscription task status to terminate, remove it from the timed scheduling queue, and release the corresponding network connection and computing resources.

[0094] In some embodiments, the granularity of the transportation lifecycle stage division can be dynamically adjusted based on the data accuracy of the data source and business needs, and / or the transportation lifecycle stage is associated with a preset geofence area or port operation area boundary to cover multi-level tracking scenarios from macro voyages to micro loading and unloading operations, thereby improving the adaptability and refinement of the subscription management strategy.

[0095] In some embodiments, optionally, an existing trajectory collection subscription that meets the criteria for unique subscription identification refers to an active subscription whose transportation event change status remains unchanged and has not reached any trajectory collection termination condition within a continuously preset observation window period, ensuring that the reused subscription task is still in an effective physical transportation process and avoiding misuse caused by historical dirty data.

[0096] In some embodiments, optionally, based on the established terminated trajectory collection subscription tasks, cold start parameter suggestions are provided for one or more newly initiated trajectory data collection subscription requests targeting the same type of container or vessel on the same route. The provided collection period and effective tracking period are generated based on statistical data matching the distribution characteristics of the transportation lifecycle stages of historical containers of the same type. By utilizing the lifecycle model accumulated from terminated subscriptions, forward-looking scheduling parameter configurations are provided for new subscriptions, improving the predictive capability of subscription management.

[0097] In some embodiments, optionally, during the processing of transport trajectory data, the transport trajectory data also includes port clearance data and terminal operation system data synchronized with time. Determining the changing status of transport events includes correcting and marking the navigation trajectory segment or stopping area based on the customs clearance status or loading / unloading instructions. The port clearance data includes at least one of the following: customs declaration status, inspection instructions, and release timestamps.

[0098] In some embodiments, optionally, such as Figure 2 As shown, step S104: Determine whether there is an existing trajectory collection subscription corresponding to the target container based on the subscription unique identifier, including:

[0099] Step S1040: Obtain the trajectory collection subscription record associated with the subscription unique identifier;

[0100] Step S1042: Determine whether the target container is in an active tracking period based on the subscription status in the trajectory acquisition subscription record;

[0101] Step S1044: If the subscription status is terminated, it is determined that there is no active trajectory collection subscription;

[0102] Step S1046: If the subscription status is pending collection, collecting, or waiting to be collected, then it is determined that there is an existing trajectory collection subscription.

[0103] Step S1048: When an existing trajectory acquisition subscription exists, reuse the task configuration and acquisition scheduling parameters of the existing trajectory acquisition subscription, and determine this subscription request as a duplicate subscription request.

[0104] In this embodiment, the system retrieves trajectory collection subscription records from distributed storage using a unique subscription identifier, and determines whether the target container is in an active tracking period based on the subscription status field. The system binary-classifies the end status with the statuses of pending collection, collection in progress, and waiting to be collected. If it is the former, it is determined that there is no active subscription; if it is the latter, it is determined that there is an existing subscription, and its task configuration and scheduling parameters are directly reused, marking the current request as a duplicate subscription.

[0105] Understandably, by using state machine-driven existence verification, redundant data collection tasks targeting the same container are intercepted at the source, ensuring the continuity and consistency of the subscription lifecycle.

[0106] The subscription management method provided by this invention performs precise existence retrieval in a distributed subscription scheduling pool using a unique subscription identifier to determine whether a target container has been included in the active tracking system.

[0107] The unique identifier of the subscription serves as the primary key index, used to locate the associated unique trajectory acquisition subscription record in the persistent storage layer. The unique trajectory acquisition subscription record is stored in structured data format, carrying not only the initial configuration information of the subscription but also maintaining the instantaneous values ​​of the subscription state machine within the current time window.

[0108] The system reads the subscription status field from the subscription record. The value of the subscription status field directly reflects the acquisition lifecycle node of the target container in the physical transportation process and the system's latest scheduling intention for the subscription task.

[0109] The subscription status field is divided into two main categories: completed and active. The active status is further subdivided into pending collection, collection in progress, and waiting to be collected. The completed status indicates that the subscription task has completed resource reclamation and exited the scheduling queue; its corresponding container transportation process has terminated due to delivery completion, transportation termination, or expiration. The pending collection status indicates that the subscription record has been successfully written to storage but has not yet been triggered for the first collection task by the timer. At this time, the system only holds configuration parameters and does not occupy collection executor resources.

[0110] The "Acquisition in Progress" status indicates that the system is sending requests to the data source and processing the returned data during the current acquisition cycle. In the acquisition in progress status, the system uses a mutex lock to prevent the repeated issuance of acquisition tasks to avoid concurrent conflicts and duplicate data writing.

[0111] The "Waiting for Collection" status indicates that the previous round of collection has been completed without triggering the termination condition, and the system is waiting for the timer to reach the preset next collection time to re-enter the scheduling queue. The system determines whether the target container is in an active tracking period based on the matching result between the current value of the subscription status field and the status definition above.

[0112] If the value of the subscription status field is "Ended", it is determined that the physical transportation process corresponding to the subscription unique identifier has been completed or expired. The system recognizes that there is no active trajectory collection subscription and allows the creation of a new subscription task and initialization of new collection parameters.

[0113] If the value of the subscription status field is any one of the following: pending collection status, collection in progress status, or waiting to be collected status, it is determined that the container corresponding to the unique identifier of the subscription is under the system monitoring and there is an existing trajectory collection subscription.

[0114] When it is determined that an existing trajectory collection subscription exists, the system directly calls the task configuration and collection scheduling parameters that have been fixed in the subscription record.

[0115] The task configuration includes a preset mapping matrix between the transportation lifecycle stages and the baseline data collection cycle. The mapping matrix defines the standard data collection frequency under different transportation stages.

[0116] The data collection and scheduling parameters include the deadline for the effective tracking period, the cumulative duration of the current period without effective transport events, the timestamp of the next data collection time, and a counter for consecutive failures. The system reuses these validated parameter configurations instead of recalculating or randomly generating them, thereby ensuring the continuity and consistency of data collection for the same container over time.

[0117] The system marks the currently received subscription request as a duplicate subscription request and blocks it from entering the new subscription process, only returning the identifier and current status information of the existing subscription task.

[0118] In this way, the system intercepts duplicate traffic for the same container from the same data source at the source, avoiding redundant collection and parsing of the same transportation trajectory data, and significantly reducing invalid network requests and computational load.

[0119] During the retrieval of the subscription unique identifier, the update and read operations of the subscription status follow atomicity constraints, ensuring that when determining whether there is an active tracking period, the obtained subscription status value is based on the result of the most recently successfully committed transaction.

[0120] For subscription records in the data collection phase, the system further checks the number of consecutive failures and the retry interval when processing duplicate subscription requests. If the current time has not exceeded the retry time window, the existing data collection rhythm is maintained without intervention. This state machine-based decision-making logic allows the system to dynamically adjust resource allocation according to the actual progress of container transportation, avoiding invalid polling during periods when containers are stationary or transportation is interrupted. By reusing the task configuration of existing subscriptions, the system can inherit the judgment results of the transportation lifecycle stage from the previous data collection cycle, thereby continuously evaluating the transportation stage of containers in subsequent data collections without re-initializing the stage judgment model each time. This mechanism is particularly suitable for long-cycle voyages such as transoceanic transportation, ensuring the consistency and stability of the data collection strategy throughout the entire transportation process.

[0121] In some embodiments, the matching rules for the subscription unique identifier are optionally dynamically adjustable based on the data accuracy and update frequency of the data source, and / or the data source identifier is selected from a predefined set of high-quality data sources to expand subscription compatibility between different data providers, enabling trajectory acquisition subscription tasks to cover complex acquisition scenarios including multi-source heterogeneous data, and improving the robustness of subscription management and data integrity.

[0122] In some embodiments, optionally, the determination of meeting the active tracking period means that the target container's subscription status record within the set observation window is strictly in the pending collection state, collection in progress state, or waiting to be collected state, and there are no unrecoverable error codes or manual freeze indicators marked in the subscription status record. This ensures that the reused subscription tasks are in a healthy physical transportation process, avoiding incorrect parameter inheritance for failed or abnormal tasks.

[0123] In some embodiments, optionally, based on the reused task configuration and collection scheduling parameters of the trajectory collection subscription task, cold start parameter suggestions are provided for one or more newly initiated batch container subscription requests targeting the same port of origin and port of destination combination. The provided collection period and effective tracking period are generated based on a statistical model that matches the distribution characteristics of the transportation lifecycle stages of containers on the same historical route. By utilizing the transportation timeliness data accumulated from terminated subscriptions, forward-looking scheduling parameter configurations are provided for new subscriptions, improving the initial scheduling accuracy of large-scale container queues.

[0124] In some embodiments, optionally, such as Figure 3 As shown, step S108: Determine the transportation lifecycle stage of the target container based on the transportation trajectory data corresponding to the target container, including:

[0125] Step S1080: Extract the transportation event type, event location, container status, and event time data from the transportation trajectory data;

[0126] Step S1082: According to the preset maritime node mapping rules, map the transportation event type, event location, and container status to a unified container transportation node type;

[0127] Step S1084: Match the unified container transport node type with the preset transport stage sequence constraints to determine the transport lifecycle stage of the target container;

[0128] The transportation lifecycle includes at least the transportation preparation stage, the maritime transportation stage, the transshipment port operation stage, the destination port operation stage, and the destination port delivery stage.

[0129] In this embodiment, by extracting four-dimensional data—event type, location, status, and time—from the transportation trajectory data and inputting it into a preset maritime node mapping rule engine, heterogeneous data source messages are transformed into a unified container transportation node type. Based on preset transportation stage sequence constraints, the standardized node sequence is logically matched with five progressive stages: transportation preparation, maritime transportation, transshipment operations, destination port operations, and delivery, thereby accurately determining the current physical transportation lifecycle stage of the target container.

[0130] Understandably, by accurately identifying key nodes such as transshipment port operations and destination port delivery, the system can dynamically adjust its data collection strategy to avoid excessive resource consumption during static or inefficient phases, while ensuring high-frequency monitoring during critical operation windows, thus significantly improving the timeliness of trajectory data and the utilization rate of system resources.

[0131] The transportation trajectory data serves as the raw input, containing discrete event records returned by the data source interface. The system first extracts fields from each record, separating four core dimensions: transportation event type, event location, container status, and event time data.

[0132] The transport event type describes the business actions that occur to a container at a specific moment, including but not limited to booking, picking up, entering the port, loading, leaving the port, arriving at the port, unloading, leaving the port, and returning to the yard.

[0133] The location of the incident provides the geographical coordinates or standard port code where the business activity took place, used to define the physical area where the container is located.

[0134] Container status reflects the operational attributes of the container itself, such as empty / loaded status, changes in owner, and seal status. Event time data provides millisecond-level precision time anchors for these actions.

[0135] The system extracts the triples, namely the transportation event type, the event location, and the container status, as input vectors and inputs them into the preset maritime node mapping rule engine.

[0136] The maritime node mapping rule engine has a built-in heterogeneous data dictionary for different data sources such as shipping companies, terminal operating systems, and port monitoring platforms, which can uniformly convert the diverse original messages into standardized container transport node types. This mapping process is achieved through pattern matching.

[0137] Unifying the container transport node type eliminates semantic ambiguity in multi-source data, providing standardized input for subsequent logical judgments.

[0138] The system then matches the serialized unified container transport node type sequence with the preset transport stage sequence constraints.

[0139] The pre-defined transportation stage sequence constraint defines the mandatory logical order of the container throughout the entire chain from the shipper to the consignee. This order is irreversible and conforms to the laws of physical transportation.

[0140] The system determines the current transportation lifecycle stage of the target container based on the node type's position in the sequence constraints.

[0141] The transportation lifecycle is divided into five progressive levels: transportation preparation, maritime transportation, transshipment port operations, destination port operations, and destination port delivery.

[0142] The transport preparation phase covers all ground operations from booking to loading.

[0143] The maritime transport stage indicates that the container has been loaded onto the ship and is sailing at sea.

[0144] The transshipment port operation phase covers the unloading, storage, and reloading of containers at the transshipment port.

[0145] The destination port operations phase covers the storage and customs clearance of containers from unloading at the destination port to pickup.

[0146] The destination port delivery stage indicates that the container has been picked up by the consignee from the terminal or the empty container has been returned to the designated yard.

[0147] Through this logical chain from raw data extraction to node standardization and then to stage matching, the system can perceive the real progress of containers in the physical world in real time, providing a basis for decision-making for dynamic adjustment of the collection cycle and precise triggering of termination conditions.

[0148] The construction of maritime node mapping rules relies on offline training and manual verification of massive historical trajectory data. The system collects message samples from different data sources in the same physical scenario, extracts their field features and contextual relationships, and establishes the optimal mapping path between heterogeneous descriptions and standard nodes. The boundary definition of the pre-defined transportation stage sequence constraints combines international trade terms and maritime operation specifications to ensure that the division of each stage is both in line with business logic and technically feasible.

[0149] During the determination of transportation lifecycle stages, the system employs a sliding window mechanism to comprehensively analyze node types across multiple consecutive data collection periods, preventing stage jumps caused by single-point data anomalies. For short-term berthing and re-departure events occurring during transshipment port operations, the system uses time interval thresholds and geofence verification to distinguish between transshipment operations and destination port deliveries, thereby avoiding misjudgments in stage determination.

[0150] This judgment method, based on multi-dimensional data fusion and logical constraints, ensures the accuracy and stability of outputs at each stage of the transportation lifecycle, laying a solid data foundation for the intelligent scheduling of the entire subscription management system.

[0151] In some embodiments, optionally, compliance with the transportation phase sequence constraint means that the node type sequence of the target container within a set observation window strictly follows a unidirectional progressive logic from the transportation preparation phase to the destination port delivery phase, and no abnormal nodes reversing or skipping outside the phase sequence specified by the constraint appear. This ensures that the determined lifecycle phases are highly reliable and avoids misjudgments of phases due to out-of-order data source messages or abnormal feedback.

[0152] In some embodiments, optionally, based on a determined transportation lifecycle stage, data collection strategy recommendations are provided for one or more container groups operating on the same route or of the same type. The provided data collection period and effective tracking period are generated based on historical statistical data matching the current transportation stage. Utilizing a validated stage feature library, adaptive scheduling parameter configurations are provided for containers in similar physical transportation processes, improving the resource allocation efficiency of large-scale container cluster management.

[0153] In some embodiments, optionally, such as Figure 4 As shown, step S110: Determine the collection period corresponding to the trajectory collection subscription task based on the transportation lifecycle stage, including:

[0154] Step S1100: Determine the baseline collection period corresponding to the transportation lifecycle stage by querying the preset stage collection parameter mapping relationship according to the transportation lifecycle stage;

[0155] Step S1102: Determine the effective tracking period corresponding to the target container based on the preset time constraints of the transportation stage according to the transportation life cycle stage query;

[0156] Step S1104: Determine the maximum allowable tracking deadline based on the effective tracking period and the start time of the trajectory acquisition subscription task;

[0157] Step S1106: Update the acquisition scheduling parameters of the trajectory acquisition subscription task according to the baseline acquisition period, effective tracking period and maximum allowed tracking deadline.

[0158] In this embodiment, the baseline collection period and the effective tracking period are determined by the preset stage collection parameter mapping relationship of the transportation lifecycle stage index and the time constraints of the transportation stage. The system superimposes the effective tracking period and the subscription start time to generate the maximum allowable tracking deadline, and dynamically updates the collection scheduling configuration based on the above parameters. This process transforms the physical transportation patterns of containers into digital scheduling instructions, enabling the collection frequency to be dynamically adjusted according to the transportation stage, and ensuring that the tracking duration covers the entire voyage, thus realizing the transformation from static polling to flexible scheduling based on the transportation process.

[0159] Understandably, by dynamically setting an effective tracking period based on route characteristics, the problem of premature termination of short-haul transportation or long-haul transportation running idle due to fixed lifecycles is solved. The flexible scheduling strategy maximizes the utilization of data collection resources and the stability of the system under high-concurrency scenarios while ensuring the timeliness of data at critical operation nodes.

[0160] The transportation lifecycle stage serves as a core input variable, used to query a pre-defined stage acquisition parameter mapping table to determine the baseline acquisition cycle that matches the physical characteristics of that stage.

[0161] The phased data collection parameter mapping table is a set of key-value pairs built offline based on the statistical patterns of massive historical container transportation data. The key represents the transportation lifecycle phase, and the value represents the recommended data collection interval that balances data timeliness and resource consumption at that phase.

[0162] For example, during the maritime transport phase, due to the slow updates of vessel positions and the significant impact of ocean currents and weather, the system is configured with a longer baseline data collection period to reduce invalid requests. Conversely, during the destination port operation phase, due to the intensive loading / unloading and container pickup operations and high timeliness requirements, the system is configured with a shorter baseline data collection period to ensure frequent data updates. The system also uses the transport lifecycle phases as indexes, querying a pre-defined transport phase time constraint database to determine the effective tracking period corresponding to the target container.

[0163] The transportation phase time constraint library stores the theoretical time range for different combinations of origin and destination ports in each transportation phase. This range combines the baseline sailing time of the shipping route, the average port operating efficiency, and seasonal factors. The effective tracking period is defined as the maximum time span during which the system should maintain an active subscription status, starting from the start time of the subscription task. This maximum time span ensures that the system will not prematurely terminate the monitoring of containers, even during phases of slow data updates.

[0164] The system arithmetically adds the effective tracking period to the start timestamp of the trajectory acquisition subscription task to calculate the maximum allowable tracking deadline. The maximum allowable tracking deadline serves as a hard scheduling boundary and is used to determine all subsequent acquisition decisions.

[0165] The system comprehensively updates the acquisition scheduling parameters of the trajectory acquisition subscription task by taking into account three dimensions: the baseline acquisition period, the effective tracking period, and the maximum allowed tracking deadline.

[0166] The data acquisition scheduling parameters include, but are not limited to, the timestamp of the next data acquisition time, the multiplier of the current data acquisition interval, and the absolute time point of task failure.

[0167] Through this parameterized configuration method based on transportation stages, the system can transform abstract transportation processes into specific scheduling instructions, ensuring that data collection is always synchronized with changes in the physical location of containers and the rhythm of operations.

[0168] The construction of the phased acquisition parameter mapping table relies on cluster analysis of historical trajectory data and verification by human experts. The system collects millions of transport records, calculates the average time interval between adjacent valid events within each transport phase, uses this as the initial value of the baseline acquisition cycle, and corrects it in conjunction with the data source interface rate limiting strategy.

[0169] The update of the time constraint library for the transportation phase introduces a sliding time window mechanism. The system continuously monitors the actual transportation time of a specific route in the past three months, dynamically smooths out anomalies caused by extreme weather or port congestion, and ensures that the effective tracking cycle always closely matches the actual operation.

[0170] During the process of updating the collection and scheduling parameters, the system adopts a version control mechanism to manage parameter change records. When a transition occurs in the transportation lifecycle stage, the system automatically loads the parameter configuration corresponding to the new stage and overwrites the old configuration. At the same time, the system ensures the atomicity and consistency of parameter updates through transaction logs.

[0171] This process of transforming physical transportation patterns into digital scheduling parameters forms the basis for the intelligence of the subscription management system, enabling the system to minimize the ineffective use of collection resources while ensuring data quality.

[0172] For example, for a container that encounters severe weather during maritime transport, resulting in a decrease in speed, although the system detects a decrease in the frequency of location updates, based on the preset effective tracking period, the system will continue to monitor the container until the maximum allowable tracking deadline is reached, without premature termination due to short-term data sparsity, thereby ensuring the continuity and reliability of long-haul transport tracking.

[0173] In some embodiments, the determination of the baseline collection period may also refer to the service level agreement and interface rate limiting threshold of the data source, and / or the boundary value of the effective tracking period and the historical on-time rate distribution of a specific route, so as to adapt to the differences in service capabilities of different data providers while ensuring data timeliness, and improve the fault tolerance and stability of subscription scheduling in the face of fluctuations in external data sources.

[0174] In some embodiments, optionally, compliance with transportation phase time constraints means that the actual dwell time of the target container within a specific transportation lifecycle phase does not exceed the preset time constraint upper limit for that phase, and that this dwell time data is consistent with the historical transportation time distribution of containers on the same route. This ensures that the calculated effective tracking cycle can accurately reflect the reasonable time span of the physical transportation process, avoiding premature termination or ineffective idle time due to port congestion or abnormal shipping speeds.

[0175] In some embodiments, optionally, based on updated collection and scheduling parameters, batch scheduling optimization suggestions are provided for one or more sets of containers at the same stage of the transportation lifecycle. The provided baseline collection period and maximum allowed tracking deadline are globally optimal solutions adjusted by a cluster load balancing algorithm. By utilizing a shared scheduling parameter model, the decision-making overhead of the system in scenarios involving massive container concurrent tracking is reduced, and the overall throughput efficiency of computing resources is improved.

[0176] In some embodiments, optionally, determining that the target container is in a state without valid transportation events based on the duration of the absence of valid transportation trajectory events within a continuous acquisition period includes: counting valid transportation trajectory events that characterize changes in the physical location or transportation status of the container within a continuous acquisition period; when no valid transportation trajectory events are acquired for multiple consecutive acquisition periods, determining the idling level based on the cumulative duration of the absence of valid transportation trajectory events; extending the baseline acquisition period according to the idling level and a preset segmented backoff rule to obtain a backoff acquisition period; and updating the next acquisition time of the trajectory acquisition subscription task according to the backoff acquisition period.

[0177] Among them, the preset segmented retreat rule is configured with different retreat growth coefficients at different stages of the transportation life cycle.

[0178] In this embodiment, by statistically analyzing the missing valid transportation trajectory events within a continuous acquisition period, the cumulative duration of unacquired valid events is calculated and mapped to discrete idling levels. Based on preset segmented backoff rules and combined with the differential growth coefficient configured for the current transportation lifecycle stage, the baseline acquisition period is dynamically extended, generating a backoff acquisition period and updating the next scheduling time. This process deeply couples event-driven monitoring results with time-dimensional resource scheduling, achieving adaptive switching from high-frequency detection to low-frequency dormancy.

[0179] Understandably, by configuring differentiated backoff coefficients at different stages of transportation, oversampling is avoided in low-dynamic phases such as maritime transport, while maintaining response sensitivity in high-risk phases such as port operations. This non-linear backoff mechanism greatly improves the system's resource utilization and long-term operational stability in high-concurrency scenarios, ensuring that no key nodes are missed.

[0180] The subscription management method provided by this invention monitors the acquisition of valid transportation trajectory events within a continuous collection period, and constructs a state determination model for the absence of valid transportation events based on the duration of event missing, along with an adaptive resource backoff mechanism.

[0181] Effective transport trajectory events serve as the core basis for determining the progress of container physical transport. Specifically, they refer to data records that can be parsed from the original messages returned by the data source, representing substantial physical displacement of the container or key transitions in its transport status. These data records include at least the loading node, departure node, arrival node, unloading node, container pickup node, and empty container return node.

[0182] After each data collection cycle is completed and the data parsing is finished, the system cleans and filters all the messages acquired in that cycle to identify whether there are any valid transportation trajectory events that meet the above definition.

[0183] The system counts the hit rate of valid transportation trajectory events within a continuous data collection period. If no such event is parsed within multiple consecutive data collection periods, the system triggers the logic to determine the state of no valid transportation events.

[0184] The timestamp of the first event where a valid transport trajectory was not acquired is recorded as the starting point of the idle period. The cumulative duration of the event without a valid transport trajectory is determined by calculating the difference between the current system time and the starting point of the idle period. The cumulative duration, as the core parameter for quantifying the degree of container stagnation, is input into the idle level calculation model.

[0185] The idling level calculation model has a built-in multi-level time threshold range. Based on the range to which the cumulative duration belongs, it maps it to a discrete idling level value, which increases stepwise as the duration increases.

[0186] Based on the currently determined idle level, the pre-defined segmented backoff rule table is consulted to obtain the corresponding backoff growth coefficient. The pre-defined segmented backoff rule table is a multi-dimensional parameter matrix, with its core dimensions being the transportation lifecycle stage and the idle level. Different backoff growth coefficients are configured for different transportation lifecycle stages in the pre-defined segmented backoff rule table.

[0187] Specifically, during the transport preparation and destination port delivery phases, given the uncertainties and dense operation windows in ground operations, a relatively small retreat growth coefficient is configured to maintain responsiveness to unexpected operations; during the maritime transport and transshipment port operation phases, given the naturally long location update intervals and small data fluctuations, a relatively large retreat growth coefficient is configured to achieve deep resource dormancy.

[0188] The acquired backoff growth coefficient is multiplied by the baseline acquisition period used by the current trajectory acquisition subscription task to obtain the extended backoff acquisition period. This backoff acquisition period is the adjusted acquisition interval. The system uses this period to update the next acquisition time field of the trajectory acquisition subscription task, thereby realizing the rearrangement of the scheduling queue.

[0189] Through the above steps, the system transforms event-stream-based dynamic monitoring into time-axis-based elastic scheduling, minimizing resource consumption caused by invalid data collection while ensuring that no critical status updates are missed.

[0190] For example, when the system detects that a container is in the maritime transport phase and only invalid messages indicating minor changes in the ship's position are obtained for seven consecutive collection cycles, the cumulative duration of the event without valid transport trajectory data is calculated to be seven days. The system determines that this duration corresponds to the third level of idleness based on a preset time threshold range. A preset segmented backoff rule table is consulted to find that the backoff growth coefficient for the maritime transport phase under the third level of idleness is 2.0. The system multiplies the current 24-hour baseline collection cycle by the 2.0 coefficient to obtain a 48-hour backoff collection cycle and updates the next collection time of the task to 48 hours after the current time.

[0191] The construction of the pre-defined segmented backoff rule table relies on big data analysis of historical massive container transportation trajectories. The system extracts the time interval distribution of adjacent valid events within each stage of the transportation lifecycle on different routes, removes extreme outliers, and calculates the average event interval of each stage under normal transportation conditions as a benchmark.

[0192] Based on this, and taking into account the average response latency of the data source interface and the rate limiting frequency, time thresholds and corresponding growth coefficients are set for each level of idle time.

[0193] The calculation of idling level uses a non-linear function, which makes the incremental time required for level transition grow exponentially with the increase of cumulative duration, thereby avoiding frequent policy switching due to brief network jitter or data latency.

[0194] During the update of the next data collection time, the system uses a distributed time wheel for task scheduling to ensure that tasks that have been backed up are precisely awakened at the designated time. While executing the backoff strategy, the system maintains real-time monitoring of the transportation lifecycle stages. Once a new valid transportation trajectory event is obtained during the backoff interval through asynchronous notification or passive reception, the system will immediately reset the idling level and cumulative duration, forcibly interrupt the backoff state, and restore the system to the baseline data collection cycle. This mechanism ensures the system's consistency between resource conservation when facing long periods of inactivity and agile response when transportation resumes.

[0195] In some embodiments, the determination of a state of no valid transportation event may optionally include the identification of a specific abnormal status code returned by the data source. When messages indicating temporary data loss or port shutdown are continuously received, the state is considered an equivalent no valid transportation event and included in the cumulative duration. This ensures that the system can correctly enter the backoff logic even when a failure occurs at the data source end, avoiding invalid duplicate requests that increase the burden on the server.

[0196] In some embodiments, the backoff collection cycle may optionally include not only time-based scheduling instructions but also derived risk assessment indicators associated with the backoff state. These derived risk assessment indicators include at least one of the following: predicted data freshness decay, probability of missed detection at critical nodes, and expected waiting cost based on historical recovery time. By feeding back risk prediction data, the system provides operations and maintenance personnel with decision support on whether to force wake-up or manual intervention, thereby improving the interpretability of automated system operations and maintenance.

[0197] In some embodiments, optionally, such as Figure 5 As shown, step S112: Track data is collected from the target container according to the collection cycle, and the change status of the transportation event corresponding to the target container is determined based on the collected transportation trajectory data, including:

[0198] Step S1120: Obtain the execution result and failure type of this round of trajectory data acquisition;

[0199] Step S1122: When the execution result indicates that the data acquisition failed, determine the retry time interval based on the failure type and the number of consecutive failures;

[0200] Step S1124: Reorder the next collection time of the trajectory collection subscription task according to the retry time interval;

[0201] Step S1126: When the next acquisition time is later than the maximum allowable tracking deadline, the maximum tracking cycle condition in the trajectory acquisition termination condition is triggered.

[0202] In this embodiment, the system collects the execution results of the current round of trajectory data acquisition from the executor, analyzes the failure type, and queries a preset retry strategy mapping table based on the number of consecutive failures. It then dynamically calculates the retry time interval to rearrange the next acquisition time. During execution time rearrangement, the system compares the rearranged time with the maximum allowed tracking deadline. If the rearranged time exceeds the effective lifecycle boundary, the maximum tracking cycle termination condition is triggered.

[0203] Understandably, by dynamically adjusting the retry rhythm based on failure frequency, both data recovery capability under network jitter is ensured, and dead tasks are promptly cleaned up through hard time boundaries. This resilient scheduling strategy significantly improves the system's stability and resource utilization in complex network environments, while reducing operational intervention costs.

[0204] The execution result of this round of trajectory data acquisition is returned by the acquisition executor after a single task is completed. The execution result reflects the success or failure status of initiating a request to the data source interface and ultimately obtaining the message.

[0205] Failure type is a further analysis of the error code or exception category in the execution result, used to distinguish between transient failures and permanent failures.

[0206] Transient failures include, but are not limited to, network timeouts, data source interface rate limiting triggering, server-side internal errors, and temporary unavailability.

[0207] Permanent failures include, but are not limited to, non-existent container number, invalid data source authorization, revoked subscription permissions, and invalid request parameters.

[0208] The system extracts the failure type from the execution results and combines it with a consecutive failure count counter maintained in the trajectory acquisition subscription task for comprehensive judgment. The consecutive failure count records the cumulative frequency of consecutive acquisition failures encountered by the subscription task within adjacent acquisition cycles; the counter is reset to zero when a valid transportation trajectory event is successfully acquired. Based on the two-dimensional input of failure type and consecutive failure count, the system queries a preset retry strategy mapping table to determine the corresponding retry time interval.

[0209] The retry policy mapping table configures different backoff bases for different failure types and different penalty multipliers for consecutive failures. The two are combined to calculate the specific retry time interval.

[0210] For example, for transient network timeout failures, configure a shorter retry interval and a lower penalty multiplier; for data source rate limiting failures, configure a longer retry interval and a higher penalty multiplier.

[0211] The system uses the calculated retry time interval to rearrange the next acquisition time field of the trajectory acquisition subscription task and re-insert the task into the specified time slot of the scheduling queue.

[0212] During the time rescheduling process, the system compares the rescheduled next acquisition time with the maximum allowed tracking deadline. The maximum allowed tracking deadline is a hard time boundary pre-calculated based on the effective tracking period and the subscription start time. If the rescheduled next acquisition time is later than this maximum allowed tracking deadline, the system determines that the subscription task cannot resume normal acquisition within the effective time window, and then triggers the maximum tracking period condition in the trajectory acquisition termination condition, setting the task status to terminated and releasing resources.

[0213] For example, for a container nearing the end of its journey, if its data source interface starts frequently returning authorization failure errors, the system determines it to be a permanent failure. Even if a corresponding retry interval exists in the retry policy mapping table, the system will ignore the retry logic and directly compare the current time with the maximum allowed tracking deadline. If the current time is close to or exceeds the deadline, the system will immediately terminate the task to prevent wasting remaining system resources on invalid data sources.

[0214] In some embodiments, the retry logic for failed data acquisition may optionally include semantic parsing of specific business exception codes returned by the data source. When consecutive terminal errors indicating container loss, waybill invalidation, or rejection at the destination port are received, the failure is mapped to a permanent fault, and the trajectory acquisition termination condition is directly triggered. This ensures that the system can quickly identify abnormal termination of the physical transportation process and avoids meaningless lifecycle renewals for invalid business objects.

[0215] In some embodiments, optionally, based on a determined retry interval and a maximum allowed tracing deadline, a batch circuit breaker suggestion is provided for one or more subscription task clusters in the same failure state and transit stage. The provided circuit breaker threshold and recovery probe frequency are calculated based on a weighted average of the overall cluster failure rate and deadline urgency. This aggregated circuit breaker mechanism reduces the timer triggering overhead of a large number of zombie tasks in edge scenarios, improving the system's self-healing capability under high-load failure scenarios.

[0216] In some embodiments, the trajectory acquisition subscription task may optionally include a pending acquisition state, an acquisition in progress state, a waiting acquisition state, and an end state; the subscription management method may further include:

[0217] When the trajectory acquisition subscription task is in the pending acquisition state, the trajectory data acquisition is triggered by a timer, and the task status is switched to the acquisition state.

[0218] When the current round of trajectory data collection is completed and no trajectory collection termination condition is met, the task status will be switched to the waiting collection status according to the next collection time.

[0219] When any trajectory acquisition termination condition is met, the task status will be switched to the end status.

[0220] When the trajectory acquisition subscription task is in an ended state, remove the trajectory acquisition subscription task from the scheduling queue and release the data acquisition resources corresponding to the target container and data source identifier.

[0221] In this embodiment, a closed-loop management system is implemented for the entire lifecycle of the trajectory acquisition subscription task by constructing state machines corresponding to the states of pending acquisition, acquisition in progress, waiting for acquisition, and completion. The system drives the task to atomically transition between each state based on timer triggers and termination conditions, and synchronously releases network connections, data source quotas, and memory caches when switching to the completion state. This mechanism strictly binds acquisition resources to task states, ensuring real-time consistency between the scheduling queue and resource usage.

[0222] Understandably, the proactive resource reclamation mechanism based on termination conditions completely solves the ghost task and memory leak problems, significantly reducing resource fragmentation rates in the later stages of system operation. State machine-driven elastic scheduling improves system stability while greatly optimizing the utilization of data source interface quotas and network bandwidth.

[0223] As the smallest unit of system scheduling, the trajectory acquisition subscription task has its state attributes strictly limited to four mutually exclusive and complete enumeration values: pending acquisition state, acquisition in progress state, waiting to be acquired state, and completed state.

[0224] The pending data acquisition status indicates that the subscription record has been successfully persisted but has not yet been added to the execution queue by the timer. At this time, the task only occupies storage resources and does not consume the acquisition executor or network connection. The system timer periodically scans the tasks in the pending data acquisition status according to the global time wheel or delay queue. When it detects that the current timestamp is greater than or equal to the task's preset initial acquisition time, the trajectory data acquisition process is triggered.

[0225] Within the same transaction that triggers execution, the system uses atomic operations to switch the task status from pending collection to collection in progress, and locks the task record to prevent the concurrent scheduler from repeatedly fetching it.

[0226] During the data acquisition process, the status characterization system has sent a request to the data source interface and is processing the response data. In this state, the task exclusively uses one acquisition executor thread and the corresponding network bandwidth resources.

[0227] Once the current trajectory data acquisition process is completed, regardless of whether valid data is successfully acquired or acquisition fails, the system will perform a full scan of the preset trajectory acquisition termination conditions.

[0228] If any termination condition is not met, the system will switch the task status from "collecting" to "waiting to collect" based on the next collection time calculated according to the current transportation lifecycle stage, idle level, or retry strategy. The "waiting to collect" status indicates that the current round of collection has ended but the task still needs to continue monitoring. At this time, the task releases the collection executor resources, retaining only a time placeholder in the scheduling queue, waiting for the timer to trigger again.

[0229] If the scan finds that any of the trajectory acquisition termination conditions are met, including arrival at the destination port for delivery, generation of a transportation completion event, exceeding the maximum tracking period, or reaching the no-event termination threshold, the system will switch the task status from the in-process or waiting-to-collection state to the terminated state. The terminated state indicates that the subscribed task has completed its physical transportation tracking mission and is no longer eligible to be triggered by the timer.

[0230] When a task enters the completed state, the system immediately removes it from the ordered set of the timed scheduling queue, cutting off its time callback link.

[0231] Simultaneously, the system releases all soft resources bound to the task, including connection pool slots corresponding to the target container and data source identifiers, trajectory buffers in memory cache, and distributed lock occupancy. Through this rigid control based on state transitions, the system ensures that each acquisition task is in only one deterministic state at any given time, and that resource allocation is strictly aligned with the state, completely eliminating the risks of ghost tasks and resource leaks.

[0232] Atomicity during state transitions is guaranteed by both distributed locks and database transactions.

[0233] When switching from the pending data collection state to the data collection in progress state, the system employs a locking mechanism before updating the state to ensure that only one scheduler instance can successfully pull the task in high-concurrency scenarios. When switching from the data collection in progress state to the waiting data collection state or the completed state, the system uses a version number mechanism to prevent dirty writes, ensuring that state transitions are based on the latest data collection results and termination criteria. The calculation logic for the next data collection time deeply integrates the baseline data collection cycle, the backoff data collection cycle, and the retry interval, making state transitions not merely attribute changes but also a dynamic manifestation of the scheduling strategy.

[0234] The scheduling queue is typically implemented using ordered sets, sorted by the next collection time. The timer only needs to scan the head node whose score is less than the current time, significantly improving time complexity performance under large-scale task scheduling. The resource release process employs a hook function mechanism, triggered after the same transaction changes to the terminated state, ensuring deterministic resource reclamation. This rigorous state machine design forms the cornerstone of the stable operation of the entire subscription management system.

[0235] In some embodiments, the determination of whether a task is in a terminated state may optionally include verifying the integrity of residual data in the task context. When a task switches to a terminated state, if critical trajectory nodes that have not been written to disk are detected in the cache, a data flush and index building operation is forcibly performed before releasing resources. This ensures the integrity and consistency of data at the end of the subscription task's entire lifecycle, avoiding trajectory breakpoints and data loss due to abnormal downtime.

[0236] In some embodiments, optionally, state transition predictions are provided for one or more active tasks at the same transport lifecycle stage or data source type, based on the state records of terminated subscription tasks. The provided predictions include estimates of the next state transition time based on the historical average state dwell time. Utilizing the patterns of historical termination paths optimizes the state machine parameter configuration of active tasks, improving the smoothness and predictability of state transitions in large-scale clusters.

[0237] In some embodiments, optionally, such as Figure 6 As shown, step S112: Track data is collected from the target container according to the collection cycle, and the change status of the transportation event corresponding to the target container is determined based on the collected transportation trajectory data, including:

[0238] Step S1130: Determine the effective transportation trajectory events representing the progress of the target container transportation process based on the preset set of effective transportation trajectory events;

[0239] Step S1132: When a new valid transportation trajectory event occurs between adjacent acquisition cycles, the transportation event change state is determined as the first change state;

[0240] Step S1134: When multiple consecutive acquisition cycles only acquire time data updates without acquiring new valid transportation trajectory events, determine the transportation event change state as the second change state;

[0241] Step S1136: Re-determine the transportation lifecycle stage corresponding to the target container based on the first change state.

[0242] In this embodiment, non-essential data is filtered out by pre-setting a set of valid transportation trajectory events. The event increments within adjacent collection periods are compared to determine the change status of transportation events. When a new valid event occurs in an adjacent period, it is marked as the first change status, triggering the recalculation and update of the transportation lifecycle stage. When only timestamp updates occur in consecutive periods without new events, it is marked as the second change status, maintaining the status quo or initiating a backoff. This mechanism transforms the raw data stream into a high signal-to-noise ratio state signal, driving the dynamic correction of the stage model.

[0243] Understandably, by accurately identifying the substantial progress of the transportation process, the system can switch its data collection strategy in real time when critical nodes occur, ensuring high-frequency monitoring of important operational processes. Simultaneously, accurate determination of the quiet period supports the execution of the segmented backoff mechanism, significantly reducing the resource overhead of invalid data collection and improving the accuracy and efficiency of end-to-end tracking.

[0244] The preset valid transportation trajectory event set is a standardized event library that has undergone rigorous screening. The preset valid transportation trajectory event set stores all node types that can characterize the substantial displacement of the physical location of the container or the critical transition of the transportation status. It includes at least booking confirmation, container pickup and exit, port entry for loading, loading and departure from the port, unloading at the transshipment port, loading at the transshipment port, arrival at the destination port, unloading at the destination port, pickup of loaded containers, and return of empty containers to the yard.

[0245] The system extracts all messages obtained from the data source within the current collection period, performs pattern matching between the event descriptions, status codes, and location information and the preset set of valid transportation trajectory events, filters out non-substantive noise data that only contains minor coordinate fluctuations, signal strength changes, or timestamp updates, and thus determines the valid transportation trajectory events that characterize the progress of the target container transportation.

[0246] The adjacent acquisition cycle refers to the time span between the current acquisition time window and the previous successful acquisition time window of valid transportation trajectory events. The system determines whether the process is progressing by comparing the set of valid events within these two windows.

[0247] When a new node belonging to the preset set of valid transportation trajectory events appears between adjacent data collection periods, and this node did not appear in the previous period, the system determines that the transportation process of the target container has undergone a substantial change, and marks this change in transportation event status as the first change state. The first change state is a strong signal that triggers a reassessment of the transportation lifecycle stage, indicating that the container may have entered the next physical transportation stage.

[0248] Conversely, when the system logs for multiple consecutive collection cycles show that only non-critical data such as timestamp updates, heartbeat packets, or minor location drifts have been acquired, without parsing any new and valid transportation trajectory events, the system determines that the target container is in a physical standstill or information silence period and marks the transportation event change state as the second change state.

[0249] When the system detects that the change status of a transportation event is the first change status, it immediately redetermines the current transportation life cycle stage of the target container based on the newly emerging valid transportation trajectory event type and its corresponding geographical location.

[0250] The recalculation process overwrites the stage judgment results of the previous cycle and dynamically adjusts the collection frequency and monitoring strategy according to the characteristics of the new stage. Through this state judgment mechanism based on effective event increments, the system can accurately capture key turning points in the container transportation process, avoiding state misjudgments and resource waste caused by redundant messages or noisy data from the data source.

[0251] For example, in the previous data collection cycle, the system acquired a ship departure event, determining that the container was in the maritime transport phase. In the subsequent three consecutive data collection cycles, the system only received coordinate updates indicating minor movements of the ship's position on the high seas, and no new valid transport trajectory events occurred. At this point, the system classified the transport event change state as the second change state and started a no-event timer. If a destination port arrival event is suddenly received in the fourth data collection cycle, the system immediately switches the change state to the first change state, forces a recalculation of the lifecycle stage to the destination port operation stage, and simultaneously adjusts the data collection frequency from 24 hours to 4 hours.

[0252] The construction of the pre-defined set of valid transportation trajectory events relies on a deep abstraction of the business rules of major global ports and shipping companies. The system collects massive amounts of historical trajectory data, uses natural language processing technology to parse the unstructured descriptions in the original messages, extracts action keywords with physical meaning, and maps them to standardized event codes. The definition of adjacent collection periods adopts an event-driven timeline alignment method, rather than fixed calendar time; that is, the system focuses on the interval between two valid events, rather than the interval between two fixed time points.

[0253] The identification of the first change state uses a sliding window deduplication algorithm to ensure that repeated departure events are not misjudged as new process progress in the event of network retransmission or repeated push of the same message by the data source.

[0254] The second change state determination introduces a minimum silent duration threshold to prevent intermittent data loss caused by brief network outages or data source maintenance from being mistakenly judged as long-term stagnation.

[0255] When redefining the transportation lifecycle stage based on the first changing state, the system uses a finite state machine model to verify the legality of the transition between the new event and the current stage. For example, if the current stage is maritime transportation and the new event is unloading at the destination port, the transition is legal; if the new event is booking in the transportation preparation stage, it is considered an abnormal jump and an alarm is recorded. This rigorous logic for determining changing states ensures that the transportation lifecycle stage accurately reflects the actual flow path of containers in the physical world.

[0256] For example, for a container waiting to berth at anchor, the system may remain in the second change state for ten consecutive days. Once the port operations system issues a pre-discharge instruction and it is captured by the system as a valid transport trajectory event, the system instantly switches to the first change state, immediately updates the lifecycle stage from the maritime transport stage to the destination port operations stage, and activates the high-frequency data acquisition mode to provide data support for subsequent rapid customs clearance and cargo collection.

[0257] In one specific embodiment, optionally, the core concept of the present invention is: at the subscription entry point, key elements are normalized and deduplicated, and a state machine is maintained for each valid subscription (pending sending, running, waiting for the next collection, completed). After each round of collection is completed, multiple conditions are used to determine whether to terminate. Otherwise, the next collection time is calculated and saved, and the subscription is re-enqueued upon expiration. If the collection fails, the subscription lifecycle is reordered, thereby forming a closed loop of subscription lifecycle and automatic recycling of collection resources.

[0258] Core method steps:

[0259] Idempotent deduplication of subscription entry: Subscription requests are normalized according to key elements (such as tracking object, destination port, data source, etc.) to generate a unique identifier. The same request can directly reuse the existing subscription, avoiding duplicate subscriptions and consuming resources from the source.

[0260] Subscription state machine: The subscription is initially set to "Pending Sending"; after the timer scans for expired subscriptions and issues the collection task, it enters "Running"; after the current round of collection is completed, it enters "Waiting for the next collection"; upon expiration, the timer re-enqueues the subscription for collection again; if the termination condition is met at any stage, it is set to "Completed".

[0261] Long-term lack of data will lead to termination: For subscriptions that have not collected valid data for an extended period, the collection interval will be extended in segments based on the duration of the subscription; if no valid data is collected for an extended period exceeding the preset limit, the subscription will be terminated.

[0262] Multi-condition termination determination: The subscription will be set to "completed" if any of the following conditions are met: "tracking end flag is set", "data source returns terminal status of completed transportation", "subscription cumulative duration reaches the preset maximum tracking period (e.g., about eight months)" and "no valid data for a long period of time, back off to the upper limit".

[0263] Collection failure rescheduling: When the current collection fails, the next collection time is rescheduled (e.g., retry as soon as possible or postpone for a fixed duration), and the collection continues to be retried in the next round without blocking the scheduling of other subscriptions.

[0264] Resource reclamation: Once the subscription is marked as "completed", it will no longer be scheduled by the timer, releasing the corresponding collection resources.

[0265] The system consists of a subscription entry deduplication module, a subscription state machine module, a backoff and validity period module, a multi-condition termination judgment module, and a failure reordering module.

[0266] like Figure 9 As shown, the full lifecycle management process for container data subscription includes:

[0267] Step S200: The timer scans for expired subscriptions and issues the data collection task;

[0268] Step S202: Determine whether this round of data collection was successful;

[0269] If the judgment result of step S202 is negative, then proceed to step S204: rearrange the next collection time and wait for the next round of retry;

[0270] If the result of step S202 is yes, then proceed to step S206: determine whether the termination condition is met;

[0271] If the judgment result of step S206 is yes, then proceed to step S208: stop scheduling and reclaim resources;

[0272] If the judgment result of step S206 is negative, then proceed to step S210: calculate the next acquisition time and wait for the next acquisition.

[0273] Step S212: When the timer expires, the data is re-enqueued and the next round of data collection begins.

[0274] like Figure 7 As shown in the illustration, this application embodiment also provides a subscription management device 900, including: a request acquisition module 902, used to acquire a trajectory data collection subscription request for a target container; an identifier generation module 904, used to determine a unique subscription identifier based on the container identifier, destination port information, and data source identifier in the trajectory data collection subscription request; a deduplication module 906, used to determine whether there is an existing trajectory collection subscription corresponding to the target container based on the unique subscription identifier; if there is no existing trajectory collection subscription, a trajectory collection subscription task corresponding to the target container is created, and the trajectory collection subscription task is initialized to a pending collection state; and a stage determination module 908, used to determine the stage based on the transportation corresponding to the target container. The trajectory data determines the transportation lifecycle stage of the target container; the cycle configuration module 910 is used to determine the collection cycle corresponding to the trajectory collection subscription task based on the transportation lifecycle stage; the collection execution module 912 is used to perform trajectory data collection on the target container according to the collection cycle, and determine the transportation event change status corresponding to the target container based on the collected transportation trajectory data; the condition judgment module 914 is used to determine whether the target container meets the trajectory collection termination condition based on the transportation event change status; the subscription management module 916 is used to set the trajectory collection subscription task to the end state and stop the subsequent trajectory data collection on the target container when any trajectory collection termination condition is met.

[0275] The trajectory collection termination conditions include: determining that the target container has arrived at the destination port or completed delivery at the destination port based on the transportation trajectory data; determining that the transportation completion event corresponding to the target container has been generated based on the transportation trajectory data; determining that the tracking time corresponding to the target container has reached the preset maximum tracking period based on the duration of the trajectory collection subscription task; determining that the target container is in a state of no valid transportation event based on the duration of no valid transportation trajectory event acquired within the continuous collection period, and reaching the preset termination threshold.

[0276] like Figure 8 As shown, this application embodiment also provides an electronic device 1000, including a processor 1110, a memory 1109, and a program or instructions stored in the memory 1109 and executable on the processor 1110. When the program or instructions are executed by the processor 1110, they implement the various processes of the above-described subscription management method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0277] Optionally, the processor 1110 is used to acquire a trajectory data acquisition subscription request for the target container;

[0278] Optionally, the processor 1110 is also used to determine a unique subscription identifier based on the container identifier, destination port information and data source identifier in the trajectory data acquisition subscription request;

[0279] Optionally, the processor 1110 is also configured to determine, based on the subscription unique identifier, whether there is an existing trajectory collection subscription corresponding to the target container;

[0280] Optionally, the processor 1110 is also configured to create a trajectory acquisition subscription task corresponding to the target container if no existing trajectory acquisition subscription exists, and initialize the trajectory acquisition subscription task to a pending acquisition state.

[0281] Optionally, the processor 1110 is also used to determine the transportation lifecycle stage of the target container based on the transportation trajectory data corresponding to the target container;

[0282] Optionally, the processor 1110 is also configured to determine the collection period corresponding to the trajectory collection subscription task based on the transportation lifecycle stage;

[0283] Optionally, the processor 1110 is also configured to collect trajectory data of the target container according to the collection cycle, and determine the change status of the transportation event corresponding to the target container based on the collected transportation trajectory data.

[0284] Optionally, the processor 1110 is also used to determine whether the target container meets the trajectory acquisition termination condition based on the change status of the transportation event;

[0285] Optionally, the processor 1110 is also configured to set the trajectory acquisition subscription task to an ended state and stop performing subsequent trajectory data acquisition on the target container when any trajectory acquisition termination condition is met.

[0286] The trajectory acquisition termination conditions include:

[0287] Based on transportation trajectory data, it is determined whether the target container has arrived at the port of destination or has been delivered to the port of destination.

[0288] Based on the transportation trajectory data, it has been determined that the transportation completion event corresponding to the target container has been generated;

[0289] The tracking time for the target container is determined based on the duration of the trajectory acquisition subscription task, reaching the preset maximum tracking period;

[0290] The target container is determined to be in a state of no valid transportation events based on the duration of no valid transportation trajectory events within the continuous collection period, and the preset termination threshold is reached.

[0291] The memory 1109 can be used to store software programs and various data. The memory 1109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1109 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0292] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described subscription management method embodiments and achieve the same technical effects. To avoid repetition, these will not be described again here. Furthermore, the readable storage medium improves the data storage capacity and data processing speed of the subscription management method in this application.

[0293] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing, but is not limited thereto. A non-exhaustive list of more specific examples of computer-readable storage media includes: portable computer floppy disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable optical disc read-only memory (CD-ROM), digital universal disk (DVD), memory cards, floppy disks, encoding mechanical devices (e.g., punched cards or grooves with raised structures for recording instructions), and any suitable combination of the foregoing. The computer-readable storage medium used herein should not be construed as the transmission of signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media, or electrical signals transmitted through wires.

[0294] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0295] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described subscription management method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here. Furthermore, the chip improves the data processing speed corresponding to the subscription management method in this application.

[0296] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0297] In this invention, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance; the term "multiple" refers to two or more unless otherwise explicitly defined. The terms "install," "connect," "link," and "fix" should be interpreted broadly. For example, "connect" can be a fixed connection, a detachable connection, or an integral connection; "link" can be a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0298] In the description of this invention, it should be understood that the terms "upper," "lower," "left," "right," "front," "rear," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or unit referred to must have a specific orientation or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0299] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to specific features, structures, materials, or characteristics described in connection with an embodiment or example that are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0300] The above are merely preferred embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A subscription management method, characterized by, This is used in a maritime container logistics information system, which collects transportation trajectory data during container transportation from multiple data sources. The subscription management method includes: Obtain a subscription request for trajectory data collection targeting the container; The unique subscription identifier is determined based on the container identifier, destination port information, and data source identifier in the trajectory data acquisition subscription request. Determine whether an existing trajectory collection subscription corresponding to the target container exists based on the subscription unique identifier; If no existing trajectory acquisition subscription exists, a trajectory acquisition subscription task corresponding to the target container is created, and the trajectory acquisition subscription task is initialized to a pending acquisition state. The transportation lifecycle stage of the target container is determined based on the transportation trajectory data corresponding to the target container; The collection period corresponding to the trajectory collection subscription task is determined based on the transportation lifecycle stage; According to the acquisition cycle, trajectory data is collected from the target container, and the transportation event change status corresponding to the target container is determined based on the collected transportation trajectory data. Determine whether the target container meets the trajectory acquisition termination condition based on the change status of the transportation event; When any of the trajectory acquisition termination conditions are met, the trajectory acquisition subscription task is set to the end state, and subsequent trajectory data acquisition of the target container is stopped. The trajectory acquisition termination conditions include: Based on the transportation trajectory data, it is determined that the target container has arrived at the port of destination or has been delivered to the port of destination. Based on the transportation trajectory data, it is determined that a transportation completion event corresponding to the target container has been generated; The tracking time for the target container is determined based on the duration of the trajectory acquisition subscription task, reaching the preset maximum tracking period; The target container is determined to be in a state of no valid transportation events based on the duration of no valid transportation trajectory events within the continuous collection period, and a preset end threshold is reached.

2. The subscription management method of claim 1, wherein, The step of determining whether an existing trajectory collection subscription corresponding to the target container exists based on the subscription unique identifier includes: Obtain the trajectory collection subscription record associated with the unique subscription identifier; Determine whether the target container is in an active tracking period based on the subscription status in the trajectory acquisition subscription record; If the subscription status is terminated, it is determined that there is no active trajectory collection subscription. If the subscription status is pending collection, in the process of collection, or waiting to be collected, it is determined that there is an existing trajectory collection subscription. When an existing trajectory collection subscription exists, the task configuration and collection scheduling parameters of the existing trajectory collection subscription are reused, and this subscription request is identified as a duplicate subscription request.

3. The subscription management method of claim 1, wherein, Determining the transportation lifecycle stage of the target container based on the transportation trajectory data corresponding to the target container includes: Extract the transportation event type, event location, container status, and event time data from the transportation trajectory data; According to the preset maritime transport node mapping rules, the transport event type, event location, and container status are mapped to a unified container transport node type; The unified container transport node type is matched with the preset transport stage sequence constraint to determine the transport life cycle stage of the target container; The transportation lifecycle stages include at least the transportation preparation stage, the maritime transportation stage, the transshipment port operation stage, the destination port operation stage, and the destination port delivery stage.

4. The subscription management method of claim 3, wherein, The step of determining the collection period corresponding to the trajectory collection subscription task based on the transportation lifecycle stage includes: The baseline collection period corresponding to the transportation lifecycle stage is determined by querying the preset stage collection parameter mapping relationship based on the transportation lifecycle stage. The effective tracking period corresponding to the target container is determined by querying the preset time constraints of the transportation stage according to the transportation life cycle stage. The maximum allowed tracking deadline is determined based on the effective tracking period and the start time of the trajectory acquisition subscription task; The acquisition scheduling parameters of the trajectory acquisition subscription task are updated based on the baseline acquisition period, the effective tracking period, and the maximum allowed tracking deadline.

5. The subscription management method of claim 4, wherein, The step of determining that the target container is in a state of no valid transportation events based on the duration of no valid transportation trajectory events acquired within a continuous acquisition period includes: Statistically collect effective transport trajectory events that characterize changes in the physical location or transport status of containers within a continuous data collection period; When no valid transportation trajectory event is acquired in multiple consecutive acquisition cycles, the idling level is determined based on the cumulative duration of the unacquired valid transportation trajectory event. Based on the idling level and the preset segmented backoff rules, the baseline acquisition period is extended to obtain the backoff acquisition period; Update the next collection time of the trajectory collection subscription task according to the retreat collection cycle; The preset segmented backoff rule is configured with different backoff growth coefficients at different stages of the transportation lifecycle.

6. The subscription management method of claim 4, wherein, The step of collecting trajectory data of the target container according to the collection period and determining the change status of the transportation event corresponding to the target container based on the collected transportation trajectory data includes: Obtain the execution results and failure types of this round of trajectory data collection; When the execution result indicates that the acquisition failed, the retry time interval is determined according to the failure type and the number of consecutive failures. The next acquisition time for the trajectory acquisition subscription task will be rearranged according to the retry time interval; When the next acquisition time is later than the maximum allowable tracking deadline, the maximum tracking cycle condition in the trajectory acquisition termination condition is triggered.

7. The subscription management method of claim 1, wherein, The trajectory acquisition subscription task includes a pending acquisition state, an in-process acquisition state, a waiting acquisition state, and a completed state. The subscription management method further includes: When the trajectory acquisition subscription task is in the pending acquisition state, trajectory data acquisition is triggered by a timer, and the task status is switched to the acquisition state. When the current round of trajectory data collection is completed and none of the trajectory collection termination conditions are met, the task status is switched to the waiting collection status according to the next collection time. When any of the trajectory acquisition termination conditions are met, the task status will be switched to the end status. When the trajectory acquisition subscription task is in an ended state, the trajectory acquisition subscription task is removed from the scheduling queue, and the data acquisition resources corresponding to the target container and data source identifier are released. 8.The subscription management method of any one of claims 1 to 7, wherein, The step of collecting trajectory data of the target container according to the collection period and determining the change status of the transportation event corresponding to the target container based on the collected transportation trajectory data includes: Based on a preset set of valid transportation trajectory events, determine the valid transportation trajectory events that characterize the progress of the target container transportation process; When a new valid transportation trajectory event occurs between adjacent collection cycles, the change state of the transportation event is determined as the first change state; When multiple consecutive acquisition cycles only acquire time data updates without acquiring new valid transportation trajectory events, the transportation event change state is determined to be the second change state; The transportation lifecycle stage corresponding to the target container is redefined based on the first change state.

9. A subscription management apparatus characterized by comprising: include: The request acquisition module is used to acquire the trajectory data acquisition subscription request for the target container; The identifier generation module is used to determine a unique subscription identifier based on the container identifier, the destination port information, and the data source identifier in the trajectory data acquisition subscription request. The de-reuse module is used to determine whether there is an existing trajectory collection subscription corresponding to the target container based on the subscription unique identifier; If no existing trajectory acquisition subscription exists, a trajectory acquisition subscription task corresponding to the target container is created, and the trajectory acquisition subscription task is initialized to a pending acquisition state. The stage determination module is used to determine the transportation life cycle stage of the target container based on the transportation trajectory data corresponding to the target container. The period configuration module is used to determine the collection period corresponding to the trajectory collection subscription task based on the transportation life cycle stage; The data acquisition and execution module is used to acquire trajectory data of the target container according to the acquisition cycle, and determine the change status of the transportation event corresponding to the target container based on the acquired transportation trajectory data. The condition determination module is used to determine whether the target container meets the trajectory acquisition termination condition based on the change status of the transportation event; The subscription management module is used to set the trajectory acquisition subscription task to the end state and stop the subsequent trajectory data acquisition of the target container when any of the trajectory acquisition termination conditions are met. The trajectory acquisition termination conditions include: Based on the transportation trajectory data, it is determined that the target container has arrived at the port of destination or has been delivered to the port of destination. Based on the transportation trajectory data, it is determined that a transportation completion event corresponding to the target container has been generated; The tracking time for the target container is determined based on the duration of the trajectory acquisition subscription task, reaching the preset maximum tracking period; The target container is determined to be in a state of no valid transportation events based on the duration of no valid transportation trajectory events within the continuous collection period, and a preset end threshold is reached.

10. An electronic device, comprising: It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the subscription management method as described in any one of claims 1 to 8.