Agricultural product collection, collection and distribution data synchronization method and system thereof
Patent Information
- Application Number
- CN202611093992.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-13
AI Technical Summary
现有技术通常仅关注数据是否上传成功或字段是否完整,缺少对离线事件是否会改变既有订单承接关系、分拨占用关系和交付时限控制结果的判断,也缺少对异常离线事件进行分层隔离、复核和放行限制的处理机制,导致数据同步准确性和配送放行安全性不足;为此,我们提出一种农产品集采集配数据同步方法及其系统
[0030](1)本发明通过在收货点形成农产品离线事件链,并在恢复通信后结合订单锁定状态、分拨占用状态和交付时限判断离线事件链是否包含承接影响事件,使离线数据同步不再仅按照上传时间或事件发生时间直接写入集配主数据,而是先判断其是否会改变已锁定订单、已占用分拨资源或交付时限控制结果。由此,能够避免离线事件恢复上传后直接覆盖集配中心既有承接结果,降低批次来源错误替换、周转筐载体码错配以及配送放行状态被误改的风险。
Smart Images

Figure CN122903499A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for synchronizing agricultural product collection and distribution data. Background Technology
[0002] The centralized collection and distribution of agricultural products typically involves multiple stages, including receiving points, distribution centers, sorting warehouses, delivery vehicles, and end-users. In actual operations, receiving points need to perform operations such as receiving confirmation, weighing, rapid inspection, pre-cooling, crating, changing crates, and handover of agricultural products, and synchronize relevant data to the distribution center so that the distribution center can manage order locking, allocation, and delivery release.
[0003] Current methods for synchronizing agricultural product collection and distribution data often involve batch uploading after network recovery, writing data chronologically, or overwriting previous data with later uploads. While these methods can re-upload offline data, in cases of communication anomalies or instability at the receiving point, the agricultural product event chain formed during the offline period may lag behind the order locking, distribution occupancy, or delivery time limit control status at the distribution center. If offline events are directly written into the distribution master data after communication is restored, it can easily lead to problems such as duplicate use of carrier codes for the same week, incorrect replacement of agricultural product batch origins, discrepancies between weighing results and distribution quantities, and mismatches between rapid testing or pre-cooling status and delivery release status.
[0004] Especially in the scenario of centralized collection and distribution of agricultural products, the carrier code of the turnover crate usually runs through the entire process of receiving, sorting, distribution, and delivery. Once the offline event chain cannot be correctly connected with the current status of the collection and distribution center, it may affect the batch source of locked orders, the carrier ownership of occupied distribution resources, and whether the corresponding agricultural product batches can be delivered on time. Existing technologies usually only focus on whether the data is uploaded successfully or whether the fields are complete, lacking judgment on whether offline events will change the existing order acceptance relationship, distribution occupation relationship, and delivery time limit control results. They also lack the processing mechanism for hierarchical isolation, verification, and release restrictions for abnormal offline events, resulting in insufficient data synchronization accuracy and delivery release security. To address this, we propose a data synchronization method and system for centralized collection and distribution of agricultural products. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for synchronizing agricultural product collection and distribution data, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for synchronizing agricultural product collection and distribution data, comprising:
[0007] A chain of offline events for agricultural products is formed at the collection point;
[0008] After communication is restored, obtain the order lock status, distribution occupancy status and delivery time limit corresponding to the turnover basket carrier code in the distribution center;
[0009] Based on the event type, event order, and event location in the offline event chain, determine whether the offline event chain contains any events that could alter locked orders, occupied distribution resources, or delivery time limit control results.
[0010] When the offline event chain does not contain any events that have a successor effect, it is considered as a candidate event that can be merged.
[0011] When the offline event chain contains events that affect the order, according to the offline event chain and the order lock status, distribution occupation status and delivery time limit, conflict-layered synchronization processing is performed on the data under the same weekly transfer carrier code, and the offline events are divided into mergeable events, isolated events and review events.
[0012] Only mergeable events are written to the distribution master data, isolated events and verification events are written to the exception synchronization queue, and the corresponding agricultural product batches are restricted from entering the distribution release process before the exception synchronization queue is processed.
[0013] Preferably, the process of forming an offline event chain for agricultural products at the receiving point includes: using the turnover crate carrier code as the chain key, connecting at least two types of events—receiving confirmation, weighing, rapid inspection, pre-cooling, crate changing, crate loading, and handover—in the order of their local occurrence; generating a closed record at the end of the offline event chain when the batch of agricultural products leaves the receiving point, completes crate loading and handover, or reaches a preset offline storage time; after communication is restored, first determining whether the closed record can be connected with the latest status of the turnover crate carrier code in the distribution center, and not directly synchronizing events within the chain if they cannot be connected.
[0014] Preferably, determining whether the offline event chain includes a continuation impact event includes: determining the business node interval based on the order locking time, distribution resource occupation time, and delivery time limit adjustment time in the distribution center; comparing the end event, basket replacement event, weight change event, and quality status change event in the offline event chain with the business node interval respectively; if the offline event occurs before the business node interval and does not change the agricultural product batch, turnover basket carrier code, deliverable quantity, or quality release status, it is determined to be a non-continuation impact event; if the offline event falls into or is later than the business node interval and changes the batch source, carrier ownership, or delivery control result, it is determined to be a continuation impact event.
[0015] Preferably, before determining the impact of an event, a sequential integrity check is performed: when there is a crate exchange event, crate loading event, or handover event in the offline event chain, but its preceding receiving confirmation event, weighing event, or quick inspection event is missing, the operation terminal number, weighing equipment number, and event location of the adjacent event are extracted; if the adjacent events can indicate that the missing event is within the continuous operation range of the same receiving point, the corresponding offline event is listed as a verification event; if the missing event makes the operation sequence between receiving, weighing, quick inspection, crate loading, and handover impossible, the corresponding offline event is listed as an isolation event.
[0016] Preferably, when performing conflict-layered synchronous processing on events affecting acceptance, a rollback feasibility assessment is first performed: based on the order lock status, it is determined whether the corresponding order can change the batch source; based on the distribution occupancy status, it is determined whether the storage location, sorting grid, or delivery vehicle loading position can be released; based on the delivery time limit, it is determined whether the re-distribution is still within the adjustable period; when the order, distribution resources, and delivery time limit can all be rolled back or re-accepted, the event affecting acceptance is listed as a review event; when any one of them cannot be rolled back or re-accepted, the event affecting acceptance is listed as an isolation event, and the original acceptance results of the distribution center are not overwritten.
[0017] Preferably, when the same turnover basket carrier code corresponds to multiple offline event chains, a carrier occupancy closure judgment is performed: query the previous handover completion record, empty basket recycling record, and rebinding record of the turnover basket carrier code; if the start event of the next offline event chain is later than the empty basket recycling record or the rebinding record, then the previous offline event chain is closed before processing the next offline event chain; if the start event of the next offline event chain is earlier than the empty basket recycling record or the rebinding record, or if there is an overlap in occupancy time with the previous offline event chain, then the next offline event chain is listed as an isolated event.
[0018] Preferably, for offline events involving changes in weighing results, a weight acceptance path is formed in the order of offline weighing, reweighing at the distribution center, deduction at the sorting center, and delivery acceptance. If the weight difference can be explained by pre-cooling water loss, sorting loss, or packaging replacement records, and does not change the delivery quantity of locked orders, it is classified as a mergeable event. If the weight difference leads to insufficient order quantity, inconsistent sorting quantity, or delivery acceptance quantity, it is classified as a verification event. If the weight difference is accompanied by repeated use of turnover crate carrier codes or changes in batch source, it is classified as an isolated event.
[0019] Preferably, for offline events involving changes in rapid inspection, pre-cooling, or delivery time, a quality time limit judgment is performed: if the changes in rapid inspection results, pre-cooling completion status, or handover time do not affect the quality release requirements and delivery time limits of locked orders, they are classified as mergeable events; if they affect the quality release requirements but can be reviewed before delivery release, they are classified as review events; if the delivery time limit has been exceeded, or if the loaded delivery batch does not meet the quality release requirements, they are classified as isolated events.
[0020] Preferably, for isolated events and verification events written to the abnormal synchronization queue, a release freeze flag is first set for the corresponding agricultural product batch; if the verification event is confirmed to be acceptable after carrier code rescanning, reweighing, quick inspection document verification, or delivery status verification, the release freeze flag is lifted and the event is converted into a mergeable event; if the isolated event cannot be eliminated by the verification result, the abnormal state is maintained and a batch replacement, order gap, or distribution occupation correction prompt is generated; when mergeable events are written to the distribution master data, an idempotent verification flag is generated based on the turnover basket carrier code, agricultural product batch, event type, and event occurrence order.
[0021] A data synchronization system for agricultural product collection and distribution, used to execute any of the methods for synchronizing agricultural product collection and distribution data, includes: a receiving point terminal, a central status acquisition module, an impact judgment module, a conflict hierarchical synchronization module, an abnormal synchronization queue module, a review processing module, and a delivery release control module.
[0022] The receiving point terminal is used to form an offline event chain for agricultural products when communication is abnormal or unstable, and to generate a closed record when the batch of agricultural products leaves the receiving point, completes the crating and handover, or reaches the preset offline storage time.
[0023] The central status acquisition module is used to acquire the order lock status, distribution occupancy status and delivery time limit corresponding to the turnover basket carrier code;
[0024] The impact assessment module is used to determine whether there are impact events based on the offline event chain and business node intervals.
[0025] The conflict-layered synchronization module is used to perform sequential integrity judgment, rollback feasibility judgment, carrier occupancy closure judgment, weight transfer path judgment, and quality time limit judgment, and divides offline events into mergeable events, isolated events, and verification events.
[0026] The abnormal synchronization queue module is used to store isolation events and review events, and to set release freeze flags for the corresponding agricultural product batches;
[0027] The verification processing module is used to verify the carrier code, weighing, quick inspection document or delivery status of the verification event.
[0028] The delivery release control module is used to restrict the corresponding agricultural product batch from entering the delivery release process before the abnormal synchronization queue is processed.
[0029] The technical effects and advantages of this invention are as follows:
[0030] (1) This invention forms an offline event chain for agricultural products at the receiving point, and after communication is restored, it determines whether the offline event chain contains events affecting acceptance by combining the order lock status, distribution occupation status, and delivery time limit. This ensures that offline data synchronization is no longer directly written to the distribution master data based solely on the upload time or event occurrence time, but rather by first determining whether it will change the locked orders, occupied distribution resources, or delivery time limit control results. As a result, it avoids directly overwriting the existing acceptance results of the distribution center after the offline event is restored and uploaded, reducing the risk of incorrect batch source replacement, mismatched turnover crate carrier codes, and erroneous changes to the delivery release status.
[0031] (2) By setting up closed records, business node intervals, sequential integrity judgment, rollback feasibility judgment and carrier occupation closure judgment, this invention can identify whether the offline event chain is connected with the latest status of the distribution center before the offline event enters the synchronization process, and further judge abnormal situations such as missing preceding events, duplicate occupation of carrier codes and non-rollback acceptance results. Compared with the traditional synchronization method of verifying field integrity, this invention can judge whether the data is real and acceptable based on the operation relationship between receiving, weighing, quick inspection, packing, handover and distribution occupation, thereby improving the accuracy of abnormal offline data identification.
[0032] (3) This invention performs weight transfer path judgment on weight change events, performs quality time limit judgment on rapid inspection, pre-cooling or delivery time change events, and writes isolation events and review events into the abnormal synchronization queue. Before the abnormal synchronization queue is processed, a release freeze mark is set on the corresponding agricultural product batch. This can prevent batches with weighing differences, quality release risks or delivery time limit risks from continuing to participate in new order allocation and delivery release. At the same time, by converting the review into mergeable events and generating idempotent verification marks, it can avoid repeated uploads that lead to repeated changes in master data, and improve the traceability consistency and delivery release security after data synchronization. Attached Figure Description
[0033] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention, but do not constitute a limitation thereof. In the drawings:
[0034] Figure 1 This is a flowchart for determining the impact of events in this invention;
[0035] Figure 2 This is a flowchart of the offline chain integrity and carrier closure judgment process of the present invention;
[0036] Figure 3 This is a flowchart of the abnormal queue freezing and review release process of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] This invention provides, for example Figures 1-3 The method for synchronizing agricultural product collection and distribution data, as shown, includes:
[0039] A chain of offline events for agricultural products is formed at the collection point;
[0040] After communication is restored, obtain the order lock status, distribution occupancy status and delivery time limit corresponding to the turnover basket carrier code in the distribution center;
[0041] Based on the event type, event order, and event location in the offline event chain, determine whether the offline event chain contains any events that could alter locked orders, occupied distribution resources, or delivery time limit control results.
[0042] When an offline event chain does not contain any events that will have an impact, it is considered a candidate event to be merged.
[0043] When the offline event chain contains events that affect the order, the data under the same weekly transfer carrier code is processed for conflict-based hierarchical synchronization based on the offline event chain and the order lock status, distribution occupation status and delivery time limit. The offline events are divided into mergeable events, isolated events and review events.
[0044] Only mergeable events are written to the distribution master data, isolated events and verification events are written to the exception synchronization queue, and the corresponding agricultural product batches are restricted from entering the distribution release process before the exception synchronization queue is processed.
[0045] In practice, during periods of communication anomalies or instability at the receiving point, the system uses the carrier code of the turnover crate as the associated object to form an offline event chain for events such as receiving, weighing, rapid inspection, pre-cooling, crating, and handover of agricultural products in the order of occurrence. After communication is restored, the system does not directly write the offline events into the distribution master data. Instead, it first obtains the order lock status, distribution occupation status, and delivery time limit corresponding to the carrier code of the turnover crate from the distribution center. Then, it combines the event type, event sequence, and event location of the offline events to determine whether the offline event chain will affect the order acceptance, distribution occupation, or delivery control results that have already been formed.
[0046] If the offline event chain is only used to supplement existing business records and does not change locked orders, occupied distribution resources, or delivery time limit control results, it is treated as a candidate event to be merged and written into the distribution master data after the synchronization conditions are met. If the offline event chain may change the batch source, turnover basket ownership, distribution occupation, or delivery time limit control results, conflict hierarchical synchronization processing is performed, dividing the offline events into mergeable events, isolated events, and verification events. This avoids the offline data being directly overwritten by the existing data in the distribution center after being restored and uploaded, reduces the risk of duplicate occupation of turnover baskets, batch mismatch, and erroneous release of abnormal batches, and improves the reliability of data synchronization in the distribution center and the accuracy of delivery release control.
[0047] The offline event chain for agricultural products is formed at the receiving point, including: using the turnover crate carrier code as the chain key, at least two types of events in the order of local occurrence, such as receiving confirmation, weighing, rapid inspection, pre-cooling, crate changing, crate loading, and handover, are linked together; when the batch of agricultural products leaves the receiving point, completes crate loading and handover, or reaches the preset offline storage time, a closed record is generated at the end of the offline event chain; after communication is restored, it is first determined whether the closed record can be connected with the latest status of the turnover crate carrier code in the distribution center, and if they cannot be connected, the events in the chain are not directly synchronized.
[0048] In practice, the receiving point uses the carrier code of the turnover basket as the primary key of the offline event chain, so that the same turnover basket can form a continuous data association in the stages of receiving confirmation, weighing, quick inspection, pre-cooling, basket replacement, basket loading and handover. When the receiving point is in a state of communication abnormality or communication instability, each event is connected in sequence according to the local occurrence order, and includes at least two types of business events, so as to avoid a single isolated event being mistaken for complete batch data.
[0049] When a batch of agricultural products leaves the receiving point, completes the crate handover, or reaches the preset offline storage time, a closed record is generated at the end of the offline event chain to indicate the end status of the offline event chain at the receiving point. After communication is restored, the system first checks the connection between the closed record and the latest status of the turnover crate carrier code in the distribution center. If the connection cannot be made, the events in the chain will not be directly synchronized. This avoids writing incomplete, duplicated, or disconnected offline event chains directly into the distribution master data, improving the integrity and synchronization security of offline supplementary data.
[0050] The determination of whether an offline event chain includes a continuation impact event includes: determining the business node interval based on the order locking time, distribution resource occupation time, and delivery time adjustment time in the distribution center; comparing the end event, crate replacement event, weight change event, and quality status change event in the offline event chain with the business node interval; if the offline event occurs before the business node interval and does not change the agricultural product batch, turnover crate carrier code, deliverable quantity, or quality release status, it is determined to be a non-continuation impact event; if the offline event falls within or after the business node interval and changes the batch source, carrier ownership, or delivery control result, it is determined to be a continuation impact event.
[0051] In practice, the distribution center determines the business node range in which the corresponding turnover crate carrier code has formed a business acceptance relationship at the center end based on the order lock time, the distribution resource occupation time, and the delivery time limit adjustment time. After communication is restored, the system compares the end event, crate replacement event, weight change event, and quality status change event in the offline event chain with the business node range to determine whether the offline event will affect the order, distribution, and delivery control results already determined at the center end.
[0052] If an offline event occurs before the business node interval and is only used to supplement data that has occurred but not been uploaded at the receiving point, without changing the batch of agricultural products, the carrier code of the turnover basket, the deliverable quantity, or the quality release status, it is determined to be a non-influencing event. If an offline event falls within or after the business node interval and causes changes in the batch source, the ownership of the turnover basket carrier, or the delivery control result, it is determined to be an influencing event. In this way, it is possible to avoid the delayed offline event directly impacting the order lock and distribution occupation relationship already formed in the distribution center, and improve the conflict identification capability when offline data is restored and synchronized.
[0053] Before determining the impact of an event, a sequential integrity check is performed: if a crate exchange event, crate loading event, or handover event exists in the offline event chain, but its preceding receiving confirmation event, weighing event, or quick inspection event is missing, the operation terminal number, weighing equipment number, and event location of the adjacent event are extracted; if the adjacent events can indicate that the missing event is within the continuous operation range of the same receiving point, the corresponding offline event is listed as a verification event; if the missing event makes the operation sequence between receiving, weighing, quick inspection, crate loading, and handover invalid, the corresponding offline event is listed as an isolation event.
[0054] In practical implementation, before determining whether an offline event belongs to the event of receiving influence, the system first performs a sequential integrity check on the offline event chain. For an offline event chain that has a basket changing event, a basket loading event, or a handover event, if its preceding receiving confirmation event, weighing event, or quick inspection event is missing, the system further extracts the operation terminal number, weighing equipment number, and event location from the adjacent events to determine whether the missing event may be located in the continuous operation range of the same receiving point.
[0055] If the operating terminal, weighing equipment, or location of an adjacent event can be matched, it indicates that the missing event may have failed to enter the chain due to communication abnormalities, terminal caching, or upload delays. In this case, the offline event is not directly rejected, but is listed as a review event and awaits subsequent verification. If the missing event causes a reasonable work sequence to be lost between receiving, weighing, quick inspection, crating, and handover, the corresponding offline event is listed as an isolation event. This can avoid the accidental deletion of valid data due to the absence of individual preceding events, and at the same time prevent data with obviously abnormal work sequences from entering the distribution master data.
[0056] When handling conflict-layered synchronous processing for events affecting acceptance, a rollback feasibility assessment is first performed: the order's locked status is used to determine whether the corresponding order can have its batch source changed; the distribution occupancy status is used to determine whether the storage location, sorting grid, or delivery vehicle loading position can be released; and the delivery time limit is used to determine whether re-distribution is still within an adjustable period. When the order, distribution resources, and delivery time limit can all be rolled back or re-accepted, the event affecting acceptance is listed as a review event. When any one of these cannot be rolled back or re-accepted, the event affecting acceptance is listed as an isolation event, and the original acceptance results of the distribution center are not overwritten.
[0057] In practice, when an offline event is determined to be an event that will have a continuation of the impact, the system does not immediately write it into the distribution master data. Instead, it first performs a rollback feasibility assessment. Specifically, the system determines whether the corresponding order still allows for changing the source of the agricultural product batch based on the order lock status; it determines whether the occupied storage locations, sorting slots, or delivery vehicle loading positions can be released based on the distribution occupancy status; and it determines whether re-distribution, reloading, or re-handover is still within the adjustable time period based on the delivery deadline.
[0058] When orders, distribution resources, and delivery deadlines can all be rolled back or re-accepted, it indicates that although the event affecting the acceptance of orders may change existing business outcomes, there is still room for correction of data and business flow through review. Therefore, it is classified as a review event. If any of the orders, distribution resources, or delivery deadlines cannot be rolled back or re-accepted, the event affecting the acceptance of orders is classified as an isolation event, ensuring that the original acceptance results of the distribution center are not overwritten by offline events. This avoids delayed offline data from disrupting established order delivery relationships, while retaining the review entry point for correctable events, improving the security and flexibility of synchronous processing.
[0059] When multiple offline event chains correspond to the same turnover basket carrier code, a carrier occupancy closure judgment is performed: query the previous handover completion record, empty basket recycling record, and rebinding record of the turnover basket carrier code; if the start event of the next offline event chain is later than the empty basket recycling record or the rebinding record, then the previous offline event chain is closed before processing the next offline event chain; if the start event of the next offline event chain is earlier than the empty basket recycling record or the rebinding record, or if there is an overlap in occupancy time with the previous offline event chain, then the next offline event chain is listed as an isolated event.
[0060] In practice, if multiple offline event chains are found to correspond to the same turnover basket carrier code after communication is restored, the system will not merge them directly according to the order of upload. Instead, it will query the previous handover completion record, empty basket recycling record and rebinding record of the turnover basket carrier code in the distribution center to determine whether the turnover basket has completed the occupancy closure in the previous batch of business and whether it has the conditions to enter the next batch of business.
[0061] If the starting event of the next offline event chain is later than the empty crate recycling record or the rebinding record, it means that the crate has been released from the previous batch of business and has re-entered a new receiving or crating process. In this case, the previous offline event chain is closed and the next offline event chain is processed. If the starting event of the next offline event chain is earlier than the empty crate recycling record or the rebinding record, or if it overlaps with the previous offline event chain in terms of occupation time, it means that the same crate may be occupied by two batches at the same time. The system will list the next offline event chain as an isolated event, thereby avoiding the crate carrier code from repeatedly accepting different agricultural product batches and reducing the risk of batch mismatch, duplicate inventory calculation and delivery traceability errors.
[0062] For offline events involving changes in weighing results, a weight acceptance path is formed in the order of offline weighing, reweighing at the distribution center, deduction at the sorting center, and delivery acceptance. If the weight difference can be explained by pre-cooling water loss, sorting loss, or packaging replacement records, and does not change the delivery quantity of locked orders, it is classified as a mergeable event. If the weight difference leads to insufficient order quantity, inconsistent sorting quantity, or delivery acceptance quantity, it is classified as a verification event. If the weight difference is accompanied by duplicate use of turnover crate carrier codes or changes in batch source, it is classified as an isolated event.
[0063] In practical implementation, for events involving changes in weighing results in the offline event chain, the system forms a weight acceptance path according to the business sequence of offline weighing, reweighing at the distribution center, deduction at the distribution center, and delivery acceptance, in order to determine whether the weight change can be reasonably accepted in subsequent stages. If there is a difference between the offline weighing and the subsequent weighing or deduction results, the system further checks the pre-cooling water loss records, sorting loss records, or packaging replacement records to determine whether the weight difference is a reasonable change in the agricultural product circulation process.
[0064] When the weight difference can be explained by the above records and does not change the delivery quantity of locked orders, the corresponding offline event will be treated as a mergeable event; when the weight difference leads to insufficient order quantity, inconsistent distribution quantity, or delivery and acceptance quantity, it will be listed as a review event; if the weight difference is accompanied by duplicate use of turnover crate carrier codes or changes in batch source, it will be listed as an isolated event. This can avoid misjudging valid data based solely on the difference in weighing values, and prevent abnormal weight changes from affecting order fulfillment, inventory deduction, and delivery and acceptance accuracy.
[0065] For offline events involving changes in rapid testing, pre-cooling, or delivery time, a quality time limit judgment is performed: if changes in rapid testing results, pre-cooling completion status, or handover time do not affect the quality release requirements and delivery time limits of locked orders, they are classified as mergeable events; if they affect quality release requirements but can be reviewed before delivery release, they are classified as review events; if the delivery time limit has been exceeded, or if the loaded delivery batch does not meet the quality release requirements, they are classified as isolated events.
[0066] In practice, for events in the offline event chain involving changes in rapid test results, pre-cooling completion status, or handover time, the system performs quality time limit judgment. The system compares the changed rapid test results with the quality release requirements corresponding to the locked order, and compares the pre-cooling completion status and handover time with the delivery time limit of the order to determine whether the offline event will affect the agricultural product batch from continuing to enter the delivery release process.
[0067] If changes in rapid test results, pre-cooling completion status, or handover time are only used to supplement records and do not affect the quality release requirements and delivery deadlines of locked orders, they are classified as mergeable events. If the change affects the quality release requirements but can still be handled before delivery release by re-verifying rapid test documents, reviewing pre-cooling records, or confirming the handover status, it is classified as a review event. If the change has resulted in exceeding the delivery deadline or causing the loaded delivery batch to no longer meet the quality release requirements, it is classified as an isolation event. This can prevent batches with abnormal quality or time limits from being released, improving the safety of agricultural product delivery and the reliability of contract fulfillment.
[0068] Specifically, for isolated events and verification events written to the abnormal synchronization queue, a release freeze flag is first set for the corresponding agricultural product batch; if the verification event is confirmed to be acceptable after carrier code rescanning, reweighing, quick inspection document verification, or delivery status verification, the release freeze flag is lifted and the event is converted into a mergeable event; if the isolated event cannot be eliminated by the verification result, the abnormal state is maintained and a batch replacement, order gap, or distribution occupation correction prompt is generated; when mergeable events are written to the distribution master data, an idempotent verification flag is generated based on the turnover basket carrier code, agricultural product batch, event type, and event occurrence order.
[0069] In practice, after writing isolated events and review events into the abnormal synchronization queue, the system first sets a release freeze flag for the corresponding agricultural product batch, so that the batch will not participate in new order allocation, distribution adjustment and delivery release. For review events, the system confirms whether they can still be accepted with existing business results through carrier code rescanning, reweighing, quick inspection document verification or delivery status verification. If it is confirmed that they can be accepted, the release freeze flag is lifted and the event is converted into a mergeable event. For isolated events, if the risk of duplicate use of turnover baskets, abnormal batch source, quantity gap or quality time limit cannot be eliminated after review, the abnormal status is maintained and a batch replacement, order gap or distribution occupation correction prompt is generated.
[0070] When mergeable events are written into the centralized distribution master data, the system generates an idempotent verification identifier based on the turnover basket carrier code, agricultural product batch, event type, and event occurrence order. This identifier is used to identify the same offline event that is uploaded repeatedly. This prevents abnormal batches from being mistakenly released before the problem is resolved, and avoids repeated uploads of offline events that cause repeated changes to the master data, thereby improving the security and data consistency of the centralized collection and distribution synchronization process.
[0071] A data synchronization system for agricultural product collection and distribution, used to execute any one of the methods for agricultural product collection and distribution data synchronization, includes: a receiving point terminal, a central status acquisition module, an impact judgment module, a conflict hierarchical synchronization module, an abnormal synchronization queue module, a review processing module, and a delivery release control module;
[0072] The receiving point terminal is used to form an offline event chain for agricultural products when communication is abnormal or unstable, and to generate a closed record when the batch of agricultural products leaves the receiving point, completes the crating and handover, or reaches the preset offline storage time.
[0073] The central status acquisition module is used to acquire the order lock status, distribution occupancy status, and delivery time limit corresponding to the turnover basket carrier code;
[0074] The impact assessment module is used to determine whether there are any impact events based on the offline event chain and business node intervals.
[0075] The conflict-layered synchronization module is used to perform sequential integrity judgment, rollback feasibility judgment, carrier occupancy closure judgment, weight transfer path judgment, and quality time limit judgment, and divides offline events into mergeable events, isolated events, and verification events.
[0076] The exception synchronization queue module is used to store isolation events and review events, and to set release freeze flags for the corresponding agricultural product batches;
[0077] The verification processing module is used to verify the carrier code, weighing, quick inspection documents, or delivery status of verification events;
[0078] The delivery release control module is used to restrict the corresponding agricultural product batches from entering the delivery release process before the abnormal synchronization queue is processed.
[0079] In practical implementation, the agricultural product collection and distribution data synchronization system can be deployed between the receiving point terminal and the distribution center server. When the receiving point terminal experiences communication abnormalities or instability, it first forms an offline event chain for agricultural products locally. When the batch of agricultural products leaves the receiving point, completes the crate handover, or reaches the preset offline storage time, it generates a closed record. After communication is restored, the central status acquisition module obtains the order lock status, distribution occupation status, and delivery time limit corresponding to the turnover crate carrier code. The impact judgment module determines whether there are impact events in the offline event chain based on this.
[0080] For offline events that have a continuation effect, the conflict-layered synchronization module further performs sequential integrity judgment, rollback feasibility judgment, carrier occupancy closure judgment, weight continuation path judgment, and quality time limit judgment, and divides offline events into mergeable events, isolated events, and verification events. The abnormal synchronization queue module temporarily stores isolated events and verification events and sets a release freeze flag for the corresponding agricultural product batches. After the verification processing module completes the verification of carrier code, weighing, quick inspection documents, or delivery status, it converts the continuation event into a mergeable event. The delivery release control module restricts the corresponding batch from entering the delivery release process before the abnormality is eliminated. This enables layered synchronization and release control after offline data recovery, avoiding abnormal data from directly affecting the distribution master data.
[0081] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for synchronizing agricultural product collection and distribution data, characterized in that, include: A chain of offline events for agricultural products is formed at the collection point; After communication is restored, obtain the order lock status, distribution occupancy status and delivery time limit corresponding to the turnover basket carrier code in the distribution center; Based on the event type, event order, and event location in the offline event chain, determine whether the offline event chain contains any events that could alter locked orders, occupied distribution resources, or delivery time limit control results. When the offline event chain does not contain any events that have a successor effect, it is considered as a candidate event that can be merged. When the offline event chain contains events that affect the order, according to the offline event chain and the order lock status, distribution occupation status and delivery time limit, conflict-layered synchronization processing is performed on the data under the same weekly transfer carrier code, and the offline events are divided into mergeable events, isolated events and review events. Only mergeable events are written to the distribution master data, isolated events and verification events are written to the exception synchronization queue, and the corresponding agricultural product batches are restricted from entering the distribution release process before the exception synchronization queue is processed.
2. The method for synchronizing agricultural product collection and distribution data according to claim 1, characterized in that, The process of forming an offline event chain for agricultural products at the receiving point includes: using the turnover crate carrier code as the chain key, connecting at least two types of events from receiving confirmation, weighing, rapid inspection, pre-cooling, crate replacement, crate loading, and handover in the order of their local occurrence; when the batch of agricultural products leaves the receiving point, completes crate loading and handover, or reaches the preset offline storage time, a closed record is generated at the end of the offline event chain; after communication is restored, it is first determined whether the closed record can be connected with the latest status of the turnover crate carrier code in the distribution center, and if they cannot be connected, the events within the chain are not directly synchronized.
3. The method for synchronizing agricultural product collection and distribution data according to claim 2, characterized in that, Determining whether the offline event chain includes a continuation impact event includes: determining the business node interval based on the order locking time, distribution resource occupation time, and delivery time limit adjustment time in the distribution center; comparing the end event, crate replacement event, weight change event, and quality status change event in the offline event chain with the business node interval respectively; if the offline event occurs before the business node interval and does not change the agricultural product batch, turnover crate carrier code, deliverable quantity, or quality release status, it is determined to be a non-continuation impact event; if the offline event falls within or after the business node interval and changes the batch source, carrier ownership, or delivery control result, it is determined to be a continuation impact event.
4. The method for synchronizing agricultural product collection and distribution data according to claim 3, characterized in that, Before determining the impact of an event, a sequential integrity check is performed: if there is a basket changing event, basket loading event, or handover event in the offline event chain, but its preceding receiving confirmation event, weighing event, or quick inspection event is missing, the operation terminal number, weighing equipment number, and event location of the adjacent event are extracted; if the adjacent events can indicate that the missing event is within the continuous operation range of the same receiving point, the corresponding offline event is listed as a review event; If a missing event prevents the sequence of operations—receiving, weighing, quick inspection, crating, and handover—from being completed, the corresponding offline event will be classified as an isolated event.
5. The method for synchronizing agricultural product collection and distribution data according to claim 4, characterized in that, When performing conflict-based synchronous processing on events affecting acceptance, a rollback feasibility assessment is first conducted: based on the order lock status, it is determined whether the corresponding order can change the batch source; based on the distribution occupancy status, it is determined whether the storage location, sorting grid, or delivery vehicle loading position can be released; based on the delivery time limit, it is determined whether the re-distribution is still within the adjustable period. When the order, distribution resources, and delivery time limit can all be rolled back or re-accepted, the event affecting acceptance is listed as a review event; when any one of them cannot be rolled back or re-accepted, the event affecting acceptance is listed as an isolation event, and the original acceptance results of the distribution center are not overwritten.
6. The method for synchronizing agricultural product collection and distribution data according to claim 5, characterized in that, When the same turnover basket carrier code corresponds to multiple offline event chains, perform a carrier occupancy closure judgment: query the previous handover completion record, empty basket recycling record, and rebinding record of the turnover basket carrier code; if the start event of the next offline event chain is later than the empty basket recycling record or the rebinding record, then close the previous offline event chain and process the next offline event chain; if the start event of the next offline event chain is earlier than the empty basket recycling record or the rebinding record, or if there is an overlap in occupancy time with the previous offline event chain, then the next offline event chain is listed as an isolated event.
7. The method for synchronizing agricultural product collection and distribution data according to claim 6, characterized in that, For offline events involving changes in weighing results, a weight acceptance path is formed in the order of offline weighing, reweighing at the distribution center, deduction at the sorting center, and delivery acceptance. If the weight difference can be explained by pre-cooling water loss, sorting loss, or packaging replacement records, and does not change the delivery quantity of the locked order, it is listed as a mergeable event. If the weight difference results in insufficient order quantity, inconsistent distribution quantity, or delivery and acceptance quantity, it is classified as a review event; if the weight difference is accompanied by duplicate use of turnover basket carrier codes or changes in batch source, it is classified as an isolation event.
8. The method for synchronizing agricultural product collection and distribution data according to claim 7, characterized in that, For offline events involving changes in rapid inspection, pre-cooling, or delivery time, a quality time limit judgment is performed: if changes in rapid inspection results, pre-cooling completion status, or handover time do not affect the quality release requirements and delivery time limits of locked orders, they are classified as mergeable events; if they affect quality release requirements but can be reviewed before delivery release, they are classified as review events. If the delivery deadline has been exceeded, or if the loaded and delivered batches do not meet the quality release requirements, it is classified as an isolated event.
9. The method for synchronizing agricultural product collection and distribution data according to claim 8, characterized in that, For isolated events and verification events written to the abnormal synchronization queue, a release freeze flag is first set for the corresponding agricultural product batch; if the verification event is confirmed to be acceptable after carrier code rescanning, reweighing, quick inspection document verification, or delivery status verification, the release freeze flag is lifted and the event is converted into a mergeable event; if the isolated event cannot be eliminated by the verification result, the abnormal state is maintained and a batch replacement, order gap, or distribution occupation correction prompt is generated; when mergeable events are written to the distribution master data, an idempotent verification flag is generated based on the turnover basket carrier code, agricultural product batch, event type, and event occurrence order.
10. A data synchronization system for agricultural product collection and distribution, characterized in that, The method for synchronizing agricultural product collection and distribution data according to any one of claims 1 to 9 includes: a receiving point terminal, a central status acquisition module, an impact judgment module, a conflict hierarchical synchronization module, an abnormal synchronization queue module, a review processing module, and a delivery release control module. The receiving point terminal is used to form an offline event chain for agricultural products when communication is abnormal or unstable, and to generate a closed record when the batch of agricultural products leaves the receiving point, completes the crating and handover, or reaches the preset offline storage time. The central status acquisition module is used to acquire the order lock status, distribution occupancy status and delivery time limit corresponding to the turnover basket carrier code; The impact assessment module is used to determine whether there are impact events based on the offline event chain and business node intervals. The conflict-layered synchronization module is used to perform sequential integrity judgment, rollback feasibility judgment, carrier occupancy closure judgment, weight transfer path judgment and quality time limit judgment, and divides offline events into mergeable events, isolated events and verification events. The abnormal synchronization queue module is used to store isolation events and review events, and to set release freeze flags for the corresponding agricultural product batches; The verification processing module is used to verify the carrier code, weighing, quick inspection document or delivery status of the verification event. The delivery release control module is used to restrict the corresponding agricultural product batch from entering the delivery release process before the abnormal synchronization queue is processed.