MCU chip applied to smart agriculture and communication protocol configuration method

By analyzing the environmental change index and mode determination index in the MCU agricultural system, switching of power consumption mode is solved, and the problem of high energy consumption in the MCU agricultural system is reduced, and the accuracy of evaluation and mode switching is improved.

CN119087844AInactive Publication Date: 2024-12-06中电科国海信通科技(海南)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410991270.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-12-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In smart agriculture, the energy consumption of MCU agricultural systems is high, especially when multiple modules work simultaneously, and the communication between sensors and MCUs and between MCUs and upper computers requires a large amount of power to support data transmission and processing, resulting in energy. Consumption increases.

Method used

By constructing an MCU agricultural system, analyzing the environmental information collected by agricultural sensors, obtaining environmental change index, and switching the power consumption mode based on the initial data and mode determination index, and switching to a low-energy mode to reduce energy consumption. The specific steps include: analyzing the temperature, light intensity, and humidity variation amount, calculating the environmental change index and the mode determination index, and if the environmental change index is greater than the determination index, switch to the first power consumption mode to reduce energy consumption.

Benefits of technology

It realizes intelligent adjustment and reduction of energy consumption in MCU agricultural system, improves energy use efficiency, solves the problem of high energy consumption in MCU agricultural system in the existing technology, and improves the accuracy of environmental change assessment and numerical evaluation of pattern judgment. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119087844A_ABST
    Figure CN119087844A_ABST
Patent Text Reader

Abstract

The invention discloses an MCU chip applied to smart agriculture and a communication protocol configuration method, and relates to the technical field of electric digital data processing. The communication protocol configuration method applied to the smart agriculture comprises the following steps of analyzing an agricultural environment, obtaining an environment change index and switching a power consumption mode. The agricultural environment information collected by the agricultural sensor is analyzed through the constructed MCU agricultural system to obtain the agricultural environment data, and the environment change index is obtained according to the initial agricultural environment data and the agricultural environment data. And comparing the power consumption levels of the constructed MCU agricultural system in the first power consumption mode and the second power consumption mode to obtain a mode judgment index, and judging whether the environment change index is greater than the mode judgment index to realize mode switching, thereby achieving the effect of reducing the energy consumption of the MCU agricultural system. The problem that in the prior art, an MCU agricultural system is high in energy consumption is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to an MCU chip and a communication protocol configuration method applied to smart agriculture. Background Art

[0002] With the rapid development of smart agriculture, one of its core technologies, the microcontroller unit (MCU chip) and the communication protocol configuration method have become the focus of research. Smart agriculture integrates the Internet of Things technology into traditional agriculture, realizes the precise perception, control and decision-making management of the agricultural production environment, and greatly improves the level of intelligent agricultural production. In addition to precise perception, control and decision-making management, in a broad sense, smart agriculture also includes agricultural e-commerce, food traceability and anti-counterfeiting, agricultural leisure tourism, agricultural information services and other aspects. As a special chip that integrates processors, memory and peripheral interfaces, MCU chips can package a large number of components and circuits into a single chip, reducing the size of the occupied space, optimizing the use and configuration of the chip, and have the advantages of small size, low power consumption, fast computing speed, low cost and high reliability. In smart agriculture, communication protocol configuration is the key link to ensure effective communication and data transmission between sensors, equipment, and platforms. As the basic rule for information exchange, the correctness and efficiency of the configuration of the communication protocol directly affect the performance and stability of the entire system. Therefore, communication protocol configuration technology has become an indispensable part of the field of modern information technology. Through reasonable communication protocol configuration, intelligent perception, control, and decision-making management of the agricultural production environment can be achieved.

[0003] In the prior art, communication with the sensor communication module is performed through a general input / output module or other communication interface. The communication protocol control unit first reads the communication protocol adapted to the agricultural sensor from the storage module. These communication protocols are pre-stored in the chip and can be selected and configured according to different agricultural sensor types and application scenarios. After the communication connection is established, the sensor communication module can communicate directly with the agricultural sensor. It is responsible for receiving the data collected by the agricultural sensor and transmitting it to the MCU chip for further processing and analysis. This direct communication method avoids additional hardware configuration and reduces the complexity and cost of the system. The direct communication between the sensor communication module and the agricultural sensor is achieved through the communication protocol control unit and the chip configuration module.

[0004] For example, a method for generating a description file of a smart agricultural Internet of Things device is announced in the invention patent with announcement number CN112764637B, including: defining a device description specification, defining a page component, loading a page component and loading a device structure, wherein loading a page component and loading a device structure include loading a main device, loading a sub-device and loading a sensor, adding a sensor configuration to a new sensor configuration selection area, dragging the label option of editing the sensor component in the control selection area to the main work area, and then setting the component properties, and judging whether there are other properties, which is judged by the user according to the needs and system hardware configuration. If a new instruction is required, the control information in the configuration selection area is configured, and the label option of the edit instruction control is dragged to the main work area by clicking the control selection area, and the properties are edited in the property modification area. Devices, sub-devices, and sensors are added to the control information and configuration information in the configuration selection area, and the label option of the edit page component is dragged to the main work area in the control selection area, and the component properties are set in the property modification area. Through graphical operations, a device configuration list is constructed, and a description file is dynamically generated.

[0005] For example, the invention patent with announcement number: CN104049995B announces a method and device for configuring FPGA in an MCU chip, including: a microcontroller unit MCU chip is integrated with a field programmable gate array FPGA module, the field programmable gate array FPGA module includes interconnected field programmable gate array FPGA devices and a field programmable gate array FPGA configuration information download submodule, the field programmable gate array module also includes a field programmable gate array FPGAIO configuration submodule, the FPGA device and the FPGAIO configuration submodule each include internal IO pins, the internal IO pins of the FPGA device are interconnected with the internal IO pins of the FPGAIO configuration submodule, the FPGA device and the FPGAIO configuration submodule communicate with each other internally through the interconnected internal IO pin pairs, the field programmable gate array FPGA configuration information download submodule receives data information; the field programmable gate array FPGA configuration information download submodule writes data information into the FPGA device.

[0006] However, in the process of implementing the technical solution of the invention in the embodiments of the present application, the present application found that the above technology has at least the following technical problems:

[0007] In the prior art, in order to meet the diverse and complex application requirements in smart agriculture, MCU chips integrate a large number of functional modules. These modules, whether data acquisition, processing, or communication control, need to consume a certain amount of electrical energy to maintain their normal operation, especially when multiple modules work at the same time, the energy consumption problem is more prominent. Secondly, the smart agricultural system relies on real-time and accurate data transmission. The communication between sensors and MCUs, and between MCUs and host computers is an indispensable part of this process. However, this type of communication not only requires fast speed and high stability, but also requires a large amount of electrical energy to support data transmission and processing. As the amount of data transmitted increases, energy consumption also increases, and there is a problem of high energy consumption in the MCU agricultural system. Summary of the invention

[0008] The embodiments of the present application solve the problem of high energy consumption of MCU agricultural systems in the prior art by providing an MCU chip and a communication protocol configuration method for smart agriculture, thereby reducing the energy consumption of the MCU agricultural system.

[0009] The embodiment of the present application provides a communication protocol configuration method for smart agriculture, comprising the following steps: S1, analyzing the agricultural environment information collected by the agricultural sensor through the constructed MCU agricultural system to obtain agricultural environment data, and performing functional testing and load testing on the agricultural cloud platform of the MCU agricultural system; S2, obtaining an environmental change index based on the initial agricultural environment data and the agricultural environment data, wherein the environmental change index is used to quantify changes in environmental conditions; S3, comparing the power consumption levels of the constructed MCU agricultural system in a first power consumption mode and a second power consumption mode to obtain a mode determination index, and determining whether the environmental change index is greater than the mode determination index to achieve mode switching; if it is greater than the mode determination index, the MCU agricultural system is switched to the first power consumption mode, otherwise it is switched to the second power consumption mode, wherein the mode determination index is used to measure the energy consumption level of the MCU agricultural system.

[0010] Furthermore, the specific method for obtaining the environmental change index is as follows: using a temperature sensor to obtain an initial temperature value and an agricultural temperature value after a preset time, thereby obtaining a temperature change; using a light intensity sensor to obtain an initial light intensity and an agricultural light intensity after a preset time, thereby obtaining a light intensity change; using a humidity sensor to obtain an initial air humidity value and an agricultural air humidity value after a preset time, thereby obtaining an air humidity change; using a soil humidity sensor to obtain an initial soil humidity and an agricultural soil humidity after a preset time, thereby obtaining a soil humidity change and performing normalization processing to obtain an environmental change index; the agricultural sensor includes a temperature sensor, a light intensity sensor, a humidity sensor and a soil humidity sensor.

[0011] Furthermore, the environmental change index is calculated using the following formula:

[0012]

[0013] Wherein, HB represents the environmental change index, e represents the natural constant, ΔT represents the preset time, Δh1 represents the temperature change, Δh2 represents the light intensity change, Δh3 represents the air humidity change, and Δh4 represents the soil humidity change.

[0014] Furthermore, a specific method for obtaining the mode determination index is as follows: measuring the time required for the MCU agricultural system to enter the first power consumption mode from the second power consumption mode to obtain the mode wake-up time, and the mode wake-up time is used to measure the response speed of the MCU agricultural system from the second power consumption mode to the first power consumption mode; measuring the time required for the MCU agricultural system to enter the second power consumption mode from the first power consumption mode to obtain the mode sleep time, and the mode sleep time is used to measure the response speed of the MCU agricultural system from the first power consumption mode to the second power consumption mode; measuring the circuit current of the MCU agricultural system in the first power consumption mode to obtain the working current, and measuring the circuit current of the MCU agricultural system in the second power consumption mode to obtain the sleep current; measuring the power supply voltage of the MCU agricultural system to obtain the power supply voltage of the MCU agricultural system, and performing normalization processing to obtain the mode determination index of the MCU agricultural system.

[0015] Furthermore, the mode determination index of the MCU agricultural system is calculated using the following formula:

[0016]

[0017] Wherein, GH represents the mode determination index, e represents the natural constant, t1 represents the mode wake-up time, t2 represents the mode sleep time, s1 represents the working current, s2 represents the sleep current, and v represents the MCU agricultural system power supply voltage.

[0018] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0019] 1. The agricultural environment information collected by the agricultural sensor is analyzed by the constructed MCU agricultural system to obtain agricultural environment data, and the environmental change index is obtained according to the initial agricultural environment data and the agricultural environment data. The power consumption levels of the constructed MCU agricultural system in the first power consumption mode and the second power consumption mode are compared to obtain the mode determination index, and the mode switching is realized based on this, thereby realizing the intelligent adjustment of the energy consumption of the MCU agricultural system, and then realizing the reduction of the energy consumption of the MCU agricultural system, which effectively solves the problem of high energy consumption of the MCU agricultural system in the prior art.

[0020] 2. The initial temperature value and the agricultural temperature value after a preset time are obtained through the temperature sensor, and the temperature change is obtained based on this. The initial light intensity is analyzed by the light intensity sensor to obtain the agricultural light intensity after a preset time to obtain the light intensity change. The humidity sensor is used to analyze the initial air humidity value and the agricultural air humidity value after a preset time to obtain the air humidity change. Finally, the soil humidity sensor is used to analyze the initial soil humidity and the agricultural soil humidity after a preset time to obtain the soil humidity change and perform normalization processing to obtain the environmental change index, thereby realizing the numerical evaluation of environmental changes and then realizing a more accurate evaluation of environmental changes.

[0021] 3. The mode wake-up time is obtained by measuring the time required for the MCU agricultural system to enter the first power consumption mode from the second power consumption mode, and the mode sleep time is obtained by measuring the time required for the MCU agricultural system to enter the second power consumption mode from the first power consumption mode. The circuit current of the MCU agricultural system in the first power consumption mode is measured to obtain the working current, and the circuit current of the MCU agricultural system in the second power consumption mode is measured to obtain the sleep current. Finally, the power supply voltage of the MCU agricultural system is measured to obtain the power supply voltage of the MCU agricultural system, and normalization is performed to obtain the mode determination index of the MCU agricultural system, thereby realizing the numerical evaluation of the mode determination, and then realizing a more accurate evaluation of the mode determination. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flow chart of a communication protocol configuration method for smart agriculture provided in an embodiment of the present application;

[0023] Figure 2 A functional test process diagram provided for an embodiment of the present application;

[0024] Figure 3 A statistical graph of changes in the mode determination index provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The embodiment of the present application solves the problem of high energy consumption of MCU agricultural systems in the prior art by providing an MCU chip and a communication protocol configuration method for smart agriculture. The constructed MCU agricultural system analyzes the agricultural environmental information collected by agricultural sensors to obtain agricultural environmental data, and performs functional testing and load testing on the agricultural cloud platform of the MCU agricultural system. An environmental change index is obtained based on initial agricultural environmental data and agricultural environmental data. Then, the power consumption levels of the constructed MCU agricultural system in a first power consumption mode and a second power consumption mode are compared to obtain a mode determination index, and it is determined whether the environmental change index is greater than the mode determination index to achieve mode switching, thereby reducing the energy consumption of the MCU agricultural system.

[0026] The technical solution in the embodiment of the present application is to solve the problem of high energy consumption of the above-mentioned MCU agricultural system, and the overall idea is as follows:

[0027] The constructed MCU agricultural system analyzes the agricultural environmental information collected by agricultural sensors to obtain agricultural environmental data, and combines the initial agricultural environmental data to obtain the environmental change index. The power consumption levels of the constructed MCU agricultural system in the first power consumption mode and the second power consumption mode are compared to obtain the mode determination index to achieve mode switching, thereby achieving the effect of reducing the energy consumption of the MCU agricultural system.

[0028] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0029] like Figure 1 As shown, it is a flow chart of a communication protocol configuration method for smart agriculture provided in an embodiment of the present application, the method comprising the following steps: S1, analyzing the agricultural environment information collected by the agricultural sensor through the constructed MCU agricultural system to obtain agricultural environment data, and performing functional testing and load testing on the agricultural cloud platform of the MCU agricultural system, the MCU agricultural system realizes connection with the agricultural sensor through the serial port, the MCU agricultural system is used to monitor the agricultural environment data in real time, the agricultural environment information includes temperature information, soil moisture information, air humidity information and light intensity information, the agricultural environment information is used to record agricultural related information of a preset area, the agricultural environment data includes agricultural temperature value, agricultural light intensity, agricultural air humidity value and agricultural soil humidity, the agricultural environment data is used to record agricultural related data of a preset area, the agricultural cloud platform is used to receive, store and analyze the agricultural environment data sent by the MCU, and the functional test is used Test the functional level of the agricultural cloud platform. The load test is used to measure the performance level of the agricultural cloud platform under different load conditions. S2. Obtain the environmental change index based on the initial agricultural environmental data and agricultural environmental data. The initial agricultural environmental data includes the initial temperature value, the initial light intensity, the initial air humidity value and the initial soil humidity. The environmental change index is used to quantify the changes in environmental conditions. S3. Compare the power consumption levels of the constructed MCU agricultural system in the first power consumption mode and the second power consumption mode to obtain the mode determination index, and determine whether the environmental change index is greater than the mode determination index to achieve mode switching. If it is greater than the mode determination index, the MCU agricultural system is switched to the first power consumption mode, otherwise it is switched to the second power consumption mode. The first power consumption mode is used to handle abnormal situations where the agricultural environment changes rapidly, and the second power consumption mode is used to reduce energy consumption. The mode determination index is used to measure the energy consumption level of the MCU agricultural system.

[0030] In this embodiment, the construction of the MCU agricultural system requires connecting agricultural sensors with the MCU main control board. The MCU main control board is used to integrate the data collected by the agricultural sensors and control the working status of the entire system. The agricultural cloud platform is obtained by designing the overall architecture and database of the agricultural cloud platform, where the overall architecture includes a front-end display layer, a back-end service layer, and a data storage layer, and the database is used to store agricultural environmental data. The agricultural cloud platform is deployed to the production environment and functional testing and load testing are performed, and the agricultural cloud platform is optimized according to the test results.

[0031] Specifically, after obtaining the agricultural environmental data, it is also necessary to monitor the agricultural environmental data in real time through the MCU agricultural system and draw a line chart of the agricultural environmental data. The line chart is used to visualize the agricultural environmental data. The drawing of the line chart requires grouping the agricultural environmental data according to the data type, and determining the drawing color of each group of data. Finally, the corresponding data points on the coordinate axis are sorted and connected by time and date to obtain the line chart; for example, during the monitoring period, the soil temperature gradually rises from 18°C ​​in the morning to 24°C at noon, and then slowly drops to 20°C in the afternoon, and further drops to about 16°C at night. The change trend of air temperature is similar to that of soil temperature, but the fluctuation range is slightly larger. The air temperature is 17°C in the morning, reaches a peak of 26°C at noon, drops to 22°C in the evening, and drops to about 15°C at night, which is consistent with the changes in temperature and soil temperature. The air humidity is the opposite of the change trend. The highest in the morning is 80%, and it gradually decreases to about 50% at noon as the temperature rises. It slightly rises to 60% in the evening and rises again to about 75% at night. In the line chart, the x-axis represents time, and the y-axis represents the value of each environmental parameter. The blue, red and green lines correspond to soil temperature, air temperature and air humidity respectively. The soil temperature line shows a relatively gentle "peak" shape, reaching the highest point at noon. The air temperature line is similar to the soil temperature line, but the fluctuation is more violent, especially the temperature difference between noon and night is large. The air humidity line presents a "valley" shape opposite to the temperature and soil temperature, with higher humidity in the morning and night and the lowest humidity at noon. It realizes a more accurate construction of the MCU agricultural system and further improves the efficiency of agricultural environmental data analysis.

[0032] Further, such as Figure 2As shown, it is a functional test process diagram provided in an embodiment of the present application, and the specific steps of the functional test are as follows: feedback testing is performed on the independent modules of the agricultural cloud platform to obtain unit test results, and the unit test results are used to measure the functional performance of the independent modules of the agricultural cloud platform; the independent modules of the agricultural cloud platform are integrated and the integration test results are obtained according to the interaction process and integration process between the modules, and the integration test results are used to measure the interaction and integration capability level between different modules of the agricultural cloud platform; the simulated agricultural environment data received by the agricultural cloud platform is checked to obtain data reception results, and the simulated agricultural environment data represents data sent to the agricultural cloud platform through the MCU simulation device, and the data reception results are used to verify the functional performance of the agricultural cloud platform in receiving agricultural environment data.

[0033] In this embodiment, the feedback test process is as follows: by writing test cases for agricultural crops, the test case content includes inputting information such as growth stage, start time, expected harvest date, etc., and executing the written test cases in sequence in the prepared test environment, and finally obtaining unit test results by recording the execution results of each test case, including passed, failed or problematic cases; implementing interface docking according to the interaction protocol between modules, executing test cases for agricultural crops, simulating the module interaction process in the actual use scenario, and building an integrated test environment similar to the actual operating environment, including necessary hardware equipment, software platform and database, etc., and gradually integrating each module into the test environment, simulating the module integration process in the actual use scenario, and checking the compatibility of the interfaces between the modules and the accuracy of data transmission during the integration process to obtain the interaction and integration capability level between different modules, and finally recording the results of the interaction process and integration process between modules to obtain the integration test results; achieving more accurate testing of the functions of the agricultural cloud platform.

[0034] Furthermore, the specific steps of the load test are as follows: obtain the load stress resistance index according to the performance of the agricultural cloud platform under the load environment. The load stress resistance index is used to measure the stress resistance level of the agricultural cloud platform under high load conditions. The load environment represents the use of a load testing tool to simulate the environment of the agricultural cloud platform with different concurrent user numbers and their corresponding request frequencies. The load testing tool is used to simulate the load environment of the agricultural cloud platform; monitor and count the results of the load stress resistance index in real time to obtain a load test report, which is used to visualize the load stress resistance index.

[0035] In this embodiment, a load test tool is used to simulate the actual use scenario of the agricultural cloud platform. Different concurrent user numbers need to be set, such as gradually increasing from 100 users to 1000 users, and each stage is maintained for 5 minutes to simulate the gradual increase in the number of users. For each concurrent user number, the corresponding request frequency is set, such as initiating 10 requests per second to initiating 100 requests per second to simulate the different intensities of user activities; the load test report obtains the load stress resistance index based on the throughput of the load test and the response time of the load test, and the error rate can also be added. For example, assuming that in the 100 user concurrent scenario, the average response time of the agricultural cloud platform is 50 milliseconds, the throughput is 100 requests / second, and the error rate is 0%; in the 1000 user concurrent scenario, the average response time is 200 milliseconds, the throughput is 800 requests / second, and the error rate is 1%. Based on these data, the load stress resistance index under different scenarios can be calculated and displayed in the form of tables and charts in the load test report. The load test report clearly and accurately reflects the performance and stress resistance level of the agricultural cloud platform under the load environment; a more accurate test of the performance of the agricultural cloud platform is achieved.

[0036] Furthermore, the specific method for obtaining the load stress resistance index is as follows: obtain the test time by counting the time of each load test; obtain the response time according to the time it takes the agricultural cloud platform to respond to each request instruction, the request instruction is used to simulate the user's behavior request, and the response time is used to quantify the response speed of the agricultural cloud platform; obtain the throughput according to the number of request instructions processed in each load test, and normalize the response time and throughput to obtain the load stress resistance index, and the throughput is used to quantify the ability level of the agricultural cloud platform in processing requests.

[0037] In this embodiment, the load compressive strength index is specifically calculated using the following formula:

[0038]

[0039] In the formula, KY represents the load compression index, g represents the number of the load test, g = 1, 2, ..., G, G represents the total number of load tests, k 1g represents the throughput of the g-th load test, k 2g represents the response time of the g-th load test, k 3g Indicates the test time of the g-th load test.

[0040] Specifically, for the convenience of analysis, define α1 is the test throughput weight, defined as α2 is the response throughput weight, and the calculation formula of the load stress resistance index is: The statistical table of changes in the load compressive index is shown in Table 1:

[0041] Table 1 Statistics of changes in load compressive index

[0042] <![CDATA[Test throughput weight α1]]> <![CDATA[Response throughput weight α2]]> Load compression index KY 1.849 1.191 0.099 1.715 1.229 0.030 1.802 1.168 0.112 1.945 1.226 0.086 ... ... ...

[0043] Among them, the algorithm of this embodiment combines the throughput, response time and test time of the load test, and comprehensively analyzes to obtain the dependent variable. The response time and throughput of the load test in this formula, under ideal circumstances, if the system resources are sufficient and there is no bottleneck, then the shorter the response time, the more requests can be processed per unit time, that is, the greater the throughput. This is because a shorter response time means that the system can process the current request faster and prepare to accept the next request. Conversely, if the response time is longer, the number of requests that the system can process in the same time will be reduced, resulting in a decrease in throughput, indicating the performance of the agricultural cloud platform under the load environment. Therefore, by establishing a mathematical form, a precise analysis is performed; the test throughput weight and The load stress resistance index is positively correlated, and the response throughput weight is negatively correlated with the load stress resistance index. High throughput and short response time usually mean that the system has a higher load stress resistance, because such a system can maintain a faster processing speed and higher processing efficiency under high load. On the contrary, if the throughput is low and the response time is long, it means that the system may face performance bottlenecks or resource limitations under high load, and its load stress resistance is relatively weak. The load stress resistance index will comprehensively consider these factors and other performance indicators such as resource utilization to give a comprehensive score or rating so that users can understand the overall performance of the system under high load; thereby achieving a comprehensive evaluation of load stress resistance and effectively solving the problem of low stress resistance level of the agricultural cloud platform.

[0044] Furthermore, a specific method for obtaining the environmental change index is as follows: obtaining the initial temperature value and the agricultural temperature value after a preset time through a temperature sensor, thereby obtaining the temperature change, and the temperature change is used to measure the difference in temperature of the agricultural environment; obtaining the initial light intensity and the agricultural light intensity after a preset time through a light intensity sensor, thereby obtaining the light intensity change, and the light intensity change is used to measure the difference in light intensity of the agricultural environment; obtaining the initial air humidity value and the agricultural air humidity value after a preset time through a humidity sensor, thereby obtaining the air humidity change, and the humidity change is used to measure the difference in humidity of the agricultural environment; obtaining the initial soil humidity and the agricultural soil humidity after a preset time through a soil humidity sensor, thereby obtaining the soil humidity change and normalizing it to obtain the environmental change index, and the soil humidity change is used to measure the difference in soil humidity of the agricultural environment; the agricultural sensor includes a temperature sensor, a light intensity sensor, a humidity sensor and a soil humidity sensor.

[0045] In this embodiment, the temperature change is the difference between the initial temperature value and the agricultural temperature value after a preset time, the light intensity change is the difference between the initial light intensity and the agricultural light intensity after a preset time, the air humidity change is the difference between the initial air humidity value and the agricultural air humidity value after a preset time, and the soil humidity change is the difference between the initial soil humidity and the agricultural soil humidity after a preset time. The environmental change index may also be related to changes in wind direction, wind speed, carbon dioxide concentration and soil pH. Although the soil pH value does not directly belong to environmental changes, it is crucial to the agricultural environment. In the MCU agricultural system, the agricultural production environment can be precisely regulated according to changes in soil pH value in combination with other environmental parameters. For example, in greenhouse cultivation, the soil pH value can be adjusted by adjusting the pH of irrigation water to provide a suitable growth environment for crops, thereby achieving more accurate analysis of environmental changes.

[0046] Furthermore, the environmental change index is calculated using the following formula:

[0047]

[0048] Wherein, HB represents the environmental change index, e represents the natural constant, ΔT represents the preset time, Δh1 represents the temperature change, Δh2 represents the light intensity change, Δh3 represents the air humidity change, and Δh4 represents the soil humidity change.

[0049] In this embodiment, the algorithm of this embodiment combines the temperature change, light intensity change, air humidity change and soil humidity change, and comprehensively analyzes to obtain the dependent variable. In this formula, the temperature change affects the air humidity change, and the temperature change and the air humidity change are positively correlated, indicating the change in environmental conditions. Therefore, by establishing a mathematical form, accurate analysis is performed; the temperature change is positively correlated with the environmental change index, the light intensity change is positively correlated with the environmental change index, the air humidity change is positively correlated with the environmental change index, and the soil humidity change is positively correlated with the environmental change index.

[0050] Specifically, extreme temperatures or temperature fluctuations may cause stress to plants and affect yield and quality. The environmental change index will consider the change in temperature, especially the degree of deviation from the suitable growth range of plants, to assess whether environmental conditions are suitable; light is necessary for plants to carry out photosynthesis, and changes in light intensity directly affect the growth rate and health of plants. The environmental change index will incorporate changes in light intensity to assess whether light conditions meet the needs of plants and adjust the light management strategy of the agricultural system accordingly; air humidity has an important impact on plant transpiration, respiration, and the occurrence of diseases and pests. The environmental change index will consider changes in air humidity to assess whether current humidity conditions are suitable, and measures may need to be taken to adjust humidity levels; soil moisture directly affects the water and nutrient absorption capacity of plant roots and is the basis for plant growth. The environmental change index will pay close attention to changes in soil moisture to ensure that the soil maintains a suitable humidity level to support normal plant growth; a more comprehensive assessment of agricultural environmental changes has been achieved, effectively solving the problem of low efficiency in agricultural environmental data analysis.

[0051] Furthermore, a specific method for obtaining the mode determination index is as follows: measuring the time required for the MCU agricultural system to enter the first power consumption mode from the second power consumption mode to obtain the mode wake-up time, the mode wake-up time is used to measure the response speed of the MCU agricultural system from the second power consumption mode to the first power consumption mode, and the MCU agricultural system executes the received preset wake-up instruction before entering the first power consumption mode from the second power consumption mode; measuring the time required for the MCU agricultural system to enter the second power consumption mode from the first power consumption mode to obtain the mode sleep time, the mode sleep time is used to measure the response speed of the MCU agricultural system from the first power consumption mode to the second power consumption mode, and the MCU agricultural system executes the received preset sleep instruction before entering the second power consumption mode from the first power consumption mode; measuring the circuit current of the MCU agricultural system in the first power consumption mode to obtain the working current, and measuring the circuit current of the MCU agricultural system in the second power consumption mode to obtain the sleep current, the working current is used to measure the current consumption level of the MCU agricultural system in the first power consumption mode, and the sleep current is used to measure the current consumption level of the MCU agricultural system in the second power consumption mode; measuring the power supply voltage of the MCU agricultural system to obtain the power supply voltage of the MCU agricultural system, and performing normalization processing to obtain the mode determination index of the MCU agricultural system, the power supply voltage is used to measure the voltage consumption level of the MCU agricultural system.

[0052] In this embodiment, the MCU agricultural system executes the received preset wake-up instruction before entering the first power consumption mode from the second power consumption mode. When the MCU agricultural system is in a sleep state, its communication interface is in a low power consumption mode or a completely closed state. When the wake-up instruction is received, an external interrupt wake-up instruction is used to wake up the MCU agricultural system. After waking up, the firmware of the MCU agricultural system will parse the received instruction and perform corresponding operations according to the instruction content, such as initializing the system, configuring peripherals, entering the first power consumption mode, etc.; the MCU agricultural system executes the received preset sleep instruction before entering the second power consumption mode from the first power consumption mode, and code is written in the firmware of the MCU agricultural system to detect and identify the received sleep instruction. When the MCU agricultural system is in the first power consumption mode or other active state, its communication interface should remain open to receive the sleep instruction. After receiving the sleep instruction, the MCU agricultural system will perform a series of cleanup operations, including saving important data, shutting down peripherals, disconnecting the network connection, etc., and then enter the second power consumption mode. Before entering the second power consumption mode, the MCU agricultural system may need to adjust its power management settings to reduce power consumption.

[0053] Specifically, the mode wake-up time is the time when the MCU agricultural system enters the wake-up state from the sleep state, and the mode sleep time is the time when the MCU agricultural system enters the sleep state from the wake-up state, which realizes more accurate control of energy consumption.

[0054] Furthermore, the mode determination index of the MCU agricultural system is calculated using the following formula:

[0055]

[0056] Wherein, GH represents the mode determination index, e represents the natural constant, t1 represents the mode wake-up time, t2 represents the mode sleep time, s1 represents the working current, s2 represents the sleep current, and v represents the MCU agricultural system power supply voltage.

[0057] In this embodiment, for the convenience of calculation, we define β1 is the working energy weight, defined as β2 is the dormant energy weight, and the calculation formula of the mode determination index is: like Figure 3 As shown, it is a statistical chart of the changes in the mode determination index provided in the embodiment of the present application. It can be seen from the figure that the working energy weight is positively correlated with the mode determination index of the MCU agricultural system, and the dormant energy weight is positively correlated with the mode determination index of the MCU agricultural system.

[0058] Specifically, the algorithm of this embodiment combines the mode wake-up time, mode sleep time, working current, sleep current and MCU agricultural system power supply voltage, and comprehensively analyzes to obtain the dependent variable. In this formula, the sleep current is the current consumed by the MCU in sleep mode, which is usually much lower than the working current. Since the sleep current is very small, the impact on the power supply voltage is relatively small. However, in long-term operation or battery-powered applications, the cumulative effect of the sleep current may still have an impact on battery life and system power consumption, indicating the energy consumption level of the MCU agricultural system. Therefore, by establishing a mathematical form, an accurate analysis is performed; a shorter wake-up time means that the system can respond to environmental changes or task requirements more quickly, but it may also lead to higher energy consumption. The mode determination index will consider the impact of the wake-up time on the overall energy consumption to avoid setting a too short wake-up interval. To reduce unnecessary energy consumption; a longer sleep time helps to reduce the average energy consumption of the system, because the current consumed by the system in sleep state is much lower than that in working state. The mode determination index will dynamically adjust the sleep time according to the current environmental conditions, task requirements and the historical energy consumption data of the system to balance the system response speed and energy consumption level; when the system detects that the working current is continuously high and the power supply voltage is stable, it may indicate that the current task is more complex or the system load is heavier. At this time, you can consider switching to a more efficient working mode or increasing the energy supply; on the contrary, when the system detects that the sleep current is extremely low and the power supply voltage is stable, it may indicate that no task needs to be performed at present or the system is idle. At this time, you can switch to sleep mode to save energy; thereby achieving a more comprehensive evaluation of mode determination and effectively solving the problem of low mode switching efficiency.

[0059] Furthermore, the specific steps of mode switching are as follows: Step 1, initialize the initial power consumption mode, environmental change index and mode determination index of the MCU agricultural system; Step 2, use the agricultural sensor to monitor the environmental change index in real time, and automatically trigger the update operation to update the environmental change index according to the preset time period, the update operation includes the agricultural sensor re-collecting the agricultural environmental information, and using the MCU agricultural system to analyze the agricultural environmental information collected by the agricultural sensor to obtain the environmental change index; Step 3, compare the environmental change index with the mode determination index, if the environmental change index is greater than the mode determination index, execute step 4, otherwise execute step 5; Step 4, determine whether the current mode of the MCU agricultural system is the first power consumption mode, if not the first power consumption mode, adjust the MCU agricultural system configuration to enable the backup graphics card and the backup network interface card, and update the MCU agricultural system state to the first power consumption mode, otherwise execute step 2; Step 5, determine whether the current mode of the MCU agricultural system is the second power consumption mode, if not the second power consumption mode, turn off the backup graphics card and the backup network interface card of the MCU agricultural system, and update the MCU agricultural system state to the second power consumption mode, otherwise execute step 2.

[0060] In this embodiment, initializing the MCU agricultural system requires resetting the MCU agricultural system. After resetting, the MCU agricultural system starts executing code from its preset startup address and calibrates the agricultural sensors in the MCU agricultural system, thereby realizing the initialization of the initial power consumption mode, environmental change index and mode determination index. If the value of the environmental change index is high, it means that the environmental conditions have changed significantly, and the MCU agricultural system will need to increase the operating frequency or take other measures to adapt to environmental changes, which may lead to increased power consumption. Therefore, by comparing the environmental change index and the mode determination index, the energy distribution is made more reasonable, and intelligent switching of power consumption modes is realized.

[0061] The embodiment of the present application provides an MCU chip for a communication protocol configuration method applied to smart agriculture, including a sensor communication module, a digital conversion module, a chip configuration module, a chip storage module and a communication protocol control module; wherein the sensor communication module is used to receive data from an agricultural sensor; the digital conversion module is used to convert the agricultural environmental information collected by the agricultural sensor into binary code, and convert the binary code into digital form to obtain agricultural environmental data; the chip configuration module is used to execute modification, addition and deletion of communication protocols adapted to the agricultural sensor; the chip storage module is used to store program code and agricultural environmental data, and the program code includes various communication protocols adapted to the agricultural sensor.

[0062] In this embodiment, the communication protocol adapted by the agricultural sensor in the program code generally includes protocol definition, data format, communication process, error handling and protocol implementation; the protocol definition is used to define the basic parameters of the communication protocol, such as baud rate, data bit, stop bit, check mode, etc.; the data format is used to specify the encoding method of sensor data, the format and structure of the data packet, which includes the definition of data field, data type, length, sequence, etc.; the communication process is used to describe the communication process between the sensor and the MCU or other processing units, including the steps of data sending, receiving, and confirming; error handling is used to define the error conditions that may occur during the communication process and their processing mechanisms, such as data verification failure, timeout, etc.; the protocol implementation is used to use a programming language to implement the above-mentioned protocol definition and data format, and write corresponding code modules to handle the reception, parsing and sending of sensor data, thereby improving the efficiency of agricultural environmental information processing.

[0063] To summarize, the embodiment of the present application analyzes the agricultural environmental information collected by the agricultural sensor through the constructed MCU agricultural system to obtain agricultural environmental data, obtains the environmental change index based on the initial agricultural environmental data and the agricultural environmental data, compares the power consumption levels of the constructed MCU agricultural system in the first power consumption mode and the second power consumption mode to obtain the mode determination index, and determines whether the environmental change index is greater than the mode determination index to achieve mode switching, thereby realizing intelligent adjustment of the energy consumption of the MCU agricultural system, and then realizing the reduction of the energy consumption of the MCU agricultural system, effectively solving the problem of high energy consumption of the MCU agricultural system in the prior art.

[0064] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0065] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0066] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0067] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0068] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0069] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. Communication protocol configuration method applied to smart agriculture, It is characterized in that The following steps are involved: S1, analyze the agricultural environment information collected by agricultural sensors through the constructed MCU agricultural system to obtain agricultural environment data, and perform functional testing and load testing on the agricultural cloud platform of the MCU agricultural system; S2, obtaining an environmental change index based on the initial agricultural environmental data and the agricultural environmental data, wherein the environmental change index is used to quantify changes in environmental conditions; S3, compare the power consumption levels of the constructed MCU agricultural system in the first power consumption mode and the second power consumption mode to obtain a mode determination index, and determine whether the environmental change index is greater than the mode determination index to achieve mode switching. If it is greater than the mode determination index, the MCU agricultural system is switched to the first power consumption mode, otherwise it is switched to the second power consumption mode. The mode determination index is used to measure the energy consumption level of the MCU agricultural system.

2. The communication protocol configuration method applied to smart agriculture as claimed in claim 1, It is characterized in that The specific steps of the functional test are as follows: Conduct feedback testing on independent modules of the agricultural cloud platform to obtain unit test results; Integrate the independent modules of the agricultural cloud platform and obtain the integration test results based on the interaction and integration process between modules; The simulated agricultural environment data received by the agricultural cloud platform is checked to obtain data reception results, wherein the simulated agricultural environment data represents data sent to the agricultural cloud platform through the MCU simulation device.

3. The communication protocol configuration method applied to smart agriculture as claimed in claim 1, It is characterized in that The specific steps of the load test are as follows: Obtaining a load stress resistance index according to the performance of the agricultural cloud platform under a load environment, wherein the load stress resistance index is used to measure the stress resistance level of the agricultural cloud platform under a high load condition; The load resistance index is monitored and counted in real time to obtain a load test report, where the load test report is used to visualize the load resistance index.

4. The communication protocol configuration method applied to smart agriculture as claimed in claim 3, It is characterized in that The specific method for obtaining the load compressive strength index is as follows: Count the time of each load test to obtain the test time; Obtaining a response time based on the time it takes the agricultural cloud platform to respond to each request instruction, wherein the response time is used to quantify the response speed of the agricultural cloud platform; The throughput is obtained based on the number of request instructions processed in each load test, and the response time and throughput are normalized to obtain the load stress resistance index.

5. The communication protocol configuration method applied to smart agriculture as claimed in claim 1, It is characterized in that The specific method for obtaining the environmental change index is as follows: The temperature sensor is used to obtain the initial temperature value and the agricultural temperature value after a preset time, and the temperature change is obtained accordingly; The light intensity sensor is used to obtain the initial light intensity and the agricultural light intensity after a preset time, and the light intensity change is obtained accordingly; The humidity sensor is used to obtain the initial air humidity value and the agricultural air humidity value after a preset time, and the air humidity change is obtained accordingly; The soil moisture sensor is used to obtain the initial soil moisture and the agricultural soil moisture after a preset time, and the soil moisture change is obtained and normalized to obtain the environmental change index; The agricultural sensors include temperature sensors, light intensity sensors, humidity sensors and soil moisture sensors.

6. The communication protocol configuration method applied to smart agriculture as claimed in claim 5, It is characterized in that The environmental change index is specifically calculated using the following formula: In the formula, HB represents the environmental change index, e represents the natural constant, ΔT represents the preset time, and Δh 1 Indicates the temperature change, Δh 2 Indicates the change in light intensity, Δh 3 Indicates the change in air humidity, Δh 4 Indicates the change in soil moisture.

7. The communication protocol configuration method applied to smart agriculture as claimed in claim 1, It is characterized in that The specific method for obtaining the mode determination index is as follows: The time required for the MCU agricultural system to enter the first power consumption mode from the second power consumption mode is measured to obtain the mode wake-up time, where the mode wake-up time is used to measure the response speed of the MCU agricultural system from the second power consumption mode to the first power consumption mode; The time required for the MCU agricultural system to enter the second power consumption mode from the first power consumption mode is measured to obtain the mode sleep time, wherein the mode sleep time is used to measure the response speed of the MCU agricultural system from the first power consumption mode to the second power consumption mode; The circuit current of the MCU agricultural system in the first power consumption mode is measured to obtain the working current, and the circuit current of the MCU agricultural system in the second power consumption mode is measured to obtain the sleep current; The power supply voltage of the MCU agricultural system is measured to obtain the power supply voltage of the MCU agricultural system, and normalized to obtain the mode determination index of the MCU agricultural system.

8. The communication protocol configuration method applied to smart agriculture as claimed in claim 7, It is characterized in that The mode determination index of the MCU agricultural system is specifically calculated using the following formula: In the formula, GH represents the mode determination index, e represents the natural constant, and t 1 Indicates the mode wake-up time, t 2 Mode sleep time, s 1 Indicates the working current, s 2 represents the sleep current, and v represents the MCU agricultural system power supply voltage.

9. The communication protocol configuration method applied to smart agriculture as claimed in claim 1, It is characterized in that The specific steps of the mode switching are as follows: Step 1: Initialize the initial power consumption mode, environmental change index and mode determination index of the MCU agricultural system; Step 2: Use agricultural sensors to monitor the environmental change index in real time, and automatically trigger an update operation to update the environmental change index according to a preset time period; Step 3, comparing the environmental change index with the mode determination index, if the environmental change index is greater than the mode determination index, executing step 4, otherwise executing step 5; Step 4, determining whether the current mode of the MCU agricultural system is the first power consumption mode, if not the first power consumption mode, adjusting the MCU agricultural system configuration to enable the standby graphics card and the standby network interface card, and updating the MCU agricultural system state to the first power consumption mode, otherwise executing step 2; Step five, determine whether the current mode of the MCU agricultural system is the second power consumption mode. If it is not the second power consumption mode, turn off the backup graphics card and backup network interface card of the MCU agricultural system, and update the MCU agricultural system status to the second power consumption mode, otherwise execute step two.

10. An MCU chip using the communication protocol configuration method for smart agriculture as described in any one of claims 1 to 9, It is characterized in that It includes a sensor communication module, a digital conversion module, a chip configuration module, a chip storage module and a communication protocol control module; Wherein, the sensor communication module is used to receive data from agricultural sensors; The digital conversion module is used to convert the agricultural environmental information collected by the agricultural sensor into binary code, and convert the binary code into digital form to obtain agricultural environmental data; The chip configuration module is used to modify, add and delete the communication protocol adapted by the agricultural sensor; The chip storage module is used for storing program codes and agricultural environment data.