A fruit sorting method and system based on pallet identification tracking
By using global combined search and multi-dimensional time window determination based on pallet identity tracking, the problems of low efficiency and poor reliability in fruit sorting are solved, and accurate perception of pallet position and state compensation are achieved, thereby improving the overall performance of the sorting system.
Patent Information
- Application Number
- CN202611301713.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies lack global combination optimization and physical status closed-loop verification mechanisms in fruit sorting, resulting in low sorting efficiency and poor operational reliability. In particular, when faced with complex working conditions such as production line shutdown, mechanical delays, or communication abnormalities, problems such as missed pushes, duplicate pushes, or batch data confusion are prone to occur.
By using a pallet identity tracking method, a global combination search is performed to generate a candidate combination set. Multidimensional combination constraints, allocation group identifiers, and multidimensional time windows are used to determine the actual push-in status of the pallet and compensate for abnormal interruptions, ensuring the consistency between the software record and the physical location.
It improves the channel utilization and sorting efficiency of the sorting system, reduces dead combination phenomenon, avoids the risk of data mixing, and enhances the system's fault tolerance and operational reliability under abnormal operating conditions.
Smart Images

Figure CN123117640A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sorting control technology, and in particular to a fruit sorting method and system based on pallet identity tracking. Background Technology
[0002] In circular fruit conveying and sorting scenarios, existing technologies typically employ a counterweight strategy of accumulating weight or quantity into a specific channel one by one according to the arrival order of pallets, or simply allocate channels based on total weight and quality grade. However, this locally greedy accumulation method easily creates "dead combinations" that are locally feasible but cannot be grouped later, leading to an increase in leftover fruit on the turntable and a decrease in channel utilization. Simultaneously, existing solutions often rely solely on the return values of control commands to determine the sorting results. When faced with complex operating conditions such as production line stoppages, mechanical delays, or communication anomalies, the allocation status recorded by the software is prone to deviating from the actual physical position of the goods, resulting in problems such as missed pushes, duplicate pushes, or batch data confusion. Therefore, existing technologies suffer from low sorting efficiency and poor operational reliability due to the lack of a global combination optimization and closed-loop verification mechanism for the physical state. Summary of the Invention
[0003] This application provides a fruit sorting method and system based on pallet identity tracking, which solves the technical problems of low sorting efficiency and poor operational reliability caused by the lack of global combination optimization and physical status closed-loop verification mechanism in the prior art.
[0004] To achieve the above objectives, this application adopts the following technical solution:
[0005] Firstly, a fruit sorting method based on pallet identity tracking is provided, comprising: acquiring the identity identifier, weight data, and pallet index of currently unassigned pallets; performing a global combination search on all unassigned pallets based on multidimensional combination constraints to generate a candidate combination set; the multidimensional combination constraints include a single fruit weight range, a combination quantity range, and a combination total weight range; selecting target combinations from the candidate combination set whose pallet indices do not overlap, and generating an allocation group identifier for each target combination to isolate sorting batch data of the same sorting channel at different time periods, so as to allocate the target combination to an idle sorting channel; in response to a pallet in a target combination arriving at the corresponding sorting channel, determining the actual push-in state of the pallet based on the identity identifier, the action stage of the actuator corresponding to the sorting channel, and a multidimensional time window including a push-in protection period and an anomaly confirmation window, and performing state compensation for anomaly interruption based on the actual push-in state.
[0006] The above solution breaks the limitations of single-channel sequential allocation by performing a global combination search on all unassigned pallets instead of local accumulation. This allows multiple idle channels to concurrently obtain non-overlapping combinations from the same global candidate pool, reducing the generation of dead combinations at the source. Simultaneously, by introducing allocation group identifiers to isolate batch data from different time periods within the same channel, data mixing during asynchronous processing is avoided. Furthermore, by combining the actuator's action phase with multi-dimensional time windows to perform closed-loop judgment and compensation for the actual pallet pushing status, strict consistency between software records and physical positions is ensured under abnormal conditions such as line stoppages and mechanical delays, improving the fault tolerance and operational reliability of the sorting system.
[0007] In conjunction with the first aspect mentioned above, in one possible implementation, a global combination search is performed on all unassigned pallets based on multidimensional combination constraints, including: in response to a triggering event, performing a global combination search on all unassigned pallets; the triggering event includes at least one of new unassigned pallets being enqueued, sorting channel release, multidimensional combination constraint change, or weight offset adjustment; in the global combination search, the unassigned pallets are arranged in non-descending order by weight data, and a prefix sum array is constructed based on the arrangement result; based on the prefix sum array, the combination quantity range, and the combination total weight range, a candidate combination set satisfying the multidimensional combination constraints is generated through depth-first traversal.
[0008] In conjunction with the first aspect mentioned above, in one possible implementation, a candidate combination set satisfying the multidimensional combination constraints is generated through depth-first traversal based on the prefix sum array, the combination quantity range, and the combination total weight range. This includes: in the current search branch of the depth-first traversal, determining the number of selected pallets, the current cumulative weight, and the remaining number of pallets to be selected; if the sum of the current cumulative weight and the total weight of the lightest pallets corresponding to the remaining number of pallets to be selected is greater than the upper limit of the combination total weight range, then the current search branch is pruned; if the sum of the current cumulative weight and the total weight of the heaviest pallets corresponding to the remaining number of pallets to be selected is less than the lower limit of the combination total weight range, then the current search branch is pruned; if the number of selected pallets meets the requirements of the combination quantity range, and the current cumulative weight falls within the combination total weight range, then the pallet combination corresponding to the current search branch is registered as a candidate combination in the candidate combination set.
[0009] In conjunction with the first aspect mentioned above, in one possible implementation, selecting target combinations from the candidate combination set whose pallet indices do not overlap includes: sorting the candidate combinations in the candidate combination set in ascending order of pallet quantity and total weight of the combination; initializing the used pallet index set and traversing the candidate combinations sequentially in the sorted order; if the intersection of the pallet index of the currently traversed candidate combination and the used pallet index set is empty, then the currently traversed candidate combination is determined as the target combination, and its pallet index is added to the used pallet index set; when the number of determined target combinations reaches the number of idle sorting channels, the traversal is stopped.
[0010] In conjunction with the first aspect mentioned above, in one possible implementation, the actual push-in status of the pallet is determined based on the identity identifier, the action phase of the actuator corresponding to the sorting channel, and a multi-dimensional time window including a push-in protection period and an exception confirmation window. This includes: in response to the reading node of the sorting channel obtaining the identity identifier, verifying whether the target sorting channel corresponding to the identity identifier matches the reading node; if they match and the action phase of the actuator corresponding to the sorting channel is in the push-in execution or within the push-in protection period, then the repeatedly obtained identity identifier is ignored; if the action phase of the actuator corresponding to the sorting channel is fully completed, then the completion time is recorded and an exception confirmation window is started; within the exception confirmation window, if no identity identifier is detected in the exception recovery channel, then the actual push-in status is determined to be a successful push-in.
[0011] In conjunction with the first aspect mentioned above, in one possible implementation, state compensation for abnormal interruptions is performed based on the actual push-in state, including: if the action phase of the actuator corresponding to the sorting channel is in an uncertain state due to production line interruption, the corresponding pallet is marked as pending confirmation, and an effective running timer is started; the effective running timer is only accumulated when the entire line is running and the key reading node is online; if the key reading node obtains the identity identifier again before the effective running timer reaches a preset threshold, it is determined as a missed push, and the corresponding pallet is restored to the waiting allocation state; if the effective running timer reaches the preset threshold and the key reading node does not obtain the identity identifier again, the actual push-in state is determined to be a successful push-in.
[0012] In conjunction with the first aspect mentioned above, in one possible implementation, the method further includes: when the number or weight data of unassigned pallets does not meet the multidimensional combination constraints, for each allowed quantity in the combination quantity range, extracting unassigned pallets less than the upper limit of the combination quantity range to construct a sliding combination; based on the total weight range of the combination and the weight range of a single fruit, calculating the intersection range of the supplementary weights that makes the sliding combination meet the multidimensional combination constraints; merging the overlapping intersection ranges of the supplementary weights to generate the next suggested weight range for a single fruit, as a feeding aid.
[0013] In conjunction with the first aspect above, in one possible implementation, merging overlapping supplementary weight intersection intervals to generate the next single-result suggested weight interval includes: sorting the valid supplementary weight intersection intervals by a lower bound, merging overlapping supplementary weight intersection intervals; and retaining a preset number of representative combinations for each merged supplementary weight intersection interval, the representative combinations being used to indicate which existing pallets the pallet added to the corresponding supplementary weight intersection interval will be grouped with.
[0014] In conjunction with the first aspect above, in one possible implementation, the method further includes: in response to a change in the state of an unassigned pallet, generating an immutable snapshot containing an identity identifier, weight data, sorting channel, action stage, and allocation group identifier, and writing it to local storage in a delayed merging manner; in response to a system restart, loading the immutable snapshot and remapping the configuration references of the sorting channel; restoring the current allocation group state of the sorting channel based on the immutable snapshot, and restoring unfinished tasks related to state compensation.
[0015] Secondly, a fruit sorting system based on pallet identity tracking is provided, comprising: a data acquisition module for acquiring the identity identifier, weight data, and pallet index of currently unassigned pallets; a combination search module for performing a global combination search on all unassigned pallets based on multi-dimensional combination constraints to generate a candidate combination set; the multi-dimensional combination constraints include a single fruit weight range, a combination quantity range, and a combination total weight range; a mutually exclusive allocation module for selecting target combinations from the candidate combination set whose pallet indices do not overlap, and generating an allocation group identifier for each target combination to isolate sorting batch data of the same sorting channel at different times, so as to allocate the target combination to an idle sorting channel; and a status determination and compensation module for determining the actual push-in status of the pallet based on the identity identifier, the action stage of the actuator corresponding to the sorting channel, and a multi-dimensional time window including a push-in protection period and an abnormal confirmation window, and performing abnormal interruption status compensation based on the actual push-in status.
[0016] This application, through a global combination search and mutually exclusive allocation mechanism, changes the existing local greedy accumulation weighting mode, enabling multiple idle channels to concurrently obtain the optimal combination from the global candidate pool. This reduces dead combinations caused by local decision-making and improves channel utilization and sorting efficiency. By introducing allocation group identifiers, batch data isolation is achieved for different time periods within the same channel, avoiding the risk of data mixing during asynchronous processing. By constructing a multi-dimensional time window that includes a push-in protection period and an anomaly confirmation window, and combining the execution mechanism's action phase and key node evidence reading for state closed-loop determination, the application solves the problem of state inaccuracy caused by relying solely on control command return values under abnormal conditions such as line stoppages and mechanical delays, ensuring strict consistency between software records and physical positions. Furthermore, by calculating and interpretably outputting the suggested weight range for the next order, complex combination constraints are transformed into intuitive loading guidance, shortening the waiting time for grouping. Through immutable snapshots and delayed merge write mechanisms, the application ensures data integrity and business continuity after long-term operation and unexpected restarts.
[0017] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a fruit sorting method based on pallet identification tracking, provided for an embodiment of this application;
[0019] Figure 2 A flowchart illustrating another fruit sorting method based on pallet identity tracking provided in this application embodiment;
[0020] Figure 3 A flowchart illustrating another fruit sorting method based on pallet identity tracking provided in this application embodiment;
[0021] Figure 4 A flowchart illustrating another fruit sorting method based on pallet identity tracking provided in this application embodiment;
[0022] Figure 5 A flowchart illustrating another fruit sorting method based on pallet identity tracking provided in this application embodiment;
[0023] Figure 6 A flowchart illustrating another fruit sorting method based on pallet identity tracking provided in this application embodiment;
[0024] Figure 7 A flowchart illustrating another fruit sorting method based on pallet identity tracking provided in this application embodiment;
[0025] Figure 8 A flowchart illustrating another fruit sorting method based on pallet identity tracking provided in this application embodiment;
[0026] Figure 9 This is a system architecture diagram of a fruit sorting system based on pallet identity tracking, provided for an embodiment of this application. Detailed Implementation
[0027] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.
[0028] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0029] Example 1:
[0030] like Figure 1 As shown, this embodiment provides a fruit sorting method based on pallet identity tracking. This method is applied to a cyclic fruit conveying and sorting system, aiming to improve sorting efficiency and reliability through global combinatorial optimization and state closed-loop control. The method mainly includes the following steps:
[0031] S101. Obtain the identity, weight data, and pallet index of the currently unassigned pallet.
[0032] Among them, the identification identifier is a unique code attached to the pallet, used to track the physical location and business status of a specific pallet throughout the entire sorting process; the weight data refers to the net weight of the fruit after deducting the pallet's own weight, which is the core numerical basis for combined weighting; the pallet index is a dynamic sequence number or pointer allocated by the system to maintain the set of unassigned pallets, used to quickly locate and reference pallet objects in algorithm calculations. The three together constitute the basic data unit participating in sorting decisions.
[0033] In this embodiment, the system scans the pallet's QR code through the reading node in front of the weighing station to obtain the identification mark, and simultaneously collects the sorting weight through the industrial scale. After confirming that the count increment is valid, the weight is bound to the identification mark. At the same time, the system automatically assigns a continuous pallet index to the newly joined qualified pallets, thereby establishing a real-time updated and unique unassigned pallet data pool to ensure that the data source on which the subsequent combination calculation is based is accurate.
[0034] As an example, in a durian sorting scenario, the weighing head sequentially reads the QR codes of trays T001 to T008 before weighing. The industrial scale measures the net weights as 2350g, 2480g, 2560g, 2650g, 2780g, 2880g, 3050g, and 3200g respectively. The system marks these trays as unassigned and assigns them corresponding indices, forming a set of 8 elements to be combined.
[0035] Based on the above steps, a precise mapping of pallets flowing in the physical world to computable objects in the digital space is achieved, ensuring that all subsequent decisions are based on real, unique and real-time physical data, eliminating invalid calculations or incorrect allocations caused by data source contamination.
[0036] S102. Perform a global combination search on all unassigned trays based on multidimensional combination constraints to generate a candidate combination set.
[0037] The multidimensional combination constraints include single fruit weight range, combination quantity range, and combination total weight range. These define the weight and quantity boundaries that a qualified packaging group must simultaneously meet. The single fruit weight range restricts the specification range of a single fruit, the combination quantity range specifies the upper and lower limits of the number of fruits in each box, and the combination total weight range sets the target range for the net weight of the entire box. Global combination search refers to using all currently unassigned pallets as the search space, traversing all possible combinations to find all feasible solutions that satisfy the above constraints, rather than performing local matching only for the most recently arrived pallet or a specific channel.
[0038] In this embodiment of the application, each time a recalculation is triggered, the system takes the current set of unallocated pallets as a whole input, performs multi-dimensional constraint verification and combination enumeration on all pallets according to preset template rules, and selects all pallet combinations that meet the requirements in terms of single fruit weight, number of combinations and total weight of combinations as candidate combination sets. This process covers all potential grouping possibilities of currently available resources.
[0039] As an example, for the above 8 durian trays, the system searches based on the constraints of 1600g-5000g per fruit, 6 combinations, and 16050g-16200g total weight. It finds that the set consisting of T001, T002, T003, T005, T006, and T007 has a total weight of 16100g and a quantity of 6, which satisfies all constraints and is registered as a valid candidate combination, while other combinations that do not meet the constraints are excluded.
[0040] Based on the above steps, by exhaustively searching and filtering feasible solutions globally, the limitations of single-channel sequential allocation are broken, enabling multiple idle channels to concurrently obtain the optimal combination from the same complete candidate pool. This reduces the generation of dead combinations from the source and improves the overall throughput of the sorting system.
[0041] S103. Select target combinations with non-overlapping pallet indices from the candidate combination set, and generate allocation group identifiers for each target combination to isolate sorting batch data of the same sorting channel at different times, so as to allocate the target combination to an idle sorting channel.
[0042] Among them, non-overlapping pallet indexes mean that the selected target combinations do not share the same pallet, ensuring that each pallet can only be assigned to one channel at a time; the allocation group identifier is a globally unique logical label used to clearly distinguish independent packaging batches processed in the same physical channel at different time periods at the software level, preventing data confusion between batches in asynchronous processes such as confirmation, printing or uploading.
[0043] In this embodiment, the system selects several mutually exclusive target combinations from the candidate combination set according to a preset priority strategy. The number of selections does not exceed the number of currently available channels. A new allocation group identifier is generated for each selected target combination. Then, all trays in the combination are bound to the identifier and the target channel, so that these trays enter the waiting execution state. At the same time, it ensures that the unselected trays continue to remain in the unallocated set to participate in the next round of search.
[0044] As an example, suppose channel 7 is currently idle. The system selects a combination containing T001, T002, T003, T005, T006, and T007 from the candidate set, generates an allocation group identifier A1 for it, and sets the target channel of these 6 trays to channel 7 and the allocation group to A1. At this time, T004 and T008 remain unallocated and wait for subsequent new trays to be added because their indices do not overlap with the selected combination but they have not yet met the grouping conditions.
[0045] Based on the above steps, resource mutual exclusion and batch isolation are achieved during concurrent allocation of multiple channels. This ensures that each tray is not allocated repeatedly and that business data processed by the same channel at different times is logically completely decoupled, laying a clear data foundation for subsequent asynchronous execution and traceability.
[0046] S104. In response to the arrival of a pallet in the target combination at the corresponding sorting channel, the actual push-in state of the pallet is determined based on the identification, the action stage of the actuator corresponding to the sorting channel, and a multi-dimensional time window including the push-in protection period and the abnormal confirmation window, and abnormal interruption state compensation is performed based on the actual push-in state.
[0047] Among them, the action phase of the actuator reflects the current working process of the pushing device such as the cylinder, such as extension, holding or retraction; the multi-dimensional time window is a timing judgment framework composed of the push-in protection period and the anomaly confirmation window. The push-in protection period is used to shield against repeated signal interference during mechanical action, while the anomaly confirmation window is used to reserve an observation period after the action is completed to verify whether the physical object is really in place; state compensation refers to correcting or confirming the final state of the pallet through subsequent evidence collection when an abnormal interruption such as a line stop is detected, which leads to uncertainty in the state.
[0048] In this embodiment, when the reading node detects the pallet identification, the system first verifies whether its target channel matches the current position. If it matches, it makes a comprehensive judgment by combining the real-time action phase of the actuator with the multi-dimensional time window: during the push-in protection period, repeatedly read identifications are ignored; during the abnormal confirmation window after the action is completed, it monitors whether there is evidence of reverse push failure; if the action phase is uncertain due to production line interruption, it starts a dedicated effective running timer and re-verifies the identification at key nodes, thereby determining whether the pallet was successfully pushed in or failed to push, and updates the status or restores the waiting for allocation accordingly.
[0049] It should be noted that this step constructs a closed-loop verification mechanism on the execution side, no longer relying solely on the return value of control commands as the success criterion. Instead, it combines the actual progress of physical actions, the fault tolerance window in the time dimension, and the secondary verification criterion of identity identification, effectively solving the problem of software records being disconnected from physical positions due to mechanical delays, signal jitter, or unexpected line stoppages, and ensuring the robustness of status determination.
[0050] As an example, when tray T001 arrives at the reader in channel 7 with the turntable, the system confirms that its target channel is 7 and that it is in the push-in execution phase. During the subsequent push-in protection period, the system ignores repeated reports from this reader. After the cylinder action is completed, an abnormal confirmation window is activated. If T001 is not detected in the abnormal recovery channel during the window period, the push-in is considered successful. If T004 encounters an emergency stop during the push-in process, resulting in an uncertain status, the system determines whether it was a missed push or has successfully entered the channel by checking whether reader 1 scans T004 again after the entire line is restored.
[0051] Based on the above steps, by integrating identity tracking, action phase and time window multi-dimensional judgment logic, the system achieves accurate perception and dynamic compensation of the actual physical state of pallets in complex industrial environments. This ensures that the allocation state always remains strictly consistent with the physical position of the goods in the physical world, significantly improving the fault tolerance and operational reliability of the sorting system under abnormal working conditions.
[0052] Based on the above technical solution, this embodiment constructs a complete sorting control link from data perception and decision optimization to execution closed loop through four core steps: acquiring unassigned pallet data, global combination search, mutual exclusion allocation and allocation group identifier generation, and state determination and compensation based on multi-dimensional time windows. This not only eliminates the dead combination problem caused by local greedy strategies and improves the concurrent utilization rate of multi-channels, but also isolates batch data through allocation group identifiers and ensures strict consistency between software state and physical position under abnormal working conditions such as line stoppage and mechanical delay through multi-dimensional time windows and state compensation mechanisms. This comprehensively improves the efficiency, reliability and fault tolerance of the fruit sorting system.
[0053] Example 2:
[0054] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 2 As shown, the above S102 can be specifically implemented through the following S201, S202 and S203, which are explained in detail below:
[0055] S201. In response to the triggering event, perform a global combined search on all unassigned trays.
[0056] Among them, the triggering events include at least one of the following: new unassigned pallets being enqueued, sorting channel release, multi-dimensional combination constraint change, or counterweight offset adjustment. These are asynchronous signal sources that drive the system to re-evaluate the current optimal solution for resource allocation. They cover various working conditions such as material flow changes (new pallet enqueuing), execution resource changes (channel release), business rule changes (constraint changes), and manual intervention (counterweight offset adjustment), ensuring that the combination optimization strategy can dynamically evolve in real time with the on-site status.
[0057] In this embodiment, the system uses an event-driven mechanism to listen to the above-mentioned signals. Once any triggering event is captured, the current low-priority task is immediately suspended and a new round of global combined search process is started. The latest unallocated tray set is used as the input object for full recalculation, rather than passively responding only at fixed time periods or under single conditions, thereby ensuring the timeliness and environmental adaptability of sorting decisions.
[0058] As an example, on the durian sorting line, when the weighing station completes the binding of pallet T008 and adds it to the unassigned queue, the system immediately recognizes the "new pallet in queue" event and triggers a search; or when the previous batch of packaging is completed in channel 7 and the operator presses the release button, the system recognizes the "sorting channel release" event and also triggers a search, ensuring that T008 or the released idle channel can be included in the next round of counterweight calculation in a timely manner.
[0059] Based on the above steps, by establishing a multi-dimensional and highly sensitive event triggering system, the precise synchronization between the combined optimization algorithm and the physical sorting cycle is achieved, ensuring that the system can output the current optimal allocation scheme with minimal delay under any working condition changes, thereby improving the dynamic response capability of the entire line.
[0060] S202. In the global combined search, the unassigned pallets are sorted in non-descending order by weight data, and a prefix sum array is constructed based on the sorting results.
[0061] Among them, non-descending order means reorganizing all unassigned pallets participating in the search according to the order of net weight from smallest to largest to form an ordered sequence; the prefix sum array is a preprocessing data structure used to store the cumulative weight value from the first element to the current element in the ordered sequence. Its core function is to reduce the weight summation operation of any continuous subsequence from linear time complexity to constant time complexity, providing a computing power basis for subsequent high-frequency pruning judgment.
[0062] In this embodiment of the application, the system first performs a quick sort on the current unassigned pallet set each time a search is triggered, and then traverses the sorted sequence to construct a prefix sum array. This allows the system to evaluate the weight of any interval during the depth-first traversal without repeatedly accumulating the weight of a single pallet. Instead, the weight is obtained directly through array lookup and simple subtraction, which significantly reduces the computational overhead during the combination enumeration process.
[0063] As an example, for 8 durian trays, the system sorts them by net weight as T001 (2350g), T002 (2480g), T003 (2560g), T004 (2650g), T005 (2780g), T006 (2880g), T007 (3050g), and T008 (3200g), and constructs a prefix sum array P accordingly. For example, P[3] represents the sum of the weights of the first 3 trays (T001, T002, T003) after sorting, which is 7390g. This value can be directly called in subsequent judgments without re-adding.
[0064] Based on the above steps, by optimizing the data structure through preprocessing, the most time-consuming weight accumulation operation in the combinatorial search is transformed into an efficient memory access operation, enabling the global enumeration of a large-scale pallet set to be completed in milliseconds on computing power-constrained devices such as industrial tablets, thus meeting the performance requirements of real-time production line control.
[0065] S203. Based on the prefix sum array, the range of number of combinations, and the range of total weight of combinations, a set of candidate combinations that satisfy the multidimensional combination constraints is generated by depth-first traversal.
[0066] Depth-first traversal is a systematic combinatorial enumeration strategy that selects pallets layer by layer according to a preset range of the number of combinations, and performs real-time feasibility verification at each layer using a prefix sum array. This process is not a blind exhaustive search, but rather a dynamic combination of the total weight range of combinations during the traversal process to perform upper and lower bound pruning, retaining only the search branches that may satisfy the constraints, and finally registering all complete and compliant combinations as a candidate combination set.
[0067] In this embodiment, the system recursively attempts to add pallets starting from an empty combination. At each recursive node, the theoretical weight boundary of the current branch is quickly calculated using a prefix sum array. Once it is found that the current path cannot meet the total weight constraint no matter which subsequent pallets are selected, the exploration of the branch is immediately terminated and backtracked to the previous level. Only when the number of selected pallets reaches the interval requirement and the actual total weight falls within the target range is the combination confirmed as a valid candidate, thereby significantly reducing the amount of invalid computation while ensuring the integrity of the solution space.
[0068] As an example, when searching for a 6-fruit combination, if the total weight of the 4 selected trays is 11000g, and 2 more need to be selected, the system uses the prefix sum array to find that the weight of the 2 lightest remaining selectable trays is 4830g. Since the sum of the two, 15830g, is still less than the target lower limit of 16050g, it is determined that this branch must be too light, and it is directly cut off without continuing to try the selection of the 5th and 6th trays, thus avoiding the generation of all subsequent invalid combinations.
[0069] Based on the above steps, by introducing a forward-looking pruning mechanism, the computational focus of the combinatorial search is concentrated near the feasible solution region, eliminating the vast majority of invalid enumeration paths. This enables global combinatorial optimization to achieve real-time full coverage search of a large number of unassigned pallets under limited hardware resources, ensuring that both sorting efficiency and weight accuracy are met.
[0070] Example 3:
[0071] In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 3 As shown, the above S203 can be specifically implemented through the following S301, S302, S303 and S304, which are explained in detail below:
[0072] S301. In the current search branch of the depth-first traversal, determine the number of selected trays, the current cumulative weight, and the remaining number of trays to be selected.
[0073] Among them, the number of selected pallets records the number of pallets that have been included in the combination on the current recursive path, which is used to determine whether the lower or upper limit of the combination number range has been reached; the current cumulative weight is the net weight of the selected pallets, which is the basic variable for evaluating the total weight constraint of the combination; the remaining number of pallets to be selected is the difference between the target combination size and the number of selected pallets, which determines how many more pallets need to be selected from the candidate pool to form a complete combination. These three state variables together constitute the real-time context of pruning judgment.
[0074] In this embodiment, the system updates and maintains these three state variables in real time at each recursive entry point of the depth-first traversal, so that they accurately reflect the progress of the current search branch and serve as direct input parameters for subsequent upper and lower bound pruning logic. This ensures that each pruning judgment is based on the latest and most accurate local state information, avoiding mispruning or missed judgments due to state asynchrony.
[0075] It should be noted that the updating and backtracking of these state variables must strictly follow the stack-based management rules of depth-first traversal. When entering the next level, the selected number is incremented and the weight is accumulated. When returning to the previous level, the original value is restored. This rigorous state management mechanism is the premise for ensuring the correctness of the pruning logic and the engineering foundation for the stable operation of the algorithm.
[0076] As an example, when searching for a combined branch containing T006, T007, and T008, after recursively reaching the 3rd level and selecting T008, the system records that the number of selected items is 3, the current cumulative weight is 9130g (2880+3050+3200), and the remaining number of selected items is 3 (assuming the target is 6). These values are then passed to the pruning judgment module to evaluate the survival value of the branch.
[0077] Based on the above steps, by accurately maintaining the key state variables in the search process, a reliable decision basis for the pruning strategy is provided, ensuring that the algorithm can always accurately perceive the feasibility boundary of the current path in complex recursive traversal. This is the cornerstone of state management for achieving efficient combinatorial search.
[0078] S302. If the sum of the current cumulative weight and the total weight of the lightest pallet corresponding to the remaining number of pallets to be selected is greater than the upper limit of the total weight range of the combination, then the current search branch is cut off.
[0079] This judgment logic is called upper bound pruning or inevitable overweight pruning. Its physical meaning is: even if only the pallet with the smallest weight is selected in all subsequent choices of the current branch, the total weight of the final combination will still exceed the allowed upper limit. This means that there is no feasible solution that satisfies the constraints under this branch, so the search of this path can be safely terminated in advance.
[0080] In this embodiment, the system uses a prefix sum array to quickly calculate the sum of the weights of the r lightest pallets starting from the current starting position in the sorted sequence (r is the number of remaining pallets to be selected), adds it to the current cumulative weight, and compares it with the upper limit of the total weight range of the combination. If the sum exceeds the limit, a pruning operation is immediately performed, abandoning further exploration of the branch and all its child nodes, and directly returning control to the upper recursion.
[0081] Optionally, the criterion for pruning the upper bound satisfies the following formula:
[0082] .
[0083] in, This indicates the current cumulative weight. Represents a prefix sum array. This indicates the starting index of the next optional tray in the current search branch. Indicates the remaining number of pallets to be selected. This indicates the upper limit of the total weight range for the combination. This is the sum of the weights of the lightest pallets in a row, starting from the index.
[0084] It should be noted that the validity of this pruning condition depends entirely on the non-descending order of the tray sequence. Only when the sequence is ordered is "r consecutive items from the current position" equivalent to "r lightest items among the remaining options". If the sequence is unordered, this inference will fail.
[0085] As an example, in the durian sorting search, if the current branch has selected 4 trays with a total weight of 12,000g, and 2 more need to be selected, and the weight of the 2 lightest remaining selectable trays after sorting is 4,830g, the sum of the two is 16,830g, which exceeds the target limit of 16,200g. The system then determines that the branch is definitely overweight and will not try to select the 5th or 6th tray, but will directly backtrack to the previous level to find other possibilities.
[0086] Based on the above steps, a large number of invalid branches that are destined to be overweight are eliminated in advance by upper bound pruning, avoiding meaningless deep recursion and weight accumulation on these paths, significantly reducing the volume of the search space, and improving the execution efficiency of the algorithm in scenarios with tight weight upper limit constraints.
[0087] S303. If the sum of the current cumulative weight and the total weight of the heaviest pallet corresponding to the remaining number of pallets to be selected is less than the lower limit of the total weight range of the combination, then the current search branch is cut off.
[0088] This judgment logic is called lower bound pruning or necessarily light pruning. Its physical meaning is: even if only the pallet with the largest weight is selected in all subsequent choices of the current branch, the total weight of the final combination still cannot reach the allowable lower limit value. This means that there is no feasible solution that satisfies the constraints under this branch, and it should be terminated in advance.
[0089] In this embodiment, the system uses a prefix sum array to quickly calculate the sum of the weights of the last r heaviest pallets in the sorted sequence, adds it to the current cumulative weight, and compares it with the lower limit of the combined total weight interval. If the sum is insufficient, a pruning operation is immediately performed, abandoning further exploration of the branch. This forms a symmetrical bidirectional pruning mechanism with the upper bound pruning, jointly compressing the invalid search space.
[0090] Optionally, the criterion for lower bound pruning satisfies the following formula:
[0091] .
[0092] in, This indicates the current cumulative weight. Represents a prefix sum array. This represents the total length of the unassigned tray sort sequence. Indicates the remaining number of pallets to be selected. This represents the lower limit of the total weight range for the combination. This is the sum of the weights of the largest pallets in the entire sequence.
[0093] It should be noted that the lower bound pruning utilizes the information of the globally heaviest pallet rather than the locally heaviest one. This is because in an ordered sequence, no matter where the current starting position is, the weight of the remaining optional pallets cannot exceed the globally heaviest r. Therefore, using the global maximum value as the supremum estimate is safe and conservative, and will not prune potential feasible solutions by mistake, while at the same time eliminating the lighter branches to the greatest extent.
[0094] As an example, in the durian sorting search, if the current branch has selected 3 trays with a cumulative weight of 7000g, and 3 more need to be selected, the sum of the weights of the 3 heaviest trays globally is 9130g (2880+3050+3200). The sum of the two, 16130g, is close to the target range but still below the target lower limit of 16050g, which is extremely rare. However, if the current cumulative weight is only 6500g, adding 9130g gives 15630g, which is significantly lower than 16050g. The system then determines that the branch must be too light and cuts it off directly.
[0095] Based on the above steps, a bidirectional approximation search space compression mechanism is constructed through the coordinated work of lower bound pruning and upper bound pruning. This enables the algorithm to quickly skip branches that are destined to fail due to their current accumulated weight being too light or too heavy, and concentrates computing resources on effective search paths within the weight range, greatly improving the overall efficiency of combinatorial enumeration.
[0096] S304. If the number of selected pallets reaches the requirement of the combination quantity range, and the current cumulative weight falls within the combination total weight range, then register the pallet combination corresponding to the current search branch as a candidate combination in the candidate combination set.
[0097] This step involves processing the leaf nodes in a depth-first traversal and is also the final confirmation step for the feasibility of the combination. Only when a search branch satisfies both the quantity constraint and the weight constraint are they considered valid solutions and included in the candidate set; otherwise, they are considered invalid paths and discarded.
[0098] In this embodiment of the application, when the system recursively reaches a specified depth, it no longer performs pruning judgment, but directly checks whether the current cumulative weight is within the closed interval of the combined total weight interval. If the check passes, all tray indices on the current path are encapsulated into a candidate combination object and added to the result list. Then, it backtracks to the previous level to continue exploring other branches until the entire search space is traversed.
[0099] It should be noted that since the previous steps have eliminated a large number of branches that could not meet the weight constraints through pruning, the combinations that reach this step have a very high pass rate. This step is more of a final safety valve to prevent false releases due to extreme cases such as floating-point errors or integer overflows in the calculation of pruning boundaries, and to ensure the absolute purity and compliance of the candidate set.
[0100] Based on the above steps, a strict final state verification mechanism ensures that every element in the output candidate combination set fully conforms to the multidimensional combination constraints, providing reliable and compliant decision-making material for subsequent channel allocation and guaranteeing the accuracy and consistency of sorting results.
[0101] Example 4:
[0102] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 4 As shown, the selection of target combinations with non-overlapping tray indices from the candidate combination set in S103 can be specifically implemented through the following S401, S402, S403, and S404, which are explained in detail below:
[0103] S401. Sort the candidate combinations in the candidate combination set in ascending order of pallet count and total weight.
[0104] The sorting strategy defines the priority order of combination selection. Ascending order of pallet quantity means prioritizing the consumption of combinations with fewer pallets, while ascending order of total weight prioritizes combinations with lighter total weight when the number of pallets is the same. This multi-level sorting rule aims to maximize the diversity and combination potential of the remaining pallet resources and avoid the risk of dead combinations that cannot be formed later due to premature consumption of a large number of pallets or excessively heavy pallets.
[0105] In this embodiment of the application, after generating a complete set of candidate combinations, the system stably sorts them according to the above priority rules, so that the combinations at the front of the list always have fewer trays and lighter total weight, providing an ordered input sequence for subsequent greedy selections, ensuring that each selection is a locally optimal solution from the current perspective, and thus approaching the maximization of global resource utilization.
[0106] It should be noted that the design of this sorting rule contains a profound insight into the problem of "dead combinations": in fruit sorting, combinations with fewer pallets and lighter total weight usually have less "destructive" effect on the remaining resources, and the remaining pallets are easier to recombine with other newly arrived pallets; conversely, if large quantity or heavy weight combinations are given priority, it is very easy for the remaining scattered pallets to remain for a long time because they cannot meet the minimum quantity or weight limit. Therefore, this sorting is the strategic basis for achieving efficient mutually exclusive allocation.
[0107] Based on the above steps, by introducing a resource-friendly sorting strategy, the combination selection is upgraded from a random or single-weight mode to a multi-objective optimization mode, which effectively alleviates the resource depletion problem caused by local greed and improves the long-term composability of the unallocated pallet set and the stability of channel utilization.
[0108] S402. Initialize the used tray index set and traverse the candidate combinations in sorted order.
[0109] The used tray index set is a dynamically maintained mutex container used to record tray indices that have been occupied by a target combination in the current round of allocation; traversing in sorted order ensures that the selection process strictly follows the established priority, ensuring that high-priority combinations always have the opportunity to be selected before low-priority combinations.
[0110] In this embodiment, the system clears the set of used tray indexes before starting the selection. Then, it takes out combinations one by one from the head of the sorted candidate list for inspection. Each time a combination is successfully selected, all the tray indexes it contains are added to the set. Subsequent combinations must be intersected with the set when selected. Only when the intersection is empty is it considered available, thereby realizing the mutual exclusion of tray resources and preventing duplicate allocation.
[0111] As an example, in durian sorting, the system first checks the first sorted combination A{T001, T002, T003, T005, T006, T007}. At this point, the set is empty and the intersection is empty, so A is selected and T001, T002, T003, T005, T006, and T007 are added to the set. Next, the system checks combination B{T001, T002, T004, T005, T006, T007}. It finds that T001, T002, T005, T006, and T007 are already in the set, and the intersection is not empty, so B is skipped. The system continues to check until a combination that does not overlap with {T001, T002, T003, T005, T006, T007} is found or the traversal ends.
[0112] Based on the above steps, by constructing an allocation mechanism that combines dynamic mutual exclusion marking with ordered traversal, it is ensured that each tray can only be uniquely allocated under multi-channel concurrent requirements, while guaranteeing the priority landing of high-priority combinations, thus achieving the unity of resource mutual exclusion and strategy optimization.
[0113] S403. If the intersection of the tray index of the candidate combination being traversed and the set of used tray indices is empty, then the candidate combination being traversed is determined as the target combination, and its tray index is merged into the set of used tray indices.
[0114] The intersection being empty is a necessary and sufficient condition for the current combination to be selected, indicating that none of the trays contained in the combination have been occupied by other combinations in this round of allocation; being identified as the target combination means that the combination officially becomes part of the allocation scheme in this round and will be bound to a specific free channel; being merged into the index set updates the mutual exclusion state to prevent subsequent combinations from selecting these trays.
[0115] In this embodiment, the system performs fast set intersection detection for each candidate combination during the traversal process. Once an empty intersection is detected, the combination is immediately marked as the target combination, a corresponding allocation group identifier is generated, and all its tray indices are batch inserted into the used set. At the same time, the idle channel count is updated. The entire process is completed in memory without external IO interaction, ensuring high-speed execution of allocation decisions.
[0116] As an example, in durian sorting, when traversing to the combination D{T004, T008, ...}, the system detects that T004 and T008 are not in the used set {T001, T002, T003, T005, T006, T007}, and the intersection is empty. Therefore, D is determined as the second target combination, and the indices of T004, T008, etc. are added to the set. At this time, the used set is updated to {T001-T008}, and any subsequent combinations containing these trays will be automatically skipped.
[0117] Based on the above steps, a lossless transformation from the candidate pool to the target allocation is achieved through an efficient mutual exclusion detection and state update mechanism, ensuring the feasibility and uniqueness of the allocation scheme, while maintaining the overall real-time response capability of the algorithm.
[0118] S404. Stop traversing when the number of identified target combinations reaches the number of available sorting channels.
[0119] This step defines the termination condition of the mutual exclusion selection process: when the number of selected target combinations is sufficient to fill all currently free channels, the remaining traversal operations immediately end. This avoids meaningless checks of subsequent candidate combinations when the channels are full, saving unnecessary computational resources.
[0120] In this embodiment, after each successful determination of a target combination, the system decrements the idle channel counter or increments the allocated combination counter. When the two are equal, the system immediately exits the traversal loop, no longer processes the remaining combinations in the candidate list, and directly outputs the currently determined target combination set as the allocation result of this round to the execution layer.
[0121] Based on the above steps, by setting dynamic termination conditions that match physical resources, the algorithm output and hardware capabilities are precisely aligned, avoiding resource waste and state risks caused by over-allocation, and ensuring the resource utilization efficiency and control stability of the sorting system under steady-state operation.
[0122] Example 5:
[0123] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 5As shown, the determination of the actual push-in status of the pallet in S104 above, based on the identity identifier, the action stage of the actuator corresponding to the sorting channel, and the multi-dimensional time window including the push-in protection period and the abnormal confirmation window, can be specifically achieved through the following S501, S502, S503, and S504, which are explained in detail below:
[0124] S501. In response to the reading node of the sorting channel obtaining the identity identifier, verify whether the target sorting channel corresponding to the identity identifier matches the reading node.
[0125] The reading node is a QR code reader or RFID reader deployed at the entrance of each sorting station to capture the identity of the passing pallet in real time; the target sorting channel is the predetermined material drop channel that the system binds to the pallet in the previous allocation step; the matching verification is to compare the physical address of the reading node with the target channel ID recorded in the pallet to confirm whether the current scanning event has occurred at the correct execution position.
[0126] In this embodiment of the application, when a reading node at any workstation reports a barcode scanning event, the system first retrieves the tray record corresponding to the identity in the activity queue in memory. If the retrieval is successful, the target channel field is extracted and compared with the configuration information of the reading node that reported the event. Only when the two are completely consistent is the tray considered to have accurately arrived at the designated workstation and allowed to enter the subsequent push-in judgment process. Otherwise, the tray's latest position information is updated without triggering any execution action.
[0127] As an example, in the durian sorting scenario, when the reader at the entrance of channel 7 scans the QR code of tray T001, the system finds that the target channel of T001 is indeed channel 7, the matching verification passes, and then prepares to enter the push-in judgment; conversely, if T001 is read by the reader of the adjacent channel 6, although the system recognizes the identity of T001, it finds that the target channel does not match, only records that it passed through station 6, and does not trigger the action of cylinder 6.
[0128] Based on the above steps, the dual identity-location verification in the spatial dimension effectively filters out interference signals caused by overlapping read head layouts or tray drift, ensuring that subsequent timing judgment logic only takes effect on the correct physical nodes, thus avoiding sorting chaos and equipment risks caused by cross-channel misoperation.
[0129] S502. If the action phase of the actuator corresponding to the matching sorting channel is in the push-in execution or push-in protection period, then the repeatedly acquired identity identifier shall be ignored.
[0130] Among them, "push-in execution" refers to the dynamic working period when the cylinder or other pushing device is in the process of extending, holding, or retracting; "push-in protection period" refers to a short buffer period preset after the completion of a single push-in action, used to cover mechanical return delay and read head signal trailing phenomenon; "ignore operation" means that when the system receives the scanning event of the identity identifier, it neither triggers a new push-in instruction nor modifies the current tray status record, but directly discards the event.
[0131] In this embodiment, the system maintains a real-time action state machine for each sorting channel. After the reading node passes the matching verification, it further queries the current action stage flag and protection period timer of the channel. If it finds that the cylinder is in action or the protection period threshold has not been exceeded since the last action was completed, it is determined that the current scan is a duplicate signal from the same pallet or a false signal caused by mechanical vibration. The system automatically performs shielding processing until the protection period ends and the cylinder is in an idle standby state before the response permission for the pallet is reopened.
[0132] As an example, when the cylinder of channel 7 is pushing the tray T001 into the hopper, the reader reports the T001 code 5 times in a row within 200 milliseconds. The system detects that the action phase is "pushing in progress" and ignores all of them. After the cylinder retracts, the system starts a 2-second push-in protection period. If the reader reports T001 again due to the tray shaking during this period, the system will remain in the protection state and continue to ignore it until the 2-second period expires before the shielding is lifted.
[0133] Based on the above steps, by using a dual filtering strategy that integrates action status and time buffering, the signal redundancy problem caused by the coupling of high-frequency sampling of the read head and mechanical motion is eliminated, ensuring that each tray triggers an effective push-in judgment only once per channel, thereby improving the system's adaptability to harsh industrial electromagnetic environments and mechanical vibrations.
[0134] S503. If the action phase of the actuator corresponding to the sorting channel is completed, record the completion time and start the exception confirmation window.
[0135] Among them, the complete completion of the action phase means that the actuator has gone through the three standard sub-phases of output opening, holding delay and output closing in sequence without any errors. The completion time is the precise timestamp of the completion state, which serves as the benchmark starting point for subsequent timing judgment. The anomaly confirmation window is a preset observation period calculated from the completion time. During this period, the system maintains the "pending" attribute of the tray state, waiting for external evidence to finally confirm the push result.
[0136] In this embodiment, when the cylinder control sequence of a certain channel is monitored to have completed the last step of the OFF command normally and the feedback is correct, the system immediately marks the action stage of the tray as completed and writes the current system time into the completion time field. At the same time, the channel-specific abnormal confirmation window timer is activated. During the existence of this window, although the tray is logically regarded as "suspected success", it has not yet been formally included in the batch statistics or released channel resources. Instead, it is in an intermediate state that can be overturned by reverse evidence.
[0137] Based on the above steps, by establishing a delayed verification mechanism after the action is completed, the fault tolerance capability of state determination is extended from the code layer to the physical interaction layer. This allows the system to use the time dimension to obtain a higher degree of confidence in the authenticity of the execution result without adding additional sensors, effectively avoiding false success records caused by mechanical transient failures.
[0138] S504. If no identity identifier is detected in the abnormal recycling channel within the abnormal confirmation window, the actual push status is determined to be a successful push.
[0139] The abnormal recovery channel is a dedicated detection path located downstream or beside the normal sorting channel, used to capture pallets that failed to enter the target channel. Detecting an identification mark means that the same pallet's coding information is captured again at the reading node of this channel. Successful push is a deterministic state in the pallet's lifecycle, indicating that the pallet has been safely removed from the main conveyor line and belongs to the current allocation group, and can participate in subsequent batch aggregation and data upload.
[0140] In this embodiment, the system continuously monitors the barcode scanning event stream of the abnormal recycling channel during the existence of the abnormal confirmation window. If the identity identifier of the tray is not received within the entire window duration, it is inferred that the tray has not been missed or slipped, and its status is officially flipped from "pending confirmation" to "successfully pushed in". At the same time, the timeout timer related to the tray is stopped and it is added to the completed count of the current allocation group. Conversely, if the identifier is detected in the window, it is immediately determined to be a missed push and the recovery process is triggered.
[0141] Based on the above steps, the probabilistic confirmation of the push result is transformed into deterministic confirmation through the reverse verification mechanism based on the time window. Without relying on expensive visual inspection or repeating core equipment, the existing read head network and timing logic can achieve a very high state determination accuracy, which significantly reduces the hardware cost and operation and maintenance complexity of the sorting system.
[0142] Based on the above technical solution, this embodiment uses four closely linked sub-steps—verification matching, protection period deduplication, completion time recording, and anomaly confirmation window verification—to concretize the abstract concept of a multi-dimensional time window into executable timing control logic. This not only effectively solves the common problems of repeated barcode scanning interference and missed push misjudgment in industrial sites, but also constructs an execution-side state closed loop that balances anti-interference and reliability through the functional decoupling and coordination of the protection period and confirmation window, ensuring accurate synchronization between software records and physical positions during the sorting process.
[0143] Example 6:
[0144] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 6 As shown, the state compensation for abnormal interruption based on the actual push-in state in S104 above can be specifically implemented through the following S601, S602 and S603, which are explained in detail below:
[0145] S601. If the action phase of the actuator corresponding to the sorting channel is in an uncertain state due to production line interruption, the corresponding pallet will be marked as pending confirmation and an effective running timer will be started.
[0146] Among them, the uncertain state refers to the intermediate state where the actuator has received the start command but has not yet fed back the completion signal. Due to external power failure, emergency stop, or communication interruption, the control link is disconnected, making it impossible for the software to know the final position of the physical object through the regular return value. The pending confirmation state is a special temporary business marker, which is different from the certain "pull-in successful" and the certain "pull-in failed". Instead, it suspends the final settlement process of the pallet and waits for subsequent physical evidence to make a judgment. The effective running time is a condition-triggered timer. Its accumulation logic is strictly bound to the actual availability of the production line and key sensing equipment, rather than the simple natural passage of time. The effective running time is only accumulated when the entire line is running and the key reading node is online. The entire line is running means that the conveyor motor is in normal operation and there are no stop signals such as emergency stop or pause. The key reading node is online means that the main reading head used to verify the pallet position (such as the No. 1 reading head at the starting position of the turntable) maintains a normal TCP connection and the heartbeat response is within the timeout threshold. Accumulation means that the timer will increment based on the system clock only when the above two conditions are met at the same time. If any condition is missing, the accumulation will be immediately paused and the current value will remain unchanged until the conditions are met again.
[0147] In this embodiment, when the system detects that the output command from the cylinder of channel 7 to tray T004 has been issued but no shutdown feedback has been received, if a line emergency stop signal or a PLC heartbeat loss event is also captured, the business status of T004 is immediately switched from "push-in execution" to "pending confirmation". A valid running timer instance associated with the tray is created in memory. The initial value of the timer is zero and it does not start running immediately, but enters a preparatory mode waiting for the trigger condition to be met. This avoids incorrect final state judgments due to missing information at the moment of fault occurrence. The system evaluates the line operation flag and the connection status of the key read head in real time during each scan cycle. Only when both are true is the valid running timer associated with the tray awaiting confirmation activated for accumulation. If a second line stop or read head network interruption occurs during the timing process, the timer is immediately frozen. After the fault is cleared and the equipment is back online, the previous accumulated value is automatically resumed to continue timing. This design ensures that the observation window always measures the effective time period when the system has the ability to perceive and verify, rather than the natural time that includes invalid time periods such as maintenance and restart.
[0148] Based on the above steps, by making the fuzzy state after an abnormal interruption explicitly managed and providing a condition-triggered timing mechanism, the discrepancy between accounts and actual conditions caused by hastily updating business data when the cause of the fault is unclear or the physical location is not updated on time is effectively prevented, thus laying a reliable state foundation for subsequent accurate compensation.
[0149] S602. If the key reading node obtains the identity identifier again before the effective running time reaches the preset threshold, it is determined as a missed push, and the corresponding tray is restored to the waiting allocation state.
[0150] Among them, the preset threshold is the upper limit of the effective observation time in advance, such as 30 seconds, which represents the maximum reasonable time window for the system to determine that "if the tray has been successfully pushed in, it should not appear on the main path again"; the key reading node obtains the identity again means that during the period when the cumulative value of the timer has not reached the threshold, a specific read head (usually read head 1) located on the turntable loop path scans the unique code of the tray to be confirmed again; missed push is a definite negative judgment of the actual physical position of the tray, indicating that the tray has not entered the target channel but continues to loop with the turntable; restore the waiting allocation state is to roll the tray back from the pending confirmation state to the unallocated queue, so that it can re-participate in the subsequent global combination search and channel scheduling.
[0151] In this embodiment, the system listens in parallel to the barcode scanning event stream of key reading nodes at every moment of the effective running timer accumulation. Once the identity of the pallet to be confirmed is captured before the threshold is reached, the timer is immediately stopped and the state of the pallet is flipped from pending confirmation to waiting for allocation. At the same time, its binding relationship with the original target channel and the original allocation group is cleared, so that it re-enters the combination optimization pool like a newly enqueued pallet. This process is fully automated and requires no manual intervention, ensuring that missed pallets can be quickly reused without causing material waste or batch loss.
[0152] Based on the above steps, the accurate identification and automatic recovery of the missed push status are achieved through secondary verification of key nodes. This not only avoids the batch shortage caused by misjudging the missed push tray as a success, but also prevents the waste of resources caused by hanging it up for a long time, thus ensuring the accuracy of sorting data and the efficiency of material flow.
[0153] S603. If the effective running time reaches the preset threshold and the key reading node does not obtain the identity identifier again, the actual push status is determined to be a successful push.
[0154] Among them, reaching the preset threshold means that the cumulative value of the effective running timer has been equal to or exceeded the configured observation duration limit; not obtaining the identity identifier again means that the key reading node has not reported the encoding information of the tray throughout the entire effective observation window; successful push is a positive conclusion derived from the negative evidence of "not reproduced on the expected path" in the absence of direct positioning sensors, indicating that the system recognizes that the tray has entered the target channel and can be included in the batch statistics.
[0155] In this embodiment of the application, when the effective running timer accumulates to the 30-second threshold and the missed push determination in step S503 is not triggered during the period, the system automatically flips the status of the tray to be confirmed to successful push, fills in the completion time and adds it to the completed count of the corresponding allocation group, and then triggers the integrity verification of the allocation group and the subsequent printing and release process. Although this determination is a probabilistic inference, it has a very high degree of confidence in engineering practice, because if it is not read by the starting read head in a complete cycle, the possibility that the tray is still stuck on the main line is almost eliminated.
[0156] Based on the above steps, a soft verification mechanism based on timing and path exclusion is used to reliably terminate uncertain states without increasing hardware costs. This ensures the integrity and traceability of sorted batch data after abnormal interruption, enabling the system to have the ability to self-repair and continue operating in complex industrial environments.
[0157] Based on the above technical solution, this embodiment constructs a four-step closed-loop mechanism: a pending confirmation state marker, a condition-triggered effective running timer, a secondary verification of key nodes, and a success inference based on time-series exclusion. This transforms the abstract abnormal interruption state compensation into deterministic control logic that can be stably executed in industrial settings. It not only solves the industry pain point of software state being disconnected from physical position under extreme conditions such as line stoppage, but also, through the ingenious design of frozen timer and path verification, ensures data accuracy while taking into account the system's economy and robustness, significantly improving the operational reliability and fault tolerance of the fruit sorting system in non-steady-state environments.
[0158] Example 7:
[0159] In one possible implementation of the embodiments of this application, such as Figure 7 As shown, the logic for generating the suggested weight range for the next order is further refined. Specifically, it can be implemented through the following steps: S701, S702, and S703. The details are explained below:
[0160] S701. When the quantity or weight data of unassigned pallets does not meet the multidimensional combination constraints, for each allowed quantity in the combination quantity range, extract unassigned pallets less than the upper limit of the combination quantity range to construct a sliding combination.
[0161] Among them, sliding combination refers to a temporary subset of elements selected from the existing pallets when the current unallocated pallet resources are insufficient to directly form a complete target combination. The number of elements is strictly less than the upper limit of the combination quantity range, and it is used as a benchmark carrier for calculating missing elements. The process of constructing sliding combination is essentially an exhaustive pre-run of existing resources to identify all potential grouping paths.
[0162] In this embodiment, the system monitors the status of the unassigned pallet set in real time. Once it is found that the current set cannot generate a valid candidate combination through global search, the system automatically triggers the suggested weight calculation process, traverses each allowed number of results k within the combination quantity range, and sequentially extracts k-1 pallets from the sorted unassigned pallet sequence to form a sliding window, forming multiple basic combinations to be evaluated, providing input objects for subsequent weight gap calculation.
[0163] Based on the above steps, a mathematical mapping bridge between incomplete resources and complete combinations is established by performing structured sliding window sampling on existing unassigned pallets. This enables the system to quantify the precise conditions required to achieve the goal in any intermediate state, laying a data foundation for generating accurate material loading suggestions in the future.
[0164] S702. Based on the total weight interval of the combination and the weight interval of a single fruit, calculate the intersection interval of the supplementary weights that makes the sliding combination satisfy the multidimensional combination constraints.
[0165] The "fill in the weight intersection range" refers to the overlapping part of the theoretical weight gap range and the physical specification limit range that the newly added individual pallet must simultaneously meet. Only weight values falling into this range can make the sliding combination expand into a legal target combination. This calculation process integrates the dual constraints of business rules and physical reality to ensure that the generated suggestions not only meet the counterweight target but also have physical feasibility.
[0166] In this embodiment, the system performs double boundary checks on each constructed sliding combination: first, it calculates the theoretical weight gap range based on the difference between the upper and lower limits of the total weight range of the combination and the total weight of the current sliding combination; then, it takes the intersection of this gap with the physical specification range of the single fruit weight range; only when the intersection is not empty is the sliding combination considered to have a valid solution for filling in; otherwise, it is discarded, thereby ensuring that every suggestion output can withstand engineering verification.
[0167] Optionally, the weight intersection interval R is filled in to satisfy the following formula:
[0168] .
[0169] in, This represents the lower limit of the total weight range for the combination. This indicates the upper limit of the total weight range for the combination. This represents the sum of the weights of all trays in the current sliding combination. This indicates the lower limit of the range for the weight of a single fruit. This indicates the upper limit of the single fruit weight range. The function is used to take the larger value between the theoretical gap lower limit and the single fruit size lower limit to ensure that no constraint is violated. The function is used to take the smaller value between the theoretical gap limit and the single fruit specification limit to prevent overweight or oversized products.
[0170] It should be noted that the physical meaning of this formula lies in solving the common solution space of the two conditions "how much more weight is needed" and "how much weight can the fruit weigh". It eliminates invalid solutions that can mathematically reach the total weight but the individual fruits are too heavy or too light, and also eliminates spurious solutions that the individual fruits are qualified but the total weight is still not up to standard, thus ensuring the absolute validity of the recommended weight.
[0171] As an example, continuing with the aforementioned durian sorting scenario, for the sliding combination {T004, T008}, its total weight S = 5850g, the total weight range of the combination is [16050, 16200], and the single fruit range is [1600, 5000]. Substituting into the formula, the theoretical gap is calculated to be [10200, 10350]. The intersection with the single fruit range [1600, 5000] is empty. Based on this, the system determines that the combination cannot be grouped by adding single fruits. However, when the unassigned set contains five trays and the total weight S = 13400g, the calculated theoretical gap is [2650, 2800], and the intersection with the single fruit range is [2650, 2800], which is the effective weight intersection range for adding single fruits.
[0172] Based on the above steps, the vague perception of "lack of fruit" is transformed into a precise range of weight values. This avoids giving incorrect suggestions that exceed physical limits and ensures that every effective suggestion can directly guide the on-site material loading operation.
[0173] S703. Merge overlapping weight intersection ranges to generate a suggested weight range for the next order, serving as a feeding aid.
[0174] Among them, merging overlap refers to merging multiple sliding combination calculations of supplementary weight intervals that have intersection or adjacency relationships on the numerical axis into a continuous wide interval to reduce the number of discrete suggestion points; the next single-product suggested weight interval is the final guidance information presented to the operator after aggregation processing. It expresses the common requirements of all potential grouping opportunities for the new product weight in a concise and intuitive way.
[0175] In this embodiment of the application, after collecting all valid overlap intervals of the added weight, the system first sorts them in ascending order according to the lower bound of each interval, and then scans whether there is overlap or gap less than a preset threshold between adjacent intervals. If there is, they are merged into a larger continuous interval, and the merged interval list is output to the human-computer interaction interface as the final suggestion result for the operator to refer to and select the fruit to be fed.
[0176] As an example, in durian sorting operations, if the system calculates three valid replenishment intervals [2650, 2800], [2700, 2850], and [2750, 2900] for different 5-fruit sliding combinations, and generates a unified suggested weight interval [2650, 2900] after sorting and merging, the operator only needs to select one durian within this range, without needing to care about which existing pallet it is paired with.
[0177] Furthermore, while performing interval merging, the system records all original sliding combination identifiers covered by each merged interval, and after the merging is completed, selects no more than a preset number (e.g., 4) of representative combinations and stores them in the suggestion data structure. The representative combinations are used to indicate which existing pallets will be grouped with the pallets added to the corresponding supplementary weight intersection interval. When the operator clicks or hovers on the interface to view a suggested weight interval, the system immediately displays the existing pallet numbers or weight details contained in these representative combinations, so that the operator can intuitively understand the combination logic behind the suggestions.
[0178] As an example, in durian sorting operations, if the system calculates three valid addition ranges [2650, 2800], [2700, 2850], and [2750, 2900] for different combinations of 5 fruits, and after sorting and merging, generates a unified suggested weight range [2650, 2900]; after the operator sees the suggested weight "2650-2900g" on the interface, clicks to view details, and the system pops up a prompt box displaying: "Adding this weight of fruit will group with the following trays: ① T001+T002+T003+T004+T005; ② T001+T002+T003+T004+T006...", the operator can confirm the reliability of the suggestion after seeing the familiar tray numbers and proceed with loading.
[0179] Based on the above technical solution, this embodiment transforms abstract multidimensional combination constraints into intuitive, reliable and safe material loading assistance prompts through a series of refined processing steps such as constructing sliding combinations, calculating the intersection of supplementary weights, merging intervals and retaining representative combinations. This not only effectively shortens the blind waiting time of manual material loading and improves the production line cycle time, but also enhances the operator's trust in the system and collaboration efficiency through interpretable design and control decoupling mechanism, realizing the organic integration of algorithmic intelligence and human experience.
[0180] Example 8:
[0181] In one possible implementation of the embodiments of this application, such as Figure 8 As shown, state persistence and restart recovery can be further refined, which can be implemented through the following S801 and S802, and will be explained in detail below:
[0182] S801. In response to a change in the state of an unassigned pallet, generate an immutable snapshot containing the identity, weight data, sorting channel, action stage, and assignment group identifier, and write it to local storage in a delayed merge manner.
[0183] Among them, immutable snapshots refer to read-only data objects that record the complete business state of the tray at a specific moment. Once the content is generated, it cannot be modified in place. It can only be overwritten and updated by generating a new version snapshot. This feature ensures the traceability of historical state and data consistency. Delayed merge write is an IO optimization strategy for high-frequency state changes. It refers to caching multiple state update requests within a short time window in memory and only persisting the latest state at the end of the window to the local storage medium, thereby avoiding frequent read and write impacts on the storage device.
[0184] In this embodiment, the system monitors all critical state change events of unassigned trays. Whenever any change occurs in the tray's identity, weight data, target sorting channel, actuator action stage, or its assigned group identifier, a new snapshot object is immediately constructed in memory. This object fully encapsulates the real-time data of the above five dimensions. At the same time, the system maintains a write buffer queue based on the tray's identity. If the same tray triggers multiple state changes consecutively within a preset merging time window, only the snapshot object corresponding to the last change is retained for physical write operations, and the remaining intermediate snapshots are automatically discarded. This significantly reduces disk I / O overhead while ensuring eventual data consistency.
[0185] Based on the above steps, the synergy between immutable data structures and delayed write strategies ensures accurate persistence and tamper-proof capability of the tray's state throughout its entire lifecycle, while effectively avoiding the lifespan degradation and performance bottlenecks of embedded storage devices caused by high-frequency state updates. This provides a solid data foundation for the stable operation of the system on resource-constrained industrial tablets.
[0186] S802. In response to a system restart, load an immutable snapshot, remap the configuration references of the sorting channel, and restore the current allocation group state of the sorting channel and any unfinished tasks related to state compensation based on the immutable snapshot.
[0187] Among them, remapping the configuration reference of the sorting channel refers to the process of dynamically associating and binding the channel logical identifier recorded in the snapshot with the physical channel configuration object in the current runtime environment after loading the historical snapshot. This is used to solve the problem of static reference invalidation caused by configuration file updates, channel start-up and shutdown, or hardware topology adjustments. Recovering incomplete tasks specifically refers to re-incorporating the tray marked as pending confirmation in the snapshot into the anomaly compensation process so that it can continue to receive valid runtime timing and key node verification, instead of being incorrectly initialized as a new tray or directly discarded.
[0188] In this embodiment, when the system starts, it first reads all the latest immutable snapshot records from local storage and reconstructs the set of unallocated trays and their associated allocation group contexts in memory. Then, it traverses the channel identifiers in each snapshot and searches for a matching physical channel instance in the currently loaded channel configuration table. If a match is found, a runtime reference link is established; if not, the snapshot is marked as orphan data and an alarm log is recorded without blocking the startup process. After the mapping is completed, the system scans all snapshots with non-empty allocation group identifiers, restores the WAITING or STOP state of the corresponding channel and the list of bound trays. In particular, for snapshots with uncertain or pending confirmation action phases, an associated valid running timer instance is automatically created and registered in the compensation monitoring queue, so that these trays can immediately continue the previous verification logic after the production line resumes operation.
[0189] Based on the above steps, by configuring dynamic remapping and task breakpoint resume mechanism, the system has achieved lossless self-healing capability after unexpected interruption, ensuring data continuity and business robustness of sorting operations in complex industrial environments, and significantly improving equipment availability and production data reliability.
[0190] Based on the above technical solutions, this embodiment optimizes IO performance while ensuring data persistence security by constructing an immutable snapshot and delayed merge write mechanism. By configuring remapping and unfinished task recovery logic, it ensures that the system can accurately restore the business scene and compensation tasks before the interruption after restarting, forming a complete data closed loop from status recording to fault recovery, providing a reliable guarantee for the long-term stable operation of the fruit sorting system in the industrial field.
[0191] Example 9:
[0192] like Figure 9 As shown, this embodiment provides a fruit sorting system based on pallet identity tracking. This system is applied to a cyclical fruit conveying and sorting scenario, and achieves intelligent control of the entire sorting process through a modular software architecture. The system includes a data acquisition module 901, a combined search module 902, a mutually exclusive allocation module 903, and a status determination and compensation module 904.
[0193] The data acquisition module 901 is used to acquire the identity, weight data, and pallet index of currently unassigned pallets.
[0194] Specifically, this module constitutes the data entry point for the system's interaction with the physical world. In the illustrated software architecture, it corresponds to the core function of the acquisition layer. Through parallel connections to hardware devices such as the pre-weighing QR code reader, industrial scale, and workstation reader, it receives and parses asynchronous physical signal streams in real time. It precisely binds and structures discrete scanning events with weight readings, thereby establishing a dynamically updated and uniquely identified pool of unassigned pallet data. For example, in durian sorting, when the pre-weighing reader sequentially reads the QR codes of pallets T001 to T008 and the industrial scale simultaneously reports the corresponding net weight, the data acquisition module 901 immediately transforms these physical entities into digital objects containing unique identifiers, precise weight values, and internal indexes, providing a reliable data foundation for subsequent decisions. Through this module's standardized data cleaning and binding mechanism, the problem of data source contamination caused by hardware signal jitter or communication delays is effectively eliminated, ensuring the accuracy and real-time nature of the entire sorting system's decision-making process.
[0195] The combination search module 902 is used to perform a global combination search on all unassigned trays based on multidimensional combination constraints to generate a candidate combination set; the multidimensional combination constraints include the single fruit weight range, the combination quantity range, and the combination total weight range.
[0196] Specifically, this module is the core of the system's intelligent decision-making. It receives all unallocated tray data output by the data acquisition module 901, moving beyond the limited local view of sequential accumulation within a single channel. Instead, it treats all available trays as a unified resource pool, performing a global feasibility enumeration under multi-dimensional constraints to filter out all potential combination schemes that simultaneously meet the targets for single fruit specifications, combination quantity, and total weight. For example, for the aforementioned eight durian trays, the combination search module 902, based on preset constraints such as single fruit weight of 1600g-5000g, six combinations, and total weight of 16050g-16200g, quickly identifies the legal candidate combination composed of T001, T002, T003, T005, T006, and T007 globally, without missing the optimal solution due to the tray arrival order. This module's global search mechanism breaks the limitations of traditional local greedy strategies, enabling multiple idle channels to concurrently acquire the optimal combination from the same complete candidate pool, significantly reducing the generation of dead combinations and improving channel utilization.
[0197] The mutual exclusion allocation module 903 is used to select target combinations with non-overlapping pallet indices from the candidate combination set, and generate allocation group identifiers for each target combination to isolate sorting batch data of the same sorting channel at different times, so as to allocate the target combination to an idle sorting channel.
[0198] Specifically, this module undertakes the dual responsibilities of resource scheduling and data isolation. Based on a preset priority strategy, it selects several mutually exclusive target combinations from the candidate set, ensuring that each pallet is allocated to only one channel at a time. Simultaneously, it generates a globally unique allocation group identifier for each selected combination, binding this identifier to the target channel and all pallets within the combination. This logically distinguishes independent packaging batches processed by the same physical channel at different times. For example, when channel 7 is idle, the mutual exclusion allocation module 903 selects the combination containing T001, T002, T003, T005, T006, and T007, generates an allocation group identifier A1 for it, and binds it to channel 7. At this time, T004 and T008 remain in the unallocated set awaiting subsequent scheduling because their indices do not overlap but they have not yet met the grouping condition. Through this module's mutual exclusion selection and batch isolation mechanism, resource security during concurrent multi-channel allocation is guaranteed, while the risk of data confuse between batches during asynchronous processing is avoided.
[0199] The status determination and compensation module 904 is used to respond to the arrival of the pallet in the target combination at the corresponding sorting channel. Based on the identity identifier, the action stage of the actuator corresponding to the sorting channel, and a multi-dimensional time window including the push-in protection period and the abnormal confirmation window, it determines the actual push-in status of the pallet and performs abnormal interruption status compensation based on the actual push-in status.
[0200] Specifically, this module forms a closed-loop verification defense line on the execution side. By connecting to the PLC actuator and the readers at each workstation, it senses the physical position and movement progress of the pallets in real time. It uses a multi-dimensional time window to filter duplicate signals and reserves an observation period after the action is completed to verify the physical arrival of the goods. Especially when encountering abnormal interruptions such as line stoppages that cause uncertainty in the status, it can activate a dynamic compensation mechanism based on effective running time and secondary verification of key nodes to ensure that the software record always maintains strict consistency with the physical position. For example, when pallet T001 arrives at channel 7, the module ignores duplicate scanning during the push-in protection period and determines success after verifying no evidence of reverse missed push within the anomaly confirmation window. If pallet T004 encounters an emergency stop during the push-in process, it accurately determines whether it was a missed push or successfully entered the channel by checking if reader 1 scans it again after the line resumes. Through this module's multi-dimensional status determination and anomaly compensation mechanism, the inaccuracy problem easily caused by relying solely on control command return values under complex industrial conditions is effectively solved, significantly improving the fault tolerance and operational reliability of the sorting system.
[0201] Based on the above technical solutions, a complete fruit sorting system architecture was constructed through the collaborative work of various modules, encompassing data perception, global decision-making, resource scheduling, and execution closed loop. This architecture not only achieved the same technical effects as the method side—namely, eliminating dead combinations and improving multi-channel concurrent utilization through global multi-constraint combination search and mutual exclusion allocation—but also isolated batch data through allocation group identifiers and ensured strict consistency between software state and physical location under abnormal operating conditions such as line stoppages and mechanical delays through multi-dimensional time windows and state compensation mechanisms. This comprehensively improved the intelligence level and industrial site adaptability of the fruit sorting system.
[0202] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0203] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
Claims
1. A fruit sorting method based on pallet identification tracking, characterized in that, include: Retrieve the identity, weight data, and pallet index of currently unassigned pallets; A global combination search is performed on all the unassigned trays based on multidimensional combination constraints to generate a candidate combination set; the multidimensional combination constraints include the single fruit weight range, the combination quantity range, and the combination total weight range. Select target combinations from the candidate combination set where pallet indices do not overlap, and generate allocation group identifiers for each target combination to isolate sorting batch data of the same sorting channel at different times, so as to allocate the target combination to an idle sorting channel; In response to the arrival of a pallet in the target combination at the corresponding sorting channel, the actual push-in state of the pallet is determined based on the identity identifier, the action phase of the actuator corresponding to the sorting channel, and a multi-dimensional time window including a push-in protection period and an anomaly confirmation window, and anomaly interruption state compensation is performed based on the actual push-in state.
2. The method according to claim 1, characterized in that, The global combinatorial search of all unassigned trays based on multidimensional combinatorial constraints includes: In response to a triggering event, the global combination search is performed on all the unassigned pallets; the triggering event includes at least one of the following: new unassigned pallet enqueuing, sorting channel release, multidimensional combination constraint change, or counterweight offset adjustment. In the global combined search, the unassigned pallets are arranged in non-descending order according to the weight data, and a prefix sum array is constructed based on the arrangement results; Based on the prefix sum array, the number of combinations range, and the total weight of combinations range, a set of candidate combinations that satisfy the multidimensional combination constraints is generated by depth-first traversal.
3. The method according to claim 2, characterized in that, The process of generating the candidate combination set that satisfies the multidimensional combination constraints through depth-first traversal based on the prefix sum array, the combination quantity range, and the combination total weight range includes: In the current search branch of the depth-first traversal, determine the number of selected pallets, the current cumulative weight, and the remaining number of pallets to be selected; If the sum of the current cumulative weight and the total weight of the lightest pallets corresponding to the remaining number of pallets to be selected is greater than the upper limit of the total weight range of the combination, then the current search branch is cut off. If the sum of the current cumulative weight and the total weight of the heaviest pallet corresponding to the remaining number of pallets to be selected is less than the lower limit of the combined total weight range, then the current search branch is cut off. If the number of selected pallets reaches the requirement of the combination quantity range, and the current cumulative weight falls within the combination total weight range, then the pallet combination corresponding to the current search branch is registered as a candidate combination in the candidate combination set.
4. The method according to claim 2, characterized in that, The step of selecting target combinations from the candidate combination set where tray indices do not overlap includes: The candidate combinations in the candidate combination set are sorted in ascending order of tray quantity and then in ascending order of total combination weight. Initialize the used tray index set and traverse the candidate combinations in sorted order; If the intersection of the tray index of the currently traversed candidate combination and the set of used tray indexes is empty, then the currently traversed candidate combination is determined as the target combination, and its tray index is merged into the set of used tray indexes. The traversal stops when the number of the determined target combinations reaches the number of idle sorting channels.
5. The method according to claim 1, characterized in that, The determination of the actual push-in status of the pallet based on the identity identifier, the action phase of the actuator corresponding to the sorting channel, and a multi-dimensional time window including a push-in protection period and an anomaly confirmation window includes: In response to the reading node of the sorting channel obtaining the identity identifier, the system verifies whether the target sorting channel corresponding to the identity identifier matches the reading node; If a match is found and the action phase of the actuator corresponding to the sorting channel is in the push-in execution or within the push-in protection period, then the repeatedly acquired identity identifier is ignored. If the action phase of the actuator corresponding to the sorting channel is completed, the completion time is recorded and the exception confirmation window is activated. If the identity identifier is not detected in the abnormal recycling channel within the abnormal confirmation window, the actual push status is determined to be a successful push.
6. The method according to claim 5, characterized in that, The state compensation for abnormal interruption based on the actual push-in state includes: If the action phase of the actuator corresponding to the sorting channel is in an uncertain state due to production line interruption, the corresponding pallet will be marked as pending confirmation and an effective operation timer will be started; the effective operation timer is only accumulated when the entire line is running and the key reading nodes are online; If the key reading node obtains the identity identifier again before the effective running time reaches the preset threshold, it is determined to be a missed push, and the corresponding tray is restored to the waiting allocation state. If the effective running time reaches the preset threshold and the key reading node does not obtain the identity identifier again, then the actual push status is determined to be a successful push.
7. The method according to claim 1, characterized in that, The method further includes: When the number of unassigned pallets or the weight data does not meet the multidimensional combination constraint, for each allowed number in the combination quantity range, extract the unassigned pallets less than the upper limit of the combination quantity range to construct a sliding combination; Based on the total weight range of the combination and the weight range of the single fruit, calculate the intersection range of the supplementary weights that makes the sliding combination satisfy the multidimensional combination constraints; The overlapping weight intersection intervals are merged to generate the next suggested weight interval for the next order, serving as a feeding aid.
8. The method according to claim 7, characterized in that, The merged overlapping weight intersection intervals generate the next single-fruit suggested weight interval, including: The valid intersecting intervals of the supplemented weights are sorted by their lower bounds, and the intersecting intervals of the supplemented weights that overlap with each other are merged. A preset number of representative combinations are reserved for each merged supplementary weight intersection interval. These representative combinations are used to indicate which existing pallets will be grouped with the pallet added to the corresponding supplementary weight intersection interval.
9. The method according to claim 1, characterized in that, The method further includes: In response to a change in the state of the unassigned pallet, an immutable snapshot containing the identity identifier, the weight data, the sorting channel, the action stage, and the assignment group identifier is generated and written to local storage in a delayed merge manner; In response to a system restart, the immutable snapshot is loaded, and the configuration references for the sorting channel are remapped; The current allocation group state of the sorting channel is restored based on the immutable snapshot, and unfinished tasks related to the state compensation are restored.
10. A fruit sorting system based on pallet identification tracking, characterized in that, The system includes: The data acquisition module is used to acquire the identity, weight data, and pallet index of currently unassigned pallets; The combination search module is used to perform a global combination search on all the unassigned trays based on multi-dimensional combination constraints to generate a candidate combination set; the multi-dimensional combination constraints include a single fruit weight range, a combination quantity range, and a combination total weight range. The mutual exclusion allocation module is used to select target combinations with non-overlapping pallet indices from the candidate combination set, and generate an allocation group identifier for each target combination to isolate sorting batch data of the same sorting channel at different time periods, so as to allocate the target combination to an idle sorting channel. The status determination and compensation module is used to respond to the arrival of the pallet in the target combination at the corresponding sorting channel, and to determine the actual push-in status of the pallet based on the identity identifier, the action stage of the actuator corresponding to the sorting channel, and a multi-dimensional time window including the push-in protection period and the abnormal confirmation window, and to perform abnormal interruption status compensation based on the actual push-in status.
