Automatic grading control system and method for royal jelly

By designing the royal jelly automated grading control system, using multi-sensors to synchronize data and using gradient enhancement decision tree model for grading, the problems of low efficiency and inconsistent standards in the existing technology are solved, and efficient and accurate royal jelly grading is achieved.

CN120146698AActive Publication Date: 2025-06-13BEIJING FENGZHEN SCIENTECH DEV

Patent Information

Application Number
CN202510329654.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-06-13
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

The existing royal jelly grading relies on manual operation, with low efficiency and inconsistent standards, and the single detection parameters cannot fully reflect quality differences and automation cannot be achieved.

Method used

Design a royal jelly automated hierarchical control system, including a data acquisition module, a control module and an execution module. The data acquisition module synchronously collects color, moisture and HDA content data through multiple sensors. The control module uses gradient enhancement decision tree to build a hierarchical model, and uses Bayesian optimization algorithm to tune to dynamically generate sorting execution parameters.

Benefits of technology

The rapid and accurate grading of royal jelly samples has been achieved, the grading efficiency and accuracy have been improved, and the grading accuracy can reach more than 99%, which significantly improves production efficiency and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146698A_ABST
    Figure CN120146698A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic grading control system and method for royal jelly, and belongs to the technical field of bee product processing automation. According to the system, color data, moisture data and HDA content data of royal jelly samples are synchronously obtained through a data acquisition module, and a control module performs normalization processing on multi-modal data, constructs a grading model based on a gradient lifting decision tree to generate a grade judgment result and dynamically generates sorting execution parameters. The execution module drives an execution mechanism to complete automatic sorting and packaging, and a man-machine interaction interface supports classification process visualization and parameter real-time adjustment. The method can be widely applied to an automatic grading assembly line of a royal jelly production enterprise, the grading efficiency and accuracy are remarkably improved, the product quality consistency is guaranteed, and data support is provided for subsequent quality tracing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of bee product processing, and particularly relates to an automated grading control system and method for royal jelly. Background Art

[0002] As a high-value bee product, the grading quality of royal jelly directly affects market circulation and consumer rights. Traditional royal jelly grading mainly relies on manual inspection. Inspectors judge the moisture content by observing the color and texture by hand, and comprehensively evaluate it in combination with the content of 10-hydroxy-2-decenoic acid (HDA) detected in the laboratory. This method has significant defects: Firstly, the efficiency of manual inspection is low, and the inspection of a single batch takes up to several hours, which is difficult to meet the needs of large-scale production; Secondly, the inspection results are significantly affected by subjective experience, and there are differences in the judgment of color depth and viscosity by different inspectors, resulting in inconsistent grading standards. Moreover, existing automated grading systems mostly make judgments based on a single index (such as moisture content), unable to comprehensively consider multi-dimensional quality characteristics, and lacking a dynamic model optimization mechanism, making it difficult to adapt to complex production scenarios. In view of the above problems, the present invention proposes an automated grading control system and method for royal jelly. Summary of the Invention

[0003] An object of an embodiment of the present invention is to solve at least the above problems and / or defects, and provide at least the advantages described hereinafter.

[0004] Another object of the present invention is to provide an automated grading control system and method for royal jelly to solve the following problems: The existing royal jelly grading relies on manual operation, resulting in low efficiency, inconsistent standards, and single detection parameters that cannot comprehensively reflect quality differences; random errors exist in manual sampling, data collection between multi-parameter detection devices is not synchronized, and it is difficult to associate traceability information, making automation impossible.

[0005] Therefore, the technical solution provided by the present invention is as follows: In a first aspect, an automated grading control system for royal jelly includes: A data acquisition module configured to synchronously acquire grade characteristic data of royal jelly samples, where the grade characteristic data includes color data, moisture data, and 10-hydroxy-2-decenoic acid HDA content data of royal jelly; A control module configured to receive the grade characteristic data of royal jelly samples collected by the data acquisition module, normalize a variety of grade characteristic data, then generate a grade determination result based on a variety of detection characteristic data, and dynamically generate sorting execution parameters according to the grade determination result; An execution module, which is configured to receive the sorting execution parameters of the control module and drive an actuator to automatically sort and package the original royal jelly corresponding to the royal jelly sample; A human-machine interaction interface, which is configured to display the grading process and receive real-time manual modification of the sorting execution parameters.

[0006] Preferably, in the automatic royal jelly grading control system, the control module includes: A real-time calibration unit, which is configured to perform deviation compensation on the detection data based on a preset reference sample; An exception handling unit, which is configured to trigger a re-inspection process for samples exceeding the threshold and record an exception log; A grading model unit, which is configured to construct a grading model through a gradient boosting decision tree according to the quality characteristic data; A storage unit, which is configured to store the grade characteristic data of the pre-stored royal jelly, the grade characteristic data of the real-time collected royal jelly samples, and the historical grade characteristic data of the collected royal jelly samples. The pre-stored grade characteristic data of the royal jelly includes photo or video data, moisture content data, and HDA content data corresponding to each grade of the royal jelly; A decision optimization unit, which is configured to iteratively update the weight coefficients of the grade characteristic data in the grading model through historical data.

[0007] Preferably, in the automatic royal jelly grading control system, the data acquisition module includes: A sampling unit, which is configured to drive a sampling robotic arm to take a part of the sample from the original royal jelly as the royal jelly sample and establish a one-to-one correspondence between the test sample and the original royal jelly from which it is sourced; A color detection unit, which is configured to obtain picture data of the royal jelly sample through a vision sensor, compare it with the photo data corresponding to each grade of the royal jelly pre-stored in the control module, and give a color detection result; A moisture detection unit, which is configured to obtain spectral data of the royal jelly sample through a near-infrared spectrometer and calculate the moisture content of the royal jelly sample; An HDA content detection unit, which is configured to obtain chromatographic data of the royal jelly sample through high performance liquid chromatography and calculate the HDA content in the royal jelly sample.

[0008] Preferably, the automatic royal jelly grading control system further includes: A verification module, which is configured to perform secondary sampling verification on the sorted original royal jelly; A quality traceability database, which is configured to establish an association relationship between the royal jelly sample, the original royal jelly, its production time, detection parameters, and grading results.

[0009] Preferably, in the automated grading control system of royal jelly, the data acquisition module further includes a synchronization control unit, and the synchronization control unit is configured to: Implement synchronous acquisition of color data, moisture data, and HDA content data through multi-threaded data acquisition technology; Establish a temporal correlation relationship between multi-modal data by using timestamp marking technology; Implement asynchronous processing of data acquisition and transmission through a circular buffer mechanism.

[0010] Preferably, in the automated grading control system of royal jelly, the grading model constructed by the gradient boosting decision tree includes: Parallelized model training based on the LightGBM algorithm framework; Use the Bayesian optimization algorithm for hyperparameter tuning; Set a dynamic pruning strategy to prevent model overfitting; Include multi-class output nodes corresponding to the grades of royal jelly.

[0011] Preferably, in the automated grading control system of royal jelly, the sampling unit includes: A positioning system based on machine vision, and use 3D vision to guide the sampling robotic arm for sampling; Integrate a micro weighing sensor to achieve dynamic monitoring of the sampling volume; Use laser marking technology to generate a unique traceability code on the surface of the original royal jelly container; Establish a two-way association relationship between the sample and the original royal jelly container through an image matching algorithm.

[0012] In a second aspect, an automated grading control method for royal jelly based on the above system includes the following steps: Data acquisition step: Synchronously obtain the grade characteristic data of the royal jelly sample, and the grade characteristic data includes the color data, moisture data, and 10-hydroxy-2-decenoic acid (HDA) content data of the royal jelly; Control step: Normalize a variety of grade characteristic data, then generate a grade determination result according to a variety of detection characteristic data, and dynamically generate sorting execution parameters according to the grade determination result; Execution step: Drive the actuator to automatically sort and package the original royal jelly corresponding to the royal jelly sample; Human-computer interaction step: Display the grading process and receive real-time manual modification of the sorting execution parameters.

[0013] Preferably, in the automated grading control method of royal jelly, the control step includes: Real-time calibration step: perform deviation compensation on the detection data based on a preset reference sample; Abnormal handling step: trigger a re-inspection process for samples exceeding the threshold and record an abnormal log; Hierarchical model construction step: construct a hierarchical model through a gradient boosting decision tree according to the quality characteristic data; Storage step: store the grade characteristic data of the pre-stored royal jelly, the grade characteristic data of the royal jelly samples collected in real time, and the historical grade characteristic data of the collected royal jelly samples. The grade characteristic data of the pre-stored royal jelly includes photo or video data, moisture content data, and HDA content data corresponding to each grade of royal jelly; Decision optimization step: iteratively update the weight coefficients of the grade characteristic data in the hierarchical model through historical data.

[0014] Preferably, in the automatic grading control method for royal jelly, the data acquisition step includes the following steps: Sampling step: drive a sampling mechanism to take out a part of the sample from the raw royal jelly as a royal jelly sample, and use it to establish a one-to-one correspondence between the detection sample and the raw royal jelly from which it is sourced; Color detection step: obtain picture data of the royal jelly sample through a vision sensor, compare it with the photo data corresponding to each grade of royal jelly pre-stored in the control step, and give a color detection result; Moisture detection step: obtain spectral data of the royal jelly sample through a near-infrared spectrometer and calculate the moisture content of the royal jelly sample; HDA content detection step: obtain chromatographic data of the royal jelly sample through high performance liquid chromatography and calculate the HDA content in the royal jelly sample.

[0015] Preferably, the automatic grading control method for royal jelly further includes the following steps: Verification step: conduct a secondary sampling inspection and verification on the sorted raw royal jelly; Quality traceability step: establish an association relationship between the royal jelly sample, the raw royal jelly, its production time, detection parameters, and grading results.

[0016] Preferably, in the automatic grading control method for royal jelly, the data acquisition step further includes a synchronization control step, and the synchronization control step includes: Realize synchronous acquisition of color data, moisture data, and HDA content data through multi-threaded data acquisition technology; Adopt a timestamp marking technology to establish a time sequence association relationship between multi-modal data; Realize asynchronous processing of data acquisition and transmission through a circular buffer mechanism.

[0017] Preferably, in the automatic grading control method of royal jelly, the grading model constructed by gradient boosting decision tree in the grading model step includes: Parallelized model training based on the LightGBM algorithm framework; Using the Bayesian optimization algorithm for hyperparameter tuning; Setting a dynamic pruning strategy to prevent model overfitting; Including multi-class output nodes corresponding to the grades of royal jelly.

[0018] Preferably, in the automatic grading control method of royal jelly, the sampling step includes: A positioning system based on machine vision, and sampling is carried out by a sampling manipulator guided by 3D vision; Integrating a micro weighing sensor to realize dynamic monitoring of the sampling amount; Adopting laser marking technology to generate a unique traceability code on the surface of the original royal jelly container; Establishing a two-way association relationship between the sample and the original royal jelly container through an image matching algorithm.

[0019] The embodiments of the present invention at least include the following beneficial effects: In the automatic grading control system of royal jelly of the present invention, the data acquisition module can simultaneously collect data on the color, moisture, and 10-hydroxy-2-decenoic acid (HDA) content of royal jelly samples. The traditional sequential acquisition method waits for each detection item to be completed in turn, resulting in a relatively long overall acquisition time. The synchronous acquisition of the present invention breaks this time limit. While the color detection unit obtains picture data through a vision sensor, the moisture detection unit calculates the moisture content using a near-infrared spectrometer, and the HDA content detection unit obtains chromatographic data and calculates the HDA content through high-performance liquid chromatography, greatly shortening the total data acquisition time. Compared with the traditional method, the data acquisition efficiency can be increased by 40% - 50%, enabling the system to obtain complete grade characteristic data of royal jelly samples faster and providing a timely basis for subsequent grading decisions.

[0020] The synchronization of the present invention uses timestamp marking technology to establish the temporal correlation relationship between multi-modal data. When collecting different types of data, the acquisition time of each data point is accurately recorded to ensure that the data of different detection items are corresponding in time. When the color data is collected at a certain moment, the moisture and HDA content data also have corresponding accurate time marks, avoiding the wrong correlation caused by inconsistent data acquisition times. At the same time, the circular buffer mechanism realizes the asynchronous processing of data acquisition and transmission. Even when the data acquisition speed is relatively fast, it can ensure the stable transmission of data, reduce the possibility of data loss and errors, thereby improving the consistency and accuracy of the data and providing high-quality data input for the subsequent grading model.

[0021] In the control module of the present invention, a gradient boosting decision tree is used to construct a grading model, and the Bayesian optimization algorithm is combined for hyperparameter tuning. The gradient boosting decision tree itself has strong learning ability and can handle complex non-linear relationships, and deeply analyze and learn the grade characteristic data of royal jelly. Using the Bayesian optimization algorithm can quickly find the optimal parameter settings among numerous possible hyperparameter combinations, enabling the grading model to better fit the training data and avoiding the overfitting problem. In this way, the accuracy of the grading model is significantly improved, and the grading accuracy rate can reach more than 99%. In addition, a dynamic pruning strategy is set to prevent the model from overfitting, so that the model can still maintain good generalization ability when facing new royal jelly sample data and accurately perform grading determination.

[0022] The decision optimization unit of the present invention iteratively updates the weight coefficients of each grade characteristic data in the grading model through historical data. As the system continues to run, a large amount of royal jelly sample detection data can be accumulated, which contains the characteristic information of royal jelly from different batches and sources. Through the analysis and learning of these historical data, the model can dynamically adjust the weights of each grade characteristic data according to the actual situation. For example, if it is found that the HDA content has a more significant impact on the grade of royal jelly at a certain stage, the model will correspondingly increase the weight of the HDA content data. This ability of continuous optimization and adaptive adjustment enables the grading model to better adapt to various changes in the royal jelly production process, such as fluctuations in raw material quality and changes in production environment, ensuring the stability and reliability of the system during long-term operation.

[0023] The present invention comprehensively improves the performance and efficiency of the entire royal jelly automatic grading control system. Fast and accurate data acquisition provides a solid foundation for grading decisions. The grading model can quickly and accurately give the grade determination results. The execution module can promptly drive the actuator to perform automatic sorting and packaging according to the grading results, making the grading process more smooth and efficient. Compared with the traditional manual grading or simple automatic grading system, this system can increase the grading processing speed by 60% - 70%, greatly improving the production efficiency and reducing the labor cost.

[0024] The present invention can be widely applied to the automatic grading production line of royal jelly production enterprises, significantly improving the grading efficiency and accuracy, ensuring the consistency of product quality, and providing data support for subsequent quality traceability.

[0025] Other advantages, objectives, and features of the present invention will be partially reflected by the following description and partially understood by those skilled in the art through the research and practice of the present invention. Brief Description of the Drawings

[0026] Figure 1 It is a block diagram of the automatic grading control system of royal jelly for this application; Figure 2 It is a schematic flow chart of the automatic grading control method of royal jelly for this application. Detailed Embodiment

[0027] The following further detailed description of the present invention is provided in conjunction with the drawings, so that those skilled in the art can implement it with reference to the text of the specification.

[0028] As Figure 1 shown, the present invention provides an automatic grading control system for royal jelly, including: A data acquisition module configured to synchronously obtain the grade characteristic data of royal jelly samples, where the grade characteristic data includes the color data, moisture data, and 10 - hydroxy - 2 - decenoic acid (HDA) content data of royal jelly; A control module configured to receive the grade characteristic data of royal jelly samples collected by the data acquisition module and perform normalization processing on various grade characteristic data, and then generate a grade determination result based on various detection characteristic data, and dynamically generate sorting execution parameters according to the grade determination result; An execution module configured to receive the sorting execution parameters of the control module and drive the actuator to automatically sort and package the original royal jelly corresponding to the royal jelly samples; A human-computer interaction interface, which is configured to display the grading process and receive real-time manual modification of sorting execution parameters. The automated royal jelly grading control system provided by this embodiment adopts a modular architecture design. The data acquisition module realizes synchronous detection of multiple parameters through multi-sensor integration: the vision sensor uses an industrial-grade CCD camera (resolution ≥ 5 million pixels), and cooperates with an LED ring light source to realize color data acquisition; the near-infrared spectrometer selects a micro fiber optic probe (wavelength range 900 - 1700nm); the high-performance liquid chromatograph is equipped with a C18 chromatographic column (4.6 × 250mm). The control module is built based on an industrial control computer (main frequency ≥ 3.2GHz), develops a data processing program using the Python language, and integrates the NumPy library for data normalization processing. The execution module selects a robotic arm driven by a servo motor (repeat positioning accuracy ± 0.05mm), and cooperates with a pneumatic gripper to realize the sorting operation. The human-computer interaction interface uses a 15.6-inch industrial touch screen, is equipped with a WinCE operating system, and supports parameter input and status monitoring. The system realizes communication between modules through the RS485 bus, and the communication rate is set to 115200bps.

[0029] In the above solution, preferably, the control module includes: A real-time calibration unit, which is configured to perform deviation compensation on the detection data based on a preset reference sample; An exception handling unit, which is configured to trigger a re-inspection process for samples exceeding the threshold and record an exception log; A grading model unit, which is configured to construct a grading model through a gradient boosting decision tree according to the quality characteristic data; A storage unit, which is configured to store the pre-stored grade characteristic data of royal jelly, the grade characteristic data of the real-time collected royal jelly samples, and the historical grade characteristic data of the collected royal jelly samples. The pre-stored grade characteristic data of royal jelly includes photo or video data, moisture content data, and HDA content data corresponding to each grade of royal jelly; A decision optimization unit, which is configured to iteratively update the weight coefficients of the characteristic data of each grade in the grading model through historical data. The real-time calibration unit of the control module adopts the three-point calibration method: when starting up every day, it sequentially detects a standard white board (reflectivity 99%), a standard gray board (reflectivity 50%), and a standard black board (reflectivity <1%) to establish a spectral response curve. The abnormal handling unit sets three-level thresholds: when the detected data exceeds the first-level threshold, it triggers a buzzer alarm; when it exceeds the second-level threshold, it automatically marks and records; when it exceeds the third-level threshold, it starts a re-inspection process. The grading model unit implements the LightGBM algorithm based on the Scikit-learn framework, sets the maximum depth of the tree to 8, the learning rate to 0.1, and the number of iterations to 1000. The storage unit uses an SQLite database to establish a historical data storage table (fields include: sample number, detection time, color value, moisture content, HDA content, grading result). The decision optimization unit sets a weekly automatic update mechanism, and when the historical data volume reaches 100,000, it triggers the model to be retrained.

[0030] In one embodiment of the present invention, preferably, the data acquisition module includes: A sampling unit, which is configured to take out a part of the sample from the original royal jelly as a royal jelly sample by driving a sampling robotic arm, and is used to establish a one-to-one correspondence between the detection sample and the original royal jelly from which it is sourced; A color detection unit, which is configured to obtain picture data of the royal jelly sample through a vision sensor, compare it with the photo data corresponding to each grade of royal jelly pre-stored in the control module, and give a color detection result; A moisture detection unit, which is configured to obtain spectral data of the royal jelly sample through a near-infrared spectrometer and calculate the moisture content of the royal jelly sample; An HDA content detection unit, which is configured to obtain chromatographic data of the royal jelly sample through high performance liquid chromatography and calculate the HDA content in the royal jelly sample. The sampling unit of the data acquisition module uses a six-axis robotic arm (load capacity 3 kg) in cooperation with a 3D vision camera (accuracy 0.02 mm), and performs image recognition and positioning through OpenCV. A micro weighing sensor (range 0 - 50 g, accuracy 0.01 g) is integrated at the end of the sampling needle to monitor the sampling amount in real time. The laser marking system selects a fiber laser (wavelength 1064 nm, power 20 W) to generate a QR code on the surface of the container. The image matching algorithm uses ORB feature point detection to establish the association relationship between the sample and the container through a FLANN matcher. The color detection unit uses HSV color space analysis to establish a standard color card database (including 12 standard color numbers). The moisture detection unit establishes a near-infrared spectrum - moisture content prediction model through partial least squares method, and the model R²≥0.985.

[0031] In one embodiment of the present invention, preferably, it further includes: A verification module configured to conduct secondary sampling inspection and verification on the sorted raw royal jelly; A quality traceability database configured to establish an association relationship between the royal jelly sample, the raw royal jelly, its production time, detection parameters, and grading results. The verification module configures an independent detection station and uses the same detection equipment as the main detection module to conduct a 10% sampling inspection on the sorted samples. The quality traceability database is constructed using blockchain technology, and each sample generates a unique hash value (SHA-256 algorithm) to record information such as production batches, detection parameters, and grading results. The system realizes data uploading to the blockchain through the MQTT protocol, and the blockchain nodes are deployed on the enterprise private cloud server. The verification process sets up an automatic comparison mechanism, and when the re-inspection result is inconsistent with the initial inspection result, a full-batch recall program is triggered. The quality traceability interface supports multi-dimensional queries and can trace back to the specific production time and detection personnel by scanning the code or inputting the batch number.

[0032] In one embodiment of the present invention, preferably, the data acquisition module further includes a synchronization control unit, and the synchronization control unit is configured to: Realize the synchronous acquisition of color data, moisture data, and HDA content data through multi-threaded data acquisition technology; Establish a temporal association relationship between multi-modal data using timestamp marking technology; Realize the asynchronous processing of data acquisition and transmission through a circular buffer mechanism. The synchronization control unit uses multi-threaded programming technology and deploys three independent threads inside the data acquisition module to process color, moisture, and HDA data acquisition respectively. The timestamp marking accuracy reaches the millisecond level, and the time consistency of each sensor is ensured through the system clock synchronization module (NTP protocol). The circular buffer adopts a double-buffer mechanism, and the capacity of each buffer is set to 1024KB, automatically overwriting old data when the data acquisition rate exceeds the transmission rate. Data transmission uses the TCP / IP protocol, and a heartbeat detection mechanism (interval of 5 seconds) is set to ensure the stability of the communication link. The synchronization control unit also integrates a data integrity verification algorithm to ensure error-free data transmission through CRC-32 verification.

[0033] In one embodiment of the present invention, preferably, the grading model constructed by the gradient boosting decision tree includes: Parallelized model training based on the LightGBM algorithm framework; Adopt the Bayesian optimization algorithm for hyperparameter tuning; Set a dynamic pruning strategy to prevent model overfitting; It includes a multi-class output node corresponding to the grade level of royal jelly. The hierarchical model is constructed using a distributed computing architecture and parallel training is implemented using Spark MLlib. The Bayesian optimization algorithm sets the parameter search space: learning rate 0.01 - 0.3, maximum depth of the tree 3 - 12, and minimum number of samples in leaf nodes 20 - 100. The dynamic pruning strategy sets the maximum number of leaf nodes to 100, and post-pruning is automatically performed when the complexity of the tree exceeds the threshold. The output layer of the model uses the Softmax function for multi-classification, corresponding to five grade levels (super grade, first grade, second grade, third grade, unqualified). The model evaluation metric is the F1-score, and the validation set ratio is set to 20%. Training stops when the F1-score does not improve for 5 consecutive iterations.

[0034] In one embodiment of the present invention, preferably, the sampling unit includes: A positioning system based on machine vision, which guides the sampling robotic arm to sample through 3D vision; Integrated with a micro weighing sensor to achieve dynamic monitoring of the sampling quantity; Adopts laser marking technology to generate a unique traceability code on the surface of the original royal jelly container; Establishes a two-way association relationship between the sample and the original royal jelly container through an image matching algorithm. The positioning system of the sampling unit uses binocular stereo vision to establish a three-dimensional coordinate system through a calibration board (size 200×200mm). The motion planning of the robotic arm uses a fifth-order polynomial interpolation algorithm to ensure a smooth sampling path. The signal of the micro weighing sensor is connected to the control system through a 24-bit AD conversion module (conversion rate 100Hz). Laser marking parameter settings: frequency 20kHz, pulse width 200ns, marking speed 500mm / s. The image matching algorithm sets the feature point matching threshold to 0.7, and repositioning is triggered when the number of matching points is less than 15. The association relationship between the sample and the container is realized through a foreign key in the database, and a two-way index table (container ID → sample ID, sample ID → container ID) is established.

[0035] The present invention also provides an automatic grading control method for royal jelly based on the above-mentioned automatic grading control system for royal jelly, as Figure 2 shown, including the following steps: Data acquisition step: Synchronously obtain the grade characteristic data of the royal jelly sample, and the grade characteristic data includes the color data, moisture data, and 10-hydroxy-2-decenoic acid (HDA) content data of the royal jelly; Control step: Normalize various grade characteristic data, then generate a grade determination result based on various detection characteristic data, and dynamically generate sorting execution parameters according to the grade determination result; Execution steps: Drive the actuator to automatically sort and package the original royal jelly corresponding to the royal jelly sample; Human-computer interaction steps: Display the grading process and receive real-time manual modification of the sorting execution parameters. The automated grading control method adopts the state machine design pattern, which is divided into five states: initialization, standby, detection, sorting, and maintenance. The data acquisition step sets a loop detection mechanism, and the detection period is configurable (adjustable from 1 to 10 seconds). The control step adopts a pipeline processing architecture, and the three stages of data normalization, model inference, and parameter generation are executed in parallel. The execution step sets a safety protection mechanism to immediately stop the robotic arm movement of the actuator when an obstacle is detected. The human-computer interaction step adopts a permission management system, setting three levels of permissions: administrator, operator, and visitor. The system log records all operation behaviors, and the storage period is not less than 180 days.

[0036] In one embodiment of the present invention, preferably, the control step includes: Real-time calibration step: Perform deviation compensation on the detection data based on a preset reference sample; Abnormal handling step: Trigger a re-inspection process for samples exceeding the threshold and record an abnormal log; Grading model construction step: Construct a grading model through a gradient boosting decision tree according to the quality characteristic data; Storage step: Store the grade characteristic data of the pre-stored royal jelly, the grade characteristic data of the real-time collected royal jelly samples, and the historical grade characteristic data of the collected royal jelly samples. The grade characteristic data of the pre-stored royal jelly includes photo or video data, moisture content data, and HDA content data corresponding to each grade of royal jelly; Decision optimization step: Iteratively update the weight coefficients of the grade characteristic data in the grading model through historical data. The real-time calibration of the control step adopts a dynamic compensation algorithm to adjust the detection parameters according to the environmental temperature change (compensation range 0 - 40 °C). The abnormal handling sets a three-level early warning mechanism: yellow warning (data fluctuation ±5%), orange warning (±10%), and red warning (±15%). The transfer learning technique is adopted in the grading model construction, and fine-tuning is performed based on a pre-trained model (ImageNet dataset). The storage step sets a data backup strategy, and automatically backs up to a remote server every day. The decision optimization adopts an online learning mechanism, and triggers an incremental update of the model when the accumulated amount of new data reaches 1000. The abnormal log record includes information such as timestamp, sample number, detection parameters, and abnormal type.

[0037] In one embodiment of the present invention, preferably, the data acquisition step includes the following steps: Sampling step: Drive the sampling mechanism to take out a part of the sample from the original royal jelly as the royal jelly sample, and use it to establish a one-to-one correspondence between the test sample and the original royal jelly from which it is sourced; Color detection step: Obtain the picture data of the royal jelly sample through a vision sensor, compare it with the photo data corresponding to each grade of royal jelly pre-stored in the control step, and give the color detection result; Moisture detection step: Obtain the spectral data of the royal jelly sample through a near-infrared spectrometer and calculate the moisture content of the royal jelly sample; HDA content detection step: Obtain the chromatographic data of the royal jelly sample through high-performance liquid chromatography and calculate the HDA content in the royal jelly sample. The data acquisition step adopts time-division multiplexing technology to complete the three-color data acquisition within 0.5 seconds. The sampling step sets anti-pollution measures, and automatic ultraviolet disinfection (wavelength 254nm, intensity 100μW / cm²) is carried out after each sampling. The color detection sets a standard ambient light (D65 light source, illuminance 5000lux). The moisture detection adopts a temperature compensation algorithm (compensation range 10 - 30°C). The HDA content detection sets a quality control standard: The standard product is calibrated after every 100 detections (standard deviation ≤ 2%). The corresponding relationship between the sample and the original royal jelly is realized through a dual coding system: laser coding on the surface of the container and RFID tags inside the sample.

[0038] Preferably, the automatic grading control method for the royal jelly further includes the following steps: Verification step: Conduct a secondary sampling inspection and verification on the sorted original royal jelly; Quality traceability steps: Establish an association relationship between the royal jelly sample, the original royal jelly, its production time, detection parameters, and grading results. After the automatic sorting and packaging of the original royal jelly are completed, secondary sampling inspection and verification begin. First, according to a preset sampling ratio, such as 10%, a certain number of samples are randomly selected from the sorted batches of the original royal jelly. These samples are sent to an independent verification and testing area, which is equipped with the same type and accuracy of testing equipment as in the data collection step, including a vision sensor for color detection, a near-infrared spectrometer for moisture detection, and a high-performance liquid chromatograph for HDA content detection. The grade characteristic data of the selected samples are re-detected, and the detected color data, moisture data, and HDA content data are compared in detail with the data recorded during the previous grading. If the difference between the two is within the allowable error range, such as the ΔE value of color within 2, the moisture content error within ±0.5%, and the HDA content error within ±0.3%, then the grading result of the sample is determined to be qualified; if it exceeds the error range, it is determined to be unqualified, and the batch where the sample is located needs to be re-graded, which may include re-grading the entire batch of products. During the verification process, the verification results of each sampled sample are recorded in detail, including information such as the verification time, detection data, and the difference from the initial inspection data, forming a complete verification log for subsequent quality analysis and traceability. Moreover, throughout the grading control process, starting from the data collection step, a unique identifier is established for each royal jelly sample and its corresponding original royal jelly. For example, in the sampling step, a unique traceability code is generated on the surface of the original royal jelly container through laser marking technology, which contains basic information such as the production batch and production time. During the data collection process, the grade characteristic data (color data, moisture data, HDA content data) of the collected royal jelly samples are associated and stored with the corresponding traceability code. In the control step, the generated grade determination result is also bound to the traceability code. After the sorting and packaging are completed in the execution step, the identification information on the package is also associated with the traceability code. A dedicated quality traceability database is established to uniformly store and manage the above-mentioned associated information. The database adopts a structured design and includes multiple data tables, such as a sample information table, a detection parameter table, a grading result table, etc. The data in each table is associated through the traceability code as the primary key. Users can query the detailed production and detection information of the royal jelly sample in the quality traceability system by inputting information such as the traceability code, production time, batch number, etc., to achieve forward traceability from the product to the raw material and reverse traceability from the raw material to the product, ensuring the traceability of product quality.

[0039] Preferably, in the automatic grading control method of the royal jelly, the data collection step further includes a synchronization control step, and the synchronization control step includes: Synchronous acquisition of color data, moisture data, and HDA content data is achieved through multi-threaded data acquisition technology; in the data acquisition step, in order to synchronously acquire color data, moisture data, and HDA content data, multi-threaded programming technology is adopted. In the software architecture of the system, independent threads are created for the color detection unit, moisture detection unit, and HDA content detection unit respectively. For example, three threads are created using the threading module in Python: color_thread is used to control the vision sensor to acquire color data, moisture_thread is used to control the near-infrared spectrometer to acquire moisture data, and hda_thread is used to control the high-performance liquid chromatograph to acquire HDA content data. The three threads are started simultaneously and execute their respective detection tasks in parallel, thus achieving synchronous acquisition of the three types of data. In each thread, appropriate acquisition frequencies and acquisition time intervals are set to ensure that the acquired data is representative and accurate. For example, the color data acquisition frequency is set to 1 time per second, the moisture data acquisition frequency is set to 1 time per 5 seconds, and the HDA content data acquisition frequency is set to 1 time per 10 seconds, and reasonable adjustments are made according to the response time and data processing requirements of different detection devices.

[0040] The time-stamp marking technology is adopted to establish the temporal correlation relationship between multi-modal data; when each thread acquires data, an accurate time stamp is added to each acquired data point. The time stamp uses a high-precision system clock, accurate to the millisecond level. For example, when the color detection unit acquires a picture data of a royal jelly sample, the specific time of the picture acquisition is recorded. The data with time stamps is stored in a temporary buffer, and in the subsequent data processing process, different types of data are sorted and correlated according to the time stamps. For example, when a comprehensive analysis of a royal jelly sample at a certain moment is required, the corresponding color data, moisture data, and HDA content data at that moment can be found according to the time stamp, ensuring the consistency and relevance of the data and providing an accurate basis for subsequent classification decisions.

[0041] Asynchronous processing of data acquisition and transmission is achieved through a circular buffer mechanism. To implement asynchronous processing of data acquisition and transmission, a circular buffer mechanism is adopted. A circular buffer with a fixed size, such as 1024 data units, is created in the system. When each thread acquires data, the data is written into the circular buffer in sequence. At the same time, an independent data transmission thread is created, which continuously reads data from the circular buffer and transmits it, for example, transmits the data to the control module for processing. When the circular buffer is full, the newly acquired data will overwrite the earliest written data, forming a recycling utilization. Through the circular buffer mechanism, the data acquisition thread and the data transmission thread can run independently without interference. Even if the data acquisition speed is fast, data loss will not occur due to untimely data transmission. For example, when the color detection unit acquires a large amount of image data in a short period of time, these data can be first stored in the circular buffer and wait to be transmitted when the data transmission thread is idle, thereby improving the data processing efficiency and stability of the system.

[0042] Preferably, in the automatic grading control method of royal jelly, the grading model constructed by gradient boosting decision tree in the grading model step includes: Parallelized model training based on the LightGBM algorithm framework; in the grading model construction step of the control step, the LightGBM algorithm framework is used for training the grading model. First, a large amount of grade characteristic data of royal jelly samples is collected as the training data set, which includes color data, moisture data, and HDA content data, as well as the corresponding grade labels. The training data set is divided into multiple subsets, and the parallelized training function of LightGBM is used to train these subsets simultaneously on multiple computing nodes or multiple CPU cores. For example, a distributed computing framework such as Apache Spark is combined with LightGBM to distribute the data set to multiple computing nodes, and each node independently conducts model training. Finally, the training results of each node are merged and integrated to obtain the final grading model. Parallelized training can significantly shorten the model training time and improve the training efficiency. For example, for a training data set containing 100,000 samples, the traditional serial training method may take several hours or even days, while with parallelized training, the training time can be shortened to dozens of minutes or even shorter.

[0043] Use the Bayesian optimization algorithm for hyperparameter tuning; When training the classification model using the LightGBM algorithm, some hyperparameters need to be set, such as the learning rate, the maximum depth of the tree, the minimum number of samples in the leaf node, etc. To find the optimal combination of hyperparameters, the Bayesian optimization algorithm is used. First, define the search space of the hyperparameters. For example, the value range of the learning rate is [0.01, 0.3], and the value range of the maximum depth of the tree is [3, 12]. Then, use the Bayesian optimization algorithm to perform iterative search in this search space. In each iteration, the algorithm builds a probability model based on the previous search results, predicts the performance metrics (such as accuracy, F1 value, etc.) of the model under different hyperparameter combinations, and selects the hyperparameter combination that is most likely to improve the performance for the next training. Through multiple iterative searches, continuously optimize the hyperparameters until the optimal combination of hyperparameters is found. For example, after 20 iterative searches, the optimal learning rate is 0.1, the maximum depth of the tree is 8, and the accuracy of the classification model reaches 99%.

[0044] Set a dynamic pruning strategy to prevent model overfitting; To prevent the classification model from overfitting the training data, a dynamic pruning strategy is set during the model training process. In the LightGBM algorithm, pruning is achieved by controlling the growth process of the tree. For example, set the maximum number of leaf nodes to 100. When the number of leaf nodes of the tree reaches this upper limit, stop the further growth of the tree. At the same time, set a minimum gain threshold. When the gain brought by splitting at a certain node is less than this threshold, no further splitting is performed, and this node is directly used as a leaf node. For example, the minimum gain threshold is set to 0.01. If the accuracy improvement of the model after splitting at a certain node is less than 0.01, no splitting is performed. During the model training process, dynamically adjust the parameters of the pruning strategy according to the changes in the training data and the performance of the model. For example, when it is found that the performance of the model on the validation set begins to decline, appropriately reduce the maximum number of leaf nodes or increase the minimum gain threshold to further strengthen the pruning intensity, thereby improving the generalization ability of the model.

[0045] Include multi-class output nodes corresponding to the grades of royal jelly. The output layer of the classification model is designed as multi-class output nodes, and each node corresponds to a grade of royal jelly. During the model training process, the cross-entropy loss function is used to measure the difference between the model prediction results and the true grade levels. By continuously adjusting the parameters of the model, make the prediction results of the model as close as possible to the true grade levels. When inputting the grade feature data of a new royal jelly sample, the model will output a probability value for each output node, indicating the possibility that the sample belongs to each grade level. Select the grade level corresponding to the node with the largest probability value as the final classification result of the sample.

[0046] Preferably, for the automated grading control method of royal jelly, the sampling step includes: A positioning system based on machine vision, which uses 3D vision to guide a sampling robotic arm for sampling; in the storage area of the raw royal jelly, a 3D vision camera is installed to obtain the three-dimensional spatial information of the raw royal jelly container. The 3D vision camera uses a high-precision depth sensor that can accurately measure the position, shape, and size of the container. A machine vision-based positioning algorithm is used to process the image data collected by the 3D vision camera to identify the accurate position and orientation of the raw royal jelly container. For example, feature extraction and matching algorithms are used to extract the feature points on the surface of the container and match them with the pre-stored container model to calculate the position and orientation information of the container. The positioning information is transmitted to the control system of the robotic arm, and the robotic arm plans its movement path based on this information, accurately moves above the container through 3D vision guidance, and inserts the sampling needle into the container for sampling. A sampling robotic arm with a movement accuracy of millimeters is used to ensure that the royal jelly sample can be accurately taken out of the container.

[0047] Integrate a micro weighing sensor to achieve dynamic monitoring of the sampling volume; integrate a micro weighing sensor on the sampling needle of the sampling robotic arm to be able to measure the weight of the royal jelly sample in the sampling needle in real time. During the sampling process, the micro weighing sensor continuously transmits the measured weight data to the control system. The control system monitors the change of the sampling volume according to the preset sampling volume requirement. For example, if the preset sampling volume is 5 grams, when the weight measured by the micro weighing sensor approaches 5 grams, the control system timely controls the sampling robotic arm to stop the sampling operation to ensure the accuracy of the sampling volume. If it is found during the sampling process that the sampling volume exceeds or is less than the preset value, the control system will automatically adjust the sampling strategy. For example, if the sampling volume exceeds the preset value, the sampling robotic arm will put the excess royal jelly sample back into the container; if the sampling volume is insufficient, the sampling robotic arm will perform the sampling operation again until the preset sampling volume is reached.

[0048] Use laser marking technology to generate a unique traceability code on the surface of the raw royal jelly container; after sampling, use a laser marking device to generate a unique traceability code on the surface of the raw royal jelly container. Laser marking technology has the characteristics of clear, durable, and non-wearable marks, which can ensure that the traceability code remains clearly readable during subsequent storage and transportation. The traceability code contains important information such as the production batch, production time, and origin of the raw royal jelly in the container. Optionally, when generating the traceability code, the laser marking device can convert the relevant information into the form of a QR code or barcode for marking according to the preset coding rules and formats. At the same time, the traceability code is associated and stored with the information of the royal jelly sample corresponding to the container for subsequent quality traceability and management.

[0049] A two-way association relationship between the sample and the original royal jelly container is established through an image matching algorithm. During the sampling process, an image acquisition device is used to collect the images of the surface of the original royal jelly container and the royal jelly sample respectively. The image acquisition device can be a 3D vision camera or an ordinary 2D camera to ensure that the collected images are clear and complete. An image matching algorithm is used to process the collected container image and sample image to extract the feature points in the images. For example, the ORB (Oriented FAST and Rotated BRIEF) feature extraction algorithm is used to extract the key points and descriptors in the images. The feature points in the container image and the sample image are matched through a feature matching algorithm, and the number and degree of matching of the matching points are calculated. When the degree of matching reaches a certain threshold, it is considered that the sample is associated with the container. For example, when the number of matching points exceeds 10 and the degree of matching reaches more than 80%, a two-way association relationship between the sample and the container is established. The established association relationship is stored in the database for convenient subsequent query and management. For example, the information of the corresponding original royal jelly container can be queried by inputting the sample number, and the information of the sample taken from the container can be queried by inputting the container number, realizing the two-way traceability of the sample and the container.

[0050] In the present invention, the grade characteristic data of royal jelly includes the color data, moisture data, and 10-hydroxy-2-decenoic acid (HDA) content data of royal jelly. However, the grade characteristics of royal jelly are not limited to this, and also include: sensory indicators such as state, smell, and taste, physical and chemical indicators such as protein and acidity, and microbial indicators, etc.

[0051] The quality grade of royal jelly is usually divided according to national standards and some general standards in the industry, as follows: Color: Premium grade: Generally milky white or light yellow, with luster and uniform color. First grade: The color is mostly milky white or light yellow, allowing slight color differences, but the overall color is basically uniform. Qualified grade: The color range is relatively wide, which can be between milky yellow and dark yellow, but there should be no obvious discoloration, blackening and other abnormal phenomena.

[0052] The moisture content standard of royal jelly has certain differences in different quality grades and different standard systems. It is mainly based on national standards such as GB 9697-2008 "Royal Jelly". Premium grade: The moisture content is generally below 62.5%. The relative content of active ingredients in royal jelly of this grade is high, which is more conducive to preservation and the exertion of its efficacy. First grade: The moisture content usually does not exceed 64%. While ensuring the quality of royal jelly, the moisture content is slightly relaxed, but it is still at a relatively low level, which can better maintain its nutritional components and physical and chemical properties. Qualified grade: The moisture content is allowed to be below 66%. Although the moisture content is relatively high, it is still within the acceptable range, and the quality and use value of royal jelly can be basically guaranteed.

[0053] 10-Hydroxy-α-decenoic acid (HDA): Premium grade: HDA content ≥ 1.8%. First grade: HDA content between 1.6% - 1.8%. Qualified grade: HDA content ≥ 1.4%.

[0054] To enable those skilled in the art to better understand the technical solution of the present invention, the following embodiments are provided for illustration: An automated grading control system for royal jelly. The grading control system provided in this embodiment adopts a modular design and consists of a data acquisition module, a control module, an execution module, a verification module, and a human-machine interface. The system hardware selects industrial-grade components and supports a production line operation with a daily processing capacity of 3000 kg of royal jelly. Each module communicates through an industrial Ethernet (Profinet protocol), with a data transmission rate of 100 Mbps and a system response time < 200 ms. It includes: A data acquisition module, which is configured to synchronously obtain the grade characteristic data of the royal jelly sample. The grade characteristic data includes the color data, moisture data, and 10-hydroxy-2-decenoic acid (HDA) content data of the royal jelly. The data acquisition module includes: A sampling unit, which is configured to take out a part of the sample from the raw royal jelly as the royal jelly sample by driving a sampling robotic arm, and is used to establish a one-to-one correspondence between the test sample and the raw royal jelly from which it is sourced. The sampling unit includes: A machine vision-based positioning system that guides the sampling robotic arm to take samples through 3D vision; An integrated micro weighing sensor to achieve dynamic monitoring of the sampling quantity; Using laser marking technology to generate a unique traceability code on the surface of the raw royal jelly container; Establishing a two-way association relationship between the sample and the raw royal jelly container through an image matching algorithm.

[0055] A color detection unit, which is configured to obtain the picture data of the royal jelly sample through a vision sensor, compare it with the photo data corresponding to each grade of royal jelly pre-stored in the control module, and give the color detection result; A moisture detection unit, which is configured to obtain the spectral data of the royal jelly sample through a near-infrared spectrometer and calculate the moisture content of the royal jelly sample; An HDA content detection unit, which is configured to obtain the chromatographic data of the royal jelly sample through high performance liquid chromatography and calculate the HDA content in the royal jelly sample.

[0056] A synchronous control unit, and the synchronous control unit is configured to: Synchronously collect color data, moisture data, and HDA content data through multi-threaded data acquisition technology; Establish a temporal correlation relationship between multi-modal data using timestamp marking technology; Implement asynchronous processing of data acquisition and transmission through a circular buffer mechanism.

[0057] A control module, which is configured to receive the grade characteristic data of the royal jelly samples collected by the data acquisition module, normalize various grade characteristic data, generate a grade determination result based on various detection characteristic data, and dynamically generate sorting execution parameters according to the grade determination result; The control module includes: A real-time calibration unit, which is configured to perform deviation compensation on the detection data based on a preset reference sample; An exception handling unit, which is configured to trigger a re-inspection process for samples exceeding the threshold and record an exception log; A grading model unit, which is configured to construct a grading model through a gradient boosting decision tree based on quality characteristic data; The grading model constructed by the gradient boosting decision tree includes: Parallel model training based on the LightGBM algorithm framework; Use the Bayesian optimization algorithm for hyperparameter tuning; Set a dynamic pruning strategy to prevent model overfitting; Include multi-class output nodes corresponding to the grade levels of royal jelly.

[0058] A storage unit, which is configured to store the pre-stored grade characteristic data of royal jelly, the grade characteristic data of the real-time collected royal jelly samples, and the historical grade characteristic data of the collected royal jelly samples. The pre-stored grade characteristic data of royal jelly includes photo or video data, moisture content data, and HDA content data corresponding to each grade of royal jelly; A decision optimization unit, which is configured to iteratively update the weight coefficients of various grade characteristic data in the grading model through historical data.

[0059] An execution module, which is configured to receive the sorting execution parameters of the control module and drive the actuator to automatically sort and package the original royal jelly corresponding to the royal jelly samples; A human-machine interaction interface, which is configured to display the grading process and receive real-time manual modification of the sorting execution parameters.

[0060] A verification module, which is configured to conduct a secondary sampling verification on the sorted original royal jelly; A quality traceability database, which is configured to establish an association relationship between the royal jelly samples, the original royal jelly, their production time, detection parameters, and grading results.

[0061] In the data acquisition module, the synchronous acquisition unit adopts Python multithreading technology (threading module), and sets three independent threads to control the vision sensor, near-infrared spectrometer, and high-performance liquid chromatograph respectively. The timestamp marking accuracy reaches the millisecond level, and the clocks of each device are synchronized through the NTP protocol (deviation ≤ ±1ms). The circular buffer adopts a double-buffer mechanism, with a capacity of 1MB for each buffer and a data acquisition rate of 30MB / h. Sampling unit: 3D vision positioning: Use Keyence 3D laser displacement sensor (LJ-V7000 series), and cooperate with a six-axis robotic arm (UR5e) to achieve a positioning accuracy of ±0.1mm. Color detection: Basler acA2000-50gm camera (2 million pixels) is combined with a D65 standard light source, and HSV color space analysis is used to establish a 12-level standard color card database (ΔE < 2). Moisture detection: Near-infrared spectrometer (Ocean Optics QE65000) establishes a prediction model through the PLS algorithm (R² = 0.989, RMSE = 0.28%). HDA detection: Agilent 1260 Infinity II HPLC system, C18 chromatographic column (4.6×250mm), mobile phase methanol-water (45:55), detection wavelength 210nm. Dynamic weighing: Integrate HBM U10 micro weighing sensor (range 0-50g, accuracy 0.01g) to monitor the sampling amount in real time. Laser marking: Fiber laser (IPG YLR-20) generates a QR code conforming to ISO / IEC 18004 standard on the container surface, with a coding capacity of 200 bytes. Image matching: Based on the ORB feature point detection algorithm (implemented by OpenCV), the feature point matching threshold is 0.7, and the matching time < 150ms.

[0062] Control Module: Industrial control computer: Intel i7-12700 processor, Ubuntu 20.04 LTS system, Python 3.9 development environment. Data normalization: Adopt Z-score standardization method, processing range [-1,1]. Real-time calibration: Three-point calibration method (standard whiteboard / gray board / blackboard), automatically executed at startup every day, compensating for environmental temperature drift (0-40°C). Hierarchical model construction: Algorithm framework: LightGBM 3.3.2, set num_leaves = 31, max_depth = 8, learning_rate = 0.1. Model optimization: Bayesian optimization for parameter tuning (search space: learning_rate 0.01 - 0.3, max_depth 3 - 12), objective function F1-score. Dynamic pruning: Set the maximum number of leaf nodes to 100, and trigger post-pruning when the Gini impurity gain < 0.01. Decision optimization mechanism: Historical data storage: SQLite database, capacity 500GB, supporting 100,000 data storage per day. Model iteration: Trigger incremental update when the accumulated amount of new data reaches 5000, and the training cycle is 4 hours. Exception handling: Set three-level thresholds (yellow ±5%, orange ±10%, red ±15%), and trigger the re-inspection process when the red warning is triggered.

[0063] In the execution module, a four-axis Delta robot (Epson LS6) is adopted, with a repeat positioning accuracy of ±0.05mm and a sorting speed of 120 times per minute. Pneumatic gripper (SMC MHF2-16D), with adjustable gripping force (5 - 30N), suitable for different packaging containers. Servo filling machine (accuracy ±0.5g), and the packaging material is food-grade PE bag (thickness 0.08mm). Traceability coding system: A laser marking machine (Sato CL4NX) generates a one-dimensional code containing information such as production time, batch number, and grade. Blockchain storage: Hyperledger Fabric platform, each package generates a SHA-256 hash value, and the timestamp of uploading to the chain is accurate to the second level.

[0064] Verification Module: The independent detection station is configured with the same detection equipment as the main module, and the sampling ratio is 10%. Automatically compare the re-inspection results, and trigger a full batch recall when the inconsistency rate exceeds 0.5%.

[0065] Quality traceability database: Adopt MySQL 8.0, establish a traceability table containing 15 fields (container ID, production time, detection parameters, grading results, etc.). Support 7-level forward / backward traceability, and the query response time < 2 seconds.

[0066] Human - machine interaction interface: The operation terminal uses a 15.6 - inch industrial touch screen (Advantech TPC - 1551HI), Windows 10 IoT system, with a resolution of 1920×1080. The interface is divided into a real - time monitoring area (data refresh frequency 5Hz), a parameter setting area (step size 0.1%), and an alarm display area (indicated by three - color lights). Three - level permission control: administrator (system configuration), operator (daily operations), visitor (read - only viewing). The operation log records all behaviors, with a storage period of 180 days, and supports keyword retrieval.

[0067] The system of this embodiment runs continuously for 72 hours without failure, with a classification accuracy rate of 99.2% and a sorting speed of 100 times per minute. Environmental adaptability Temperature and humidity test: It operates stably in an environment with a temperature of 5 - 40°C and a humidity of 30 - 80%, and the detection error is <±0.5%. Electromagnetic interference resistance: Passed CE certification and complies with the EN 61000 - 6 - 2 standard.

[0068] This embodiment realizes the full - process automatic control of royal jelly classification, significantly improves production efficiency while ensuring detection accuracy, meets the quality control requirements of large - scale production enterprises, and provides a reliable technical solution for royal jelly classification. The key indicators of the system are shown in Table 1: Table 1 System performance index table Index Value Sorting accuracy 99.2% Sorting speed 100 times / minute Data storage latency <100ms Abnormal response time <5 seconds Readability of traceability code 99.9% Model update cycle 48 hours (automatically triggered) An automatic royal jelly classification control method includes five core steps: data acquisition, control processing, execution of sorting, verification and traceability, and human - machine interaction. The method adopts a pipeline - type processing architecture, with the single - batch processing time controlled within 30 minutes, and supports large - scale production of processing 3000 kg of royal jelly per day. It includes the following steps: Data acquisition step: Synchronously obtain the grade characteristic data of the royal jelly sample. The grade characteristic data includes the color data, moisture data, and 10 - hydroxy - 2 - decenoic acid (HDA) content data of the royal jelly. The data acquisition step includes the following steps: Sampling step: Drive the sampling mechanism to take out a part of the sample from the raw royal jelly as the royal jelly sample, and use it to establish a one - to - one correspondence between the test sample and the raw royal jelly from which it is sourced. The sampling step includes: a positioning system based on machine vision, using 3D vision to guide the sampling robotic arm for sampling; integrating a micro - weighing sensor to achieve dynamic monitoring of the sampling amount; using laser marking technology to generate a unique traceability code on the surface of the raw royal jelly container; establishing a two - way association relationship between the sample and the raw royal jelly container through an image matching algorithm.

[0069] Color detection step: Obtain the picture data of the royal jelly sample through a vision sensor, compare it with the photo data corresponding to each grade of royal jelly pre-stored in the control step, and give the color detection result; Moisture detection step: Obtain the spectral data of the royal jelly sample through a near-infrared spectrometer and calculate the moisture content of the royal jelly sample; HDA content detection step: Obtain the chromatographic data of the royal jelly sample through high-performance liquid chromatography and calculate the HDA content in the royal jelly sample.

[0070] Synchronization control step, including: realizing the synchronous acquisition of color data, moisture data and HDA content data through multi-threaded data acquisition technology; establishing the temporal correlation relationship between multi-modal data by using the timestamp marking technology; realizing the asynchronous processing of data acquisition and transmission through the circular buffer mechanism.

[0071] Control step: Perform normalization processing on various grade characteristic data, then generate a grade determination result according to various detection characteristic data, and dynamically generate sorting execution parameters according to the grade determination result; the control step includes: Real-time calibration step: Perform deviation compensation on the detection data based on a preset reference sample; Abnormal processing step: Trigger a re-inspection process for samples exceeding the threshold and record the abnormal log; Grading model construction step: Construct a grading model through a gradient boosting decision tree according to the quality characteristic data; the grading model constructed through a gradient boosting decision tree includes: parallel model training based on the LightGBM algorithm framework; using the Bayesian optimization algorithm for hyperparameter tuning; setting a dynamic pruning strategy to prevent model overfitting; including multi-class output nodes corresponding to the grade levels of royal jelly.

[0072] Storage step: Store the pre-stored grade characteristic data of royal jelly, the grade characteristic data of the real-time collected royal jelly sample, and the historical grade characteristic data of the collected royal jelly sample. The pre-stored grade characteristic data of royal jelly includes photo or video data, moisture content data and HDA content data corresponding to each grade of royal jelly; Decision optimization step: Iteratively update the weight coefficients of each grade characteristic data in the grading model through historical data.

[0073] Execution step: Drive the actuator to automatically sort and package the original royal jelly corresponding to the royal jelly sample; Human-computer interaction step: Display the grading process and receive real-time manual modification of the sorting execution parameters.

[0074] Verification step: Conduct a secondary sampling inspection and verification on the sorted original royal jelly; Quality traceability steps: Establish an association relationship between the royal jelly sample, the original royal jelly, its production time, detection parameters, and grading results.

[0075] Specifically, step S1: Data acquisition step 1. Synchronous multi-threaded acquisition: Start three independent threads to control the vision sensor, near-infrared spectrometer, and high-performance liquid chromatograph respectively, and realize synchronous data acquisition through Python multi-threading technology. Use the NTP protocol to calibrate the clocks of each device, ensure that the timestamp marking accuracy reaches the millisecond level, and establish the timing association relationship of multi-modal data. Data is asynchronously transmitted through a circular buffer (double-buffer mechanism, capacity 1MB), the acquisition rate is 30MB / h, and the packet loss rate <0.1%.

[0076] 2. Precise sampling and traceability Drive the six-axis robotic arm (UR5e) to cooperate with the 3D vision sensor (Keyence LJ-V7000) for positioning, with a positioning accuracy of ±0.1mm. Dynamically monitor the sampling volume (0 - 50g, accuracy 0.01g) through a micro weighing sensor (HBM U10), and the sampling needle automatically performs ultraviolet disinfection (254nm, 10 seconds). Use the ORB feature point detection algorithm (OpenCV) to establish a two-way association between the sample and the container, with a matching threshold of 0.7 and a matching time <150ms. The fiber laser (IPG YLR-20) generates a QR code that complies with the ISO / IEC 18004 standard on the container surface, with an encoding capacity of 200 bytes.

[0077] 3. Multi-parameter detection Color detection: The industrial camera (Basler acA2000-50gm) collects images under the D65 standard light source, analyzes in the HSV color space, and compares with a 12-level standard color card (ΔE < 2). Moisture detection: The near-infrared spectrometer (Ocean Optics QE65000) calculates the moisture content through the PLS algorithm (R² = 0.989, RMSE = 0.28%), and the temperature compensation formula: correction value = measured value × (1 + 0.0015 × (T - 25)). HDA detection: The high-performance liquid chromatograph (Agilent 1260 Infinity II) is equipped with a C18 chromatographic column, the mobile phase is methanol-water (45:55), the detection wavelength is 210nm, and the content is calculated by peak area integration.

[0078] Step S2: Control and processing step 1. Data preprocessing Perform Z-score standardization (range [-1, 1]) on color, moisture, and HDA data. Use moving average filtering (window 5) to remove high-frequency noise from HDA data and perform temperature compensation to correct moisture data.

[0079] 2. Real-time calibration and anomaly handling Execute three-point calibration (white board / gray board / black board) every day when powering on to establish a spectral response compensation curve. Set three-level thresholds (yellow ±5%, orange ±10%, red ±15%). When a red warning is triggered, initiate a re-inspection process, and record the timestamp, sample number, and anomaly type in the anomaly log.

[0080] 3. Hierarchical model construction and optimization Construct a hierarchical model based on the LightGBM algorithm with parameter settings: num_leaves = 31, max_depth = 8, learning_rate = 0.1. Use Bayesian optimization to tune the parameters (search space: learning_rate 0.01 - 0.3, max_depth 3 - 12), with the F1-score as the objective function. Set a dynamic pruning strategy (maximum number of leaf nodes 100, prune when the Gini gain < 0.01) to prevent overfitting. Historical data is stored in an SQLite database with a capacity of 500GB, supporting a storage of 100,000 records per day. The model automatically updates incrementally every time 5000 new data records are accumulated.

[0081] Step S3: Execute the sorting step 1. Intelligent sorting execution The Delta robot (Epson LS6) dynamically adjusts its motion trajectory (using quintic polynomial interpolation) according to the grading results. The sorting speed is 120 times per minute, and the repeat positioning accuracy is ±0.05mm. The pneumatic gripper (SMC MHF2-16D) has an adjustable gripping force of 5 - 30N to adapt to different packaging containers. The servo filling machine (accuracy ±0.5g) completes quantitative filling, and the packaging material is a food-grade PE bag (thickness 0.08mm).

[0082] 2. Traceability code generation The laser marking machine (Sato CL4NX) generates a one-dimensional code on the packaging surface, including information such as production time, batch number, and grade. Use Hyperledger Fabric blockchain technology to record packaging information. Each package generates a SHA-256 hash value, and the timestamp for uploading to the blockchain is accurate to the second level.

[0083] Step S4: Verification and Traceability Step 1. Secondary Sampling Verification The independent inspection station conducts sampling inspections at a ratio of 10%. The re-inspection results are automatically compared. When the non-conformance rate exceeds 0.5%, a full-batch recall is triggered. The verification process includes reinspection of color, moisture, and all HDA parameters. The testing equipment is configured identically to the main module.

[0084] 2. Quality Traceability System A traceability table (15 fields) is established in the MySQL 8.0 database, supporting 7-level forward / backward traceability, with a query response time < 2 seconds. The traceability information includes container ID, production time, inspection parameters, grading results, etc., and can be queried by scanning the code or entering the batch number.

[0085] Step S5: Human-Machine Interaction Step 1. Real-Time Monitoring and Parameter Adjustment A 15.6-inch industrial touch screen (Advantech TPC-1551HI) displays the grading process (data refresh frequency 5Hz), supporting real-time viewing of grading results. A parameter setting interface (step size 0.1%) is provided, supporting operations such as white balance adjustment of visual sensors and baseline correction of spectrometers.

[0086] 2. Permission Management and Log Recording Three-level permission control (administrator / operator / visitor), with different roles having corresponding operation permissions. The operation log records all actions (timestamp, operator, operation content), with a storage period of 180 days, supporting keyword retrieval.

[0087] This embodiment realizes the automated and precise control of royal jelly grading through a standardized method process, and is applicable to large-scale production scenarios.

[0088] The working process of the present invention is as follows: 1. Data Acquisition Stage The sampling unit precisely samples from the original royal jelly container through a 3D vision-guided sampling robotic arm (accuracy ±0.1mm), and a micro weighing sensor monitors the sampling quantity in real time (accuracy 0.01g). The multi-threaded synchronization control unit drives the visual sensor, near-infrared spectrometer, and high-performance liquid chromatograph to synchronously collect color, moisture, and HDA data, and the timestamp marking technology ensures the consistency of data timing. Laser marking generates a unique traceability code, and the image matching algorithm establishes a two-way association between the sample and the container.

[0089] 2. Control and Processing Stage The control module performs Z-score normalization on multimodal data and calibrates the detection data in real time based on a preset reference sample. The gradient boosting decision tree model processes data through the LightGBM algorithm and generates a hierarchical result by combining Bayesian optimization for parameter tuning and dynamic pruning strategies. Historical data iteratively updates the model weights, and abnormal samples trigger a re-inspection process and log records.

[0090] 3. Sorting Execution Stage The execution module receives control parameters, and the servo drives the robotic arm to automatically sort the raw royal jelly according to the hierarchical result. The filling machine completes quantitative packaging (with an accuracy of ±0.5g). The laser marking machine generates a one-dimensional code containing production information on the packaging surface, and blockchain technology records the traceability data.

[0091] 4. Verification and Traceability Stage The verification module conducts secondary detection on 10% of the sorted products. The re-inspection results are compared with the initial inspection, and if the tolerance is exceeded, a full batch recall is triggered. The quality traceability database associates samples with information such as production time and detection parameters, supporting 7-level forward / backward queries.

[0092] 5. Human-Machine Interaction Stage The touch interface displays the grading process in real time, supports online adjustment of parameter thresholds, and abnormal alarm handling. Three-level permission management ensures operation safety, and historical data can be exported for analysis.

[0093] Working Principle: 1. Multimodal Data Synchronous Acquisition Multithreading technology is used to parallelly control multiple types of sensors, and the timestamp marking and circular buffer mechanism achieve efficient data synchronization. The vision sensor analyzes through the HSV color space, the near-infrared spectrometer uses the PLS algorithm to predict the moisture content, and HPLC calculates the HDA content through the chromatographic peak area.

[0094] 2. Intelligent Grading Decision After the control module normalizes the data, it inputs it into the gradient boosting decision tree model. The model is parallelly trained based on the LightGBM framework, and dynamic pruning prevents overfitting. The Bayesian optimization algorithm automatically searches for the optimal hyperparameters, and historical data drives the continuous optimization of the model.

[0095] 3. Precise Execution and Traceability The sampling robotic arm plans the path through cubic spline interpolation, and the pneumatic gripper achieves flexible sorting. Laser marking and blockchain technology build an immutable traceability system, and the image matching algorithm ensures the two-way association between samples and containers.

[0096] 4. Closed-loop Quality Control The verification module analyzes the re-inspection data through statistical process control (SPC), and the quality traceability system enables the whole-process data to be traceable. The human-machine interaction interface provides real-time monitoring and parameter fine-tuning, and the exception handling mechanism ensures the robustness of the system.

[0097] Through the deep cooperation of hardware and algorithms, the present invention realizes the full-process automatic control of royal jelly grading, significantly improving the production efficiency while ensuring the detection accuracy.

[0098] Although the embodiments of the present invention have been disclosed as above, it is not limited to the applications listed in the specification and embodiments. It can be fully applied to various fields suitable for the present invention. For those familiar with the field, additional modifications can be easily made. Therefore, without departing from the general concept defined by the claims and the equivalent scope, the present invention is not limited to the specific details and the illustrated examples here.

Claims

1. A royal jelly automatic grading control system, characterized in that: include: A data acquisition module, which is configured to synchronously acquire grade characteristic data of the royal jelly sample, wherein the grade characteristic data includes color data, water content data and 10-hydroxy-2-decenoic acid HDA content data of the royal jelly; A control module, which is configured to receive the grade characteristic data of the royal jelly sample collected by the data collection module and perform normalization processing on a plurality of grade characteristic data, then generate a grade determination result according to a plurality of detection characteristic data, and dynamically generate a sorting execution parameter according to the grade determination result; An execution module, configured to receive the sorting execution parameters of the control module and drive the execution mechanism to automatically sort and package the original royal jelly corresponding to the royal jelly sample; A human-machine interface configured to display the grading process and receive manual real-time modifications to sorting execution parameters.

2. The royal jelly automatic grading control system according to claim 1, characterized in that: The control module comprises: A real-time calibration unit configured to perform deviation compensation on the detection data based on a preset reference sample; An exception handling unit, which is configured to trigger a recheck process for samples exceeding a threshold and record an exception log; A classification model unit, which is configured to construct a classification model through a gradient boosting decision tree according to the quality feature data; A storage unit configured to store pre-stored grade characteristic data of royal jelly, grade characteristic data of royal jelly samples collected in real time, and historical grade characteristic data of collected royal jelly samples, wherein the pre-stored grade characteristic data of royal jelly include photo or video data corresponding to each grade of royal jelly, water content data, and HAD content data; The decision optimization unit is configured to iteratively update the weight coefficients of the characteristic data of each grade in the grading model through historical data.

3. The royal jelly automatic grading control system according to claim 1, characterized in that: The data acquisition module comprises: A sampling unit, which is configured to take out a portion of the sample from the original royal jelly as a royal jelly sample by driving the sampling mechanical arm, and is used to establish a one-to-one correspondence between the test sample and the original royal jelly from which it is derived; A color detection unit is configured to obtain image data of the royal jelly sample through a visual sensor, compare it with the photo data corresponding to each grade of royal jelly pre-stored in the control module, and give a color detection result; A moisture detection unit, configured to obtain spectral data of the royal jelly sample through a near infrared spectrometer and calculate the moisture content of the royal jelly sample; The HAD content detection unit is configured to obtain the chromatographic data of the royal jelly sample by high performance liquid chromatography and calculate the HAD content in the royal jelly sample.

4. The royal jelly automatic grading control system according to claim 1, characterized in that: Also includes: A verification module, which is configured to perform a secondary sampling verification on the sorted raw royal jelly; A quality traceability database is configured to associate royal jelly samples with original royal jelly, and their production time, test parameters and grading results.

5. The royal jelly automatic grading control system according to claim 1, characterized in that: The data acquisition module further includes a synchronization control unit, which is configured as follows: The color data, moisture data and HAD content data are collected synchronously through multi-threaded data collection technology; Use timestamp marking technology to establish temporal correlation between multimodal data; Asynchronous processing of data collection and transmission is achieved through a ring buffer mechanism.

6. The royal jelly automatic grading control system according to claim 2, characterized in that: The hierarchical model constructed by the gradient boosting decision tree includes: Parallel model training based on the LightGBM algorithm framework; Use Bayesian optimization algorithm for hyperparameter tuning; Set dynamic pruning strategy to prevent model overfitting; Contains multiple classification output nodes corresponding to the grade levels of royal jelly.

7. The royal jelly automatic grading control system according to claim 3, characterized in that: The sampling unit comprises: The positioning system based on machine vision guides the sampling robot arm to take samples through 3D vision; Integrated micro weighing sensor to achieve dynamic monitoring of sampling volume; Laser marking technology is used to generate a unique traceability code on the surface of the original royal jelly container; A bidirectional association between the sample and the original royal jelly container is established through an image matching algorithm.

8. An automated grading control method for royal jelly based on the system of claim 1, characterized in that: The following steps are involved: Data collection step: synchronously acquiring grade characteristic data of the royal jelly sample, wherein the grade characteristic data includes color data, water content data and 10-hydroxy-2-decenoic acid (HDA) content data of the royal jelly; Control step: normalizing the multiple grade feature data, then generating grade determination results according to the multiple detection feature data, and dynamically generating sorting execution parameters according to the grade determination results; Execution step: driving the actuator to automatically sort and package the original royal jelly corresponding to the royal jelly sample; Human-computer interaction steps: display the grading process and receive manual real-time modifications to sorting execution parameters.

9. The automated grading control method for royal jelly according to claim 8, characterized in that: The control step comprises: Real-time calibration step: compensate the deviation of the test data based on the preset reference sample; Exception handling steps: trigger the re-inspection process for samples that exceed the threshold and record the exception log; Steps for building a classification model: Building a classification model through a gradient boosting decision tree based on quality feature data; Storage step: storing pre-stored royal jelly grade characteristic data, real-time collected royal jelly sample grade characteristic data, and collected historical grade characteristic data of royal jelly samples, wherein the pre-stored royal jelly grade characteristic data includes photo or video data corresponding to each grade of royal jelly, water content data, and HDA content data; Decision optimization step: Iterate and update the weight coefficients of each grade characteristic data in the grading model through historical data.

10. The automated grading control method for royal jelly according to claim 8, characterized in that: The data collection step comprises the following steps: Sampling step: taking out a portion of the sample from the original royal jelly as the royal jelly sample by driving the sampling mechanism, and establishing a one-to-one correspondence between the test sample and the original royal jelly from which it is derived; Color detection step: obtaining the image data of the royal jelly sample through the visual sensor, comparing it with the photo data corresponding to each grade of royal jelly pre-stored in the control step, and giving the color detection result; Moisture detection step: obtaining spectral data of the royal jelly sample through a near-infrared spectrometer and calculating the moisture content of the royal jelly sample; HDA content detection step: obtaining the chromatographic data of the royal jelly sample by high performance liquid chromatography and calculating the HDA content in the royal jelly sample.

Citation Information

Patent Citations

  • Method for rapid detection of contents of water and protein in royal jelly

    CN104849232A

  • Method for quickly measuring moisture content of pulping material with near infrared spectrum technology

    CN105181640A

  • Naoxinshu oral liquid quality control model building method and use

    CN105548030A

  • Construction method for near infrared quantitative correction model of royal jelly and detection method of royal jelly

    CN109030410A

  • Food production full-chain information intelligent monitoring system and method

    CN113344728A

Cited By

  • Method for detecting pure natural royal jelly freeze-dried powder

    CN121558676A

  • A method for detecting pure natural royal jelly freeze-dried powder

    CN121558676B