A product length-based material distribution method, system and storage medium
By optimizing the material sorting method based on product length and using machine vision technology, combined with MicroPython embedded board control, the problem of high error rates in material sorting and barcode scanning on high-speed production lines has been solved, achieving accurate material sorting and barcode scanning, reducing hardware costs, and making it suitable for small and micro enterprises.
Patent Information
- Application Number
- CN202510725753.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-06-03
AI Technical Summary
Existing technologies suffer from high error rates in material sorting and barcode scanning on high-speed production lines, high hardware costs, and are not suitable for small and micro enterprises.
A product length-based sorting method is adopted, which uses two detection units to detect whether the product is in place and the duration of the sorting. The classification model is optimized by combining machine vision technology, and the sorting system is controlled by a MicroPython embedded board to achieve accurate sorting and barcode scanning.
It improves the accuracy of material sorting and barcode scanning, reduces the error rate, and lowers hardware costs, making it suitable for small and micro-sized enterprises.
Smart Images

Figure CN120288443B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automatic control technology, and in particular to a material sorting method, system and storage medium based on product length. Background Technology
[0002] In recent years, production lines have become increasingly faster, and product jams and accidental triggering frequently occur during product sorting and material distribution, leading to counting errors. This design method eliminates the need for specialized technical expertise; various input and output signals can be quickly connected according to the drawings. This creates favorable conditions for the rapid implementation and completion of projects.
[0003] Given the increasing demands of high-speed production lines and the growing need for barcode tracking in manufacturing enterprises, this paper presents a simplified material sorting method. This method solves both the problem of single-batch barcode scanning and the error-prone material sorting, saving hardware costs. No internal structure knowledge is required; simply insert the corresponding signal lines according to the design method. Furthermore, this design addresses the common problem of incorrect material sorting caused by the lack of spacing between products in high-speed environments. It also solves the problem of scanning by quantity by employing a one-time overlay buffer method for accurate barcode scanning and association with the sorted boxes. This innovation is compatible, requiring only the addition of a cylinder and two photoelectric sensors to achieve accurate material sorting. This innovation not only solves the material sorting problem on the production line but also addresses errors such as recursive errors after barcode scanning input, reducing the error rate.
[0004] While numerous designs exist on the market, most fail to integrate seamlessly with barcode scanning devices or are unsuitable for production line digital data acquisition. They often require additional barcode triggering, necessitating extensive wiring and significantly increasing costs. This makes them unsuitable for small businesses or individuals unfamiliar with electronics, further increasing on-site labor costs. Therefore, this solution aims to address the accuracy of material distribution and the timing of barcode triggering. Summary of the Invention
[0005] In order to provide a method, system and storage medium for efficient and accurate product sorting based on length, this application provides a product length-based sorting method, system and storage medium.
[0006] Firstly, this application provides a material sorting method based on product length, employing the following technical solution:
[0007] A material splitting method based on product length, comprising:
[0008] S100, Build a material distribution system; the material distribution system includes a feeding module, a distribution module and at least two distribution tracks connected in sequence;
[0009] The first detection unit is configured to detect whether the product reaches the channeling module, and the second detection unit is configured to detect the product on one side of the feeding module.
[0010] S200, starting the feeding module to feed the product at a specified speed, and starting the first detection unit and the second detection unit;
[0011] S300, judging whether the product reaches the first detection unit, if yes, entering step S400;
[0012] S400, judging whether the second detection unit continuously detects the product within a specified duration and detects that the product does not exist when the specified duration arrives, if yes, entering S500 when the specified duration arrives, otherwise triggering a backup dispensing procedure; S500, triggering a dispensing action on the product and recording.
[0013] S500, triggering a dispensing action on the product and recording.
[0014] By adopting the above technical scheme, two detection units are adopted in the present application, the first detection unit is arranged at the channeling module which is the buffer area of dispensing to detect whether the product is in place, the second detection unit is arranged on the side of the feeding module in the advancing direction, when the product continuously enters the buffer area and reaches the position of the second detection unit and continuously exists within a specified duration and the first detection unit also detects, dispensing is performed, which can avoid the false triggering or inaccurate repeated counting of the original counting mode; in addition, when the second detection unit detects that the product exists for more than the specified duration, it can be judged that the product changes in type, and the backup dispensing procedure is started to avoid error dispensing.
[0015] Optionally, the triggering of the backup dispensing procedure comprises:
[0016] S401, acquiring a time point at which the second detection unit detects the existence of the product and a time point at which the first detection unit detects the nonexistence of the product for the first time;
[0017] S402, judging whether the following condition is met , if yes, entering step S500, otherwise entering step S403;
[0018] S403, judging whether the specified duration arrives, if yes, entering step S404;
[0019] S404, driving the second detection unit to move in a direction opposite to the product, and at a time point Stop and reset in time;
[0020] S405, calculate and obtain the product length of the product, and return to step S200.
[0021] By adopting the above technical solution, two scenarios are considered: shorter product types and longer product types. For shorter product types, the following requirements are met: Under the given conditions, proceed directly to step S500, where a robotic arm is used for gripping and sorting, saving overall sorting time and making it suitable for scenarios with high product feeding density; for longer product types, within a specified duration... Upon arrival, in order to obtain the actual length of the product and improve the accuracy of subsequent material sorting, and at the same time to improve sorting efficiency, the second detection unit is driven to move relative to the product feeding direction to quickly obtain the product length.
[0022] Optionally, the specified duration The configuration methods include;
[0023]
[0024] in, To specify the ideal duration, This is a correction factor that is positively correlated with the specified speed.
[0025] By adopting the above technical solution, since the processes of gripping, sorting, and delivery require time, millisecond-level configurations are possible. Step S500 can be triggered earlier to further improve sorting efficiency and reduce the damage caused by problems such as sorting jamming.
[0026] Optionally, S500, the process of triggering and recording the material distribution action of the product, includes:
[0027] S51, determine the track to which the product belongs based on the product length;
[0028] S52, trigger the barcode scanning record, and dynamically bind the data to the product's track number and packaging box number;
[0029] S53, the channel module is activated to send the product to the corresponding channel track.
[0030] By adopting the above technical solution, existing machine vision technology can be used to optimize the product classification model. Adding a prominent mark related to the product length to the training images and sampled images helps to improve classification accuracy.
[0031] Optionally, the time interval between steps S52 and S53 is controlled to be 50-200ms.
[0032] By adopting the technical scheme, the preparation work before sending to the corresponding track can be quickly completed, the error propagation after scanning code recording is reduced, and the error rate is reduced.
[0033] Optionally, the system further comprises:
[0034] S600, determining whether the material is overdue or blocked, if so, triggering an audible and light alarm and pausing the production line, otherwise returning to step S200.
[0035] In a second aspect, the application provides a product length-based material distribution system, which adopts the following technical scheme:
[0036] A product length-based material distribution system, the material distribution system comprising a feeding module, a track distribution module and at least two track distribution tracks connected in sequence;
[0037] The track distribution module is provided with a first detection unit for detecting whether the product reaches the track distribution module, and one side of the feeding module is provided with a second detection unit for detecting the product;
[0038] Further comprising:
[0039] A control unit is configured to start the feeding module to transport the product at a specified speed, and start the first detection unit and the second detection unit;
[0040] The product reaches the first detection unit, and the second detection unit is continuously detected within a specified duration The product does not exist when it arrives at the specified duration If so, enter S500 when the specified duration arrives, otherwise trigger a backup material distribution program;
[0041] S500, triggering the material distribution action of the product and recording.
[0042] Optionally, the control unit is a MicroPython embedded board or an IO card.
[0043] By adopting the above technical scheme, the MicroPython embedded board is used to control the material distribution, and the PLC does not need to be additionally purchased, which can be used as an integrated material distribution module separated from the computer.
[0044] Optionally, the specified duration is dynamically configured through an external interface.
[0045] By adopting the above technical scheme, the specified duration can be adjusted at any time according to the actual situation, and the flexibility of the material distribution scheme is improved.
[0046] In a third aspect, the present application provides a storage medium, which adopts the technical scheme as follows:
[0047] A storage medium, which stores a program of the product length-based material distribution method according to any one of the above.
[0048] In summary, the present application has at least one of the following beneficial technical effects:
[0049] 1、The two detection units are adopted in the present application, the first detection unit is arranged at the buffer area of the material distribution, that is, the channel module, to detect whether the product is in place, the second detection unit is arranged on the side of the feeding module in the advancing direction, when the product continuously enters the buffer area and reaches the position of the second detection unit for a specified duration and the first detection unit also detects, the material distribution is performed, so that the original counting mode is avoided to be triggered or triggered repeatedly; in addition, when the second detection unit detects that the product exceeds the specified duration, it is judged that the product changes in type, and a standby material distribution program is started to avoid incorrect material distribution.
[0050] 2、The present application considers two cases, one is a shorter type of product, and the other is a longer type of product, for the shorter type of product, the condition is met, the mechanical hand clamping sorting mode is directly entered into step S500, so that the overall sorting time is saved, and the product feeding density is large; for the longer type of product, when the specified duration is reached, the actual length of the product is obtained to improve the accuracy of subsequent material distribution, and the second detection unit is driven to move relative to the product feeding direction to improve the sorting efficiency and quickly obtain the product length. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 is a flowchart of the product length-based material distribution method in the present application;
[0052] Figure 2 is a partial structure diagram of the material distribution system in the present application.
[0053] Reference signs: 1, feeding module; 2, channel module; 3, first detection unit; 4, second detection unit. DETAILED DESCRIPTION
[0054] The embodiments of the present application will be described in detail below, and examples of the embodiments are shown in the accompanying drawings.
[0055] In the description of the present specification, the description of the terms "certain embodiments", "one embodiment", "some embodiments", "illustrative embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the described embodiments or examples are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the described specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0056] The embodiments of the present application disclose a product length-based material distribution method, referring to Figure 1 and Figure 2 , comprising a product length-based material distribution method, comprising:
[0057] S100, building a material distribution system; the material distribution system comprises a feeding module 1, a channel distribution module 2 and at least two channel distribution tracks connected in sequence;
[0058] Wherein, the channel distribution module 2 is configured with a first detection unit 3 for detecting whether the product reaches the channel distribution module 2, and one side of the feeding module 1 is configured with a second detection unit 4 for detecting the product;
[0059] S200, starting the feeding module 1 to convey the product at a specified speed, and starting the first detection unit 3 and the second detection unit 4;
[0060] S300, judging whether the product reaches the first detection unit 3, if yes, entering step S400;
[0061] S400, judging whether the second detection unit 4 continuously detects the product within a specified duration and detects that the product does not exist when the specified duration is reached, if yes, entering S500 when the specified duration is reached, otherwise triggering a standby material distribution program;
[0062] S500, triggering a material distribution action on the product and recording. The material distribution action can be bound with code scanning data, and specifically, an electromagnetic valve driven cylinder can be used to execute channel distribution.
[0063] By using the above technical solution, the electric eye can be used as two detection units in the present application, the first detection unit 3 can be set at the buffer area of the material distribution, that is, the channel distribution module 2, for detecting whether the product is in place, and the second detection unit 4 is set on the side of the feeding module 1 in the advancing direction, when the product continuously enters the buffer area and reaches the position of the second detection unit 4 for a specified duration And the first detection unit 3 also detects the time, that is, the material is separated, so as to avoid the original counting method of false triggering or triggering inaccurate repeated counting; in addition, the second detection unit 4 detects the product exceeding the specified duration to determine the product type change, and starts the standby separation program to avoid error separation. The driving channel module 2 can be driven by electromagnetic valve control, and the product is sent to the corresponding channel track entrance by driving the guide rail to move.
[0064] Optionally, the trigger standby separation program comprises:
[0065] S401, obtaining the time point when the second detection unit 4 detects the existence of the product And the time point when the first detection unit 3 detects the absence of the product signal ;
[0066] S402, judging whether the specified duration is reached If yes, step S500 is entered, otherwise step S403 is entered;
[0067] S403, judging whether the specified duration is reached If yes, step S404 is entered;
[0068] S404, driving the second detection unit 4 to move in the opposite direction of the product, and stopping and resetting at the time point ;
[0069] S405, calculating the product length of the product, and returning to step S200.
[0070] By adopting the above technical scheme, two cases are considered, one is the shorter type of product, and the other is the longer type of product. For the shorter type of product, the condition of is met, and the mechanical hand clamping separation mode is directly entered into step S500, which can save the overall separation time and is suitable for the scene with large product feeding density. For the longer type of product, when the specified duration is reached, the actual length of the product is obtained to improve the subsequent separation accuracy, and the second detection unit 4 is driven to move in the opposite direction of the product feeding direction to quickly obtain the product length, so as to improve the separation efficiency.
[0071] Optionally, the configuration method of the specified duration Comprises:
[0072]
[0073] Among them, The specified ideal duration, The correction factor is positively correlated with the specified speed.
[0074] By adopting the above technical solution, since the processes of gripping, sorting, and delivery require time, millisecond-level configurations are possible. Step S500 can be triggered earlier to further improve sorting efficiency and reduce the damage caused by problems such as sorting jamming.
[0075] Optionally, S500, the process of triggering and recording the material distribution action of the product, includes:
[0076] S51, determine the track to which the product belongs based on the product length;
[0077] S52, trigger the barcode scanning record, and dynamically bind the data to the product's track number and packaging box number;
[0078] S53, the channel module 2 is activated to send the product to the corresponding channel track.
[0079] By adopting the above technical solution, existing machine vision technology can be used to optimize the product classification model. Adding a prominent mark related to the product length to the training images and sampled images helps to improve classification accuracy.
[0080] In this invention, the classification model can employ a Convolutional Neural Network (CNN), which can automatically extract data features through local connectivity, weight sharing, and spatial downsampling. This significantly reduces the number of parameters while improving the robustness of the model. Automatic feature extraction reduces the workload of manually designing features, and it has a certain degree of invariance to translation, rotation, and scaling. Parameter sharing greatly reduces computational complexity.
[0081] The convolutional layer of a classification model is used to extract local features from the input data. A convolutional kernel (filter) slides across the input data for a small weight matrix (such as 3×3 or 5×5) to calculate the weighted sum of local regions. The stride reflects the size of each movement of the convolutional kernel (such as 1 or 2). The larger the stride, the smaller the output size. Zeros are padded at the edges of the input data (such as same padding to keep the output size unchanged). Each convolutional kernel generates a feature map, and multiple convolutional kernels can extract different features.
[0082] The training process of a convolutional neural network revolves around data, model structure, and optimization strategies. The core of the process is to gradually capture data features by iteratively adjusting parameters. At the beginning of training, a labeled data set needs to be prepared and preprocessed, including normalizing pixel values to the range of 0-1 to accelerate convergence, and performing data augmentation operations such as random rotation, cropping, or flipping on images. This not only expands the limited amount of data, but more importantly, forces the network to learn rotation and translation invariance, improving the model's generalization ability. When constructing the network architecture, the convolutional layer automatically extracts spatial features through the characteristics of local receptive field and weight sharing, and introduces nonlinearity with the ReLU activation function. The pooling layer gradually reduces the resolution of the feature map to expand the receptive field, and the fully connected layer finally maps high-order features to classification results.
[0083] Parameter initialization usually uses the Xavier or He method to adjust the initial weight range according to the number of input and output neurons, avoiding the premature disappearance or explosion of gradients in shallow networks. In the forward propagation stage, after the input data is transformed by each layer to obtain the prediction result, the difference between the predicted value and the true label is quantified by the cross-entropy loss function. At this time, the backpropagation algorithm starts to calculate the gradient of the loss with respect to the parameters layer by layer. Optimizers such as stochastic gradient descent (SGD) or Adam use these gradients to update the weights, where the momentum term is designed to smooth the parameter update trajectory, and the adaptive learning rate mechanism assigns different update amplitudes to different parameters.
[0084] The learning rate, as a key hyperparameter that controls the step size of parameter updates, is often dynamically adjusted using cosine annealing or stage-based decay strategies. In the early stage, a larger step size is used to quickly approach the optimal region, and in the later stage, fine-tuning is used to avoid oscillation. To prevent the network from relying too much on local neurons, the Dropout technique randomly masks some neurons during forward propagation, forcing the remaining neurons to learn robust features collaboratively. The batch normalization layer standardizes the distribution of intermediate layer activation values, alleviating the gradient vanishing problem while providing a slight regularization effect.
[0085] During the training process, the performance of the training set and the validation set needs to be continuously monitored. When the validation loss does not improve for several consecutive rounds, the early stopping mechanism is triggered to prevent overfitting. The trained model needs to be evaluated on an independent test set to assess its generalization performance. Through the confusion matrix, the recognition effect of each class can be analyzed. The model tuning stage may involve adjusting hyperparameters such as convolution kernel size, network depth, and regularization strength. The entire process presents a spiral optimization feature, and the effects of different configurations need to be repeatedly verified. Before final deployment, error samples are visualized for analysis, and the convolution layer activation pattern is observed to diagnose the reasonableness of feature extraction, forming a complete closed loop from data understanding to model improvement.
[0086] The input data of the classification model is processed layer by layer through convolution, activation, pooling, and other operations, and finally the prediction result is output,
[0087] Optionally, the time interval between step S52 and step S53 is controlled to be 50-200 ms.
[0088] By adopting the technical scheme, the preparation work before sending to the corresponding split track can be quickly completed, the error propagation after scanning code recording is reduced, and the error rate is reduced.
[0089] Optionally, it further comprises:
[0090] S600, if the material is judged to be overdue or blocked, triggering an audible and light alarm and pausing the production line, otherwise returning to step S200.
[0091] The embodiment of the application also discloses a product length-based material splitting system, which comprises a feeding module 1, a split module 2 and at least two split tracks connected in sequence.
[0092] The split module 2 is provided with a first detection unit 3 for detecting whether the product reaches the split module 2, and one side of the feeding module 1 is provided with a second detection unit 4 for detecting the product.
[0093] It further comprises:
[0094] A control unit is configured to start the feeding module 1 to feed the product at a specified speed, and start the first detection unit 3 and the second detection unit 4.
[0095] The control unit is configured to cyclically judge whether the product reaches the first detection unit 3, and judge whether the second detection unit 4 continuously detects the product within a specified duration and detects that the product does not exist when the specified duration is reached, if so, entering S500 when the specified duration is reached, otherwise triggering a backup material splitting program.
[0096] S500, triggering the material splitting action of the product and recording.
[0097] Optionally, the control unit is a MicroPython embedded board or an IO card.
[0098] By adopting the technical scheme, the MicroPython embedded board is used to control the material splitting, and the PLC does not need to be additionally purchased, so that the integrated material splitting module can be separated from the computer.
[0099] Optionally, the specified duration is dynamically configured through an external interface.
[0100] By adopting the technical scheme, the specified duration can be adjusted at any time according to actual conditions, and the flexibility of the material splitting scheme is improved.
[0101] The embodiment of the present application also discloses a storage medium, which stores the product length-based material distribution method, system and program of any one of the above.
[0102] Although the embodiments of the present application have been shown and described above, it should be understood by those skilled in the art that the above embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A product length-based dispensing method, characterized by, Comprising: S100, building a distribution system; the distribution system comprises a feeding module (1), a channeling module (2) and at least two channeling tracks connected in sequence; Wherein, the channeling module (2) is configured with a first detection unit (3) for detecting whether the product reaches the channeling module (2), and one side of the feeding module (1) is configured with a second detection unit (4) for detecting the product; S200, starting the feeding module (1) to transport the product at a specified speed, while starting the first detection unit (3) and the second detection unit (4); S300, cyclically judging whether the product reaches the first detection unit (3), if yes, entering step S400; S400, determining whether the product is continuously detected by the second detection unit (4) for a specified duration S500, determining whether the product is continuously detected by the second detection unit (4) for a specified duration S400, determining whether the product is continuously detected by the second detection unit (4) for a specified duration S500, triggering the distribution action of the product and recording; The trigger standby distribution program comprises: S401, obtaining a time point at which the second detection unit (4) detects the presence of the product and a time point at which the first detection unit (3) detects the absence of the product ; S402, judge whether the condition is satisfied If yes, go to step S500, otherwise go to step S403. S403, loop judging the specified duration whether the destination is reached, if yes, go to step S404; S404, driving the second detection unit (4) to move in a movement direction opposite to the product, stopping and resetting when reaching a time point ; S405, calculating the product length of the product, and returning to step S200; the specified duration The configuration method includes; ; wherein, is a specified ideal duration, is a correction factor positively correlated with the specified speed.
2. The product length-based dividing method according to claim 1, wherein The process of S500, triggering the distribution action of the product and recording, comprises: S51, determining the channeling track to which the product belongs in combination with the product length; S52, triggering code scanning recording, and dynamically binding data with the channeling track and packaging box number of the product; S53, starting the channeling module (2) to send the product to the corresponding channeling track.
3. The product length-based dividing method according to claim 2, wherein The time interval between step S52 and step S53 is controlled within 50-200ms.
4. The product length-based dividing method according to claim 2, wherein Further comprising: S600, judging whether the distribution is overtime or material jam, if yes, triggering sound and light alarm and pausing the production line, otherwise returning to step S200.
5. A product length based distribution system, characterized by, The distribution system comprises a feeding module (1), a channeling module (2) and at least two channeling tracks connected in sequence; Wherein, the channeling module (2) is configured with a first detection unit (3) for detecting whether the product reaches the channeling module (2), and one side of the feeding module (1) is configured with a second detection unit (4) for detecting the product; Further comprising: A control unit for starting the feeding module (1) to transport the product at a specified speed, while starting the first detection unit (3) and the second detection unit (4); cyclically determining whether the product is detected by the second detection unit (4) when the product arrives at the first detection unit (3) for a specified duration is not detected by the second detection unit (4) when the product arrives at the first detection unit (3) for the specified duration, S500 is entered if so, otherwise a backup distribution procedure is triggered. S500, triggering the distribution action of the product and recording; The trigger standby distribution program comprises: S401, obtaining a time point at which the second detection unit (4) detects the presence of the product and a time point at which the first detection unit (3) detects the absence of the product ; S402, judge whether the condition is satisfied , if yes, go to step S500, otherwise go to step S403; S403, loop judging the specified duration whether the destination is reached, if yes, go to step S404; S404, driving the second detection unit (4) to move in a movement direction opposite to the product, stopping and resetting when reaching a time point ; S405, calculating the product length of the product, and returning to step S200; the specified duration The configuration method includes; ; wherein, is a specified ideal duration, is a correction factor positively correlated with the specified speed.
6. The product length based dividing system according to claim 5, wherein, The control unit is a MicroPython embedded board or an IO card.
7. The product length based dividing system according to claim 5, wherein, the specified duration Dynamic configuration through external interface.
8. A storage medium, characterized by The program of the product length-based distribution method according to any one of claims 1-4 is stored.
Citation Information
Patent Citations
Material length detection method and detection device
CN108313407A
Material separation mechanism
CN111824710A