Grain inventory management method and system in granary

By conducting regional division and data collection in the granary, combined with image recognition and environmental data evaluation, the problem of inaccurate grain inventory management in the granary is solved, and refined management and quality monitoring of grain inventory are realized, and storage safety is improved.

CN118469310BActive Publication Date: 2024-12-03BEIJING LIANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410932014.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-12-03
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

The existing technology cannot achieve comprehensive real-time monitoring of the grain status in the granary, and it is difficult to detect potential grain quality problems in advance, resulting in inaccurate management of grain inventory in the granary.

Method used

By dividing the granary area, we obtain the detection images collected by the camera device and the environmental data collected by the sensor, and combine the initial inventory amount and inventory time to identify the appearance of grain and evaluate the environmental risks, and distinguish between food that can continue to be stored and deteriorated or expired. in stock.

Benefits of technology

The refined management of grain inventory in the granary has been achieved, the accuracy of inventory management has been improved, and problems such as mold and pests in time have been discovered to ensure grain quality and storage safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118469310B_ABST
    Figure CN118469310B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for managing grain inventory in a granary, and relates to the technical field of granary management. In the method, the granary is divided into regions to obtain a plurality of inventory management regions; the types of grain stored in the inventory management regions are determined; the initial inventory and the starting storage time corresponding to the grain types are obtained; the detection images corresponding to the grain types collected by the camera device arranged in the inventory management regions are obtained, and a plurality of initial environmental data collected by the sensor arranged in the inventory management regions are obtained; based on the initial inventory, the starting storage time, the detection images and the plurality of initial environmental data, the grain inventory situation corresponding to the grain types is obtained; the grain inventory situation includes a first grain inventory and a second grain inventory, the first grain inventory is the grain inventory that supports continued storage, and the second grain inventory is the deteriorated or expiring grain inventory. The implementation of the technical solution of the present application can improve the accuracy of grain inventory management in the granary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of granary management, and in particular to a method and system for managing grain inventory in a granary. Background Art

[0002] With the development of agricultural science and technology, grain storage technology is also constantly improving. Some granaries have begun to try to introduce automated management systems, but most systems can only achieve basic monitoring functions and lack comprehensive intelligent management of grain inventory. In traditional grain inventory management, manual methods are usually used to count the inventory of various types of grain. Existing technologies cannot achieve comprehensive real-time monitoring of the state of grain in the granary, making it difficult to detect potential grain quality problems in advance, and thus it is impossible to accurately know the grain inventory in the granary.

[0003] Therefore, how to improve the accuracy of grain inventory management in granaries has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides a method and system for managing grain inventory in a granary, which can improve the accuracy of grain inventory management in the granary.

[0005] In the first aspect, the present application provides a method for managing grain inventory in a granary, the method comprising: dividing the granary into areas to obtain multiple inventory management areas; determining the types of grain stored in the inventory management areas; obtaining an initial inventory quantity and a starting warehousing time corresponding to the types of grain; obtaining a detection image corresponding to the types of grain captured by a camera device disposed in the inventory management areas, and obtaining a plurality of initial environmental data captured by a sensor disposed in the inventory management areas; based on the initial inventory quantity, the starting warehousing time, the detection image, and the plurality of initial environmental data, obtaining a grain inventory situation corresponding to the types of grain; the grain inventory situation includes a first grain inventory and a second grain inventory, wherein the first grain inventory is a grain inventory that supports continued storage, and the second grain inventory is a deteriorated or expiring grain inventory.

[0006] By adopting the above technical solution, the granary is divided into regions to obtain multiple inventory management areas, so that the grain can be classified and stored according to the storage conditions and characteristics of the grain varieties in different regions, thereby realizing the refined management of the granary. By determining the types of grain stored in the inventory management area, the grain varieties in each area can be accurately managed. By obtaining the initial inventory and the starting storage time corresponding to the grain type, basic data is provided for subsequent inventory management. Based on the initial inventory, the starting storage time, the detection image and multiple initial environmental data, the grain inventory situation corresponding to the grain type is obtained. The grain inventory situation includes a first grain inventory and a second grain inventory, wherein the first grain inventory is a grain inventory that supports continued storage, and the second grain inventory is a deteriorated or expiring grain inventory, so that the storage status of the grain can be comprehensively and accurately evaluated according to the actual storage status of the grain, thereby improving the accuracy of the grain inventory management in the granary.

[0007] Optionally, the obtaining of the grain inventory situation corresponding to the grain type based on the initial inventory quantity, the starting warehousing time, the detection image and the multiple initial environmental data specifically includes: based on the detection image, identifying the appearance of the grain type, and judging whether there is any abnormality in the appearance of the grain type; when there is no abnormality in the appearance of the grain type, determining the multiple relevant environmental data corresponding to the grain type from the multiple initial environmental data; based on the multiple relevant environmental data, obtaining the comprehensive environmental risk value corresponding to the grain type; when the comprehensive environmental risk value is greater than the preset risk threshold, obtaining the grain inventory situation corresponding to the grain type based on the comprehensive environmental risk value, the starting warehousing time and the initial inventory quantity; when the comprehensive environmental risk value is not greater than the preset risk threshold, determining the grain inventory situation corresponding to the grain type as the first grain inventory.

[0008] By adopting the above technical solution, the appearance of the grain type is identified based on the detection image, and it is judged whether there is any abnormality in the appearance of the grain type, so that the appearance problems of the grain such as mildew, insect pests, discoloration, etc. can be discovered in time. Based on multiple relevant environmental data, the comprehensive environmental risk value corresponding to the grain type is obtained, so as to comprehensively evaluate the impact of the storage environment on the quality of the grain. When the comprehensive environmental risk value is greater than the preset risk threshold, the grain inventory situation corresponding to the grain type is obtained based on the comprehensive environmental risk value, the starting storage time and the initial inventory, so that the environmental risk, storage time and inventory can be comprehensively considered to accurately judge the storage status of the grain.

[0009] Optionally, based on the detection image, the appearance of the type of grain is identified to determine whether there is any abnormality in the appearance of the type of grain, which specifically includes: preprocessing the detection image to obtain a preprocessed detection image; extracting grain color features, grain shape features and grain texture features from the preprocessed detection image; performing feature analysis on the grain color features, grain shape features and grain texture features to determine whether there is any abnormality in any of the grain color features, grain shape features and grain texture features; when there is any abnormality in any of the grain color features, grain shape features and grain texture features, determining that there is any abnormality in the appearance of the type of grain; when there is no abnormality in all of the grain color features, grain shape features and grain texture features, determining that there is no abnormality in the appearance of the type of grain.

[0010] By adopting the above technical solution, the detection image is preprocessed to obtain the preprocessed detection image, thereby improving the image quality, removing noise and irrelevant information, and ensuring the accuracy of subsequent feature extraction. The grain color features, grain shape features and grain texture features are extracted from the preprocessed detection image, thereby comprehensively reflecting the appearance features of the grain. By performing feature analysis on the grain color features, grain shape features and grain texture features, it is determined whether any of the grain color features, grain shape features and grain texture features is abnormal, thereby accurately identifying the appearance problems of the grain.

[0011] Optionally, obtaining a comprehensive environmental risk value corresponding to the type of grain based on multiple related environmental data specifically includes: standardizing multiple related environmental data to obtain multiple standardized related environmental data; determining a preset environmental risk function and a preset risk weight corresponding to each of the related environmental data; substituting each of the standardized related environmental data into the corresponding preset environmental risk function to obtain an environmental factor risk value corresponding to each of the related environmental data; and obtaining a comprehensive environmental risk value corresponding to the type of grain based on multiple environmental factor risk values ​​and multiple preset risk weights.

[0012] By adopting the above technical solution, multiple relevant environmental data are standardized to obtain multiple standardized relevant environmental data, so that data of different dimensions can be converted to the same scale for comparison and calculation. By determining the preset environmental risk function and preset risk weight corresponding to each relevant environmental data, the degree of influence of different environmental factors on grain storage risk can be quantified. By substituting each standardized relevant environmental data into the corresponding preset environmental risk function, the environmental factor risk value corresponding to each relevant environmental data is obtained, so that the standardized data is converted into a specific risk value. Based on multiple environmental factor risk values ​​and multiple preset risk weights, the comprehensive environmental risk value corresponding to the grain type is obtained, so as to comprehensively evaluate the overall risk of the storage environment to the grain quality.

[0013] Optionally, the grain inventory situation corresponding to the grain type is obtained based on the comprehensive environmental risk value, the starting warehousing time and the initial inventory, specifically including: determining the environmental risk value range corresponding to the comprehensive environmental risk value, determining the grain storage time range corresponding to the grain type, and determining the inventory range corresponding to the inventory management area; based on the environmental risk value range, standardizing the comprehensive environmental risk value to obtain a standardized comprehensive environmental risk value; based on the grain storage time range, standardizing the starting warehousing time to obtain a standardized starting warehousing time; based on the inventory range, standardizing the initial inventory to obtain a standardized initial inventory; based on the standardized comprehensive environmental risk value, the standardized starting warehousing time and the standardized initial inventory, obtaining the comprehensive storage risk coefficient corresponding to the grain type; when the comprehensive storage risk coefficient is not greater than the preset storage risk threshold, determining that the grain inventory situation corresponding to the grain type is the first grain inventory; when the comprehensive storage risk coefficient is greater than the preset storage risk threshold, determining that the grain inventory situation corresponding to the grain type is the second grain inventory.

[0014] By adopting the above technical scheme, by determining the environmental risk value range corresponding to the comprehensive environmental risk value, determining the grain storage time range corresponding to the grain type, and determining the inventory range corresponding to the inventory management area, a clear benchmark is provided for standardization and comprehensive risk assessment. By standardizing the comprehensive environmental risk value based on the environmental risk value range, a standardized comprehensive environmental risk value is obtained, thereby converting the environmental risk value into data under a unified scale. By standardizing the starting storage time based on the grain storage time range, a standardized starting storage time is obtained, thereby converting the storage time into data under a unified scale. By standardizing the initial inventory based on the inventory range, a standardized initial inventory is obtained, thereby converting the inventory data into data under a unified scale. By obtaining the comprehensive storage risk coefficient corresponding to the grain type based on the standardized comprehensive environmental risk value, the standardized starting storage time and the standardized initial inventory, the storage risk level of the grain is comprehensively evaluated. When the comprehensive storage risk coefficient is not greater than the preset storage risk threshold, the grain inventory corresponding to the grain type is determined as the first grain inventory, thereby ensuring that low-risk grain can continue to be stored safely. When the comprehensive storage risk coefficient is greater than the preset storage risk threshold, the grain inventory corresponding to the grain type is determined as the second grain inventory, so as to identify and handle high-risk grain in time.

[0015] Optionally, determining a plurality of relevant environmental data corresponding to the type of grain from a plurality of the initial environmental data specifically includes: determining storage requirements corresponding to the type of grain; and based on the storage requirements, determining relevant environmental data corresponding to the type of grain from a plurality of the initial environmental data.

[0016] Optionally, after identifying the appearance of the grain type based on the detection image and determining whether there is any abnormality in the appearance of the grain type, the method further includes: when there is any abnormality in the appearance of each grain type, determining that the grain inventory situation corresponding to the grain type is the second grain inventory.

[0017] In a second aspect of the present application, a grain inventory management system in a granary is provided, the system comprising a processing module and an acquisition module; the processing module is used to divide the granary into areas to obtain multiple inventory management areas; the processing module is also used to determine the types of grain stored in the inventory management areas; the acquisition module is used to obtain the initial inventory and starting warehousing time corresponding to the grain type; the acquisition module is also used to obtain a detection image corresponding to the grain type captured by a camera device arranged in the inventory management area, and obtain a plurality of initial environmental data collected by a sensor arranged in the inventory management area; the processing module is also used to obtain the grain inventory situation corresponding to the grain type based on the initial inventory, the starting warehousing time, the detection image and the plurality of initial environmental data; the grain inventory situation includes a first grain inventory and a second grain inventory, wherein the first grain inventory is a grain inventory that supports continued storage, and the second grain inventory is a deteriorated or expiring grain inventory.

[0018] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as described in the first aspect of the present application.

[0019] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method as described in any one of the first aspects of the present application.

[0020] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0021] By dividing the granary into regions, multiple inventory management areas are obtained, so that the grain can be classified and stored according to the storage conditions and characteristics of the grain varieties in different regions, realizing the refined management of the granary. By determining the types of grain stored in the inventory management area, the grain varieties in each area can be accurately managed. By obtaining the initial inventory and the starting storage time corresponding to the grain type, basic data is provided for subsequent inventory management. Based on the initial inventory, the starting storage time, the detection image and multiple initial environmental data, the grain inventory situation corresponding to the grain type is obtained. The grain inventory situation includes the first grain inventory and the second grain inventory, wherein the first grain inventory is the grain inventory that supports continued storage, and the second grain inventory is the deteriorated or expiring grain inventory, so that the storage status of the grain can be comprehensively and accurately evaluated according to the actual storage status of the grain, thereby improving the accuracy of the grain inventory management in the granary. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is one of the flow charts of a method for managing grain inventory in a granary provided in an embodiment of the present application;

[0023] Figure 2 This is the second flow chart of a method for managing grain inventory in a granary provided in an embodiment of the present application;

[0024] Figure 3 This is a structural diagram of a grain inventory management system in a granary provided by an embodiment of the present application;

[0025] Figure 4 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.

[0026] Explanation of the reference numerals: 1. Acquisition module; 2. Processing module; 400. Electronic device; 401. Processor; 402. Communication bus; 403. User interface; 404. Network interface; 405. Memory. DETAILED DESCRIPTION

[0027] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0028] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0029] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0030] This application provides a method for managing grain inventory in a granary, referring to Figure 1, which shows one of the flow diagrams of a method for managing grain inventory in a granary provided in an embodiment of the present application. The method includes steps S1-S5, which are as follows:

[0031] Step S1: Divide the granary into regions to obtain multiple inventory management areas.

[0032] In granary management, reasonable regional division of granaries is a key step to ensure the safety and efficient management of grain storage. Specifically, the regional division of granaries needs to take into account multiple factors such as grain type, storage conditions, and environmental monitoring to achieve scientific management and precise monitoring.

[0033] First, a comprehensive analysis of the physical structure and storage capacity of the granary is needed to understand the space size, ventilation conditions, temperature and humidity conditions, and safety facilities of each area. Based on this information, it can be determined how to divide the granary into several independent inventory management areas. The division of each inventory management area should be based on the characteristics and storage requirements of the grain variety. For example, grains of the same type or with similar storage requirements should be stored in the same management area for unified management and monitoring.

[0034] Next, each divided inventory management area needs to be labeled and numbered to ensure that managers can clearly identify and access each area. The label should include information such as the area number, type of stored grain, and capacity to facilitate subsequent management. At the same time, necessary monitoring equipment, such as high-definition cameras and environmental sensors, is installed in each management area to monitor the storage status and environmental conditions of grain in real time.

[0035] Step S2: Determine the types of food stored in the inventory management area.

[0036] In granary management, clarifying the types of grain stored in the inventory management area is the basis for effective inventory management and monitoring. Specifically, ensuring that the types of grain in each inventory management area are clear and specific can facilitate subsequent inventory management.

[0037] For specific operational implementation, first of all, it is necessary to check the actual grain varieties stored in each inventory management area based on the warehouse entry records and the data in the inventory management system. The warehouse entry records usually include detailed information such as the type, quantity, warehouse entry time and storage location of the grain. By checking these records, it is possible to preliminarily determine the grain varieties stored in each inventory management area. In this process, it is necessary to ensure the accuracy and completeness of the data to prevent recording errors or omissions.

[0038] On the basis of checking the warehousing records, managers need to conduct on-site inspections of each inventory management area to verify whether the information in the records is consistent with the actual situation, so as to discover and correct possible data deviations. For example, managers can confirm the specific types and quantities of grain stored in each inventory management area by on-site visits, checking labels and logos, etc.

[0039] After confirming the types of grain stored in each inventory management area, this information needs to be entered into the inventory management system to form a complete inventory database. The database should include information such as the number of each inventory management area, the type of grain stored, the quantity, and the time of entry. Through this database, managers can easily query and dispatch the grain situation in each inventory management area to achieve precise management.

[0040] Step S3: Obtain the initial inventory and starting storage time corresponding to the grain type.

[0041] Specifically, first, the initial inventory and starting storage time of each grain type are extracted based on the storage records and data in the inventory management system. Storage records usually contain detailed information such as grain type, quantity, storage time and storage location. By checking these records, the initial inventory and storage time of each grain variety can be preliminarily obtained. In this process, the accuracy and completeness of the data need to be ensured to prevent recording errors or omissions.

[0042] In the process of extracting data, the information system can be used for data integration and verification. The inventory management system should have an automated data processing function, which can automatically extract and summarize the initial inventory and storage time of each grain variety from the storage records, and compare them with the actual inventory situation to ensure the consistency and accuracy of the data. If the system detects inconsistent data, the management personnel need to manually check and correct it to ensure the accuracy of the final data.

[0043] After confirming the initial inventory and the starting warehousing time, these data need to be entered into the inventory management system to form a complete inventory database. The database should include information such as the number of each inventory management area, the type of grain stored, the initial inventory, and the warehousing time. Through this database, managers can easily query and dispatch the grain situation in each inventory management area, and achieve precise management and dynamic monitoring.

[0044] In addition, in order to improve the reliability of data, multiple verifications can be performed on the initial inventory quantity and the time of entry into the warehouse. For example, regular physical inventory checks can be conducted to check the data in the inventory management system with the actual inventory situation to ensure the accuracy and real-time nature of the data. In this way, data deviations can be discovered and corrected in a timely manner to prevent management problems caused by data errors.

[0045] Step S4: Acquire a detection image corresponding to the type of grain collected by a camera device installed in the inventory management area, and acquire a plurality of initial environmental data collected by a sensor installed in the inventory management area.

[0046] Specifically, during the data collection process, a unified data management platform needs to be established to receive and integrate data from camera devices and environmental sensors. The platform should have data storage, processing and analysis functions. The data management platform includes a central database that can automatically associate detection images and initial environmental data with corresponding inventory management areas and food types.

[0047] For specific operational implementation, first, high-definition cameras need to be installed in each inventory management area to collect detection images corresponding to grain types regularly or in real time. High-definition cameras should be placed in places that can fully cover the grain storage location to ensure that the collected detection images are clear and complete. The camera device should be set with a timed shooting function or a triggered shooting mechanism to automatically capture images according to preset time intervals or environmental changes to ensure that the latest situation of grain storage can be continuously obtained, and the detection images can be uploaded to the central database for storage and management.

[0048] At the same time, environmental sensors are installed in each inventory management area to collect multiple initial environmental data. Environmental sensors should include temperature sensors, humidity sensors, gas sensors (such as carbon dioxide, oxygen), light sensors, etc., to ensure that all key parameters of the grain storage environment can be fully monitored. Sensors should collect initial environmental data regularly or in real time, and upload the initial environmental data to the central database for storage and management.

[0049] Step S5: Based on the initial inventory quantity, the starting warehousing time, the detection image and multiple initial environmental data, the grain inventory situation corresponding to the grain type is obtained; the grain inventory situation includes a first grain inventory and a second grain inventory, wherein the first grain inventory is the grain inventory that supports continued storage, and the second grain inventory is the deteriorated or expiring grain inventory.

[0050] Specifically, in granary management, comprehensive evaluation of grain inventory based on multiple data sources is an important step to ensure grain storage safety and quality. The purpose of this step is to accurately determine the storage status of grain by comprehensively analyzing the initial inventory, the start of storage time, detection images, and multiple initial environmental data, and to distinguish between grain that can continue to be stored and grain that is spoiled or about to expire, thereby achieving scientific management and precise monitoring.

[0051] In one possible implementation, refer to Figure 2 , which shows the second flow chart of a method for managing grain inventory in a granary provided in an embodiment of the present application. Step S5 specifically includes steps S51-S55:

[0052] Step S51: Based on the detection image, the appearance of the grain type is identified to determine whether there is any abnormality in the appearance of the grain type.

[0053] Specifically, in granary management, identifying the appearance of grain types based on detection images is an important step to ensure the quality and safety of grain storage. The purpose of this step is to detect the appearance characteristics of grain through image recognition technology, and determine whether there are abnormal conditions such as mold, insect pests, discoloration, etc., so as to take timely measures to avoid grain quality problems.

[0054] In a possible implementation, step S51 specifically includes the following steps:

[0055] The detection image is preprocessed to obtain a preprocessed detection image.

[0056] Specifically, the detection image may be affected by factors such as ambient lighting and noise, and the quality may vary, so preprocessing is required.

[0057] For the specific operation implementation, first, perform image denoising on the original detection image. Image denoising is to remove the noise in the image through a filter to make the image clearer. Commonly used filters include Gaussian filters, median filters, etc. Here, a Gaussian filter can be used to smooth the image and reduce the interference of random noise. The Gaussian filter retains the details of the image by weighted averaging the image, while effectively removing noise.

[0058] After denoising, the image needs to be enhanced. Image enhancement is to adjust the contrast and brightness to highlight the grain details and make them more obvious in the image. You can use histogram equalization technology to enhance the image. Histogram equalization increases the contrast of the image by redistributing the grayscale values ​​of the image, thereby enhancing the details of the image. For example, after applying histogram equalization, the color and texture features of the grain will be more obvious, which will help with subsequent feature extraction and analysis.

[0059] Subsequently, the image is cropped. Image cropping is to remove irrelevant parts of the image and retain the effective area of ​​the grain. This step can use image segmentation technology to identify the grain area in the image and separate it from the background. This not only reduces the amount of calculation, but also improves the accuracy of feature extraction. Through image segmentation and cropping, an image containing only the grain part is obtained, effectively removing the interference information in the background.

[0060] Through the above preprocessing steps, the clarity and contrast of the image are improved, noise and irrelevant information are removed, the extracted color features, shape features and texture features are more accurate, and a higher quality detection image is obtained, that is, the preprocessed detection image. This improves the accuracy and reliability of grain appearance recognition for subsequent feature extraction and analysis.

[0061] Grain color features, grain shape features and grain texture features are extracted from the preprocessed detection image.

[0062] Specifically, in granary management, extracting the color, shape, and texture features of grain from the preprocessed detection image is an important step in grain appearance recognition. The purpose of this step is to extract and analyze key image features to provide a scientific basis for subsequent judgment of whether there is any abnormality in the grain appearance.

[0063] For the specific operation implementation, first, after completing the image preprocessing, it is necessary to extract color features from the preprocessed detection image. Color features are important indicators reflecting the color distribution of the grain surface, which can be obtained by calculating the color histogram. The color histogram counts the color information in the image and generates a chart reflecting the color distribution. The specific operation is to convert the image to an appropriate color space (such as RGB or HSV), and then calculate the histogram of each color channel. By analyzing the color histogram, the color distribution characteristics of the grain, such as color uniformity, brightness distribution, etc., can be obtained, which provides a basis for judging whether there is color abnormality in the grain.

[0064] Next, shape features are extracted from the detected image. Shape features are key parameters that describe the appearance contour and geometric shape of grains, and can be obtained by using shape descriptors such as Hu moments. Hu moments are a commonly used shape description method that can reflect the basic characteristics of the shape by calculating the seven invariant moments of the image. The specific operation is to binarize the image, extract the contour of the grain, and then calculate the Hu moments. By analyzing the Hu moments, the shape characteristics of the grain, such as the smoothness and symmetry of the contour, can be obtained, providing a basis for judging whether the grain has shape abnormalities.

[0065] Then, texture features are extracted from the detected image. Texture features are important parameters that reflect the detailed structure of the grain surface and can be obtained through texture analysis methods (such as grayscale co-occurrence matrix). The grayscale co-occurrence matrix is ​​a method that describes the spatial relationship between the grayscale values ​​of pixels in an image. By calculating the grayscale co-occurrence matrix of pixel pairs in the image, the texture features of the image can be obtained. The specific operation is to convert the image into a grayscale image, calculate the grayscale co-occurrence matrix in different directions, and then extract texture features from it, such as contrast, uniformity, energy, etc. By analyzing the grayscale co-occurrence matrix, the texture distribution characteristics of the grain can be obtained, which provides a basis for judging whether there are texture anomalies in the grain.

[0066] The grain color feature, grain shape feature and grain texture feature are analyzed to determine whether any one of the grain color feature, grain shape feature and grain texture feature is abnormal. When any one of the grain color feature, grain shape feature and grain texture feature is abnormal, it is determined that the appearance of the grain type is abnormal. When all of the grain color feature, grain shape feature and grain texture feature are normal, it is determined that the appearance of the grain type is normal.

[0067] Specifically, first, the color features, shape features, and texture features extracted from the preprocessed detection image are imported into the feature analysis module. The feature analysis module compares and analyzes each feature using the preset normal feature range and abnormal feature threshold. The normal feature range and abnormal feature threshold are determined based on historical data and expert experience, reflecting the numerical range of different features under normal and abnormal conditions.

[0068] For color features, the feature analysis module calculates the statistical values ​​of the color histogram, such as the mean, standard deviation, and kurtosis, and compares them with the normal range. If the statistical values ​​of the color features are significantly deviated from the normal range, such as uneven color distribution, too high or too low brightness, the color features of the batch of grain are judged to be abnormal. For example, if the color histogram of a batch of grain is detected to show a large number of mold spots or discolored areas, its color features can be judged to be abnormal.

[0069] For shape features, the feature analysis module calculates the value of the shape descriptor, such as the seven invariant moments of the Hu moment, and compares it with the normal range. If the descriptor value of the shape feature deviates significantly from the normal range, such as the contour is not smooth and the symmetry is poor, it is determined that the shape feature of the batch of grain is abnormal. For example, if the Hu moment value of a batch of grain is detected to show shape distortion or damage, it can be determined that its shape feature is abnormal.

[0070] For texture features, the feature analysis module calculates the statistical values ​​of the grayscale co-occurrence matrix, such as contrast, uniformity, energy, and entropy, and compares them with the normal range. If the statistical values ​​of the texture features deviate significantly from the normal range, such as the surface roughness is too high or too low, the texture features of the batch of grain are judged to be abnormal. For example, if the grayscale co-occurrence matrix of a batch of grain is detected to show surface insect pests or uneven roughness, its texture features can be judged to be abnormal.

[0071] During the feature analysis process, if any of the color, shape or texture features of the grain is abnormal, the analysis module will comprehensively evaluate the degree of abnormality and mark it as an abnormal batch. Specifically, when any feature value exceeds the preset normal range or reaches the abnormal threshold, it is determined that the appearance of the grain type in the batch is abnormal. If all feature values ​​are within the normal range, the appearance is determined to be normal.

[0072] Step S52: When there is no abnormality in the appearance of the grain type, a plurality of relevant environmental data corresponding to the grain type is determined from a plurality of initial environmental data.

[0073] Specifically, in granary management, after determining that there is no abnormality in the appearance of a grain type, it is necessary to further determine multiple related environmental data corresponding to the grain type from multiple initial environmental data. The purpose of this step is to ensure that the grain storage environment meets its specific storage requirements by screening and analyzing environmental data, thereby effectively identifying potential environmental risks.

[0074] In a possible implementation, step S52 specifically includes the following steps:

[0075] Determine the storage requirements for the type of grain.

[0076] Specifically, first, collect and consult relevant standards and literature to understand the storage requirements of different types of grains. Different types of grains have specific requirements for environmental factors such as temperature, humidity, gas composition (such as carbon dioxide, oxygen), and light intensity during storage. Managers need to consult national or industry standards, research literature, and related technical manuals to obtain the best storage conditions for each type of grain. For example, the optimal storage temperature range for wheat is 10-20 degrees Celsius and the humidity range is 50%-60%; the optimal storage temperature range for corn is 5-15 degrees Celsius and the humidity range is 45%-55%.

[0077] Next, these storage requirements are systematized and standardized for subsequent data screening and environmental monitoring. The storage requirements corresponding to each type of grain are recorded in a unified database or management system, including information such as grain type, optimal temperature range, optimal humidity range, allowable gas component concentration and light intensity.

[0078] Based on the storage requirement, relevant environmental data corresponding to the food type is determined from a plurality of initial environmental data.

[0079] Specifically, first, according to the storage requirements corresponding to the types of grains determined in the previous steps, the environmental factors that need to be paid attention to are clarified, including temperature, humidity, gas composition (such as carbon dioxide, oxygen) and light intensity. Each type of grain has its own specific optimal storage conditions, which are important bases for ensuring that the grain does not deteriorate, is not infested by insects, and maintains its nutritional value.

[0080] Next, the environmental sensor network is used to collect initial environmental data for each inventory management area. Environmental sensors include temperature sensors, humidity sensors, gas sensors, and light sensors, which can monitor the environmental parameters of each area in real time. These sensors collect data periodically or in real time and transmit the data to the central database for storage and management.

[0081] After data collection is completed, these initial environmental data need to be screened and filtered through the data management platform. The specific operation is to compare the initial environmental data with the storage requirements of the grain type and screen out the relevant environmental data that meets the storage requirements. For example, if the storage requirements for a batch of wheat are a temperature of 10-20 degrees Celsius and a humidity of 50%-60%, the system will screen out all data with temperature and humidity within this range from the initial environmental data as relevant environmental data.

[0082] To achieve this process, you can set up automated data screening rules. The data management platform should have the ability to automatically screen and filter data according to storage requirements. By setting the threshold range of storage conditions, the system can automatically screen out environmental data that meets the conditions and mark it as relevant environmental data.

[0083] Step S53: Based on a plurality of relevant environmental data, a comprehensive environmental risk value corresponding to the food type is obtained.

[0084] Specifically, in granary management, calculating the comprehensive environmental risk value of grain types based on multiple relevant environmental data is an important step in assessing grain storage risks. The purpose of this step is to obtain a comprehensive environmental risk value by analyzing and calculating relevant environmental data, thereby determining the impact of the storage environment on grain quality and ensuring that grain is stored under optimal conditions.

[0085] In a possible implementation, step S53 specifically includes the following steps:

[0086] A plurality of related environmental data are standardized to obtain a plurality of standardized related environmental data.

[0087] Specifically, first, collect relevant environmental data corresponding to the food types selected from multiple initial environmental data. These data include temperature, humidity, gas composition (such as carbon dioxide, oxygen) and light intensity, etc. Each data item has its specific numerical range and dimension. For example, temperature may vary in degrees Celsius, humidity is expressed in percentage, while gas composition and light intensity may have different measurement units.

[0088] Next, these environmental data are standardized. The purpose of standardization is to convert data of different dimensions to a unified scale for comparison and calculation. The specific operation is to use the following standardization formula to convert each environmental data into a standardized value. ;in, is the original environmental data, and are the minimum and maximum values ​​of the environmental data respectively. The standardized values will vary between 0 and 1, reflecting where the original data falls within its range. For example, for temperature data, if the temperature range for an area is 10 degrees Celsius to 30 degrees Celsius, and the current measurement is 20 degrees Celsius, the normalized temperature value will be Similarly, data such as humidity, gas composition, and light intensity are normalized to ensure that all data items are in the range of 0 to 1.

[0089] Determine the preset environmental risk function and preset risk weight corresponding to each relevant environmental data.

[0090] Specifically, first, according to the storage requirements and historical data of the grain types, the preset environmental risk function corresponding to each relevant environmental data is determined. Used to standardize environmental data Convert to corresponding risk value These functions reflect the specific impact of each environmental factor on food quality. Different environmental factors have different impacts on food, so different risk functions need to be set for each factor.

[0091] For temperature data, the risk function can be set as a U-shaped curve, indicating that too high or too low temperature will have a negative impact on food quality, for example: ;

[0092] For humidity data, the risk function can be set as a linear function, indicating that the higher the humidity, the greater the risk, for example: ;

[0093] For gas composition data, the risk function can be set as a step function, indicating that the risk increases sharply above a certain threshold, for example: .

[0094] Next, determine the pre-set risk weight for each environmental factor The risk weight reflects the degree of influence of each environmental factor on the comprehensive environmental risk value and is set based on historical data and expert opinions. The allocation of weights needs to consider the importance of each environmental factor and its specific impact on food quality. For example, if temperature has a greater impact on the storage of a certain type of food, a higher weight can be given to temperature; conversely, if light intensity has a smaller impact, a lower weight can be given. Ensure that the sum of all weights is 1, that is, For example, suppose that for wheat storage, the weights of temperature, humidity, carbon dioxide concentration, and light intensity are: .

[0095] Substitute each standardized relevant environmental data into the corresponding preset environmental risk function to obtain the environmental factor risk value corresponding to each relevant environmental data.

[0096] Specifically, after substituting each standardized relevant environmental data into the formula in the above embodiment, the environmental factor risk value corresponding to each relevant environmental data will be obtained. By quantifying the risk level of environmental data, a scientific basis is provided for subsequent comprehensive environmental risk assessment, thereby ensuring the safety and quality of grain storage.

[0097] Based on multiple environmental factor risk values ​​and multiple preset risk weights, the comprehensive environmental risk value corresponding to the food type is obtained.

[0098] Specifically, first, use the risk values ​​of each environmental factor calculated in the previous steps , and the preset risk weights of each environmental factor determined in the previous steps , the comprehensive environmental risk value is calculated by weighted summation method The calculation formula for the comprehensive environmental risk value is: . Where n is the number of relevant environmental data, is the environmental factor risk value of the i-th environmental data, The preset risk weight of the i-th environmental data.

[0099] Step S54: When the comprehensive environmental risk value is greater than the preset risk threshold, the grain inventory situation corresponding to the grain type is obtained based on the comprehensive environmental risk value, the starting warehousing time and the initial inventory.

[0100] Specifically, in grain silo management, when the comprehensive environmental risk value is greater than the preset risk threshold, it is necessary to further evaluate the storage status of grain to determine whether it is suitable for continued storage. The purpose of this step is to accurately judge the storage status of grain by comprehensively analyzing the environmental risk value, the starting storage time and the initial inventory, so as to take corresponding management measures to ensure grain quality and storage safety.

[0101] In a possible implementation, step S54 specifically includes the following steps:

[0102] Determine the range of environmental risk values ​​corresponding to the comprehensive environmental risk value, determine the grain storage time range corresponding to the grain type, and determine the inventory quantity range corresponding to the inventory management area.

[0103] Specifically, in granary management, determining the environmental risk value range corresponding to the comprehensive environmental risk value, and determining the storage time range corresponding to the grain type and the inventory range of the inventory management area are the basic steps for calculating the comprehensive storage risk coefficient. The purpose of this step is to provide a basis for subsequent standardization and comprehensive risk assessment by clarifying the scope of each data, and to ensure the scientificity and accuracy of the assessment process.

[0104] First, determine the comprehensive environmental risk value The comprehensive environmental risk value is calculated based on the risk values ​​of multiple environmental factors, so its range depends on the range and weight of the risk values ​​of each environmental factor. Generally speaking, the range of the comprehensive environmental risk value is between 0 and 1, that is: The values ​​within this range reflect the magnitude of environmental risk, with 0 indicating the lowest environmental risk and 1 indicating the highest environmental risk.

[0105] Next, determine the storage time range T corresponding to the type of grain. The storage time range reflects the storage time of the grain from the time it was put into storage to the current time, usually in days. For example, for wheat, the storage time range can be set to 0 to 365 days, that is: T∈[0,365]. The values ​​in this range reflect the length of time the grain has been stored in the warehouse, 0 means it has just been put into storage, and 365 means it has been stored for a year.

[0106] Then, determine the inventory range Q corresponding to the inventory management area. The inventory range reflects the amount of grain in the warehouse, usually in tons. For example, for a warehouse, its inventory range can be set to 0 to 1000 tons, that is: Q∈[0,1000]. The values ​​in this range reflect the amount of grain in the warehouse, 0 means no inventory, and 1000 means full warehouse.

[0107] Based on the environmental risk value range, the comprehensive environmental risk value is standardized to obtain the standardized comprehensive environmental risk value. Based on the grain storage time range, the starting storage time is standardized to obtain the standardized starting storage time. Based on the inventory range, the initial inventory is standardized to obtain the standardized initial inventory.

[0108] Specifically, standardization is performed based on these ranges. Comprehensive environmental risk value The standardized processing formula is: ; The standardized processing formula for the starting storage time T is: ; The standardized processing formula for the initial inventory Q is: .

[0109] Based on the standardized comprehensive environmental risk value, the standardized starting warehousing time and the standardized initial inventory quantity, the comprehensive storage risk coefficient corresponding to the grain type is obtained.

[0110] Specifically, the standardized comprehensive environmental risk value, the standardized starting warehousing time, and the standardized initial inventory are weighted and summed to obtain the comprehensive storage risk coefficient C. The calculation formula is: .in, , and They are the preset weights of the comprehensive environmental risk value, the starting warehousing time and the initial inventory quantity. These weights reflect the influence of each factor on the comprehensive storage risk, and the sum of the weights is 1.

[0111] When the comprehensive storage risk coefficient is not greater than the preset storage risk threshold, the food inventory corresponding to the food type is determined to be the first food inventory. When the comprehensive storage risk coefficient is greater than the preset storage risk threshold, the food inventory corresponding to the food type is determined to be the second food inventory.

[0112] Specifically, first, the calculated comprehensive storage risk coefficient C reflects the overall risk level of grain storage due to the current storage environment, storage time and inventory. In order to make a judgment, it is necessary to compare this comprehensive storage risk coefficient with the preset storage risk threshold C. threshold Storage risk threshold C threshold It is set based on historical data and expert opinions and represents the critical value of grain storage risk. When the comprehensive storage risk coefficient C is not greater than the preset storage risk threshold C threshold When C≤C thresholdIn this case, the inventory of this batch of grain is determined to be the first grain inventory. The first grain inventory refers to the grain inventory that supports continued storage, indicating that these grains have no obvious risk of deterioration or expiration under the current storage conditions and can continue to maintain the current storage status. Similarly, when C>C threshold In this case, the inventory of this batch of grain is determined to be the second grain inventory. The second grain inventory refers to the deteriorated or expiring grain inventory, which means that these grains have an obvious risk of deterioration or are about to reach their shelf life under the current storage conditions, and further processing or emergency measures are required.

[0113] Step S55: When the comprehensive environmental risk value is not greater than the preset risk threshold, the grain inventory situation corresponding to the grain type is determined to be the first grain inventory.

[0114] Specifically, the comprehensive environmental risk value R e Compared with the preset risk threshold R threshold Preset risk threshold R threshold It is set based on historical data and expert opinions and represents the safety threshold for grain storage. The specific comparison conditions are: R e ≤R threshold When the comprehensive environmental risk value R e Not greater than the preset risk threshold R threshold When the food storage environment is low risk to grain, the storage conditions are relatively safe. This means that the food will not have obvious risk of deterioration or expiration under the current environment and can continue to be stored safely.

[0115] In a possible implementation, after step S51, the method further includes the following steps:

[0116] When there is an abnormality in the appearance of each grain type, the grain inventory situation corresponding to the grain type is determined to be the second grain inventory.

[0117] Specifically, when any one of the color feature, shape feature or texture feature is abnormal, it is determined that the appearance of the batch of grain is abnormal. In this case, the inventory of the batch of grain is determined to be the second grain inventory. For example, through image analysis, it is found that the color feature of a batch of wheat is moldy, the shape feature shows obvious damage, and the texture feature also shows abnormal roughness. According to the above judgment criteria, it is confirmed that the appearance of the batch of wheat is abnormal, so its inventory is determined to be the second grain inventory.

[0118] Reference Figure 3, which shows a structural schematic diagram of a grain inventory management system in a grain silo provided by an embodiment of the present application, the system includes a processing module 1 and an acquisition module 2; the processing module 1 is used to divide the grain silo into areas to obtain multiple inventory management areas; the processing module 1 is also used to determine the type of grain stored in the inventory management area; the acquisition module 2 is used to obtain the initial inventory and the starting warehousing time corresponding to the grain type; the acquisition module 2 is also used to obtain the detection image corresponding to the grain type collected by the camera device arranged in the inventory management area, and obtain multiple initial environmental data collected by the sensor arranged in the inventory management area; the processing module 1 is also used to obtain the grain inventory situation corresponding to the grain type based on the initial inventory, the starting warehousing time, the detection image and the multiple initial environmental data; the grain inventory situation includes a first grain inventory and a second grain inventory, wherein the first grain inventory is the grain inventory that supports continued storage, and the second grain inventory is the deteriorated or expiring grain inventory.

[0119] In a possible implementation, the processing module 1 is also used to identify the appearance of the grain type based on the detection image, and determine whether there is any abnormality in the appearance of the grain type; when there is no abnormality in the appearance of the grain type, determine multiple relevant environmental data corresponding to the grain type from multiple initial environmental data; based on the multiple relevant environmental data, obtain a comprehensive environmental risk value corresponding to the grain type; when the comprehensive environmental risk value is greater than a preset risk threshold, based on the comprehensive environmental risk value, the starting warehousing time and the initial inventory, obtain the grain inventory situation corresponding to the grain type; when the comprehensive environmental risk value is not greater than the preset risk threshold, determine that the grain inventory situation corresponding to the grain type is the first grain inventory.

[0120] In a possible implementation, the processing module 1 is also used to preprocess the detection image to obtain a preprocessed detection image; extract grain color features, grain shape features and grain texture features from the preprocessed detection image; perform feature analysis on the grain color features, grain shape features and grain texture features to determine whether any one of the grain color features, grain shape features and grain texture features is abnormal; when any one of the grain color features, grain shape features and grain texture features is abnormal, determine that the appearance of the grain type is abnormal; when all of the grain color features, grain shape features and grain texture features are normal, determine that the appearance of the grain type is normal.

[0121] In a possible implementation, the processing module 1 is also used to perform standardization processing on multiple relevant environmental data to obtain multiple standardized relevant environmental data; determine the preset environmental risk function and preset risk weight corresponding to each relevant environmental data; substitute each standardized relevant environmental data into the corresponding preset environmental risk function to obtain the environmental factor risk value corresponding to each relevant environmental data; based on the multiple environmental factor risk values ​​and the multiple preset risk weights, obtain the comprehensive environmental risk value corresponding to the food type.

[0122] In a possible implementation, the processing module 1 is also used to determine the environmental risk value range corresponding to the comprehensive environmental risk value, determine the grain storage time range corresponding to the grain type, and determine the inventory range corresponding to the inventory management area; based on the environmental risk value range, the comprehensive environmental risk value is standardized to obtain a standardized comprehensive environmental risk value; based on the grain storage time range, the starting warehousing time is standardized to obtain a standardized starting warehousing time; based on the inventory range, the initial inventory is standardized to obtain a standardized initial inventory; based on the standardized comprehensive environmental risk value, the standardized starting warehousing time and the standardized initial inventory, the comprehensive storage risk coefficient corresponding to the grain type is obtained; when the comprehensive storage risk coefficient is not greater than the preset storage risk threshold, the grain inventory situation corresponding to the grain type is determined to be the first grain inventory; when the comprehensive storage risk coefficient is greater than the preset storage risk threshold, the grain inventory situation corresponding to the grain type is determined to be the second grain inventory.

[0123] In a possible implementation, the processing module 1 is further used to determine storage requirements corresponding to the grain type; based on the storage requirements, determine relevant environmental data corresponding to the grain type from a plurality of initial environmental data.

[0124] In a possible implementation, the processing module 1 is further configured to determine that the grain inventory corresponding to each grain type is the second grain inventory when there is an abnormality in the appearance of each grain type.

[0125] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0126] The present application also discloses an electronic device. Figure 4 , Figure 4The electronic device 400 may include: at least one processor 401 , at least one network interface 404 , a user interface 403 , a memory 405 , and at least one communication bus 402 .

[0127] The communication bus 402 is used to realize the connection and communication between these components.

[0128] The user interface 403 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 403 may also include a standard wired interface and a wireless interface.

[0129] The network interface 404 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0130] Among them, the processor 401 may include one or more processing cores. The processor 401 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 405, and calling data stored in the memory 405. Optionally, the processor 401 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 401 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 401, and it can be implemented separately through a chip.

[0131] Among them, the memory 405 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 405 includes a non-transitory computer-readable storage medium. The memory 405 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 405 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 405 may optionally be at least one storage device located away from the aforementioned processor 401. Refer to Figure 4 , the memory 405 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module and an application program.

[0132] exist Figure 4 In the electronic device 400 shown, the user interface 403 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 401 can be used to call an application stored in the memory 405, and when executed by one or more processors 401, the electronic device 400 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0134] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0136] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0137] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0138] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.

[0139] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A method for managing grain inventory in a granary, characterized in that: The method comprises: Divide the granary into regions to obtain multiple inventory management areas; Determining the types of food stored in the inventory management area; Obtaining the initial inventory and starting storage time corresponding to the food type; Acquire a detection image corresponding to the food type collected by a camera device disposed in the inventory management area, and acquire a plurality of initial environmental data collected by a sensor disposed in the inventory management area; Preprocessing the detection image to obtain a preprocessed detection image; Extracting grain color features, grain shape features and grain texture features from the preprocessed detection image; Performing feature analysis on the grain color feature, the grain shape feature, and the grain texture feature to determine whether any one of the grain color feature, the grain shape feature, and the grain texture feature is abnormal; When any one of the grain color feature, the grain shape feature, and the grain texture feature is abnormal, it is determined that the appearance of the grain type is abnormal; When all of the grain color feature, the grain shape feature, and the grain texture feature are normal, it is determined that the appearance of the grain type is normal; When there is no abnormality in the appearance of the grain type, determining a plurality of relevant environmental data corresponding to the grain type from the plurality of initial environmental data; Performing standardization processing on the plurality of related environmental data to obtain a plurality of standardized related environmental data; Determine a preset environmental risk function and a preset risk weight corresponding to each of the relevant environmental data; Substituting each of the standardized related environmental data into the corresponding preset environmental risk function to obtain the environmental factor risk value corresponding to each of the related environmental data; Based on the multiple environmental factor risk values ​​and the multiple preset risk weights, obtaining a comprehensive environmental risk value corresponding to the food type; When the comprehensive environmental risk value is greater than a preset risk threshold, the food inventory situation corresponding to the food type is obtained based on the comprehensive environmental risk value, the starting warehousing time and the initial inventory; the food inventory situation corresponding to the food type is obtained based on the comprehensive environmental risk value, the starting warehousing time and the initial inventory, specifically including: determining the environmental risk value range corresponding to the comprehensive environmental risk value, determining the food storage time range corresponding to the food type, and determining the inventory range corresponding to the inventory management area; based on the environmental risk value range, standardizing the comprehensive environmental risk value to obtain a standardized comprehensive environmental risk value; based on the food storage time range, standardize the starting warehousing time to obtain the standardized starting warehousing time; based on the inventory range, standardize the initial inventory to obtain the standardized initial inventory; based on the standardized comprehensive environmental risk value, the standardized starting warehousing time and the standardized initial inventory, obtain the comprehensive storage risk coefficient corresponding to the grain type; when the comprehensive storage risk coefficient is not greater than the preset storage risk threshold, determine the grain inventory situation corresponding to the grain type as the first grain inventory; when the comprehensive storage risk coefficient is greater than the preset storage risk threshold, determine the grain inventory situation corresponding to the grain type as the second grain inventory; When the comprehensive environmental risk value is not greater than a preset risk threshold, determining the food inventory corresponding to the food type as the first food inventory; When there is an abnormality in the appearance of each of the grain types, the grain inventory situation corresponding to the grain type is determined to be the second grain inventory; the grain inventory situation includes the first grain inventory and the second grain inventory, wherein the first grain inventory is the grain inventory that supports continued storage, and the second grain inventory is the deteriorated or expiring grain inventory.

2. The method according to claim 1, characterized in that The determining of a plurality of relevant environmental data corresponding to the food type from the plurality of initial environmental data specifically includes: Determining storage requirements corresponding to the types of food; Based on the storage requirement, relevant environmental data corresponding to the food type is determined from the plurality of initial environmental data.

3. A grain inventory management system in a granary, characterized in that: The system includes a processing module and an acquisition module; The processing module is used to divide the granary into regions to obtain multiple inventory management regions; The processing module is further used to determine the types of food stored in the inventory management area; The acquisition module is used to acquire the initial inventory and the starting storage time corresponding to the food type; The acquisition module is further used to acquire a detection image corresponding to the food type acquired by a camera device disposed in the inventory management area, and acquire a plurality of initial environmental data acquired by a sensor disposed in the inventory management area; The processing module is further used to preprocess the detection image to obtain a preprocessed detection image; Extracting grain color features, grain shape features and grain texture features from the preprocessed detection image; Performing feature analysis on the grain color feature, the grain shape feature, and the grain texture feature to determine whether any one of the grain color feature, the grain shape feature, and the grain texture feature is abnormal; When any one of the grain color feature, the grain shape feature, and the grain texture feature is abnormal, it is determined that the appearance of the grain type is abnormal; When all of the grain color feature, the grain shape feature, and the grain texture feature are normal, it is determined that the appearance of the grain type is normal; When there is no abnormality in the appearance of the grain type, determining a plurality of relevant environmental data corresponding to the grain type from the plurality of initial environmental data; Performing standardization processing on the plurality of related environmental data to obtain a plurality of standardized related environmental data; Determine a preset environmental risk function and a preset risk weight corresponding to each of the relevant environmental data; Substituting each of the standardized related environmental data into the corresponding preset environmental risk function to obtain the environmental factor risk value corresponding to each of the related environmental data; Based on the multiple environmental factor risk values ​​and the multiple preset risk weights, obtaining a comprehensive environmental risk value corresponding to the food type; When the comprehensive environmental risk value is greater than a preset risk threshold, based on the comprehensive environmental risk value, the starting storage time and the initial inventory, the grain inventory situation corresponding to the grain type is obtained; The method of obtaining the food inventory situation corresponding to the food type based on the comprehensive environmental risk value, the starting warehousing time and the initial inventory quantity specifically includes: determining the environmental risk value range corresponding to the comprehensive environmental risk value, determining the food storage time range corresponding to the food type, and determining the inventory quantity range corresponding to the inventory management area; based on the environmental risk value range, standardizing the comprehensive environmental risk value to obtain a standardized comprehensive environmental risk value; based on the food storage time range, standardizing the starting warehousing time to obtain a standardized starting warehousing time; based on the inventory quantity range, standardizing the initial inventory to obtain a standardized initial inventory; based on the standardized comprehensive environmental risk value, the standardized starting warehousing time and the standardized initial inventory quantity, obtaining the comprehensive storage risk coefficient corresponding to the food type; when the comprehensive storage risk coefficient is not greater than the preset storage risk threshold, determining the food inventory situation corresponding to the food type to be the first food inventory; when the comprehensive storage risk coefficient is greater than the preset storage risk threshold, determining the food inventory situation corresponding to the food type to be the second food inventory; When the comprehensive environmental risk value is not greater than the preset risk threshold, the food inventory situation corresponding to the food type is determined to be the first food inventory; when there is an abnormality in the appearance of each of the food types, the food inventory situation corresponding to the food type is determined to be the second food inventory; the food inventory situation includes the first food inventory and the second food inventory, wherein the first food inventory is the food inventory that supports continued storage, and the second food inventory is the deteriorated or expiring food inventory.

4. An electronic device, characterized in that: The electronic device (400) comprises a processor (401), a memory (405), a user interface (403) and a network interface (404), wherein the memory (405) is used to store instructions, the user interface (403) and the network interface (404) are used to communicate with other devices, and the processor (401) is used to execute the instructions stored in the memory (405) so that the electronic device (400) executes the method according to any one of claims 1 to 2.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 2 is performed.