Wheat quality rapid detection system based on near infrared spectrum
By dynamically classifying detection focus, combining growth environment parameters, and evaluating detection accuracy in real time, the system load status and resource allocation are dynamically adjusted, solving the problems of inaccurate detection results and resource waste in existing wheat quality detection, and achieving efficient and accurate wheat quality detection.
Patent Information
- Application Number
- CN202511625849.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-27
AI Technical Summary
Existing wheat quality detection technologies based on near-infrared spectroscopy suffer from inaccurate results, resource waste, and low efficiency. In particular, when detecting wheat samples under different growing conditions, existing technologies fail to differentiate the level of focus based on the actual conditions of the wheat samples, ignore the influence of growing environment parameters, and lack a real-time evaluation mechanism, resulting in biased test results and low resource utilization.
The system employs a dynamic spectral feature acquisition module to divide the sample areas of interest in real time, combines an environmental parameter coupling analysis module to obtain growth environment parameters, calculates real-time detection accuracy through a spectral accuracy evaluation module, adjusts the system load status through a detection status control module, and dynamically allocates resources through a spectral resource optimization module to achieve dynamic resource allocation.
It improves the accuracy and efficiency of test results, reduces resource waste, ensures that the testing needs of key areas are met, and the system can flexibly adjust its operating status to adapt to different testing scenarios, thereby improving the overall testing performance.
Smart Images

Figure CN121577574A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wheat quality detection technology, specifically a rapid wheat quality detection system based on near-infrared spectroscopy. Background Technology
[0002] In the wheat production and processing industry chain, quality testing is a crucial link in ensuring product quality and market circulation efficiency. Currently, wheat quality testing mainly relies on traditional laboratory testing methods. These methods typically require pretreatment steps such as crushing, extraction, and chemical reactions of wheat samples. Not only are the procedures cumbersome, but they also consume large amounts of chemical reagents and have long testing cycles, often requiring several hours or even days to obtain test results. This makes it difficult to meet the timeliness requirements of wheat purchasing sites and processing production lines.
[0003] With the development of near-infrared spectroscopy technology, it has been gradually applied to the field of wheat quality detection due to its advantages such as no sample pretreatment required and fast detection speed. However, existing wheat quality detection technologies based on near-infrared spectroscopy still have many problems in practical applications.
[0004] Most existing technologies use fixed spectral acquisition modes and fail to divide different detection interest areas according to the actual situation of wheat samples. As a result, the same acquisition standard is used for all sample areas during the detection process. This may result in insufficient acquisition accuracy for high interest areas, affecting the accuracy of the detection results, or over-acquisition for low interest areas, wasting spectral resources.
[0005] Wheat quality is significantly influenced by its growing environment. Parameters such as soil fertility, duration of sunlight, and rainfall all affect the internal components and quality indicators of wheat to some extent. However, existing near-infrared spectroscopy detection technology often ignores the impact of growing environment parameters on the detection results, relying solely on spectral data for quality analysis. This leads to discrepancies between the detection results and the actual quality of wheat, especially when testing wheat samples from different growing environments.
[0006] Existing detection systems lack a real-time evaluation mechanism for detection accuracy, making it impossible to promptly understand the detection precision in different sample areas and consequently, difficult to adjust the system's operating status based on detection accuracy. Furthermore, in terms of spectral resource allocation, existing technologies mostly employ static allocation methods, failing to dynamically adjust spectral analysis resources according to the actual system load and the detection focus of sample areas. This results in low spectral resource utilization, further impacting detection efficiency and the reliability of detection results. These problems severely restrict the promotion and application of near-infrared spectroscopy-based wheat quality detection technology in actual production. Summary of the Invention
[0007] The purpose of this invention is to provide a rapid wheat quality detection system based on near-infrared spectroscopy to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides a rapid wheat quality detection system based on near-infrared spectroscopy, the system comprising: The dynamic acquisition module for spectral features obtains near-infrared spectral reflectance data of wheat samples and divides sample regions of different detection focuses in real time. The environmental parameter coupling analysis module collects the growth environment parameters of wheat samples, and integrates the growth environment parameters with the near-infrared spectral reflectance data of the corresponding sample area to generate an environmental coupling analysis dataset. The spectral accuracy evaluation module calculates the real-time detection accuracy of each sample area based on the difference between the reference quality index in historical detection records and the real-time detection quality index of each sample area in the environmental coupling analysis dataset. The detection status control module switches the load status of the system's spectral acquisition channel based on the relationship between the real-time detection accuracy and the preset detection accuracy threshold. The spectral resource optimization module dynamically allocates near-infrared spectral analysis resources to sample regions of different detection interest levels based on the load status of the spectral acquisition channels.
[0009] Preferably, the dynamic acquisition module for spectral features includes: The regional attention classification submodule obtains the frequency of occurrence of each sample region in consecutive detection frames and marks the high-frequency sample regions as high-attention sample regions. The real-time attention calculation submodule calculates the real-time attention value of each high-attention sample region based on the spectral reflectance feature distribution, spatial location information, and reflectance intensity of each high-attention sample region in a single detection. The secondary attention calculation submodule calculates the real-time attention value of each non-high attention sample area based on the proportion of reflective area of the non-high attention sample area in a single detection and its spatial distance from the high attention sample area. The dynamic region segmentation submodule divides sample regions into different levels of detection fineness based on the real-time attention value.
[0010] Preferably, the real-time attention calculation submodule includes: The feature reflection point extraction unit uses a spectral waveform analysis algorithm to extract the location and reflection intensity value of the feature reflection points in the high-interest sample region in a single detection. The region contour mapping unit determines the position of the visible contour points of the sample region in the current detection frame based on the three-dimensional coordinates of the geometric vertices of the high-interest sample region and the detection viewpoint direction. The feature point difference comparison unit calculates the difference between the number of feature reflection points and the number of visible contour points, and uses the reciprocal of the sum of this difference and the first spectral correction coefficient as the first attention reference value. The reflectance intensity analysis unit obtains the average reflectance intensity ratio of the high-interest sample area in a single detection as a second reference value for interest. The attention integration unit performs a normalized multiplication operation on the number of matching feature reflection points, the first attention reference value, and the second attention reference value, and outputs the real-time attention value of the high attention sample region.
[0011] Preferably, the secondary attention calculation submodule includes: The minimum spatial distance calculation unit obtains the minimum spatial distance between non-high-interest sample regions and all high-interest sample regions; The distance influence factor unit uses the reciprocal of the sum of the minimum spatial spacing and the second spectral correction coefficient as the first attention influence factor; The regional reflectance ratio unit calculates the reflectance area ratio of non-high-interest sample regions in a single detection as the second attention influence factor. The level adjustment unit divides the difference between the total number of fine-grained levels detected and the preset level correction value by the total number of fine-grained levels detected to obtain the attention adjustment weight. The secondary attention integration unit multiplies the product of the first attention influence factor and the second attention influence factor by the attention adjustment weight, and outputs the real-time attention value of the non-high attention sample area.
[0012] Preferably, the spectral accuracy evaluation module includes: The historical reference comparison submodule obtains the reference quality index data sequence for each sample area in the historical detection records; The real-time difference detection submodule calculates the absolute difference value sequence between the reference quality index data sequence and the current real-time detection quality index data; The detection accuracy conversion submodule sums all absolute difference values and then performs negative normalization to generate the real-time detection accuracy of the sample region.
[0013] Preferably, the detection state control module includes: The high-load state switching submodule activates the high-load state of the spectral acquisition channel when the real-time detection accuracy is less than or equal to the preset detection accuracy threshold, or when the system spectral resource occupancy rate exceeds the preset resource occupancy threshold. When the real-time detection accuracy is consistently greater than the preset detection accuracy threshold and the system spectral resource idle rate exceeds the preset resource release threshold for a stable period of time, the normal state switching submodule restores the normal load state of the spectral acquisition channel.
[0014] Preferably, the spectral resource optimization module includes: The detection task classification submodule divides the detection task priority according to the fine level of the sample region and attaches a corresponding priority label; When the spectral acquisition channel is under high load, the spectral resource allocation submodule prioritizes allocating idle spectral analysis resources to the detection task corresponding to the highest priority tag. The resource matching execution submodule analyzes and processes detection tasks of the same priority based on the type of real-time idle spectral resources and matches them with detection tasks of the corresponding resource requirement type.
[0015] Preferably, the detection task grading submodule includes: The resource consumption analysis unit compiles historical data on the percentage of resources consumed by the spectral analysis instrument during testing tasks. The resource type tagging unit uses the spectral analysis resource type with the highest consumption rate as the resource requirement type label for the detection task; The task queue management unit establishes different priority task queues based on the fineness level of detection, and sub-queues are established within each queue according to the resource requirement type label.
[0016] Preferably, the spectral resource optimization module further includes: When the spectral acquisition channel is under high load, the high-load task scheduling submodule will import newly arriving detection tasks into the waiting queue with the corresponding priority and resource requirement type. The real-time resource monitoring submodule dynamically acquires idle rate data for various spectral analysis resources; The task execution optimization submodule selects the detection task that matches the type of spectral analysis resource with the highest current idle rate from the highest priority pending queue for execution and analysis.
[0017] Preferably, the normal state switching submodule includes: The continuous status monitoring unit simultaneously monitors real-time detection accuracy data and system spectral resource idle rate data under high load conditions of the spectral acquisition channel; The dual-condition judgment unit triggers a load state switching command when the real-time detection accuracy continuously exceeds the preset detection accuracy threshold and the idle rate of all spectral analysis resource types continuously exceeds the preset resource release threshold to reach a stable time window. The state switching execution unit responds to the load state switching command and restores the spectral acquisition channel to the normal load state.
[0018] Compared with the prior art, the beneficial effects of the present invention are: The dynamic spectral feature acquisition module can acquire near-infrared spectral reflectance data of wheat samples and divide sample areas of different detection priorities in real time. This dynamic division method changes the traditional detection model that uses a uniform acquisition standard for all sample areas. It allows for differentiated spectral acquisition strategies for areas of different priorities, making the detection process more targeted. For high-priority areas, more detailed spectral data can be acquired, capturing more quality-related feature information; for low-priority areas, the acquisition intensity can be reasonably controlled while ensuring basic detection needs are met, avoiding unnecessary resource consumption. This improves the effectiveness of detection in key areas while achieving high efficiency in the spectral acquisition process.
[0019] The environmental parameter coupling analysis module collects the growth environment parameters of wheat samples and integrates them with the near-infrared spectral reflectance data of the corresponding sample areas to generate an environmental coupling analysis dataset. This module fully considers the impact of the growth environment on wheat quality, breaking through the limitations of traditional detection methods that rely solely on spectral data. The combination of growth environment parameters and spectral data can more comprehensively reflect the background of wheat quality formation, making the quality analysis based on this dataset more closely reflect the actual growth conditions of wheat. This reduces detection bias caused by ignoring environmental factors, allowing the detection results to more accurately reflect the quality status of wheat. This advantage is particularly prominent when testing wheat samples from different growth environments, effectively improving the reliability and accuracy of the detection results.
[0020] The spectral accuracy assessment module calculates real-time detection accuracy based on the difference between historical reference quality indicators and real-time detection quality indicators for each sample region in the environmental coupling analysis dataset. This assessment mechanism enables dynamic monitoring of the detection process, allowing for timely understanding of changes in detection accuracy for each sample region. By monitoring detection accuracy in real time, potential problems in the current detection process can be clearly identified. For example, if the detection accuracy of a certain sample region is abnormal, the problem can be quickly located, providing direction for subsequent adjustments to the detection strategy. This avoids erroneous detection results due to insufficient detection accuracy and ensures the controllability of the entire detection process.
[0021] The detection status control module switches the load status of the system's spectral acquisition channels based on the relationship between real-time detection accuracy and a preset threshold. This accuracy-based state switching method allows the system to flexibly adjust its operating status according to actual detection conditions. When the real-time detection accuracy is higher than the preset threshold, the load status can be adjusted appropriately to improve detection efficiency; when the real-time detection accuracy is lower than the preset threshold, it promptly switches to a more optimal load status to ensure that the spectral acquisition channels operate in a more suitable mode, guaranteeing detection accuracy and avoiding problems such as unstable detection accuracy or low efficiency caused by the system being in a fixed load state for a long time.
[0022] The spectral resource optimization module dynamically allocates near-infrared spectral analysis resources to sample regions of different detection priorities based on the load status of the spectral acquisition channels. This dynamic allocation method achieves rational allocation of spectral resources, avoiding resource waste or shortages as seen in traditional static allocation methods. When the system load is high, resources can be prioritized for high-priority sample regions to ensure that the detection needs of key areas are met; when the system load is low, resources can be rationally allocated to various regions to improve overall detection efficiency. Through dynamic optimization of resource configuration, the utilization rate of spectral resources is significantly improved, further enhancing the operating efficiency and detection performance of the entire detection system. This allows the system to maintain good operating conditions under different detection scenarios, better meeting the actual needs of wheat quality detection. Attached Figure Description
[0023] Figure 1 This is a time-series diagram of the rapid wheat quality detection system based on near-infrared spectroscopy described in this invention. Figure 2 A flowchart illustrating the operation of the real-time attention calculation submodule; Figure 3 A flowchart illustrating the operation of the secondary attention calculation submodule; Figure 4 A flowchart illustrating the operation of the spectral resource optimization module; Figure 5 An additional flowchart for optimizing spectral resources under high load conditions. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Please see Figure 1 This invention provides a rapid wheat quality detection system based on near-infrared spectroscopy, the system comprising: The system acquires near-infrared reflectance data of wheat samples through a dynamic spectral feature acquisition module and divides sample areas of different detection focuses in real time. An environmental parameter coupling analysis module collects growth environment parameters of the wheat samples and integrates these parameters with the near-infrared reflectance data of the corresponding sample areas to generate an environmental coupling analysis dataset. A spectral accuracy evaluation module calculates the real-time detection accuracy of each sample area based on the difference between the reference quality index in historical detection records and the real-time detection quality index in the environmental coupling analysis dataset. A detection status control module switches the load status of the system's spectral acquisition channels based on the relationship between real-time detection accuracy and a preset detection accuracy threshold. A spectral resource optimization module dynamically allocates near-infrared spectral analysis resources to sample areas of different detection focuses based on the load status of the spectral acquisition channels. This system achieves efficient and accurate detection of wheat quality and optimizes resource utilization.
[0026] Example 1: The implementation of the dynamic spectral feature acquisition module is achieved through a series of collaborative sub-modules. These sub-modules process the raw spectral data acquired from the surface of wheat samples and intelligently segment the sample regions based on dynamically changing attention levels. When the region attention level grading sub-module starts working, the system is scanning wheat samples continuously passing through the conveyor belt. The near-infrared spectral camera captures spectral images at a rate of several frames per second. Each frame is divided into multiple regular sample region units. The sub-module maintains a dynamically updated frequency statistics table, recording the number of times each sample region unit appears in consecutive detection frames. When the number of times a unit appears within a set time window exceeds a preset frequency threshold, the unit is marked as a high-attention sample region. These high-attention regions typically correspond to key monitoring features in the wheat sample, such as the germ region or specific texture feature areas. The system updates the high-attention region list in real time, removing regions that no longer appear frequently and adding newly appearing high-frequency regions.
[0027] The real-time attention calculation submodule performs a more detailed analysis of each marked high-interest sample region. This submodule receives a real-time data stream from the spectral camera, including the spectral reflectance distribution, spatial coordinates, and reflectance intensity values of each high-interest region. For each high-interest region, the submodule analyzes its relative position within the entire detection field of view and, combined with the region's spectral reflectance characteristics, calculates a quantified real-time attention value. This value reflects the importance of the region at the current detection moment; a higher value indicates that the region requires more detection resources.
[0028] Meanwhile, the secondary attention calculation submodule handles the remaining areas that were not marked as high-attention sample regions. Although these non-high-attention sample regions occur less frequently, they may still contain valuable detection information. This submodule calculates the proportion of the reflective area of each non-high-attention region in the total detection area, while also measuring the spatial distance between these regions and the nearest high-attention sample region. Based on these parameters, the submodule calculates a corresponding real-time attention value for each non-high-attention region. This value is typically lower than that for high-attention regions, but it effectively distinguishes the relative importance between different non-high-attention regions.
[0029] The dynamic region segmentation submodule receives the attention values output from the first two submodules and uses them as a basis for hierarchical segmentation of the sample region. This submodule pre-defines multiple detection refinement levels, each corresponding to different detection precision and resource allocation schemes. By comparing the real-time calculated attention values with preset level thresholds, each sample region is assigned to the corresponding detection refinement level. Regions with high attention values are assigned to the high-refinement level, which will receive higher precision spectral analysis and more frequent detection; regions with medium attention values are assigned to the medium-refinement level; and regions with low attention values are assigned to the basic refinement level. This dynamic segmentation process is continuous; as samples move and spectral characteristics change, the attention values of each region are constantly updated, and its corresponding detection refinement level may also be adjusted accordingly.
[0030] Throughout the implementation, these submodules exchange data efficiently via shared memory and a data bus. The regional attention grading submodule pushes a list of high-attention sample regions to other submodules in real time; the real-time attention calculation submodule and the secondary attention calculation submodule write the calculated attention values into the common data area; and the dynamic region partitioning submodule reads these values from the data area and makes hierarchical partitioning decisions. The processing cycle of all submodules is synchronized with the acquisition frame rate of the spectral camera, ensuring that the system can respond to changes in sample characteristics in real time.
[0031] The system employs a multi-threaded parallel processing architecture, with each submodule running on an independent processing thread. Secure data access is achieved through mutexes and semaphores. At the hardware level, these processing tasks are allocated to dedicated processor cores, coupled with high-speed cache memory, ensuring high-speed and real-time data processing. Through this collaborative mechanism, the entire spectral feature dynamic acquisition module achieves intelligent sensing and dynamic segmentation of wheat sample areas, laying a solid foundation for subsequent detection and processing stages.
[0032] In practical applications, when wheat samples pass through the detection area at a constant speed, the system can automatically identify key regions within the sample and allocate appropriate detection resources. For example, if an area of a sample exhibits abnormal spectral features across multiple consecutive frames, its attention value will automatically increase, thus placing it in a finer detection level for more detailed spectral analysis. Conversely, areas with stable spectral features and no significant changes will have their detection level appropriately reduced to conserve system resources for areas requiring greater attention. This dynamic adjustment mechanism allows the system to optimize overall resource utilization efficiency without compromising the detection quality of key regions.
[0033] Example 2: See Figure 2 and Figure 3 The implementation of the real-time attention calculation submodule and the secondary attention calculation submodule demonstrates the system's deep analytical capabilities for spectral data. These two submodules work collaboratively to perform refined calculations of attention levels for sample regions. The real-time attention calculation submodule focuses on the marked high-attention sample regions. As wheat samples pass through the detection area at a constant speed on the conveyor belt, the near-infrared spectral camera continuously captures spectral data from the sample surface. The feature reflectance point extraction unit first analyzes the spectral waveform of each high-attention sample region, using a spectral waveform analysis algorithm to identify the reflectance feature points within a specific wavelength range. These feature points include reflectance peaks, valleys, and inflection points, and each feature point records its corresponding wavelength position and reflectance intensity value. For example, when analyzing wheat protein content, this unit focuses on reflectance feature points appearing near specific wavelengths.
[0034] Simultaneously, the region contour mapping unit begins operation. Based on the 3D coordinates of the geometric vertices of the high-interest sample region and the orientation parameters of the current detection viewpoint, this unit calculates the actual visible contour of the region in the current detection frame. Through a 3D-to-2D projection transformation, the precise boundary position of the region on the image plane is determined. This process requires comprehensive consideration of camera parameters, lighting conditions, and the geometry of the sample surface.
[0035] The feature point difference comparison unit receives the processing results from the first two units and assesses the spectral feature richness of the region by comparing the degree of difference between the number of feature reflection points and the number of visible contour points. This unit combines the calculated difference with a system-preset spectral correction coefficient to generate an intermediate parameter reflecting the salience of the region's features. This parameter is further transformed into a first-interest reference value.
[0036] The reflectance intensity analysis unit analyzes the spectral data of the same region in parallel, calculating the relative proportion of the region's average reflectance intensity within the overall detection range. This unit statistically analyzes the reflectance intensity values of all sampling points within the region, calculating its ratio to the global maximum reflectance intensity, thus obtaining a second reference value of interest. This reference value reflects the strength of the region's reflectance characteristics in the current detection frame.
[0037] The attention integration unit then processes all the aforementioned parameters. This unit receives the number of matched feature reflection points, the first attention reference value, and the second attention reference value, and fuses these parameters into a comprehensive real-time attention value through normalized multiplication. This value ultimately represents the importance of the high-attention sample region at the current moment and will be passed to the subsequent dynamic region segmentation submodule.
[0038] Meanwhile, the secondary attention calculation submodule handles the remaining regions that were not marked as high-attention sample regions. The minimum spatial distance calculation unit first determines the spatial relationship between each non-high-attention sample region and all high-attention sample regions. By calculating the Euclidean distance in three-dimensional space, it finds the minimum spatial distance between each non-high-attention region and the nearest high-attention region. This distance value reflects the proximity of the non-high-attention region to the important regions.
[0039] The distance impact factor unit combines the obtained minimum spatial spacing with another preset spectral correction coefficient to generate the first level of attention impact factor through mathematical transformation. This impact factor is inversely proportional to the spatial distance; that is, the closer a non-high-attention area is to the high-attention area, the larger its impact factor value.
[0040] The region reflectance percentage unit simultaneously calculates the reflectance area percentage of each non-high-interest sample region in a single detection. This unit counts the number of pixels occupied by this region in the detection field of view, calculates its ratio to the total detection area, and obtains the second attention influence factor. This factor reflects the physical size of the region within the current detection range.
[0041] The hierarchical adjustment unit calculates a dynamic adjustment weight coefficient based on the total number of fine-grained detection levels currently set in the system. This coefficient is used to balance the distribution of attention among different levels, preventing system resources from being overly concentrated in certain specific levels. The secondary attention integration unit then combines the outputs of the first four units. This unit multiplies the first and second attention influence factors, then multiplies by the weight coefficient calculated by the hierarchical adjustment unit, ultimately outputting the real-time attention value for each non-high-attention sample region. Although this value is usually lower than the corresponding value for high-attention regions, it effectively distinguishes the relative importance between different non-high-attention regions.
[0042] Throughout the implementation, these two submodules collaborate efficiently through a shared data bus and memory buffer. The processing results from the real-time attention calculation submodule are promptly updated to the common data area for use by the secondary attention calculation submodule. All calculations are synchronized with the frame rate of the spectral camera, ensuring the system can respond to changes in sample features in real time. Each submodule employs a multi-threaded parallel processing architecture, distributing computational tasks across different sample regions to maximize computational efficiency.
[0043] When testing wheat samples of different varieties, these two submodules can automatically adjust their parameter calculation strategies to generate corresponding attention values based on the actual spectral characteristics of the samples. For example, when processing wheat samples with high protein content, the system automatically increases the attention value of regions with characteristic reflectance within a specific wavelength range; while when processing samples with high moisture content, it adjusts the focus of attention calculation accordingly. This adaptive calculation mechanism enables the system to flexibly cope with various detection scenarios and maintain stable detection performance.
[0044] Example 3: The spectral accuracy assessment module and the detection status control module together constitute the core of the system's quality control. These two modules work collaboratively to achieve continuous monitoring of detection accuracy and intelligent adjustment of system resources. When the spectral accuracy assessment module starts working, the historical reference comparison submodule first retrieves historical detection records for the current sample area from the system database. These records contain a sequence of reference quality index data obtained from multiple previous tests of that area, such as historical measurements of protein content, moisture content, ash content, and other quality parameters. This submodule organizes this historical data chronologically, forming a data sequence with temporal characteristics.
[0045] The real-time difference detection submodule receives the quality index data obtained from the current real-time detection and compares it with historical reference data. This submodule calculates the absolute difference between each historical data point in the reference quality index data sequence and the current real-time detection value, generating a sequence containing all difference values. This difference sequence reflects the degree of deviation between the current detection result and the historical benchmark, providing a quantitative basis for accuracy assessment. The detection accuracy conversion submodule further processes the obtained difference sequence. This submodule adds all absolute difference values to obtain a total difference value, and then converts it into an accuracy value through negative normalization. This conversion process uses the following formula:
[0046] in: This indicates the real-time detection accuracy of the current sample region. This represents the sum of all absolute differences. This represents the maximum possible difference value set based on the fluctuation range of historical data. This maximum possible difference value is determined according to the fluctuation characteristics of quality indicators in the long-term detection records of the sample area, reflecting the normal range of variation of quality indicators in the area. Using this calculation method, when the real-time detection results are highly consistent with historical data, the accuracy value is close to 1; when significant differences occur, the accuracy value decreases accordingly.
[0047] The detection status control module dynamically adjusts the system's operating status based on the accuracy value output by the spectral accuracy evaluation module. The high-load state switching submodule continuously monitors the real-time detection accuracy value and the system's spectral resource utilization rate. When the real-time detection accuracy value drops to or below a preset detection accuracy threshold, this submodule immediately triggers the state switching mechanism. Similarly, when the system's spectral resource utilization rate exceeds a preset resource utilization threshold, this submodule will also initiate a state switch regardless of the accuracy value. Both of these situations cause the spectral acquisition channel to enter a high-load state. In this state, the system increases the density and frequency of spectral acquisition, improving detection accuracy.
[0048] When the system is under high load, the normal state switching submodule simultaneously monitors two key parameters: real-time detection accuracy data and system spectral resource idle rate data. This submodule sets a stable time window; a state switching command is only triggered when the accuracy value consistently exceeds a preset threshold, and the idle rate of all types of spectral analysis resources remains above the resource release threshold, and this state remains stable for a specified duration. This dual-condition determination mechanism avoids frequent system state switching near critical points, ensuring system stability.
[0049] The state switching execution unit is responsible for implementing the state transition operations. Upon receiving a switching command, this unit adjusts the operating parameters of the spectral acquisition channel, including modifying the acquisition frequency, adjusting the integration time, and reconfiguring filter settings. During the recovery from a high-load state to a normal state, the unit gradually reduces the acquisition intensity to avoid a sudden drop in detection quality. The entire state switching process employs a smooth transition to ensure the continuity and consistency of the detection data.
[0050] The implementation of these two modules relies on an efficient data processing architecture and sophisticated control logic. The spectral accuracy assessment module needs to process large amounts of historical and real-time data, requiring highly accurate and rapid calculations. The detection status control module needs to monitor multiple system parameters in real time and make timely status adjustment decisions. The system achieves collaborative work between these two modules through a dedicated data bus and control interface, ensuring that the accuracy assessment results can be promptly translated into appropriate control actions.
[0051] In actual operation, when testing wheat samples, these two modules form a closed-loop control system. The spectral accuracy assessment module continuously evaluates the current detection quality, while the detection status control module adjusts the system's operating status based on the assessment results. This design allows the system to automatically adapt to wheat samples with different quality characteristics, optimizing resource utilization efficiency while ensuring detection accuracy. For example, when abnormal fluctuations in sample quality indicators are detected, the system automatically increases the detection intensity; conversely, when sample quality is stable, it appropriately reduces resource consumption. This adaptive operating mode enables the system to maintain optimal working condition under various detection conditions.
[0052] Example 4: See Figure 4 In the implementation of a rapid wheat quality detection system based on near-infrared spectroscopy, the spectral resource optimization module achieves intelligent scheduling and optimized allocation of system analysis resources through the collaborative operation of the detection task classification submodule, the spectral resource allocation submodule, and the resource matching execution submodule. This module dynamically adjusts the resource allocation strategy according to the detection fineness level of the sample region, ensuring that high-priority tasks receive sufficient computing resources. The detection task classification submodule first processes the incoming detection tasks. Based on the detection fineness level information provided by the dynamic region division submodule, this submodule divides the detection tasks into three priority levels: high fineness level corresponding to priority label P1, medium fineness level corresponding to P2, and low fineness level corresponding to P3. Each detection task is assigned a corresponding priority label upon creation, and these labels determine the task's position in the resource allocation queue.
[0053] The resource consumption analysis unit is responsible for statistically analyzing the system resource usage of historical detection tasks. This unit maintains a resource consumption statistics database, recording the average proportion of spectral analysis resources (CPU, memory, storage I / O, and network bandwidth) used by each type of detection task over a past period. By analyzing historical data, this unit can identify the resource usage characteristics of different detection task types. See Table 1 for historical resource consumption statistics for detection tasks.
[0054] Table 1: Statistics on resource consumption of historical testing tasks.
[0055]
[0056] Based on the resource consumption analysis results, the resource type labeling unit adds a resource requirement type label to each detection task. This unit analyzes the main resource consumption characteristics of each task type and labels the task as "computation-intensive," "memory-intensive," "storage-intensive," or "network-intensive." For example, as can be seen from the table, the protein analysis task has high requirements for CPU and memory resources, and therefore is labeled as "computation-memory-intensive."
[0057] The task queue management unit establishes a multi-level priority queue system to organize pending detection tasks. This unit creates three main queues corresponding to priorities P1, P2, and P3, respectively. Each main queue is further divided into several sub-queues based on resource requirement type. Newly arriving detection tasks are inserted into the corresponding sub-queue according to their priority tag and resource requirement type. Queue management employs a dynamic adjustment mechanism, automatically adjusting the task processing rate of each queue based on system load.
[0058] The spectral resource allocation submodule starts operating under high system load, monitoring the idle status of various system resources in real time. It obtains resource metrics such as CPU core idle rate, available memory capacity, storage I / O bandwidth, and network bandwidth through the resource monitoring interface. When available idle resources are detected, this submodule prioritizes selecting tasks from the highest priority queue (P1 queue) for resource allocation. During allocation, it considers the match between the resource type required by the task and the currently available idle resources, allocating computationally intensive tasks to idle CPU cores and memory-intensive tasks to computing nodes with sufficient memory capacity.
[0059] The resource matching and execution submodule handles resource allocation among multiple detection tasks with the same priority. It employs a resource demand matching algorithm to analyze the resource requirement characteristics of each task and match them with currently available resource types. When multiple tasks of the same priority compete for resources, this submodule prioritizes the task whose resource requirement best matches the available idle resources. For example, when the system has both idle CPU and idle memory, it prioritizes tasks that require both computational and memory resources to maximize resource utilization.
[0060] The entire spectral resource optimization module is implemented using a distributed architecture, with each submodule running on different processing nodes and exchanging and coordinating data via a high-speed network. The detection task classification submodule acts as a front-end processor, quickly classifying and labeling input tasks; the spectral resource allocation submodule acts as a resource scheduler, monitoring the global resource status and making allocation decisions; and the resource matching execution submodule acts as an executor, responsible for assigning tasks to specific computing nodes for execution. The module employs an event-driven mechanism, triggering corresponding processing flows when a new detection task arrives, resource status changes, or a task completes. This design ensures the system can quickly respond to status changes and adjust resource allocation strategies promptly. Simultaneously, the module implements a load balancing mechanism, evenly distributing tasks across computing nodes to prevent some nodes from becoming overloaded while others remain idle.
[0061] In actual operation, when a batch of wheat samples enters the detection system, the dynamic acquisition module for spectral features generates multiple detection tasks. These tasks, after being classified and labeled by the task classification submodule, are sent to their respective priority queues. The spectral resource allocation submodule selects suitable tasks from the queues and allocates them to computing resources based on the current system resource status. The resource matching and execution submodule ensures that tasks are assigned to the most suitable computing nodes for execution. This entire process achieves efficient processing of detection tasks, ensuring that critical detection tasks receive priority processing while fully utilizing system computing resources.
[0062] Example 5: See Figure 5 The high-load task scheduling submodule, real-time resource monitoring submodule, and task execution optimization submodule of the spectral resource optimization module, along with the continuous state monitoring unit, dual-condition judgment unit, and state switching execution unit of the normal state switching submodule, together constitute the intelligent management core of the system under high-load conditions. These components, through precise coordination, achieve dynamic optimization of system resources and smooth transitions between operating states.
[0063] The high-load task scheduling submodule starts working when the system enters a high-load state in the spectral acquisition channel. This submodule receives detection task data from the detection task classification submodule. These tasks have been assigned corresponding priority tags and resource requirement type identifiers according to the fine-grained detection level. The scheduling submodule maintains a multi-level pending queue system, which is organized from high to low priority. Each priority queue is further subdivided according to resource requirement type. Newly arrived detection tasks are automatically imported into the corresponding priority and resource requirement type pending subqueue. The import process is based on the priority identifier and resource type tag contained in the task metadata, and quickly locates the target subqueue through a hash mapping algorithm. Queue management adopts a dynamic balancing mechanism, which can automatically adjust the task allocation strategy according to the length and waiting time of each subqueue to prevent task backlog in some subqueues.
[0064] The real-time resource monitoring submodule continuously tracks the utilization status of various spectral analysis resources in the system. Through the system's underlying resource monitoring interface, it acquires key indicators such as the idle percentage of CPU computing cores, available memory capacity, storage I / O bandwidth idle rate, and network bandwidth idle rate at a fixed sampling frequency. This monitoring data is updated in real-time to the shared memory area for other submodules to query. The monitoring submodule also implements data smoothing, eliminating interference from instantaneous fluctuations by weighted averaging of data from multiple consecutive sampling points, ensuring the stability of resource status assessment. When a significant change in the idle rate of certain resource types is detected, this submodule immediately sends a status update notification to the task execution optimization submodule.
[0065] The task execution optimization submodule makes task scheduling decisions based on real-time resource monitoring data. It periodically scans the highest-priority queue and, combined with the current idle rate data of various spectral analysis resources, selects the most suitable detection task for analysis. The selection algorithm first identifies the resource type with the highest idle rate, then searches the highest-priority queue for detection tasks matching the demand of that resource type. When multiple matching tasks exist, the algorithm further compares the waiting time and resource demand intensity of these tasks, selecting the task that maximizes the utilization of currently idle resources. After selecting a task, this submodule sends instructions to the resource allocation system to assign the task to the corresponding computing node for execution.
[0066] The continuous status monitoring unit of the normal state switching submodule maintains monitoring of key parameters when the system is under high load. This unit continuously acquires real-time detection accuracy values through a data acquisition interface, while simultaneously monitoring the idle rate data of all spectral analysis resource types. Monitoring data is stored in a circular buffer in time-series format, retaining historical records for trend analysis and smoothing. The monitoring unit employs a multi-indicator comprehensive evaluation strategy, focusing not only on data values at individual time points but also analyzing the changing trends and fluctuation characteristics of each parameter.
[0067] The dual-condition decision-making unit determines state switching based on data provided by the continuous state monitoring unit. This unit sets a configurable stable time window, requiring that the real-time detection accuracy value continuously exceeds a preset detection accuracy threshold, and that the idle rate of all spectral analysis resource types continuously exceeds a preset resource release threshold. The decision-making algorithm uses a sliding window technique to check whether all sampling points simultaneously meet both conditions within a specified time interval. Only when all conditions are met throughout the entire time window will the unit generate a load state switching command. This strict dual-condition decision-making mechanism effectively prevents erroneous switching caused by temporary state fluctuations.
[0068] The state switching execution unit is responsible for implementing specific state transition operations. Upon receiving a switching command, this unit gradually restores the spectral acquisition channel from a high-load state to a normal-load state according to a predefined state transition procedure. The switching process employs a gradual adjustment strategy, smoothly changing the operating parameters of the acquisition channel through multiple small-step adjustments, including gradually reducing the spectral acquisition frequency, adjusting the gain settings of the photomultiplier tube, and modifying the passband width of the spectral filter. After each parameter adjustment, the unit waits for the system to run stably for a period of time to confirm that all indicators are normal before proceeding to the next adjustment. The entire switching process ensures a smooth transition in system performance, avoiding fluctuations in the quality of detection data due to sudden state changes.
[0069] These submodules work together efficiently through a distributed collaborative architecture. The high-load task scheduling submodule and the task execution optimization submodule are deployed on the system's scheduling node, the real-time resource monitoring submodule is distributed across various computing nodes, and the normal state switching submodule runs on the system control node. The modules communicate with each other via a high-speed data bus, using a publish-subscribe model to exchange status information and control commands. The system also implements a heartbeat detection mechanism to periodically check the operational status of each submodule, ensuring the reliability and stability of the entire management system.
[0070] In actual operation, when the wheat quality testing system enters a high-load state, these sub-modules form a complete control closed loop. High-load task scheduling ensures that newly arrived tasks are queued in an orderly manner, real-time resource monitoring provides a basis for decision-making, task execution optimization maximizes resource utilization, and the normal state switching mechanism restores the system to normal operating conditions in a timely manner when conditions permit. This design enables the system to intelligently cope with various load conditions and achieve optimal resource utilization efficiency while ensuring testing quality.
[0071] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0072] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A rapid wheat quality detection system based on near-infrared spectroscopy, characterized in that, The system includes: The dynamic acquisition module for spectral features obtains near-infrared spectral reflectance data of wheat samples and divides sample regions of different detection focuses in real time. The environmental parameter coupling analysis module collects the growth environment parameters of wheat samples, and integrates the growth environment parameters with the near-infrared spectral reflectance data of the corresponding sample area to generate an environmental coupling analysis dataset. The spectral accuracy evaluation module calculates the real-time detection accuracy of each sample area based on the difference between the reference quality index in historical detection records and the real-time detection quality index of each sample area in the environmental coupling analysis dataset. The detection status control module switches the load status of the system's spectral acquisition channel based on the relationship between the real-time detection accuracy and the preset detection accuracy threshold. The spectral resource optimization module dynamically allocates near-infrared spectral analysis resources to sample regions of different detection interest levels based on the load status of the spectral acquisition channels.
2. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 1, characterized in that, The dynamic acquisition module for spectral features includes: The regional attention classification submodule obtains the frequency of occurrence of each sample region in consecutive detection frames and marks the high-frequency sample regions as high-attention sample regions. The real-time attention calculation submodule calculates the real-time attention value of each high-attention sample region based on the spectral reflectance feature distribution, spatial location information, and reflectance intensity of each high-attention sample region in a single detection. The secondary attention calculation submodule calculates the real-time attention value of each non-high attention sample area based on the proportion of reflective area of the non-high attention sample area in a single detection and its spatial distance from the high attention sample area. The dynamic region segmentation submodule divides sample regions into different levels of detection fineness based on the real-time attention value.
3. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 2, characterized in that, The real-time attention calculation submodule includes: The feature reflection point extraction unit uses a spectral waveform analysis algorithm to extract the location and reflection intensity value of the feature reflection points in the high-interest sample region in a single detection. The region contour mapping unit determines the position of the visible contour points of the sample region in the current detection frame based on the three-dimensional coordinates of the geometric vertices of the high-interest sample region and the detection viewpoint direction. The feature point difference comparison unit calculates the difference between the number of feature reflection points and the number of visible contour points, and uses the reciprocal of the sum of this difference and the first spectral correction coefficient as the first attention reference value. The reflectance intensity analysis unit obtains the average reflectance intensity ratio of the high-interest sample area in a single detection as a second reference value for interest. The attention integration unit performs a normalized multiplication operation on the number of matching feature reflection points, the first attention reference value, and the second attention reference value, and outputs the real-time attention value of the high attention sample region.
4. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 2, characterized in that, The secondary attention calculation submodule includes: The minimum spatial distance calculation unit obtains the minimum spatial distance between non-high-interest sample regions and all high-interest sample regions; The distance influence factor unit uses the reciprocal of the sum of the minimum spatial spacing and the second spectral correction coefficient as the first attention influence factor; The regional reflectance ratio unit calculates the reflectance area ratio of non-high-interest sample regions in a single detection as the second attention influence factor. The level adjustment unit divides the difference between the total number of fine-grained levels detected and the preset level correction value by the total number of fine-grained levels detected to obtain the attention adjustment weight. The secondary attention integration unit multiplies the product of the first attention influence factor and the second attention influence factor by the attention adjustment weight, and outputs the real-time attention value of the non-high attention sample area.
5. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 1, characterized in that, The spectral accuracy evaluation module includes: The historical reference comparison submodule obtains the reference quality index data sequence for each sample area in the historical detection records; The real-time difference detection submodule calculates the absolute difference value sequence between the reference quality index data sequence and the current real-time detection quality index data; The detection accuracy conversion submodule sums all absolute difference values and then performs negative normalization to generate the real-time detection accuracy of the sample region.
6. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 1, characterized in that, The detection status control module includes: The high-load state switching submodule activates the high-load state of the spectral acquisition channel when the real-time detection accuracy is less than or equal to the preset detection accuracy threshold, or when the system spectral resource occupancy rate exceeds the preset resource occupancy threshold. When the real-time detection accuracy is consistently greater than the preset detection accuracy threshold and the system spectral resource idle rate exceeds the preset resource release threshold for a stable period of time, the normal state switching submodule restores the normal load state of the spectral acquisition channel.
7. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 1, characterized in that, The spectral resource optimization module includes: The detection task classification submodule divides the detection task priority according to the fine level of the sample region and attaches a corresponding priority label; When the spectral acquisition channel is under high load, the spectral resource allocation submodule prioritizes allocating idle spectral analysis resources to the detection task corresponding to the highest priority tag. The resource matching execution submodule analyzes and processes detection tasks of the same priority based on the type of real-time idle spectral resources and matches them with detection tasks of the corresponding resource requirement type.
8. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 7, characterized in that, The detection task hierarchical submodule includes: The resource consumption analysis unit compiles historical data on the percentage of resources consumed by the spectral analysis instrument during testing tasks. The resource type tagging unit uses the spectral analysis resource type with the highest consumption rate as the resource requirement type label for the detection task; The task queue management unit establishes different priority task queues based on the fineness level of detection, and sub-queues are established within each queue according to the resource requirement type label.
9. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 6, characterized in that, The spectral resource optimization module also includes: When the spectral acquisition channel is under high load, the high-load task scheduling submodule will import newly arriving detection tasks into the waiting queue with the corresponding priority and resource requirement type. The real-time resource monitoring submodule dynamically acquires idle rate data for various spectral analysis resources; The task execution optimization submodule selects the detection task that matches the type of spectral analysis resource with the highest current idle rate from the highest priority pending queue for execution and analysis.
10. The rapid wheat quality detection system based on near-infrared spectroscopy as described in claim 6, characterized in that, The normal state switching submodule includes: The continuous status monitoring unit simultaneously monitors real-time detection accuracy data and system spectral resource idle rate data under high load conditions of the spectral acquisition channel; The dual-condition judgment unit triggers a load state switching command when the real-time detection accuracy continuously exceeds the preset detection accuracy threshold and the idle rate of all spectral analysis resource types continuously exceeds the preset resource release threshold to reach a stable time window. The state switching execution unit responds to the load state switching command and restores the spectral acquisition channel to the normal load state.