A lightweight security authentication method and system for smart agriculture internet of things
By using task version identifiers to generate task-level authentication sub-keys in agricultural IoT systems, the problem of synchronous switching of authentication status when the data collection task configuration changes is solved, reducing the amount of authentication processing and improving the system's flexibility and efficiency.
Patent Information
- Application Number
- CN202611571757.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-12
- Publication Date
- 2026-11-27
AI Technical Summary
When the configuration of data collection tasks changes, the authentication status of existing agricultural IoT terminals cannot be switched synchronously while keeping the basic session key unchanged, resulting in an increase in authentication processing volume.
By establishing a basic session key between the agricultural gateway and the agricultural IoT terminal, and generating a task-level authentication subkey using the task version identifier, the task-level authentication subkey can be updated synchronously while keeping the basic session key unchanged when the data collection task configuration is updated, thus reducing the processing of re-establishing the basic session key.
This reduces the amount of authentication processing when updating the collection task configuration, avoids the long-term sharing of the same task-level authentication subkey, reduces the impact of collection task adjustments on existing authentication relationships, and improves the efficiency and flexibility of the authentication process.
Smart Images

Figure CN123184972A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural Internet of Things (IoT) security authentication technology, and in particular to a lightweight security authentication method and system for smart agricultural IoT. Background Technology
[0002] Smart agriculture IoT typically utilizes sensor terminals deployed in farmland, greenhouses, or livestock areas to collect agricultural environmental data such as temperature, humidity, soil moisture, and light intensity, and transmits this data to agricultural gateways or management platforms via wireless communication networks. Agricultural IoT terminals need to perform sensor queries and data reporting according to pre-configured collection parameters. Chinese invention patent application CN111163181A discloses a lightweight smart agriculture heterogeneous IoT management system. This system can manage terminal access and dynamic configuration, and issue sensor query commands and related configuration parameters to sensor terminals. Sensor terminals periodically collect environmental data according to a set method, generating reporting messages after the reporting cycle is reached. Existing agricultural IoT systems can already configure the collection content, data format, and data reporting process based on production units and sensor types.
[0003] After agricultural IoT terminals complete data collection, they still need to undergo secure authentication of the terminal's identity and transmitted data. Resource-constrained sensing terminals are typically unsuitable for frequently performing computationally intensive full authentication processes. Therefore, existing technologies have begun to adopt a method where an initial authentication establishes a session key, which is then used to continue authentication in subsequent communication phases. Chinese invention patent application CN117097489A discloses a lightweight two-factor continuous authentication method and system for agricultural IoT devices. This method divides device authentication into static authentication and continuous authentication. During static authentication, session key-related information is generated between the device and the gateway. During continuous authentication, the device and the gateway each obtain their own session keys and use these keys to form authentication messages to complete subsequent authentication. This approach can reduce the computational load of authentication for agricultural IoT devices during subsequent communication processes.
[0004] Existing agricultural IoT terminals can configure their data collection parameters and reporting processes, and lightweight authentication methods can maintain subsequent authentication status after initial authentication. However, when the data collection task configuration is updated, current technology still lacks a lightweight authentication method that can synchronize the authentication status of subsequent agricultural sensing data with the current data collection task while maintaining the existing basic authentication relationship. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide a lightweight security authentication method and system for smart agriculture IoT, which can solve the problem that the authentication status is difficult to switch synchronously while keeping the basic session key unchanged when the data collection task configuration changes. It can realize the synchronous update of the task-level authentication subkey when the data collection task configuration is updated, reducing the processing of re-establishing the basic session key.
[0006] To achieve the above objectives, the present invention provides the following solution: A lightweight security authentication method for smart agriculture IoT includes: Agricultural gateways establish basic session keys with agricultural IoT terminals; The agricultural gateway sends data collection task configurations with task version identifiers to agricultural IoT terminals; The agricultural gateway and the agricultural IoT terminal generate task-level authentication subkeys based on the basic session key and the task version identifier, respectively; Agricultural IoT terminals acquire agricultural sensing data according to the data collection task configuration; Agricultural IoT terminals use task-level authentication subkeys to generate authentication information for agricultural sensing data, and then send the agricultural sensing data and authentication information to the agricultural gateway. Agricultural gateways use task-level authentication subkeys to verify authentication information; When the data collection task configuration is updated, the agricultural gateway sends the updated data collection task configuration with the new task version identifier to the agricultural IoT terminal. Agricultural gateways and agricultural IoT terminals update task-level authentication subkeys based on the basic session key and the new task version identifier, while keeping the basic session key unchanged.
[0007] Preferably, different versions of the data collection task configuration correspond to different task version identifiers, and the new task version identifier is different from the task version identifier before the update.
[0008] Preferably, the agricultural gateway and the agricultural IoT terminal generate task-level authentication sub-keys based on the basic session key and the task version identifier, respectively, including: Use the base session key and task version identifier as inputs to the key derivation operation; The agricultural gateway and the agricultural IoT terminal each perform the same key derivation operation to generate a task-level authentication subkey corresponding to the task version identifier.
[0009] Preferably, the agricultural IoT terminal uses a task-level authentication subkey to generate authentication information for agricultural sensing data, including: The agricultural sensing data are assigned incremental data sequence numbers according to the order in which they were acquired. The task version identifier, data sequence number, and agricultural sensing data are used as inputs for message authentication calculation; Message authentication operations are performed using the task-level authentication subkey to generate authentication information; Send the task version identifier, data sequence number, agricultural sensing data, and authentication information to the agricultural gateway.
[0010] Preferably, the agricultural gateway verifies authentication information using a task-level authentication subkey, including: Determine the corresponding task-level authentication subkey based on the received task version identifier; The determined task-level authentication subkey is used to perform message authentication operations on the received task version identifier, data sequence number, and agricultural sensing data to generate verification authentication information. If the authentication information matches the received authentication information and the received data sequence number is greater than the maximum data sequence number recorded corresponding to the task version identifier, the authentication information is deemed to have passed verification, and the maximum data sequence number is updated according to the received data sequence number.
[0011] Preferably, the agricultural gateway sends an updated data collection task configuration with a new task version identifier to the agricultural IoT terminal, including: The basic session key is used to perform message authentication operations on the new task version identifier and the updated collection task configuration to generate configuration authentication information. Send the new task version identifier, the updated data collection task configuration, and the configuration authentication information to the agricultural IoT terminal; The agricultural IoT terminal uses the basic session key to perform the same message authentication operation on the newly received task version identifier and the updated collection task configuration to generate verification configuration authentication information. When the verification configuration authentication information matches the received configuration authentication information, the updated collection task configuration and the new task version identifier are used.
[0012] Preferably, the agricultural gateway and agricultural IoT terminal update the task-level authentication subkey based on the basic session key and the new task version identifier, while keeping the basic session key unchanged, including: The agricultural gateway performs key derivation operations based on the basic session key and the new task version identifier to generate a new task-level authentication subkey corresponding to the new task version identifier. After the agricultural IoT terminal passes the authentication information verification, it performs the same key derivation operation based on the basic session key and the new task version identifier to generate a new task-level authentication subkey corresponding to the new task version identifier. Agricultural gateways and agricultural IoT terminals use new task-level authentication subkeys to authenticate the agricultural sensing data corresponding to the updated data collection task configuration.
[0013] Preferably, the agricultural gateway verifies authentication information using a task-level authentication subkey, including: After the updated data collection task configuration is issued, and before the first authentication information verification is completed using the new task-level authentication subkey, the agricultural gateway retains both the old and new task-level authentication subkeys. When agricultural IoT terminals send agricultural sensing data and authentication information, they also send a task version identifier corresponding to the current data collection task configuration. The agricultural gateway determines the corresponding task-level authentication subkey based on the received task version identifier, and uses the determined task-level authentication subkey to verify the authentication information.
[0014] Preferably, the agricultural gateway verifies authentication information using a task-level authentication subkey, and further includes: After completing the initial verification of the authentication information corresponding to the new task version identifier using the new task-level authentication subkey, the old task-level authentication subkey will no longer be used. After ceasing the use of the previous task-level authentication subkey, the authentication information corresponding to the previous task version identifier is determined to have failed verification.
[0015] A lightweight security authentication system for smart agriculture IoT includes an agricultural gateway and an agricultural IoT terminal, wherein: Agricultural gateways and agricultural IoT terminals are used to establish basic session keys; The agricultural gateway is used to send data collection task configurations with task version identifiers to agricultural IoT terminals; Agricultural gateways and agricultural IoT terminals are also used to generate task-level authentication subkeys based on the basic session key and the task version identifier, respectively. Agricultural IoT terminals are used to acquire agricultural sensing data according to the data collection task configuration; The agricultural IoT terminal is also used to generate authentication information for agricultural sensing data using task-level authentication subkeys, and to send the agricultural sensing data and authentication information to the agricultural gateway. Agricultural gateways are also used to verify authentication information using task-level authentication subkeys; The agricultural gateway is also used to send an updated data collection task configuration with a new task version identifier to the agricultural IoT terminal when the data collection task configuration is updated. Agricultural gateways and agricultural IoT terminals are also used to update task-level authentication subkeys based on the basic session key and the new task version identifier, while keeping the basic session key unchanged.
[0016] The present invention discloses the following beneficial effects: (1) This invention distributes a data collection task configuration with a task version identifier to an agricultural IoT terminal through an agricultural gateway. The agricultural gateway and the agricultural IoT terminal generate task-level authentication sub-keys based on the basic session key and the task version identifier, respectively, thus establishing a correspondence between the data collection task configuration and the key used for agricultural sensing data authentication. After the data collection task configuration is updated, the new task version identifier participates in the update of the task-level authentication sub-key, so that the data collection task configuration before and after the update corresponds to different authentication key states, solving the problem that the authentication state cannot be adjusted synchronously with the data collection task when the data collection task changes.
[0017] (2) In this invention, the basic session key remains unchanged when the data collection task configuration is updated. The agricultural gateway and the agricultural IoT terminal update the task-level authentication sub-key according to the new task version identifier, without the need to re-establish the basic session key due to changes in the data collection task configuration. For authentication state switching caused only by the update of the data collection task configuration, the process of re-establishing the basic session key can be saved for each data collection task configuration update, thereby reducing the authentication processing load of the agricultural IoT terminal during the data collection task adjustment process.
[0018] (3) In this invention, the agricultural IoT terminal acquires agricultural sensing data according to the acquisition task configuration, and generates authentication information using the corresponding task-level authentication subkey. The agricultural gateway then verifies the authentication information using the task-level authentication subkey. Therefore, the authentication process of agricultural sensing data is associated with the task-level authentication subkey corresponding to the current acquisition task configuration, enabling the agricultural gateway to complete the authentication of agricultural sensing data based on the current authentication key status, thus avoiding the long-term sharing of the same task-level authentication subkey by different acquisition task configurations.
[0019] (4) This invention uses the basic session key as a stable basic key and the task version identifier as the input for updating the task-level authentication subkey. When the acquisition task configuration is not updated, there is no need to change the task-level authentication subkey; when the acquisition task configuration is updated, only the task-level authentication subkey is updated according to the new task version identifier. This process separates the basic session key establishment process from the authentication key update process after the acquisition task changes, reducing the impact of acquisition task adjustments on existing authentication relationships. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. 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.
[0021] Figure 1 A flowchart illustrating a lightweight security authentication method for smart agriculture IoT provided in this embodiment of the invention.
[0022] Figure 2 This is a schematic diagram illustrating the authentication interaction between an agricultural gateway and an agricultural IoT terminal, provided in an embodiment of the present invention.
[0023] Figure 3 This is a schematic diagram illustrating the switching of task-level authentication subkeys during the task version update process provided in an embodiment of the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0026] Figure 1 The method flowchart provided in the embodiments of the present invention is as follows: Figure 1 As shown, this invention provides a lightweight security authentication method for smart agriculture IoT, comprising: Step 100: The agricultural gateway establishes a basic session key with the agricultural IoT terminal; Step 200: The agricultural gateway sends a data collection task configuration with a task version identifier to the agricultural IoT terminal; Step 300: The agricultural gateway and the agricultural IoT terminal generate task-level authentication sub-keys based on the basic session key and the task version identifier, respectively; Step 400: The agricultural IoT terminal acquires agricultural sensing data according to the data collection task configuration; Step 500: The agricultural IoT terminal uses the task-level authentication subkey to generate authentication information for the agricultural sensing data, and sends the agricultural sensing data and authentication information to the agricultural gateway; Step 600: The agricultural gateway verifies the authentication information using the task-level authentication subkey; Step 700: When the data collection task configuration is updated, the agricultural gateway sends the updated data collection task configuration with the new task version identifier to the agricultural IoT terminal. Step 800: The agricultural gateway and agricultural IoT terminal update the task-level authentication subkey based on the basic session key and the new task version identifier, while keeping the basic session key unchanged.
[0027] In one specific embodiment, the present invention provides a lightweight security authentication method for smart agriculture IoT. Agricultural IoT terminals are deployed in greenhouses, farmland, or agricultural facility environments. The agricultural gateway is responsible for terminal access, distributing data collection task configurations, managing task versions, verifying authentication information, and receiving agricultural sensing data. The agricultural gateway can be deployed in edge computing devices, network servers, or agricultural IoT nodes with data processing capabilities in agricultural settings.
[0028] The agricultural gateway is a logical entity responsible for security authentication and data collection task management. In low-power wide-area communication scenarios, the logical entity can be deployed on the same edge computing device as the wireless access device, or it can be deployed on a network server that communicates with the wireless access device. The agricultural gateway distinguishes the accessed agricultural IoT terminals by terminal identifiers and stores secure session states for different agricultural IoT terminals.
[0029] The agricultural IoT terminal connects to the corresponding sensor based on the object being monitored. In this embodiment, the SHT31-DIS-B digital temperature and humidity sensor is used as the data source in a greenhouse temperature and humidity monitoring scenario. 2 The SHT31-DIS-B reads sensor measurement data via the C interface. Its temperature measurement range is -40℃ to 125℃, with a typical temperature accuracy of 0.2℃; its relative humidity measurement range is 0 to 100%RH, with a typical relative humidity accuracy of 2%RH.
[0030] The sensor returns 16-bit raw temperature values. and 16-bit raw relative humidity values Agricultural IoT terminals calculate temperature based on the conversion relationships between sensor data. and relative humidity .
[0031] The unit is Celsius. The unit is percentage.
[0032] When the value is 26738, the calculated temperature is 26.3993℃, which is rounded to two decimal places to get 26.40℃. When the value is 46661, the calculated relative humidity is 71.2001%RH, which is rounded to two decimal places to obtain 71.20%RH. The raw sensor values are then converted to form agricultural sensing data.
[0033] Table 1 Greenhouse data source and authentication field configuration
[0034] The field lengths given in Table 1 constitute a defined encoding format for this embodiment. When agricultural IoT terminals use other digital temperature and humidity sensors, soil moisture sensors, or light sensors, the corresponding digital quantities are entered into agricultural sensing data authentication according to a fixed field length and a fixed byte order.
[0035] Establishing a basic session key between agricultural gateways and agricultural IoT terminals The basic session key is jointly stored by both ends during the validity of the current secure session. The basic session key can be established using pre-shared key authentication or challenge-response authentication. The agricultural gateway maintains corresponding basic session keys for different agricultural IoT terminals.
[0036] When the basic session key reaches the validity period specified by the security policy, or when the agricultural IoT terminal re-executes secure access, the agricultural gateway and the agricultural IoT terminal establish a new basic session key. When the data collection task configuration changes within the current secure session, the basic session key retains its current value, and the key adjustment corresponding to the task change is handled by the task-level authentication subkey.
[0037] The agricultural gateway obtains the data collection task parameters from the agricultural IoT management platform and forms the data collection task configuration for execution by the agricultural IoT terminal. The data collection task configuration can record the data collection object, sampling period, data reporting period, and data triggering conditions. The data collection object determines the type of sensor read by the agricultural IoT terminal, the sampling period determines the time interval between two consecutive data collections, and the data reporting period determines the frequency at which agricultural sensing data is sent to the agricultural gateway.
[0038] The agricultural gateway configures and assigns task version identifiers for data collection tasks. The task version identifier uses a 32-bit unsigned integer. During the validity period of the same basic session key, the agricultural gateway assigns task version identifiers in ascending order. The agricultural gateway maintains the correspondence between the data collection task configuration and the task version identifier. The agricultural IoT terminal receives the data collection task configuration and saves the current task version identifier.
[0039] The maximum value of the 32-bit task version identifier is denoted as .
[0040] The agricultural gateway assigns task version identifiers incrementally according to the task configuration update order within the current security session. The next task update will cause the task version identifier to exceed [a certain threshold]. At that time, the agricultural gateway establishes a new basic session key with the agricultural IoT terminal and restarts the numbering from the preset initial task version identifier within the new secure session.
[0041] The first data collection task is configured with a corresponding task version identifier. =1. The first data acquisition task configuration can specify that the agricultural IoT terminal collects temperature and relative humidity, with a sampling period of 300 seconds and a data reporting period of 900 seconds. The agricultural IoT terminal saves the first data acquisition task configuration and task version identifier. .
[0042] The task version identifier participates in the generation of the task-level authentication subkey. The agricultural gateway and agricultural IoT terminal use the same basic session key, the same task version identifier, and the same field encoding rules to perform key derivation operations respectively. Both ends generate the same task-level authentication subkey locally.
[0043] This embodiment uses HMAC-SHA-256 as the pseudo-random function in the key derivation operation and organizes the key derivation input according to the counting mode. The fixed label used to identify the purpose of the task-level authentication subkey adopts the ASCII string AGRI-TASK, corresponding to the hexadecimal data 414752492D5441534B. The task-level authentication subkey length is set to 128 bits.
[0044] Key Derivation Input The input values are arranged in the following order: 32-bit count value, fixed label, single-byte separator, task version identifier, and task-level authentication subkey length. BE32 indicates that the input values are encoded as 32-bit unsigned big-endian byte order. The big-endian encoding of the 32-bit count value 1 is 00000001. The big-endian encoding of the 128-bit length field is 00000080. This means that the leftmost 128 bits of the HMAC-SHA-256 calculation result are retained.
[0045] The fixed tag AGRI-TASK distinguishes task-level authentication subkey derivation from agricultural sensing data authentication and data acquisition task configuration authentication. The task version identifier is used as the key derivation context in the calculation. After the data acquisition task configuration enters a new task version, both ends obtain a new task-level authentication subkey.
[0046] HMAC-SHA-256 uses the 64-byte block size specified by SHA-256. The key used in the HMAC-SHA-256 operation is denoted as... When the key length is less than 64 bytes, zero bytes are added to the end to form a 64-byte key. The iPad consists of 64 bytes of 0x36, while the Opal consists of 64 bytes of 0x5C.
[0047] When the basic session key is 32 bytes, 32 zero bytes are added to the end of the basic session key before HMAC operation. When the task-level authentication subkey is 16 bytes, 48 zero bytes are added to the end of the task-level authentication subkey before HMAC operation. Agricultural gateways and agricultural IoT terminals use the same key padding rules.
[0048] The process of calculating task-level authentication subkeys is explained using a defined base session key. Retrieve 32 bytes of hexadecimal data: 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F.
[0049] When = 1, the big-endian encoding of the task version identifier is 00000001. The big-endian encoding of the counter value 1 is 00000001. The 128-bit length of the task-level authentication subkey is encoded as 00000080. The complete key derivation input is: 00000001414752492D5441534B000000000100000080.
[0050] Performing an HMAC-SHA-256 operation using the base session key as the HMAC key yields a 256-bit result: F16715F4481C1C39391DE021B46A402E578B82B74E2FC044D6580D5443B7D6BC.
[0051] The first 128 bits are retained to obtain the first task-level authentication subkey. =F16715F4481C1C39391DE021B46A402E. The agricultural gateway and the agricultural IoT terminal each perform the same calculation. The task-level authentication subkey is stored locally at both ends.
[0052] The agricultural IoT terminal reads the SHT31-DIS-B according to the first data acquisition task configuration. In order to unify the representation of agricultural sensing data on different processor platforms, this embodiment converts the temperature value and relative humidity value into fixed-length integers.
[0053] `round` indicates rounding to the nearest integer. (Integer temperature value) Use 16-bit signed integers. Relative humidity integer values. Use 16-bit unsigned integers. A temperature of 26.40℃ corresponds to 2640, which is 0A50 in big-endian hexadecimal. A relative humidity of 71.20%RH corresponds to 7120, which is 1BD0 in big-endian hexadecimal.
[0054] Agricultural sensing data corresponding to a temperature of 26.40℃ and a relative humidity of 71.20%RH. The value is 0A501BD0. The integer range mapped to the temperature measurement range is -4000 to 12500, and the integer range mapped to the relative humidity measurement range is 0 to 10000, both of which are within the range of the corresponding 16-bit integer representation.
[0055] The agricultural IoT terminal assigns a data sequence number to each set of agricultural sensing data to be sent. The data sequence number is a 32-bit unsigned integer, incrementing sequentially within the current task version according to the order in which the agricultural sensing data was generated. The task version identifier and the data sequence number are used together in the calculation of authentication information.
[0056] Agricultural sensing data authentication uses a fixed tag DATA. The ASCII hexadecimal code for DATA is 44415441. Authentication messages are arranged in the following order: fixed tag, task version identifier, data sequence number, and agricultural sensing data.
[0057] The task version identifier associates authentication information with the current data collection task configuration. Data sequence numbers distinguish agricultural sensing data generated at different times within the current task version. The agricultural sensing data undergoes HMAC-SHA-256 computation, allowing the agricultural gateway to regenerate verification and authentication information using the received fields.
[0058] =1, data sequence number At 17:00, the big-endian encoding of the data sequence number is 00000011. Agricultural sensing data uses 0A501BD0. The complete authentication message is: 4441544100000001000000110A501BD0.
[0059] Performing an HMAC-SHA-256 operation using the first-level authentication subkey yields a 256-bit result: F1C2197166DA11085520B9B240D1ACA7E69B3D01872D7598C8B54919A8C60DBB.
[0060] The authentication information is obtained by taking the first 128 digits. =F1C2197166DA11085520B9B240D1ACA7. The agricultural IoT terminal sends the task version identifier, data sequence number, agricultural sensing data, and authentication information.
[0061] According to the field settings in this embodiment, the task version identifier occupies 4 bytes, the data sequence number occupies 4 bytes, and the authentication information occupies 16 bytes. Each set of agricultural sensing data corresponds to 24 bytes of authentication-related fields. The task-level authentication subkey is calculated separately by both ends and stored locally.
[0062] After receiving agricultural sensing data, the agricultural gateway reads the task version identifier and determines the corresponding task-level authentication sub-key based on it. The agricultural gateway then reconstructs the authentication message according to the same field order and performs an HMAC-SHA-256 operation using the determined task-level authentication sub-key. The first 128 bits of the calculation result constitute the verification authentication information.
[0063] The authentication is successful when the verified authentication information equals the received authentication information. The agricultural gateway then determines the data sequence number. In sequential reception mode, the agricultural gateway stores the largest verified data sequence number for each currently valid task version. .
[0064] When the received data sequence number satisfies the above relationship, the data sequence number determination is successful. After the authentication information verification is successful and the data sequence number determination is successful, the agricultural gateway records the received data sequence number as the new maximum data sequence number and receives the corresponding agricultural sensing data.
[0065] For example, the agricultural gateway has recorded that the maximum data sequence number corresponding to task version identifier 1 is 16, and the received data sequence number is 17. Since 17 is greater than 16, the data sequence number determination is valid. After completing the authentication information verification, the agricultural gateway updates the maximum data sequence number to 17.
[0066] When packet retransmissions or out-of-order packets occur in low-power wireless networks, agricultural gateways can establish a data sequence number receiving window based on the current task version. The receiving window records data sequence numbers that have already been verified. Data sequence numbers that fall into the receiving window but have not yet been recorded proceed to the authentication process. Recorded data sequence numbers remain in a received state.
[0067] When an agricultural IoT terminal uses a storage area with power-loss retention capability to save the current task version identifier and current data sequence number, the saved data sequence number continues to increment after a restart. If the agricultural IoT terminal fails to obtain a valid data sequence number after restarting, it initiates a data acquisition task recovery request to the agricultural gateway. The agricultural gateway reissues the current data acquisition task configuration and assigns a new task version identifier. Both ends generate new task-level authentication subkeys and establish new data sequence number records under the new task version.
[0068] When changes occur during the greenhouse operation phase, the agricultural gateway can adjust the sampling period and data reporting period. The first data collection task is configured with a sampling period of 300 seconds and a data reporting period of 900 seconds. When a higher monitoring frequency is required, the agricultural gateway configures a second data collection task, adjusting the sampling period to 60 seconds and the data reporting period to 300 seconds.
[0069] The agricultural gateway is configured to assign a new task version identifier for the second data collection task. =2. The new task version identifier is greater than the current task version identifier. The agricultural gateway generates configuration authentication information for the updated data collection task configuration.
[0070] The authentication fixed label is configured using the ASCII string "CFG", corresponding to the hexadecimal data 434647. Sampling period. and data reporting cycle All are in seconds and are encoded using 32-bit unsigned big-endian integers.
[0071] Sampling period and data reporting cycle Valid values are positive integers. The 32-bit unsigned integer field can represent valid periods from 1 to 4,294,967,295 seconds, covering both second-level sampling tasks and cross-day reporting tasks.
[0072] =60 seconds corresponds to 0000003C, =300 seconds corresponds to 0000012C, and the updated acquisition task configuration code is 0000003C0000012C. When the acquisition task configuration includes acquisition objects or data triggering conditions, the additional fields continue to be arranged in the configuration code according to the predefined field order and fixed length.
[0073] When = 2, the complete hexadecimal data of the configuration authentication message is: 434647000000020000003C0000012C.
[0074] The agricultural gateway performs an HMAC-SHA-256 operation using the underlying session key. The complete calculation result is as follows: 413C31C3FE9212898357387CA834A035B659735536C96641D920557F873B6165.
[0075] The first 128 bits of the configuration authentication information are taken to obtain... =413C31C3FE9212898357387CA834A035. The agricultural gateway sends a new task version identifier, second data collection task configuration, and configuration authentication information.
[0076] After receiving the new task version identifier, the second data collection task configuration, and the configuration authentication information, the agricultural IoT terminal reconstructs the configuration authentication message according to the same field order, and uses the basic session key to generate verification configuration authentication information. Configuration authentication is successful when the verification configuration authentication information equals the received configuration authentication information.
[0077] Agricultural IoT terminals require successful configuration authentication as a prerequisite for comparing data collection task versions. If configuration authentication fails, the current data collection task configuration, current task version identifier, and current task-level authentication subkey remain valid.
[0078] The version update condition is met when the new task version identifier is greater than the current task version identifier. After successful configuration authentication and the version update condition is met, the agricultural IoT terminal saves the second data collection task configuration and the new task version identifier. When the new task version identifier is equal to the current task version identifier, the agricultural IoT terminal maintains the current data collection task configuration. When the new task version identifier is less than the current task version identifier, the version update condition is not met.
[0079] After receiving the second data collection task configuration, the agricultural IoT terminal substitutes the new task version identifier into the key derivation input. The lengths of the base session key, fixed tag, and task-level authentication subkey remain at their current values. The agricultural gateway completes the calculation according to the same rules.
[0080] The updated key derivation input is denoted as It is formed according to the same field order as the current task version.
[0081] When = 2, the complete key derivation input is: 00000001414752492D5441534B000000000200000080.
[0082] The complete calculation result of HMAC-SHA-256 is as follows: E482EBF5F766DA89C06C75FC1C43F542C630BE471A9B326B0EF20188978CC5CF.
[0083] The first 128 bits are retained to obtain the second-level authentication subkey. =E482EBF5F766DA89C06C75FC1C43F542. The agricultural gateway and the agricultural IoT terminal each receive the same second-level authentication subkey.
[0084] After the agricultural IoT terminal begins acquiring agricultural sensing data according to the second acquisition task configuration, it generates authentication information using the second task-level authentication subkey and carries task version identifier 2 when sending the agricultural sensing data. The agricultural gateway selects the second task-level authentication subkey based on task version identifier 2 to complete authentication.
[0085] When the configuration for the second data collection task is first issued, the agricultural gateway temporarily stores the first task-level authentication subkey and the second task-level authentication subkey. When the agricultural gateway receives agricultural sensing data corresponding to task version identifier 1, it selects the first task-level authentication subkey; when it receives agricultural sensing data corresponding to task version identifier 2, it selects the second task-level authentication subkey.
[0086] Before the initial verification of the authentication information corresponding to the second task-level authentication subkey is successful, agricultural sensing data that has already entered the wireless transmission process and carries task version identifier 1 will still select the first task-level authentication subkey to complete authentication according to task version identifier 1; agricultural sensing data carrying task version identifier 2 will select the second task-level authentication subkey to complete authentication according to task version identifier 2. The agricultural gateway directly determines the task-level authentication subkey used during the transition period based on the task version identifier.
[0087] After the authentication information corresponding to the second task-level authentication subkey is successfully verified for the first time, the agricultural gateway registers task version identifier 2 as the current task version identifier and stops using the first task-level authentication subkey. The task configuration, task version identifier, and task-level authentication subkey are thus synchronized into the new task state.
[0088] After task version identifier 2 is registered as the current valid task version, the current version condition is met when the received task version identifier equals 2. The agricultural gateway uses the second task-level authentication subkey to complete the authentication of the current task data. If the received task version identifier 1 does not meet the current version condition, the agricultural gateway will determine the corresponding authentication information as verification failed.
[0089] When an update configuration message is lost during wireless transmission, the agricultural IoT terminal continues to store the current data acquisition task configuration, the current task version identifier, and the current task-level authentication subkey. The agricultural gateway then resends the new task version identifier, the updated data acquisition task configuration, and the configuration authentication information. Upon receiving a duplicate new version configuration message, the agricultural IoT terminal completes configuration authentication and maintains the current task status based on the task version identifier comparison result.
[0090] Table 2 Example of Authentication Calculation for Task Switching
[0091] In Table 2, the first task-level authentication subkey corresponds to... The second task-level authentication subkey corresponds to Temperature and humidity agricultural sensing data correspond Agricultural sensing data authentication information corresponds to The second data acquisition task configuration code corresponds to Configure authentication information accordingly .
[0092] The two sets of task-level authentication subkeys in Table 2 are calculated using the same basic session key, but with different task version identifiers. As the task version identifier changes from 1 to 2, the task-level authentication subkey changes accordingly. Both agricultural sensing data authentication information and configuration authentication information are directly obtained from the given field encoding and HMAC-SHA-256 calculation.
[0093] When switching the data acquisition task configuration from the first to the second, the base session key continues to maintain the current secure session. The agricultural gateway and the agricultural IoT terminal each use the new task version identifier to perform a task-level authentication subkey derivation. The task-level authentication subkey is stored locally at both ends.
[0094] In another specific implementation, agricultural sensing data can come from soil moisture sensors, light sensors, conductivity sensors, or other digital agricultural environmental sensors. The agricultural IoT terminal specifies fixed field lengths and fixed byte orders for different agricultural sensing parameters. The task version identifier, data sequence number, and agricultural sensing data are entered into the message authentication process according to the determined field order.
[0095] When agricultural IoT terminals communicate with agricultural gateways via LoRa, NB-IoT, or other low-power wireless communication methods, the task version identifier, data sequence number, and authentication information are transmitted as application-layer authentication fields along with the agricultural sensing data. The underlying wireless communication protocol is responsible for carrying the data on the corresponding link, and the agricultural gateway verifies the authentication information at the application layer according to the current task version.
[0096] Figure 2 This illustrates an authentication interaction between an agricultural gateway and an agricultural IoT terminal. After the agricultural gateway issues the first data acquisition task configuration corresponding to task version identifier 1, both ends generate a first task-level authentication subkey. The agricultural IoT terminal uses the first task-level authentication subkey to complete agricultural sensing data authentication. After the data acquisition task configuration is updated, the agricultural gateway issues the second data acquisition task configuration corresponding to task version identifier 2, and both ends generate a second task-level authentication subkey.
[0097] Figure 3 This illustrates the switching process of the task-level authentication subkey as the task version changes. Task version identifier 1 corresponds to the first task-level authentication subkey, and task version identifier 2 corresponds to the second task-level authentication subkey. Before the second task-level authentication subkey completes the initial authentication information verification, the agricultural gateway stores two sets of task-level authentication subkeys. After the second task-level authentication subkey completes the initial authentication information verification, the agricultural gateway uses task version identifier 2 and the second task-level authentication subkey as the current authentication status.
[0098] This invention also provides a lightweight security authentication system for smart agriculture IoT. The system includes an agricultural gateway and an agricultural IoT terminal.
[0099] In one specific implementation, the agricultural gateway stores the basic session key, data collection task configuration, task version identifier, and task-level authentication subkey corresponding to the agricultural IoT terminal. The agricultural gateway assigns a new task version identifier based on changes in the data collection task configuration and completes the calculation of the task-level authentication subkey.
[0100] The agricultural IoT terminal stores the basic session key, the current data acquisition task configuration, the current task version identifier, and the current task-level authentication subkey. The agricultural IoT terminal acquires agricultural sensing data according to the current data acquisition task configuration and generates authentication information using the current task-level authentication subkey.
[0101] After receiving agricultural sensing data, task version identifier, data sequence number, and authentication information, the agricultural gateway determines the corresponding task-level authentication sub-key based on the task version identifier. The agricultural gateway then uses the determined task-level authentication sub-key to verify the authentication information.
[0102] When the data collection task configuration is updated, the agricultural gateway generates a new task version identifier. Both the agricultural gateway and the agricultural IoT terminal continue to use the current basic session key, and each generate a new task-level authentication subkey based on the new task version identifier. The new task-level authentication subkey corresponds to the updated data collection task configuration.
[0103] During system operation, a clear correspondence is maintained between the data acquisition task configuration, task version identifier, and task-level authentication subkey. When the data acquisition task configuration remains at the current version, agricultural sensing data uses the current task-level authentication subkey for authentication. When the data acquisition task configuration is updated to a new version, both ends generate a new task-level authentication subkey using the new task version identifier, and the authentication status of the agricultural sensing data changes accordingly.
[0104] This embodiment uses the base session key as the stable key material within the current secure session, and the task version identifier as a variable parameter for deriving the task-level authentication subkey. Each update to the data acquisition task configuration generates a new task version identifier and a new task-level authentication subkey. Authentication state switching caused by changes in the data acquisition task is handled centrally at the task-level authentication layer.
[0105] The task version identifier is used for configuration authentication, task-level authentication subkey derivation, and agricultural sensing data authentication. Agricultural gateways and agricultural IoT terminals can establish corresponding data collection task configurations, authentication keys, and agricultural sensing data authentication statuses around the same task version. When using a 32-bit task version identifier, a 32-bit data sequence number, and 128-bit authentication information, each set of agricultural sensing data corresponds to 24 bytes of authentication-related fields.
[0106] This embodiment assigns corresponding task version identifiers to different data acquisition tasks and generates task-level authentication sub-keys using the basic session key and task version identifiers, establishing a clear correspondence between data acquisition task configuration, task version identifiers, and agricultural sensing data authentication status. When the data acquisition task configuration is updated from version one to version two, the agricultural gateway and agricultural IoT terminal continue to use the current basic session key and generate new task-level authentication sub-keys based on the new task version identifier, ensuring that the authentication key is updated synchronously with changes in the data acquisition task. The task-level authentication sub-key is calculated locally at both ends, reducing the need for repeated establishment of basic session keys and transmission of task-level authentication sub-keys during task adjustments. The agricultural IoT terminal uses the task version identifier, data sequence number, and agricultural sensing data to form authentication input. The agricultural gateway selects the corresponding task-level authentication sub-key based on the received task version identifier to complete authentication. During task switching, it can process agricultural sensing data corresponding to the task versions before and after the update separately. When using a 32-bit task version identifier, a 32-bit data sequence number, and 128-bit authentication information, each group of agricultural sensing data adds 24 bytes of authentication-related fields, enabling agricultural sensing data authentication under changing data acquisition task conditions while controlling the length of the authentication fields.
[0107] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0108] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A lightweight security authentication method for smart agriculture IoT, characterized in that, include: Agricultural gateways establish basic session keys with agricultural IoT terminals; The agricultural gateway sends a data collection task configuration with a task version identifier to the agricultural IoT terminal; The agricultural gateway and the agricultural IoT terminal respectively generate task-level authentication sub-keys based on the basic session key and the task version identifier; The agricultural IoT terminal acquires agricultural sensing data according to the data collection task configuration. The agricultural IoT terminal uses the task-level authentication subkey to generate authentication information for the agricultural sensing data, and sends the agricultural sensing data and the authentication information to the agricultural gateway. The agricultural gateway uses the task-level authentication subkey to verify the authentication information; When the data collection task configuration is updated, the agricultural gateway sends an updated data collection task configuration with a new task version identifier to the agricultural IoT terminal. The agricultural gateway and the agricultural IoT terminal update the task-level authentication subkey based on the basic session key and the new task version identifier, while keeping the basic session key unchanged.
2. The lightweight security authentication method for smart agriculture IoT according to claim 1, characterized in that, Different versions of the data acquisition task configuration correspond to different task version identifiers, and the new task version identifier is different from the task version identifier before the update.
3. The lightweight security authentication method for smart agricultural IoT according to claim 1, characterized in that, The agricultural gateway and the agricultural IoT terminal respectively generate task-level authentication sub-keys based on the basic session key and the task version identifier, including: The basic session key and the task version identifier are used as inputs for key derivation operations; The agricultural gateway and the agricultural IoT terminal each perform the same key derivation operation to generate the task-level authentication subkey corresponding to the task version identifier.
4. The lightweight security authentication method for smart agriculture IoT according to claim 1, characterized in that, The agricultural IoT terminal uses the task-level authentication sub-key to generate authentication information for the agricultural sensing data, including: The agricultural sensing data is assigned an incremental data sequence number according to the order in which it was acquired. The task version identifier, the data sequence number, and the agricultural sensing data are used as inputs for the message authentication operation; The message authentication operation is performed using the task-level authentication subkey to generate the authentication information; The task version identifier, the data sequence number, the agricultural sensing data, and the authentication information are sent to the agricultural gateway.
5. The lightweight security authentication method for smart agriculture IoT according to claim 4, characterized in that, The agricultural gateway verifies the authentication information using the task-level authentication subkey, including: The corresponding task-level authentication subkey is determined based on the received task version identifier; The message authentication operation is performed on the received task version identifier, data sequence number, and agricultural sensing data using the determined task-level authentication subkey to generate verification authentication information; When the verification authentication information is consistent with the received authentication information, and the received data sequence number is greater than the recorded maximum data sequence number corresponding to the task version identifier, the authentication information is determined to be verified successfully, and the maximum data sequence number is updated according to the received data sequence number.
6. The lightweight security authentication method for smart agriculture IoT according to claim 1, characterized in that, The agricultural gateway sends an updated data collection task configuration with a new task version identifier to the agricultural IoT terminal, including: The basic session key is used to perform message authentication operations on the new task version identifier and the updated collection task configuration to generate configuration authentication information. The new task version identifier, the updated data collection task configuration, and the configuration authentication information are sent to the agricultural IoT terminal. The agricultural IoT terminal uses the basic session key to perform the same message authentication operation on the received new task version identifier and the updated collection task configuration to generate verification configuration authentication information; When the verification configuration authentication information matches the received configuration authentication information, the updated collection task configuration and the new task version identifier are used.
7. The lightweight security authentication method for smart agriculture IoT according to claim 6, characterized in that, The agricultural gateway and the agricultural IoT terminal, while keeping the basic session key unchanged, update the task-level authentication sub-key based on the basic session key and the new task version identifier, including: The agricultural gateway performs a key derivation operation based on the basic session key and the new task version identifier to generate a new task-level authentication subkey corresponding to the new task version identifier. After the configuration authentication information is verified, the agricultural IoT terminal performs the same key derivation operation based on the basic session key and the new task version identifier to generate the new task-level authentication subkey corresponding to the new task version identifier. The agricultural gateway and the agricultural IoT terminal use the new task-level authentication subkey to authenticate the agricultural sensing data corresponding to the updated data collection task configuration.
8. The lightweight security authentication method for smart agriculture IoT according to claim 7, characterized in that, The agricultural gateway verifies the authentication information using the task-level authentication subkey, including: After the updated data collection task configuration is issued, until the first authentication information verification is completed using the new task-level authentication subkey, the agricultural gateway simultaneously retains both the task-level authentication subkey before the update and the new task-level authentication subkey. When the agricultural IoT terminal sends the agricultural sensing data and the authentication information, it also sends a task version identifier corresponding to the currently used data collection task configuration. The agricultural gateway determines the corresponding task-level authentication sub-key based on the received task version identifier, and uses the determined task-level authentication sub-key to verify the authentication information.
9. The lightweight security authentication method for smart agriculture IoT according to claim 8, characterized in that, The agricultural gateway verifies the authentication information using the task-level authentication subkey, and further includes: After the initial verification of the authentication information corresponding to the new task version identifier is completed using the new task-level authentication subkey, the use of the previous task-level authentication subkey is discontinued. After ceasing the use of the task-level authentication subkey before the update, the authentication information corresponding to the task version identifier before the update is determined to have failed verification.
10. A lightweight security authentication system for smart agriculture IoT, comprising an agricultural gateway and an agricultural IoT terminal, characterized in that: The agricultural gateway and the agricultural IoT terminal are used to establish a basic session key; The agricultural gateway is used to send data collection task configurations with task version identifiers to the agricultural IoT terminal. The agricultural gateway and the agricultural IoT terminal are also used to generate task-level authentication sub-keys based on the basic session key and the task version identifier, respectively. The agricultural IoT terminal is used to acquire agricultural sensing data according to the data collection task configuration. The agricultural IoT terminal is also used to generate authentication information for the agricultural sensing data using the task-level authentication subkey, and send the agricultural sensing data and the authentication information to the agricultural gateway. The agricultural gateway is also used to verify the authentication information using the task-level authentication subkey; The agricultural gateway is also used to send an updated collection task configuration with a new task version identifier to the agricultural IoT terminal when the collection task configuration is updated. The agricultural gateway and the agricultural IoT terminal are also used to update the task-level authentication subkey based on the basic session key and the new task version identifier while keeping the basic session key unchanged.
Citation Information
Patent Citations
Lightweight smart agricultural heterogeneous Internet of Things management system
CN111163181A
Lightweight two-factor agricultural Internet of Things equipment continuous authentication method and system
CN117097489A
