Intelligent agricultural internet of things integration method based on multi-protocol adaptation and edge computing

By constructing a protocol-driven library and a weighted feature matching algorithm, combined with a task profiling model and a reinforcement learning model, the problems of protocol fragmentation and strong data heterogeneity in agricultural IoT are solved. This enables the system to adapt to unknown devices and dynamic environments, generates real-time optimized control commands, and improves the reliability and efficiency of smart agriculture.

CN121509466BActive Publication Date: 2026-04-24YUNONG JINGFEI (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YUNONG JINGFEI (BEIJING) TECH CO LTD
Filing Date
2025-12-04
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing agricultural IoT integration methods lack compatibility with unknown or dynamically changing protocols, making it difficult to meet real-time control requirements. Furthermore, they fail to fully integrate the semantic features of agricultural tasks for fine-grained profiling and intelligent decision-making, resulting in unreasonable allocation of edge and cloud resources and making it difficult to support highly reliable and adaptive agricultural intelligent control.

Method used

By constructing a protocol-driven library, employing a weighted feature matching algorithm for protocol sniffing and matching, using a task profiling model for quantitative analysis, combining a reinforcement learning model for decision-making, generating intelligent processing results, and generating optimal control commands through a model predictive controller, the integration of multi-protocol adaptation and edge computing into smart agriculture IoT is achieved.

Benefits of technology

It enhances the adaptability of agricultural IoT to unknown devices and dynamic environments, enables real-time optimized generation of control commands, and provides highly reliable and efficient integrated support for smart agriculture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509466B_ABST
    Figure CN121509466B_ABST
Patent Text Reader

Abstract

The application discloses a smart agricultural Internet of Things integration method based on multi-protocol adaptation and edge computing, relates to the technical field of Internet of Things integration, and comprises the following steps: after sending a standardized data object to an edge computing node, using a task portrait model to perform quantitative analysis, obtaining a task description vector, using a reinforcement learning model to make a decision on the task description vector, obtaining a task execution position, performing forward reasoning on the standardized data object according to the task execution position, generating an intelligent processing result, performing space-time alignment and fusion on the intelligent processing result, obtaining a decision vector, inputting the decision vector into a model predictive controller to perform prediction, generating an optimal control instruction and executing the optimal control instruction; the application improves the adaptability of the agricultural Internet of Things to unknown equipment and dynamic environments through the self-adaptive Internet of Things integration method, and realizes real-time optimization generation of control instructions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) integration technology, and in particular to a smart agriculture IoT integration method based on multi-protocol adaptation and edge computing. Background Technology

[0002] With the deep integration of the Internet of Things and edge computing, smart agriculture is accelerating towards a new stage of high automation and data-driven development. In recent years, various high-precision environmental sensors, crop monitoring devices, and intelligent agricultural machinery have been widely used in agricultural production, building a sensing network covering all elements of farmland. These devices collect multi-dimensional data such as air temperature and humidity, soil moisture, light intensity, crop growth status, and equipment operating parameters in real time, providing a solid data foundation for intelligent decision-making such as precision irrigation, variable fertilization, and pest and disease early warning. In addition, the widespread use of industrial communication protocols such as Modbus, CAN bus, and LoRaWAN in agricultural scenarios has also provided diverse methods and paths for device interconnection and data interaction, laying the foundation for modern agriculture.

[0003] Nevertheless, existing agricultural IoT integration methods still have room for improvement. First, they lack compatibility with unknown or dynamically changing protocols, making it difficult to meet real-time control requirements. In addition, they mostly focus on general task offloading strategies and fail to fully integrate the semantic features of agricultural tasks for fine-grained profiling and intelligent decision-making, resulting in unreasonable allocation of edge and cloud resources and difficulty in supporting highly reliable and adaptive agricultural intelligent control. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a smart agriculture IoT integration method based on multi-protocol adaptation and edge computing to solve the problem of difficulty in supporting intelligent agricultural control.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] This invention provides a smart agriculture IoT integration method based on multi-protocol adaptation and edge computing, comprising:

[0008] Collect communication data from heterogeneous agricultural sensing devices and build a protocol driver library;

[0009] The edge gateway sniffs and matches communication data using a weighted feature matching algorithm to obtain the selected protocol type;

[0010] Based on the selected protocol type, load the corresponding driver parsing data from the protocol driver library, map it to the unified object model, and generate standardized data objects;

[0011] After the standardized data objects are sent to the edge computing nodes, the task profiling model is used for quantitative analysis to obtain the task description vector.

[0012] Using a reinforcement learning model, decisions are made on the task description vector to obtain the task execution location;

[0013] Based on the task execution location, forward reasoning is performed on standardized data objects to generate intelligent processing results;

[0014] Spatiotemporal alignment and fusion of intelligent processing results are performed to obtain decision vectors;

[0015] The decision vector is input into the model predictive controller for prediction, generating the optimal control command and issuing it for execution.

[0016] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the communication data includes environmental sensing data, crop data, and equipment status data.

[0017] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the construction of the protocol driver library specifically includes:

[0018] Collect different industrial communication protocol specification documents, and extract message structure definitions, register address mapping relationships and data encoding rules to form protocol parsing rule templates;

[0019] For different types of industrial communication protocols, establish mapping relationship tables according to the unified physical model specification;

[0020] The protocol parsing rule template and mapping table are stored in JSON format to form a protocol driver library.

[0021] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the edge gateway sniffs and matches communication data using a weighted feature matching algorithm to obtain the selected protocol type, specifically:

[0022] Use the edge gateway to access the physical layer status register in the wireless transceiver, obtain the received signal strength indicator value, calculate the cyclic redundancy check error ratio of the communication data, and obtain the bit error rate.

[0023] The channel quality factor is calculated based on the received signal strength indicator value and the bit error rate.

[0024] Deep packet inspection is performed on the communication data, and checksum sequence features, message header structure features, and data field length features are extracted.

[0025] Based on the protocol parsing rule templates in the protocol driver library, calculate the matching degree of message header structure features, data field length features, and checksum sequence features for each protocol type.

[0026] The matching scores of each protocol type are obtained by weighting the checksum sequence feature matching degree, message header structure feature matching degree, data field length feature matching degree, and channel quality factor. The protocol type with the highest matching score is selected.

[0027] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the method involves: loading corresponding driver parsing data from the protocol driver library according to the protocol type, mapping it to a unified object model, and generating standardized data objects. Specifically:

[0028] Based on the selected protocol type, query the protocol driver parsing rules from the protocol driver library;

[0029] The communication data is decoded according to the protocol-driven parsing rules to extract the device address, function code and data payload from the communication data;

[0030] The device address is mapped to the unified object model device identifier, the function code is mapped to the unified object model operation type, and the data payload is converted into the unified object model data value to form a standardized data object.

[0031] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the step of sending standardized data objects to edge computing nodes and then performing quantitative analysis using a task profiling model refers to sending standardized data objects to edge computing nodes via message queue telemetry transmission protocol, then using a task profiling model to extract data feature vectors from the standardized data objects, and then standardizing and reducing the dimensionality of the data feature vectors to obtain task description vectors.

[0032] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the step of using a reinforcement learning model to make decisions on the task description vector and obtain the task execution location specifically involves:

[0033] Collect current resource and network status information of edge computing nodes;

[0034] The task description vector, current resource status, and network status information are input into the reinforcement learning model. The reinforcement learning model calculates the Q-value vector of the task description vector based on the deep Q-network algorithm, and selects the position with the largest Q-value as the task execution position.

[0035] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the step of performing forward reasoning on standardized data objects according to the task execution location to generate intelligent processing results specifically includes:

[0036] When the task is executed at the edge, a lightweight analysis model is loaded into the edge computing node to perform forward reasoning calculations on standardized data objects and obtain intelligent processing results.

[0037] When the task is executed in the cloud, a cloud-based deep analysis model is used on the cloud platform to perform distributed parallel computing on standardized data objects and obtain intelligent processing results.

[0038] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the spatiotemporal alignment and fusion of the intelligent processing results refers to using the nearest neighbor interpolation method to spatiotemporally align the intelligent processing results with the external environment data, then performing feature splicing to form a feature vector, and using principal component analysis to reduce the dimensionality of the feature vector to obtain the decision vector.

[0039] As a preferred embodiment of the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing described in this invention, the step of inputting the decision vector into the model predictive controller for prediction, generating the optimal control command and issuing it for execution refers to constructing a constraint set and an objective function based on the decision vector, inputting the decision vector into the model predictive controller, and the model predictive controller solving for the optimal control sequence that minimizes the objective function while satisfying the constraint set. The first control quantity is extracted from the optimal control sequence as the optimal control command and issued to the corresponding agricultural actuator for operation.

[0040] The beneficial effects of this invention are as follows: by constructing an extensible protocol driver library, adopting a weighted matching algorithm that integrates channel quality and message characteristics to achieve protocol self-identification, introducing a task profiling model to semantically abstract agricultural data, and combining reinforcement learning to dynamically decide the edge-cloud task offloading location, an end-to-end multi-protocol adaptation and intelligent collaborative computing mechanism is formed. This effectively solves key problems in agricultural IoT such as protocol fragmentation, strong data heterogeneity, and coarse task scheduling. This not only improves the adaptability of agricultural IoT to unknown devices and dynamic environments, but also realizes the real-time optimization and generation of control commands, providing highly reliable and efficient integrated support for smart agriculture. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a flowchart of a smart agriculture IoT integration method based on multi-protocol adaptation and edge computing.

[0043] Figure 2 A flowchart for obtaining the task execution location.

[0044] Figure 3 A flowchart for driving agricultural actuators.

[0045] Figure 4 A flowchart for obtaining the decision vector. Detailed Implementation

[0046] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0047] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0048] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0049] Reference Figures 1-4 This is one embodiment of the present invention, which provides a smart agriculture IoT integration method based on multi-protocol adaptation and edge computing, comprising the following steps:

[0050] S1. Collect communication data from heterogeneous agricultural sensing devices and build a protocol driver library.

[0051] S1.1 It should be noted that the collection of communication data from heterogeneous agricultural sensing devices (including environmental sensing data, crop data, and equipment status data) is as follows: Specifically, environmental sensing devices are deployed in the farmland environment to collect environmental sensing data, including air temperature data, air humidity data, light intensity data, carbon dioxide concentration data, and soil temperature and humidity data; sensing devices are deployed on the crop plants to collect crop data, including leaf surface temperature data, stem diameter change data, fruit enlargement data, and leaf surface humidity data. Agricultural equipment controllers are used to collect equipment status data, including irrigation valve opening data, film rolling machine position data, fan speed data, and supplemental lighting brightness data.

[0052] Environmental sensor data, crop data, and equipment status data are transmitted to the edge gateway via LoRa wireless communication. After receiving the data through the network port, the edge gateway stores the environmental sensor data, crop data, and equipment status data in the receiving buffer of the edge gateway in binary data stream format.

[0053] S1.2 Collect different industrial communication protocol specification documents, and extract message structure definitions, register address mapping relationships and data encoding rules to form a protocol parsing rule template;

[0054] It should be noted that different industrial communication protocol specification documents were collected, including Modbus protocol specification documents, CAN bus protocol specification documents, and LoRaWAN protocol specification documents.

[0055] Extract the frame start delimiter definition, device address field definition, function code field definition, and data payload structure definition from the Modbus protocol specification document, CAN bus protocol specification document, and LoRaWAN protocol specification document, respectively.

[0056] The frame start delimiter definition, device address field definition, function code field definition, and data payload structure definition are organized in a unified format to form Modbus protocol parsing rule template, CAN bus protocol parsing rule template, and LoRaWAN protocol parsing rule template.

[0057] S1.3. Establish mapping relationship tables according to the unified physical model specification for different types of industrial communication protocols;

[0058] It should be noted that, for the Modbus protocol, the Modbus protocol holding register address field is mapped to the soil temperature attribute of the unified object model, and the Modbus protocol input register address field is mapped to the soil moisture attribute of the unified object model, establishing a mapping table from the Modbus protocol to the unified object model. For the CAN bus protocol, the entry with index 0x6401 in the CAN bus protocol object dictionary is mapped to the light intensity attribute of the unified object model, and the entry with index 0x6402 is mapped to the carbon dioxide concentration attribute of the unified object model, establishing a mapping table from the CAN bus protocol to the unified object model. For the LoRaWAN protocol, according to the data format definition of the terminal device manufacturer, the payload data of port number 1 is mapped to the air temperature attribute of the unified object model, and the payload data of port number 2 is mapped to the air humidity attribute of the unified object model, establishing a mapping table from the LoRaWAN protocol type to the unified object model. The mapping table is stored in the form of a structured database table.

[0059] The Modbus protocol parsing rule template, CAN bus protocol parsing rule template, LoRaWAN protocol parsing rule template, and mapping relationship table are stored in JSON format to form a protocol driver library.

[0060] S2. The edge gateway sniffs and matches communication data using a weighted feature matching algorithm to obtain the selected protocol type.

[0061] S2.1 Use the edge gateway to access the physical layer status register in the wireless transceiver, obtain the received signal strength indicator value, calculate the cyclic redundancy check error ratio of the communication data, and obtain the bit error rate.

[0062] It should be noted that the edge gateway accesses the physical layer status register in the wireless transceiver via the serial peripheral interface bus, and reads the received signal strength indicator value stored in the physical layer status register. The received signal strength indicator value represents the signal power level in dBm. The edge gateway performs cyclic redundancy check (CRCD) on the received communication data, counts the number of data frames with CRCD errors, and calculates the CRCD error ratio by dividing the number of CRCD error data frames by the total number of received data frames. The CRCD error ratio is used as an evaluation indicator of the bit error rate (BER), which is equal to the CRCD error ratio.

[0063] S2.3 Calculate the channel quality factor based on the received signal strength indicator value and the bit error rate;

[0064] It should be noted that the received signal strength indicator value is converted to a normalized value within the range of 0 to 1 using the minimum-maximum normalization method, expressed by the formula:

[0065] ;

[0066] in, This represents the normalized received signal strength indicator value. This indicates the value of the received signal strength indicator. This indicates the minimum value of the received signal strength indicator. This indicates the maximum value of the received signal strength indicator.

[0067] The bit error rate is normalized using a logarithmic transformation method, expressed by the formula:

[0068] ;

[0069] in, This represents the normalized bit error rate. Indicates bit error rate. This indicates a positive constant (added to prevent errors in mathematical calculations).

[0070] The channel quality factor is obtained by weighted summation of the normalized received signal strength indicator value and the bit error rate; the weighting coefficient of the normalized received signal strength indicator value is 0.6, and the weighting coefficient of the normalized bit error rate is 0.4; the weighting coefficients are set based on the engineering principles of communication reliability and the specific needs of smart agriculture scenarios.

[0071] S2.4 Perform deep packet inspection on the communication data and extract checksum sequence features, message header structure features and data field length features;

[0072] It should be noted that after trying different common check operations (including byte-by-byte summation, bit-by-bit XOR, fixed polynomial cyclic redundancy check, and high-low byte segmented summation) at the candidate check field positions in the communication data, each operation is matched against the content of the fields used for check in the communication data. Based on the successfully matched operation paths, the check method and check bit calculation range used in the communication data are determined. Furthermore, the number of successful matches for each check operation method is verified on multiple consecutive frames of communication data, and the percentage of successful matches for each check operation method is calculated. When the percentage of successful matches for a certain check operation method exceeds a consistency threshold (e.g., 90%), it is determined to be the actual check method used in the communication data. Based on the determination result, the generator polynomial, initial value, and XOR value corresponding to the check operation method are extracted to form the check algorithm identifier in the checksum sequence feature. The checksum sequence calculated by the check operation method is extracted from multiple consecutive frames of communication data, and the stable occurrence pattern of each bit in the checksum sequence is statistically analyzed to form a check bit sequence template. The check algorithm identifier, check bit sequence template, and check bit calculation range together constitute the checksum sequence feature.

[0073] The consistency threshold is set based on communication reliability theory and statistical decision theory.

[0074] Based on the frame start delimiter definitions recorded in the protocol parsing rule templates in the protocol driver library, a bit-level scan is performed on the start position of the communication data. The start boundary of the message header is determined by matching the start bit sequence of the communication data with the frame start delimiter definition. After the message header start boundary, the synchronization byte arrangement recorded in each protocol parsing rule template is parsed sequentially to obtain the synchronization byte arrangement structure characteristics. The length, position, and bit value characteristics of the protocol identifier field recorded in each protocol parsing rule template are parsed bit by bit to obtain the protocol identifier field structure characteristics. The frame start delimiter definition, the synchronization byte arrangement structure characteristics, and the protocol identifier field structure characteristics together constitute the message header structure characteristics.

[0075] When scanning the length of a field range in communication data, the bit sequence of the communication data is continuously traversed according to the expected field arrangement order. The start and end positions of the field are determined by detecting the start and end bit positions of the field in the communication data. After the start and end positions of the field are determined, the length flag bit used to represent the field length in the communication data is interpreted to obtain the encoding method of the length flag bit for the field length. The actual length of the field content field in different communication data frames is statistically analyzed frame by frame. By comparing the variation amplitude and variation pattern of the content field length between different communication data frames, the variation law of the content field length is identified. The start and end positions of the field, the length flag bit, and the variation law of the content field length form the data field length feature.

[0076] The expected field order comes from the protocol driver library and is the knowledge foundation for implementing protocol parsing.

[0077] S2.5. Based on the protocol parsing rule templates in the protocol driver library, calculate the matching degree of the message header structure feature, the matching degree of the data field length feature, and the matching degree of the checksum sequence feature for each protocol type.

[0078] It should be noted that the protocol parsing rule templates for each protocol type in the protocol driver library are loaded sequentially (Modbus protocol parsing rule template, CAN bus protocol parsing rule template, LoRaWAN protocol parsing rule template); the original byte sequence of the communication data is used as input, and the parsing process defined by each protocol parsing rule template is executed; for the header structure feature matching degree, it is verified whether the byte sequence at the beginning of the communication data conforms to the header structure constraints defined in each protocol parsing rule template. The header structure feature matching degree is equal to the ratio of the number of fields that satisfy the header structure constraints to the total number of header fields defined in the protocol parsing rule template. For the data field length feature matching degree, it is verified whether the actual length of the data field in the communication data conforms to the data length rules defined in each protocol parsing rule template, and the data field length feature matching degree is calculated using the following formula:

[0079] ;

[0080] in, This indicates the matching degree of the data field length feature. Indicates the actual length of the data field. This indicates the length of the standard data field defined in the protocol parsing rule template. This indicates the maximum permissible length difference.

[0081] According to the checksum calculation rules defined in the protocol parsing rule templates, the checksum calculation range is extracted from the communication data. The checksum calculation range includes the starting position and length of the bytes covered by the checksum. The byte sequence within the checksum calculation range is recalculated according to the checksum algorithm specified in the protocol parsing rule templates. The checksum algorithm includes an accumulation summation algorithm, a cyclic redundancy check algorithm, or an XOR check algorithm. After recalculation, the actual value of the checksum field is extracted from the checksum field of the communication data. The actual value of the checksum field is located at a predetermined position in the communication data frame. The recalculated checksum is compared with the actual value of the checksum field in binary. When the recalculated checksum is exactly the same as the actual value of the checksum field, the checksum sequence feature matching degree is determined to be 1; when the recalculated checksum is different from the actual value of the checksum field, the checksum sequence feature matching degree is determined to be 0.

[0082] S2.6. Perform weighted calculations on the checksum and sequence feature matching degree, message header structure feature matching degree, data field length feature matching degree, and channel quality factor for each protocol type to obtain the matching score for each protocol type, and select the protocol type with the highest matching score.

[0083] It should be noted that weight coefficients are assigned to the checksum sequence feature matching degree, message header structure feature matching degree, data field length feature matching degree, and channel quality factor for each protocol type. The weight coefficient for checksum sequence feature matching degree is 0.2, the weight coefficient for message header structure feature matching degree is 0.5, the weight coefficient for data field length feature matching degree is 0.3, and the weight coefficient for channel quality factor is 0.1. After the weight coefficients are assigned, a weighted sum is performed to obtain the matching score for each protocol type. The protocol with the highest matching score is selected as the chosen protocol type.

[0084] The weighting coefficients for checksum and sequence feature matching degree, message header structure feature matching degree, data field length feature matching degree, and channel quality factor for each protocol type are set according to the hierarchical importance of the communication protocol stack.

[0085] S3. Based on the selected protocol type, load the corresponding driver parsing data from the protocol driver library, map it to the unified object model, and generate a standardized data object.

[0086] S3.1 It should be noted that, based on the selected protocol type, the protocol driver parsing rules are queried from the protocol driver library. According to the frame start delimiter definition in the protocol driver parsing rules, the frame start delimiter in the communication data is scanned to locate the start position of the communication data header. According to the device address field definition in the protocol driver parsing rules, the binary value of the device address field is read from the specified offset address after the header start position, and converted to a decimal value to obtain the device address. According to the function code field definition in the protocol driver parsing rules, the binary value of the function code field is read from the specified offset address after the device address field, and converted to a decimal value to obtain the function code. According to the data payload structure definition in the protocol driver parsing rules, the binary sequence of the data payload field is read starting from the specified offset address after the function code field, and converted to a physical quantity value according to the data encoding rules specified in the data payload structure definition to obtain the data payload.

[0087] The process involves querying the device address mapping table within the protocol-driven parsing rules. This table maps protocol-specific device addresses to unified object model (UIM) device identifiers. A matching UIM device identifier is then found within the table based on the device address. Next, the process involves querying the function code mapping table defined within the protocol-driven parsing rules. This table maps protocol-specific function codes to UIM operation types. A matching UIM operation type is then found within the table based on the function code. The physical quantity values ​​of the data payload are then standardized in unit conversion and format according to the UIM specification to obtain UIM data values. Finally, the UIM device identifier, UIM operation type, and UIM data values ​​are encapsulated in JSON-LD format to form a standardized data object (including device identifier, operation type, data value, timestamp, and data quality fields).

[0088] The Unified Object Model Specification is a data modeling specification that standardizes the description of the attributes, services, events, and behaviors of physical entities (such as devices, sensors, and environmental indicators) in the digital space. Its core objective is to achieve unified interoperability of IoT data from different sources and using different protocols at the semantic level.

[0089] S4. After sending the standardized data object to the edge computing node, use the task profiling model for quantitative analysis to obtain the task description vector.

[0090] S4.1. Collect historical standardized data objects as training and validation sets, and pre-label task description vectors. Input the training set into the task profiling model, which employs a gradient boosting decision tree algorithm. The gradient boosting decision tree algorithm uses the field values ​​of the historical standardized data objects as input features and the pre-labeled task description vectors as the training target. During training, the parameters of the gradient boosting decision tree algorithm are iteratively updated by minimizing the loss function between the predicted and labeled task description vectors. The loss function used is the mean squared error loss function. After training, the performance of the trained task profiling model is evaluated using the validation set, and the parameters of the trained task profiling model are saved to obtain the trained task profiling model.

[0091] After standardized data objects are sent to edge computing nodes via message queue telemetry transmission protocol, a trained task profiling model is used to extract data features. Specifically, the trained task profiling model performs feature encoding on the device identifier field, converting the text value of the device identifier field into a device type feature vector; it performs feature mapping on the operation type field, mapping the enumerated values ​​of the operation type field into operation category feature vectors; and it performs statistical analysis on the data value field, extracting the numerical range features, change frequency features, and update cycle features of the data value field to form a data statistical feature vector. Simultaneously, the task profiling model performs timeliness analysis on the timestamp field in the standardized data objects, calculating the freshness index and urgency index of the standardized data objects. Specifically, it reads the timestamp of the standardized data object and obtains the current timestamp from the clock of the processing node. The formula for calculating the freshness index is:

[0092] ;

[0093] in, Indicators of freshness Indicates the current timestamp. A timestamp representing a standardized data object.

[0094] The task profiling model matches the calculated freshness index with the intervals in the freshness-urgency mapping table. When the freshness index falls into an interval, the corresponding urgency index is selected.

[0095] The freshness-urgency mapping table is obtained through statistical analysis of historical freshness indicators and corresponding performance loss scores. Specifically, the historical freshness indicators are divided into six intervals: 0-1000 milliseconds, 1000-2000 milliseconds, 2000-3000 milliseconds, 3000-4000 milliseconds, 4000-5000 milliseconds, and greater than 5000 milliseconds. The average performance loss score is calculated for each interval. After min-max normalization, the average performance loss scores for each interval are mapped to a value between 0.3 and 0.9. The urgency index range is used to obtain a freshness-urgency mapping table. For example, "freshness index 0-1000 milliseconds corresponds to urgency index 0.9, freshness index 1000-2000 milliseconds corresponds to urgency index 0.8, freshness index 2000-3000 milliseconds corresponds to urgency index 0.7, freshness index 3000-4000 milliseconds corresponds to urgency index 0.6, freshness index 4000-5000 milliseconds corresponds to urgency index 0.5, and freshness index greater than 5000 milliseconds corresponds to urgency index 0.3."

[0096] Reliability assessments are performed on the data quality fields in standardized data objects. Specifically, this involves parsing the data quality fields (including signal-to-noise ratio, bit error rate, and data integrity flags). Reliability levels are determined based on the range of the signal-to-noise ratio: a ratio greater than 30dB corresponds to high reliability, a ratio between 20dB and 30dB corresponds to medium reliability, and a ratio below 20dB corresponds to low reliability. Similarly, reliability levels are determined based on the range of the bit error rate: a bit error rate below 0.001% corresponds to high reliability, a bit error rate between 0.001% and 0.1% corresponds to medium reliability, and a bit error rate above 0.1% corresponds to low reliability. Finally, reliability levels are determined based on the status of the data integrity flag: a complete data integrity flag corresponds to high reliability, a partially lost data integrity flag corresponds to medium reliability, and a severely lost data integrity flag corresponds to low reliability. The reliability requirement feature vector is obtained by combining the signal-to-noise ratio index level, the bit error rate index level, and the data integrity flag level using a weighted decision method. The reliability requirement feature vector is represented by three-bit one-hot encoding, with high reliability requirement corresponding to [1,0,0], medium reliability requirement corresponding to [0,1,0], and low reliability requirement corresponding to [0,0,1].

[0097] The classification of signal-to-noise ratio (SNR) index levels, bit error rate (BER) index levels, and data integrity indicator levels is based on reliability thresholds in communication theory and industry standards. The aim is to map continuous physical layer parameters into discrete reliability levels that are instructive for decision-making.

[0098] The task profiling model concatenates equipment type feature vectors, operation category feature vectors, data statistics feature vectors, timeliness feature vectors, and reliability requirement feature vectors in a fixed order to form a high-dimensional composite feature vector. The model then performs dimensionality standardization on this high-dimensional composite feature vector, using a max-min normalization method to map each dimension value to the [0,1] interval. Principal component analysis is then used to perform dimensionality reduction on the standardized high-dimensional composite feature vector, retaining the principal components with the highest variance contribution. The dimensionality-reduced feature vector is then used as the task description vector, represented in floating-point array format.

[0099] S5. Use a reinforcement learning model to make decisions on the task description vector and obtain the task execution location.

[0100] S5.1 It should be noted that historical task description vectors, historical resource state information, and historical network state information are collected as the training set and input into the reinforcement learning model. The reinforcement learning model uses a deep Q-network algorithm to calculate the current Q-value and the target Q-value. During the training process, the online network parameters of the deep Q-network algorithm are updated using the gradient descent algorithm by minimizing the mean squared error loss function between the current Q-value and the target Q-value. During training, the online network parameters are periodically synchronized to the target network to maintain training stability. The training process is repeated multiple times (e.g., 50 times) to obtain the trained reinforcement learning model.

[0101] The system collects current resource and network status information of edge computing nodes. The task description vector, current resource status, and network status information are input into the trained reinforcement learning model. The reinforcement learning model concatenates these information into a feature vector, which is then input into the input layer of a deep Q-network algorithm. The fully connected neural network in the input layer performs a nonlinear transformation on the input feature vector. The hidden layer uses a multilayer perceptron structure to perform a high-dimensional mapping on the nonlinearly transformed feature vector, and the output layer outputs a Q-value vector (including edge Q-values ​​and cloud Q-values). The location with the largest Q-value is selected as the task execution location.

[0102] The edge Q-value represents the long-term expected return of performing data processing tasks on an edge computing node, while the cloud Q-value represents the long-term expected return of performing data processing tasks on a cloud platform.

[0103] S6. Based on the task execution location, perform forward reasoning on standardized data objects to generate intelligent processing results.

[0104] S6.1 When the task execution location is at the edge, load the edge-side lightweight analysis model in the edge computing node, perform forward reasoning calculation on the standardized data object, and obtain intelligent processing results;

[0105] It should be noted that standardized data objects collected historically and their corresponding historical intelligent processing results are used as the training set. The training set is input into the edge-side lightweight analysis model for training. During the training process, the loss function between the model's predicted output and the historical intelligent processing results is minimized. The weight parameters of the edge-side lightweight analysis model are iteratively updated using the backpropagation algorithm and gradient descent optimizer. When the number of iterations reaches, for example, 50, the training is stopped, and the trained edge-side lightweight analysis model is obtained.

[0106] Standardized data objects are input into a lightweight edge-side analytics model. This model extracts features from the data value fields of the standardized data objects. Specifically, it performs a one-dimensional convolution operation on the temporal sequence of the data value fields, using convolution kernels of different sizes sliding along the time dimension (3x1, 5x1, and 7x1). After extracting local temporal pattern features from the temporal sequence, the one-dimensional convolution operation outputs a feature map. The feature map is then normalized for mean and variance. The standardized feature map undergoes a non-linear transformation using an activation function, specifically ReLU, which suppresses negative features to zero while preserving positive features. After processing through multiple convolutional blocks, the lightweight edge-side analytics model compresses the feature map into a fixed-length (e.g., 64-dimensional) abstract vector using a global average pooling layer. This abstract vector is then input into a fully connected layer for pattern classification to obtain the intelligent processing results.

[0107] S6.2 When the task is executed in the cloud, the cloud-based deep analysis model is used on the cloud platform to perform distributed parallel computing on standardized data objects and obtain intelligent processing results.

[0108] It should be noted that standardized data objects collected historically and their corresponding historical intelligent processing results are used as training data. The training process employs a distributed training framework, which divides the training data into multiple data shards and distributes them to multiple training nodes. Each training node calculates the local gradient, which is aggregated through a parameter server. The parameter server uses a synchronous stochastic gradient descent algorithm to update the global parameters of the cloud-based deep analytics model. The training process iteratively optimizes the weights of the cloud-based deep analytics model by minimizing the cross-entropy loss function between the predicted output and the historical intelligent processing results. Training stops when the number of iterations reaches 50, and the trained cloud-based deep analytics model is obtained. The cloud-based deep analytics model is then deployed to a distributed computing cluster on the cloud platform for inference (the distributed computing cluster consists of N computing nodes, each of which is assigned the parameters of the cloud-based deep analytics model).

[0109] Standardized data objects are sent to a cloud platform. The cloud-based deep analytics model, trained on the platform, divides the data value fields of the standardized data objects into multiple data slices. These slices are distributed to different computing nodes for processing in a parallel manner. The computing nodes input the data slices into the input layer of the cloud-based deep analytics model, which performs mean normalization and variance scaling on the slices. The convolutional layer of the model performs convolution operations on the standardized data slices, using a 3D convolution kernel to perform sliding computation across the temporal and feature dimensions of the slices. After extracting the local spatiotemporal features of the slices, a feature map is output. The feature map is then normalized for mean and variance and transformed nonlinearly using an activation function layer employing the ReLU activation function. The fully connected layer of the model maps the feature maps extracted by the convolutional layer to the sample label space, performing matrix multiplication and bias addition operations. Simultaneously, the output layer applies the Softmax function to calculate the probability distribution of each category, generating preliminary inference results for the data slices. Each computing node sends the preliminary inference results to a parameter server for global aggregation, forming a complete intelligent processing result.

[0110] S7. Perform spatiotemporal alignment and fusion of the intelligent processing results to obtain the decision vector.

[0111] S7.1 It should be noted that the process involves identifying each timestamp of the intelligent processing result and all timestamps of the external environment data. For each timestamp of the intelligent processing result, the absolute time difference between it and all timestamps of the external environment data is calculated using the nearest neighbor interpolation method. The magnitudes of all absolute time differences are compared, and the external environment data timestamp with the smallest absolute time difference is selected as the matching timestamp. The corresponding external environment data is assigned to the timestamp of the intelligent processing result, completing the data mapping. The above matching process is repeated for all timestamps of the intelligent processing results using the nearest neighbor interpolation method to achieve spatiotemporal alignment between the external environment data and the intelligent processing result. The spatiotemporally aligned intelligent processing result and external environment data are concatenated according to feature dimensions to form a high-dimensional feature vector.

[0112] The high-dimensional feature vectors are organized into a sample matrix, where rows correspond to the number of samples and columns correspond to the feature dimensions. The covariance matrix of the sample matrix is ​​calculated, with diagonal elements representing the variance of each feature dimension and off-diagonal elements representing the covariance between different feature dimensions. Eigenvalue decomposition is performed on the covariance matrix to obtain eigenvalues ​​and eigenvectors. Eigenvalues ​​represent the magnitude of the variance of each principal component direction, and eigenvectors represent the orientation of each principal component direction in the original feature space. The eigenvectors are sorted according to their eigenvalues, and the eigenvectors corresponding to the top k (e.g., 3) largest eigenvalues ​​are selected as principal components and used to construct a projection matrix. Matrix multiplication is performed between the high-dimensional feature vectors and the projection matrix to obtain the decision vector. The value of k is a data-driven decision, seeking the optimal balance between "dimensionality reduction effect" (smaller k is better) and "information preservation" (larger k is better).

[0113] S8. Input the decision vector into the model predictive controller for prediction, generate the optimal control command and issue it for execution.

[0114] S8.1. It should be noted that the equipment type feature information in the decision vector is analyzed. This equipment type feature information indicates the type of agricultural actuator currently being controlled. Agricultural actuator types include irrigation valves, fertilizer pumps, and supplemental lighting equipment. Actuator constraints are constructed based on the agricultural actuator type, including the maximum and minimum opening degrees of irrigation valves, the maximum and minimum flow rates of fertilizer pumps, and the maximum and minimum brightness of supplemental lighting equipment. The timeliness feature information in the decision vector is analyzed. This timeliness feature information indicates the allowable range of variation for the controlled variable. State constraints are constructed based on this timeliness feature information, including upper and lower thresholds for soil moisture, the allowable fluctuation range of ambient temperature, and the safe interval for carbon dioxide concentration. The reliability requirement feature information in the decision vector is analyzed. Agronomic constraints are constructed based on this reliability requirement feature information, including the water requirements of crops at different growth stages, the optimal operating time for pest and disease control, and the safe interval for fertilizer application. The actuator constraints, state constraints, and agronomic constraints together constitute the constraint set, which serves as the boundary conditions for the optimization solution of the model predictive controller. The objective function is constructed based on the decision vector. The objective function includes a tracking error term and a control cost term. The tracking error term represents the sum of squares of the deviations between the controlled variable and the set value in the decision vector, and the control cost term represents the sum of squares of the changes in the control quantity.

[0115] The objective function is transformed into the standard form of a quadratic programming problem, which includes a quadratic cost term and linear constraint terms. The quadratic cost term corresponds to the tracking error term and control cost term in the objective function, while the linear constraint terms correspond to the actuator constraints, state constraints, and agronomic constraints in the constraint set. A model predictive controller (MMC) is used to solve the quadratic programming problem. Specifically, the MMC employs an effective set algorithm to identify the effective constraint set at the current iteration point. The effective set algorithm solves the unconstrained optimization problem within the feasible subspace formed by the effective constraint set. The unconstrained optimization problem obtains the search direction by solving a system of linear equations. Specifically, the Hessian matrix of the unconstrained optimization problem is constructed; the Hessian matrix is ​​the matrix of second-order partial derivatives of the objective function with respect to the optimization variables. Solving the search direction in the unconstrained optimization problem is transformed into solving a system of linear equations, where the product of the Hessian matrix and the search direction vector equals the negative gradient vector. The Choliski decomposition method is used to decompose the Hessian matrix into the product of a lower triangular matrix and its transpose, forming a triangular linear equation system. The lower triangular linear equation system is solved through a forward substitution operation to obtain an intermediate solution vector. The search direction vector is obtained by solving the upper triangular linear equation system through a backward substitution operation.

[0116] Based on the effective set algorithm, a one-dimensional line search is performed along the search direction to determine the optimal step size factor. Specifically, the distance between the current iteration point and the constraint boundary is calculated as the current iteration point moves along the search direction. The intersection distance represents the maximum feasible movement step from the current iteration point to the nearest constraint boundary. A curve representing the change of the objective function value along the search direction is constructed, which is a univariate function of the step size factor. The optimal step size factor that minimizes the objective function value is found within the step size factor value interval [0, intersection distance]. The optimal step size factor corresponds to the lowest point of the objective function value change curve. The golden section method is used to find the optimal step size factor. The golden section method divides the step size factor interval into three sub-intervals according to the golden ratio, and compares the objective function values ​​at the endpoints of the two middle sub-intervals. The golden section method discards the sub-interval with the larger objective function value, retaining the sub-interval with the minimum value. The interval range is iteratively reduced until the interval length is less than the convergence tolerance, thus determining the optimal step size factor (the optimal step size factor ensures that the objective function value decreases without violating any constraints). The above process is repeated using a model predictive controller until the change in the objective function value is less than the limit threshold, at which point the model predictive controller outputs the optimal control sequence.

[0117] The model predictive controller extracts the first control variable from the optimal control sequence as an immediate control command. This immediate control command is then sent to agricultural actuators such as irrigation valves, fertilizer pumps, or supplemental lighting equipment via a corresponding protocol. The agricultural actuators execute the immediate control command to complete agricultural operations such as precision irrigation, variable-rate fertilization, or intelligent supplemental lighting.

[0118] The convergence tolerance ranges from [1e-8, 1e-4], and the threshold ranges from [1e-6, 1e-3]. These values ​​are set based on the engineering balance between computational accuracy and computational efficiency.

[0119] This embodiment also provides a computer device applicable to the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing proposed in the above embodiment.

[0120] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0121] This embodiment also provides a storage medium storing a computer program. When executed by a processor, the program implements the smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0122] In summary, this invention, through: constructing an extensible protocol driver library; employing a weighted matching algorithm that integrates channel quality and message characteristics to achieve protocol self-identification; introducing a task profiling model to semantically abstract agricultural data; and combining reinforcement learning to dynamically decide the edge-cloud task offloading location, forms an end-to-end multi-protocol adaptation and intelligent collaborative computing mechanism. This effectively solves key challenges in agricultural IoT such as protocol fragmentation, strong data heterogeneity, and coarse task scheduling. This not only improves the adaptability of agricultural IoT to unknown devices and dynamic environments but also enables real-time optimized generation of control commands, providing highly reliable and efficient integrated support for smart agriculture.

[0123] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A smart agriculture IoT integration method based on multi-protocol adaptation and edge computing, characterized in that: include, Collect communication data from heterogeneous agricultural sensing devices and build a protocol driver library; The edge gateway sniffs and matches communication data using a weighted feature matching algorithm to obtain the selected protocol type, specifically: Use the edge gateway to access the physical layer status register in the wireless transceiver, obtain the received signal strength indicator value, calculate the cyclic redundancy check error ratio of the communication data, and obtain the bit error rate. The channel quality factor is calculated based on the received signal strength indicator value and the bit error rate. Deep packet inspection is performed on the communication data, and checksum sequence features, message header structure features, and data field length features are extracted. Based on the protocol parsing rule templates in the protocol driver library, calculate the matching degree of message header structure features, data field length features, and checksum sequence features for each protocol type. The matching scores of each protocol type are obtained by weighting the checksum and sequence feature matching degree, message header structure feature matching degree, data field length feature matching degree, and channel quality factor. The protocol type with the highest matching score is selected. Based on the selected protocol type, load the corresponding driver parsing data from the protocol driver library, map it to the unified object model, and generate standardized data objects; After the standardized data objects are sent to the edge computing nodes, the task profiling model is used for quantitative analysis to obtain the task description vector. Using a reinforcement learning model, decisions are made on the task description vector to obtain the task execution location; Based on the task execution location, forward reasoning is performed on standardized data objects to generate intelligent processing results; Spatiotemporal alignment and fusion of intelligent processing results are performed to obtain decision vectors; The decision vector is input into the model predictive controller for prediction, generating the optimal control command and issuing it for execution.

2. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 1, characterized in that: The communication data includes environmental sensing data, crop data, and equipment status data.

3. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 2, characterized in that: The construction of the protocol driver library specifically involves: Collect different industrial communication protocol specification documents, and extract message structure definitions, register address mapping relationships and data encoding rules to form protocol parsing rule templates; For different types of industrial communication protocols, establish mapping relationship tables according to the unified physical model specification; The protocol parsing rule template and mapping table are stored in JSON format to form a protocol driver library.

4. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 3, characterized in that: Based on the protocol type, the corresponding driver parsing data is loaded from the protocol driver library and mapped to the unified object model to generate standardized data objects, specifically: Based on the selected protocol type, query the protocol driver parsing rules from the protocol driver library; The communication data is decoded according to the protocol-driven parsing rules to extract the device address, function code and data payload from the communication data; The device address is mapped to the unified object model device identifier, the function code is mapped to the unified object model operation type, and the data payload is converted into the unified object model data value to form a standardized data object.

5. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 4, characterized in that: The step of sending standardized data objects to edge computing nodes and then using a task profiling model for quantitative analysis refers to sending standardized data objects to edge computing nodes via message queue telemetry transmission protocol, then using a task profiling model to extract data feature vectors from the standardized data objects, and then standardizing and reducing the dimensionality of the data feature vectors to obtain task description vectors.

6. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 5, characterized in that: The process of using a reinforcement learning model to make decisions on the task description vector and obtain the task execution location specifically involves: Collect current resource and network status information of edge computing nodes; The task description vector, current resource status, and network status information are input into the reinforcement learning model. The reinforcement learning model calculates the Q-value vector of the task description vector based on the deep Q-network algorithm, and selects the position with the largest Q-value as the task execution position.

7. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 6, characterized in that: The step of performing forward reasoning on standardized data objects based on the task execution location to generate intelligent processing results specifically includes: When the task is executed at the edge, a lightweight analysis model is loaded into the edge computing node to perform forward reasoning calculations on standardized data objects and obtain intelligent processing results. When the task is executed in the cloud, a cloud-based deep analysis model is used on the cloud platform to perform distributed parallel computing on standardized data objects and obtain intelligent processing results.

8. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 7, characterized in that: The aforementioned spatiotemporal alignment and fusion of intelligent processing results refers to using the nearest neighbor interpolation method to spatiotemporally align the intelligent processing results with external environmental data, then concatenating features to form a feature vector, and using principal component analysis to reduce the dimensionality of the feature vector to obtain the decision vector.

9. The smart agriculture IoT integration method based on multi-protocol adaptation and edge computing as described in claim 8, characterized in that: The process of inputting the decision vector into the model predictive controller for prediction, generating the optimal control command, and issuing it for execution refers to constructing a constraint set and an objective function based on the decision vector, inputting the decision vector into the model predictive controller, and the model predictive controller solving for the optimal control sequence that minimizes the objective function while satisfying the constraint set. The first control quantity is extracted from the optimal control sequence as the optimal control command and issued to the corresponding agricultural actuator for operation.

Citation Information

Patent Citations

  • Internet of Things equipment data acquisition method and system driven by embedded template

    CN120567881A

  • Intelligent fusion terminal multi-protocol communication method and system based on edge computing

    CN120856810A