Experimental equipment management system based on LoRaWAN

Through the LoRaWAN-based experimental equipment management system, dynamic differential upgrade and insertion strategies are adopted to solve the problems of resource allocation conflicts and low data transmission efficiency in laboratory equipment management, realize efficient remote reservation and firmware update of equipment, and improve laboratory management efficiency and equipment utilization.

CN119324939BActive Publication Date: 2025-10-03ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411307209.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-10-03
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

Laboratory equipment management faces problems such as resource allocation conflicts, equipment usage conflicts, low equipment update efficiency, and high risk of transmission failure. This is especially true when remotely updating equipment operation information, which affects the progress of experiments and the normal operation of equipment.

Method used

Abstract: In order to improve the efficiency of experimental equipment management, a LoRaWAN-based experimental equipment management system was designed. The system includes a device control unit, a LoRaWAN communication unit, a power monitoring unit, a user interactive display unit, a remote appointment management platform, a gateway and server unit, and a firmware management and upgrade unit. The system adopts a dynamic differential upgrade strategy and an insertion strategy to perform device control, appointment management, power monitoring, and firmware upgrades through the LoRaWAN network, ensuring the normal use and efficient update of the equipment.

Benefits of technology

It realizes efficient remote reservation management of experimental equipment, reduces equipment usage conflicts, shortens firmware update time, improves data transmission efficiency and reliability, ensures the normal use of equipment and the continuity of experimental progress, and improves laboratory management efficiency and equipment utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324939B_ABST
    Figure CN119324939B_ABST
Patent Text Reader

Abstract

A LoRaWAN-based experimental equipment management system aims to address resource allocation conflicts and inefficient data transmission in laboratory equipment management. The system includes a device control unit, a LoRaWAN communication unit, an energy monitoring unit, a user interactive display unit, a remote reservation management platform, a gateway and server unit, and a firmware management and upgrade unit. By using the BSDIFF algorithm to generate differential packets and combining it with the LZ77 compression algorithm, the system effectively reduces the amount of transmitted data. Simultaneously, the gateway dynamically adjusts the data block size based on network quality and employs an interpolation strategy to embed upgrade data between service data transmissions. After receiving and verifying the differential packets, the terminal node generates new firmware to replace the old one, ensuring efficient remote updates while the equipment is in normal use. This invention significantly improves the management efficiency and stability of laboratory equipment and is suitable for equipment management scenarios in various scientific research laboratories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of Internet of Things and embedded systems, and in particular to a LoRaWAN-based experimental equipment management system, which aims to solve problems such as resource allocation conflicts and low data transmission efficiency in laboratory equipment management. Background Art

[0002] With the advancement of modern scientific research, laboratories are expanding in size and the number of devices is increasing. The management and efficient use of laboratory equipment has become a key issue in laboratory operations. Traditional equipment management methods rely primarily on manual operations, which is not only inefficient but also prone to uneven resource allocation. In current laboratory environments, multiple students or researchers often need to use the same equipment simultaneously, leading to equipment conflicts and unnecessary waiting. This situation not only affects the progress of experiments but can also cause confusion in experimental data, further reducing the overall operational efficiency of the laboratory.

[0003] Updating operational information is a crucial step in the management of laboratory equipment. This operational information typically includes instructions for use, operating procedures, graphical interfaces, and images of the equipment. It is typically presented in a graphic and text format, resulting in large amounts of data and requiring significant file transfers when updated. In existing technologies, updating this information often requires local operations, such as using an SD card or USB interface to directly update the device's display. This approach incurs additional technical staffing costs, and in a laboratory environment with a large number of widely distributed devices, manual operations are difficult to meet the needs of efficient management.

[0004] To address these issues, LoRaWAN technology, a low-power, long-range communication technology, has been increasingly adopted for remote monitoring and management of laboratory equipment. However, due to its low data rate, LoRaWAN faces significant efficiency bottlenecks when transmitting large amounts of data, including device operating information. Especially when updating this information remotely, transmission times are long and susceptible to network quality, increasing the risk of transmission failure. Furthermore, existing transmission methods typically employ fixed strategies and lack dynamic adjustment capabilities, making them incapable of optimizing transmission efficiency under real-time network conditions. Furthermore, this update method often requires equipment to be temporarily unavailable during the update, disrupting normal laboratory operations. Summary of the Invention

[0005] In view of the shortcomings of the existing technology, the present invention proposes an experimental equipment management system based on LoRaWAN. The specific technical solution is as follows:

[0006] An experimental equipment management system based on LoRaWAN, comprising: an equipment control unit, a LoRaWAN communication unit, an electric energy monitoring unit, a user interaction display unit, a remote reservation management platform, a gateway and server unit, and a firmware management and upgrade unit;

[0007] The device control unit is used to control the power supply of the experimental equipment, and includes a relay module controlled by a single-chip microcomputer to realize the power switch control of the equipment; the LoRaWAN communication unit uses a wireless communication Soc chip to communicate with the remote server through the LoRaWAN network, and is responsible for receiving and transmitting device status information and firmware upgrade data packets; the power monitoring unit includes an energy metering chip for real-time monitoring of parameters such as current, voltage and power of the experimental equipment; the user interaction display unit includes a serial port screen connected via 485 communication, which is used to display the appointment information, operation process, equipment introduction pictures and precautions of the experimental equipment; the remote appointment management platform runs on the server side, which is used to manage the use appointment of the experimental equipment and monitor the operating status of the equipment; the gateway and the server are used to process the communication and data transmission of the system, wherein the server runs the remote appointment management platform and the firmware upgrade management system, and the gateway is responsible for device communication and firmware update management through the LoRaWAN network;

[0008] The firmware management and upgrade unit adopts a dynamic differential upgrade strategy to remotely update the firmware of the display unit, specifically: first, obtain the old version of the firmware of the target terminal device, and compare it with the new firmware on the server side to generate a differential packet; then, divide the differential packet into several small blocks, and dynamically adjust the size and transmission frequency of the blocks based on the current network conditions and the normal business data transmission of the device; when there is no normal business data transmission, block transmission is performed according to the maximum transmission capacity; when there is normal business data transmission, the differential packet data is embedded in the transmission gap of the normal business data through the interpolation strategy; at the terminal device, each block data is received and verified, and confirmation or retransmission is requested based on the verification result; after all blocks are received and reassembled, new firmware is generated based on the differential packet and the old firmware, and after verification, it is overwritten and written to the main storage area of ​​the terminal device; the microcontroller starts the firmware upgrade program, and uses the new firmware to update the content of the display unit to ensure the normal operation of the display unit function.

[0009] Furthermore, in the experimental equipment management system, the experimenter reserves the usage time of the equipment through the remote reservation management platform. The equipment control unit performs the power-on operation when the reservation time arrives, connects the power of the equipment for the experimenter to use, and after the reservation time ends, the experimenter turns off the power of the equipment by himself.

[0010] Furthermore, the device control unit works in conjunction with the power monitoring unit to control and monitor the operating status of the experimental equipment in real time. After the experimental equipment's scheduled use ends, the power monitoring unit determines whether the equipment is still in use by monitoring the equipment's current. If the equipment is still in use, a notification is sent to the person who made the reservation via the remote reservation management platform, indicating that the reservation time has expired and requiring the person to manually power off the equipment. To protect the equipment's safety, the device control unit can only perform a power-off operation after the equipment's power has been manually turned off.

[0011] Furthermore, the display content of the serial port screen can be remotely and dynamically differentially upgraded through the firmware management and upgrade unit to update the device introduction picture and operation process.

[0012] Furthermore, the firmware management and upgrade unit storage area includes a storage chip for storing the current firmware and the received differential upgrade package.

[0013] Furthermore, the dynamic differential upgrade strategy is specifically implemented through the following sub-steps:

[0014] S1: differential packet generation;

[0015] S1.1: The server receives the update request, obtains the device ID and the new update package, and then sends a request message for version information to the target terminal through the gateway;

[0016] S1.2: Based on the received version number, the server retrieves and obtains the corresponding old version update package stored on the server. The server compares the old and new version files using the BSDIFF algorithm to generate a differential package, which is then compressed using the LZ77 lossless compression algorithm. The differential upgrade package is created and sent to the gateway storage.

[0017] S2: Network quality assessment;

[0018] S2.1: The gateway sends an upgrade request to the target terminal node that needs to be upgraded, including basic information about the upgrade package (including file size and CRC16 checksum). After receiving the request, the target node records the upgrade package information and starts the upgrade process.

[0019] S2.2: After starting the upgrade program, the node sends an empty data packet (i.e., an empty uplink message) to the gateway. After receiving the data packet, the gateway measures the received signal strength indicator (RSSI) and signal-to-noise ratio (SNR) and calculates the link margin. The calculation formula for the link margin is:

[0020] M arg in=SNR measured -SNR required (1)

[0021] Among them, SNR measured is the signal-to-noise ratio of the empty data packet received by the gateway, SNR required The minimum signal-to-noise ratio (SNR) required for the gateway to successfully demodulate the signal (typically determined by the spreading factor (SF) used);

[0022] S3: differential packet transmission;

[0023] S3.1: The gateway divides the upgrade package file into several file blocks and dynamically adjusts the size of the file blocks based on the link margin (Margin) calculated in step S2.2 and the current spreading factor (SF). Suppose the file block size is B n ;

[0024] S3.2: First calculate the maximum load capacity P under the current spreading factor (SF) SF : Based on the current spreading factor (SF) and bandwidth, the maximum payload capacity P SF It can be calculated by the following formula:

[0025]

[0026] Among them, DR is the data rate, which is determined by SF and bandwidth, TOA is the air time, which means the time required for the data packet to propagate in the air, Header Size is the size of the physical layer header, and Payload Overhead is the overhead of LoRaWAN transmission. The calculated result P SF Represents the maximum load capacity that can be carried under the current SF;

[0027] S3.3: File block size B n According to the change of Margin and the maximum load capacity P SF Adjust according to the following formula:

[0028]

[0029] Among them, B n-1 The size of the file block transferred last time, Margin n-1 Margin is the link margin measured last time. baseline is the preset benchmark Margin value. Through this adjustment method, when the link margin is high, the file block size is increased to improve the transmission efficiency; when the link margin is low, the file block size is reduced to improve the transmission success rate.

[0030] S3.4: When service data and upgrade package data need to be transmitted at the same time, the gateway can insert the upgrade package data into a single service transmission frame. If the service data does not occupy the maximum load capacity P SF, the remaining capacity is used to transmit the upgrade package data; specifically, if the business data size B data Less than the maximum load capacity P SF , the remaining capacity is used to insert the upgrade package data B upgrade ,The adjustment formula for interpolation transmission is as follows:

[0031] B upgrade =min(P SF -B data ,B n ) (4)

[0032] Among them, B upgrade B is the size of the upgrade package data actually inserted into the transmission frame. n The size of the upgrade package data block is dynamically adjusted based on the margin. Through this frame insertion method, business data and upgrade package data share the same transmission frame, ensuring that business data is transmitted first and fully utilizing bandwidth resources for efficient upgrade package transmission.

[0033] S3.5: After each successful file block transmission and verification by the node, the node sends a short acknowledgment (ACK) to the gateway to confirm receipt and verification of the file block. After receiving the acknowledgment, the gateway measures the signal quality (such as signal strength and signal-to-noise ratio) of the acknowledgment and calculates the link margin accordingly. Throughout the upgrade process, the gateway dynamically adjusts the file block size and transmission frequency based on the network quality measured by the received empty data packets and the current spreading factor (SF) value, ensuring optimized transmission efficiency and success rate under different network conditions.

[0034] S4: differential packet storage and processing;

[0035] S4.1: Each data block is appended with an index number and an end flag when it is sent. A 1 indicates that this is the last data block, while a 0 indicates that there are subsequent data blocks. The data block ends with a CRC-16 checksum to verify the accuracy of the data packet.

[0036] S4.2: The terminal node first allocates a buffer for the received data blocks to temporarily store the contents of each data block. After the data block is stored in the buffer, the node immediately calculates the CRC-16 checksum of the data block and compares it with the checksum carried in the data block. If the check succeeds, the data block is marked as writable and an ACK signal is sent to the gateway. If the check fails, the data block in the buffer is discarded and a NACK signal is immediately sent to the gateway to request retransmission.

[0037] S4.3: On the gateway side, after each data block is sent, it waits for an ACK signal from the terminal node. If an ACK is not received within the set timeout period, the gateway will retransmit the data block. The number of retransmissions is set to 3. If there is still no success after 3 retransmissions, the gateway will trigger the error handling mechanism, suspend the upgrade, and report to the server;

[0038] S4.4: In the terminal node, the storage space is divided into three independent storage partitions: Slot A, Slot B, and Slot C, which are used to store the old firmware, the new firmware, and the differential package, respectively. Slot A is used to store the currently running old firmware version. The firmware in this partition will not be erased until the new firmware is fully verified to ensure that the system always has a stable running version. Slot B is used to store the generated new firmware version. When the new firmware is generated, the system will temporarily store it in this partition and overwrite it with Slot B after verification. Slot C is used to store received differential packages. This partition is used to temporarily store and process differential data until the new firmware is generated and verified.

[0039] S4.5: If the received data block passes verification, the terminal node writes its contents to Slot C of the storage chip based on the data block index number. During each write, the size of a single data block is ensured to be no larger than 256 bytes. If the data block is smaller than 256 bytes, the remaining portion is padded with a specific padding byte, 0xFF, to ensure page write consistency. After writing each data block, the terminal node immediately reads the written data from the storage chip and performs a CRC check again to ensure that no errors occurred during the data writing process.

[0040] S5: differential packet reassembly and verification;

[0041] S5.1: After all data blocks have been received and successfully written to Slot C, the terminal node begins differential packet reassembly. The terminal node arranges the received data blocks in index order, first creating an array of sufficient size to store pointers to all data blocks, then inserting the data blocks one by one according to their index numbers, ensuring that they are arranged in the correct order. After the sorting is complete, the ordered data blocks are merged into a continuous differential packet. After the reassembly is complete, the terminal node performs a full CRC check on the entire differential packet to ensure data integrity.

[0042] S6: New firmware generation and old firmware replacement;

[0043] S6.1: The terminal node uses the BSDIFF algorithm to generate new firmware based on the old firmware in Slot A and the differential packet in Slot C. The new firmware is temporarily stored in Slot B.

[0044] S6.2: After the new firmware is generated, the terminal node triggers the upgrade system and the screen enters the upgrade program;

[0045] S6.3: After the screen upgrade is successful, the terminal node erases the old firmware in Slot A. After the erasure is complete, the terminal node writes the new firmware in Slot B to Slot A, overwriting the original old firmware. After the new firmware is written to Slot A, the terminal node erases Slot B and Slot C to free up storage space.

[0046] Furthermore, the present invention adopts a dynamic differential upgrade strategy, in which the frame insertion strategy embeds the upgrade package data into the normal business data transmission gap, ensuring that business data is transmitted first even during the firmware upgrade process, thereby not affecting the normal scheduled use of the experimental equipment.

[0047] Furthermore, all terminal nodes of the experimental equipment management system adopt CLASS C type LoRaWAN devices to ensure the real-time data transmission and system stability.

[0048] The beneficial effects of the present invention are:

[0049] The LoRaWAN-based laboratory equipment management system and software upgrade method provided by this invention significantly improve the efficiency of laboratory equipment management and the reliability of data transmission through innovative design and multiple technical improvements. Specifically, it has the following outstanding innovative and practical features:

[0050] 1. This invention addresses the management needs of laboratory equipment and has designed a laboratory equipment management system that covers functions such as remote control, appointment management, and equipment power monitoring. Through the remote appointment management platform, lab personnel can efficiently schedule equipment usage. The system automatically manages equipment power on and off based on appointments, avoiding conflicts in equipment usage. The system also intelligently reminds users to shut down equipment after an appointment ends, further improving equipment utilization and laboratory management efficiency while reducing resource waste and experimental delays caused by human error.

[0051] 2. Compared to traditional full firmware updates, this paper introduces a dynamic differential upgrade strategy based on the BSDIFF algorithm for experimental device management. This strategy only transmits the differences between the new and old firmware, significantly reducing data transmission volume and making it particularly suitable for low-speed network environments such as LoRaWAN. This not only shortens firmware update time but also reduces network load, improving overall system efficiency.

[0052] 3. This invention cleverly applies a frame insertion strategy between the transmission of business data and firmware update data, achieving dynamic coordination between the two. During normal use of the experimental equipment, the system prioritizes the transmission of business data, while flexibly inserting firmware update data in the transmission gaps. This innovative technology effectively prevents firmware updates from interfering with normal equipment operation, ensuring the continuity of experimental progress and efficient equipment utilization.

[0053] 4. This invention evaluates the signal quality of the LoRaWAN network in real time and dynamically adjusts the data block size and transmission frequency based on this information. This intelligent adjustment mechanism maximizes data transmission efficiency and success rate under different network conditions, reduces transmission failures and retransmissions, and improves system stability and reliability.

[0054] 5. This invention introduces a partitioned storage and differential packet reassembly mechanism, dividing the firmware storage space into multiple independent partitions for storing old firmware, new firmware, and differential packets. Through a rigorous checksum and verification process, data integrity and security are ensured during the generation and deployment of new firmware. This partitioned storage and management approach provides greater system redundancy and fault tolerance. Even if an anomaly occurs during the update process, it can quickly restore to a stable state, avoiding the risk of prolonged device unavailability.

[0055] Through these innovative designs, the present invention significantly enhances the automation and intelligence of laboratory equipment management, greatly optimizing equipment utilization efficiency and data transmission performance, and effectively resolving existing issues such as resource allocation conflicts and inefficient data transmission. This system has broad application prospects and widespread value in equipment management in modern scientific research laboratories. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a schematic diagram of the system architecture of the present invention;

[0057] Figure 2 This is a flowchart of remote reservation and management of experimental equipment of the present invention;

[0058] Figure 3 It is a flow chart of the dynamic differential upgrade strategy of the present invention. DETAILED DESCRIPTION

[0059] The present invention will be described in detail below based on the accompanying drawings and preferred embodiments. The purpose and effects of the present invention will become more apparent. The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.

[0060] like Figure 1As shown, a LoRaWAN-based experimental equipment management system and software upgrade method include: a device control unit, a LoRaWAN communication unit, a power monitoring unit, a user interaction display unit, a remote reservation management platform, a gateway and server unit, and a firmware management and upgrade unit;

[0061] The device control unit is used to control the power supply of the experimental equipment. It contains a relay module controlled by an STM32F103VET6 single-chip microcomputer to realize the power switch control of the equipment. The LoRaWAN communication unit uses the ASR6601CB chip to communicate with the remote server through the LoRaWAN network and is responsible for receiving and transmitting device status information and firmware upgrade data packets. The power monitoring unit contains the BL0942 power metering chip, which is used to monitor the current, voltage, power and other parameters of the experimental equipment in real time. The user interaction display unit contains a serial port screen connected via 485 communication, which is used to display the appointment information, operation process, equipment introduction pictures and precautions of the experimental equipment. The remote appointment management platform runs on the server side and is used to manage the use appointments of the experimental equipment and monitor the operating status of the equipment. The gateway and server are used to handle the communication and data transmission of the system. Among them, the server runs the remote appointment management platform and the firmware upgrade management system, and the gateway is responsible for device communication and firmware update management through the LoRaWAN network.

[0062] The firmware management and upgrade unit adopts a dynamic differential upgrade strategy to remotely update the firmware of the display unit, specifically: first, obtain the old version of the firmware of the target terminal device, and compare it with the new firmware on the server to generate a differential packet; then, divide the differential packet into several small blocks, and dynamically adjust the size and transmission frequency of the blocks based on the current network conditions and the normal business data transmission of the device; when there is no normal business data transmission, block transmission is performed according to the maximum transmission capacity; when there is normal business data transmission, the differential packet data is embedded in the transmission gap of the normal business data through the interpolation strategy; at the terminal device, each block data is received and verified, and confirmation or retransmission is requested based on the verification result; after all blocks are received and reassembled, new firmware is generated based on the differential packet and the old firmware, and after verification, it is overwritten and written to the main storage area of ​​the terminal device; the microcontroller starts the firmware upgrade program, and uses the new firmware to update the content of the display unit to ensure the normal operation of the display unit function.

[0063] like Figure 2 As shown, in the experimental equipment management system, the experimenter reserves the use time of the equipment through the remote reservation management platform. The equipment control unit performs the power-on operation when the reservation time arrives, connects the power of the equipment for the experimenter to use, and after the reservation time ends, the experimenter turns off the power of the equipment by himself.

[0064] The device control unit and power monitoring unit work together to control and monitor the operating status of the experimental equipment in real time. After the experimental equipment's scheduled use ends, the power monitoring unit determines whether the equipment is still in use by monitoring the equipment's current. If the equipment is still in use, it sends a notification to the person who made the reservation through the remote reservation management platform, notifying them that the reservation time has expired and requiring them to manually power off the equipment. To protect the equipment, the device control unit will only perform a power-off operation after the equipment power has been manually turned off.

[0065] The display content of the serial port screen can be remotely and dynamically upgraded through the firmware management and upgrade unit to update the device introduction pictures and operation procedures.

[0066] The firmware management and upgrade unit storage area includes a W25Q64 storage chip for storing the current firmware and received differential upgrade packages.

[0067] like Figure 3 As shown in the figure, the dynamic differential upgrade strategy is implemented through the following sub-steps:

[0068] S1: differential packet generation;

[0069] S1.1: The server receives the update request, obtains the device ID and the new update package, and then sends a request message for version information to the target terminal through the gateway;

[0070] S1.2: Based on the received version number, the server retrieves and obtains the corresponding old version update package stored on the server. The server compares the old and new version files using the BSDIFF algorithm to generate a differential package, which is then compressed using the LZ77 lossless compression algorithm. The differential upgrade package is created and sent to the gateway storage.

[0071] S2: Network quality assessment;

[0072] S2.1: The gateway sends an upgrade request to the target terminal node that needs to be upgraded, including basic information about the upgrade package (including file size and CRC16 checksum). After receiving the request, the target node records the upgrade package information and starts the upgrade process.

[0073] S2.2: After starting the upgrade program, the node sends an empty data packet (i.e., an empty uplink message) to the gateway. After receiving the data packet, the gateway measures the received signal strength indicator (RSSI) and signal-to-noise ratio (SNR) and calculates the link margin. The calculation formula for the link margin is:

[0074] Margin=SNR measured -SNR required (1)

[0075] Among them, SNR measured is the signal-to-noise ratio of the empty data packet received by the gateway, SNR required The minimum signal-to-noise ratio (SNR) required for the gateway to successfully demodulate the signal (typically determined by the spreading factor (SF) used);

[0076] S3: differential packet transmission;

[0077] S3.1: The gateway divides the upgrade package file into several file blocks and dynamically adjusts the size of the file blocks based on the link margin (Margin) calculated in step S2.2 and the current spreading factor (SF). Suppose the file block size is B n ;

[0078] S3.2: First calculate the maximum load capacity P under the current spreading factor (SF) SF : Based on the current spreading factor (SF) and bandwidth, the maximum payload capacity P SF It can be calculated by the following formula:

[0079]

[0080] Among them, DR is the data rate, which is determined by SF and bandwidth, TOA is the air time, which means the time required for the data packet to propagate in the air, Header Size is the size of the physical layer header, and Payload Overhead is the overhead of LoRaWAN transmission. The calculated result P SF Represents the maximum load capacity that can be carried under the current SF;

[0081] S3.3: File block size B n According to the change of Margin and the maximum load capacity P SF Adjust according to the following formula:

[0082]

[0083] Among them, B n-1 The size of the file block transferred last time, Margin n-1 Margin is the link margin measured last time. baseline is the preset benchmark Margin value. Through this adjustment method, when the link margin is high, the file block size is increased to improve the transmission efficiency; when the link margin is low, the file block size is reduced to improve the transmission success rate.

[0084] S3.4: When service data and upgrade package data need to be transmitted at the same time, the gateway can insert the upgrade package data into a single service transmission frame. If the service data does not occupy the maximum load capacity P SF, the remaining capacity is used to transmit the upgrade package data; specifically, if the business data size B data Less than the maximum load capacity P SF , the remaining capacity is used to insert the upgrade package data B upgrade ,The adjustment formula for interpolation transmission is as follows:

[0085] B upgrade =min(P SF -B data ,B n ) (4)

[0086] Among them, B upgrade B is the size of the upgrade package data actually inserted into the transmission frame. n The size of the upgrade package data block is dynamically adjusted based on the margin. Through this frame insertion method, business data and upgrade package data share the same transmission frame, ensuring that business data is transmitted first and fully utilizing bandwidth resources for efficient upgrade package transmission.

[0087] S3.5: After each successful file block transmission and verification by the node, the node sends a short acknowledgment (ACK) to the gateway to confirm receipt and verification of the file block. After receiving the acknowledgment, the gateway measures the signal quality (such as signal strength and signal-to-noise ratio) of the acknowledgment and calculates the link margin accordingly. Throughout the upgrade process, the gateway dynamically adjusts the file block size and transmission frequency based on the network quality measured by the received empty data packets and the current spreading factor (SF) value, ensuring optimized transmission efficiency and success rate under different network conditions.

[0088] S4: differential packet storage and processing;

[0089] S4.1: Each data block is appended with an index number and an end flag when it is sent. A 1 indicates that this is the last data block, while a 0 indicates that there are subsequent data blocks. The data block ends with a CRC-16 checksum to verify the accuracy of the data packet.

[0090] S4.2: The terminal node first allocates a buffer for the received data blocks to temporarily store the contents of each data block. After the data block is stored in the buffer, the node immediately calculates the CRC-16 checksum of the data block and compares it with the checksum carried in the data block. If the check succeeds, the data block is marked as writable and an ACK signal is sent to the gateway. If the check fails, the data block in the buffer is discarded and a NACK signal is immediately sent to the gateway to request retransmission.

[0091] S4.3: On the gateway side, after each data block is sent, it waits for an ACK signal from the terminal node. If an ACK is not received within the set timeout period, the gateway will retransmit the data block. The number of retransmissions is set to 3. If there is still no success after 3 retransmissions, the gateway will trigger the error handling mechanism, suspend the upgrade, and report to the server;

[0092] S4.4: In the terminal node, the storage space is divided into three independent storage partitions: Slot A, Slot B, and Slot C, which are used to store the old firmware, the new firmware, and the differential package, respectively. Slot A is used to store the currently running old firmware version. The firmware in this partition will not be erased until the new firmware is fully verified to ensure that the system always has a stable running version. Slot B is used to store the generated new firmware version. When the new firmware is generated, the system will temporarily store it in this partition and overwrite it with Slot B after verification. Slot C is used to store received differential packages. This partition is used to temporarily store and process differential data until the new firmware is generated and verified.

[0093] S4.5: If the received data block passes verification, the terminal node writes its contents to Slot C of the storage chip based on the data block index number. During each write, the size of a single data block is ensured to be no larger than 256 bytes. If the data block is smaller than 256 bytes, the remaining portion is padded with a specific padding byte, 0xFF, to ensure page write consistency. After writing each data block, the terminal node immediately reads the written data from the storage chip and performs a CRC check again to ensure that no errors occurred during the data writing process.

[0094] S5: differential packet reassembly and verification;

[0095] S5.1: After all data blocks have been received and successfully written to Slot C, the terminal node begins differential packet reassembly. The terminal node arranges the received data blocks in index order, first creating an array of sufficient size to store pointers to all data blocks, then inserting the data blocks one by one according to their index numbers, ensuring that they are arranged in the correct order. After the sorting is complete, the ordered data blocks are merged into a continuous differential packet. After the reassembly is complete, the terminal node performs a full CRC check on the entire differential packet to ensure data integrity.

[0096] S6: New firmware generation and old firmware replacement;

[0097] S6.1: The terminal node uses the BSDIFF algorithm to generate new firmware based on the old firmware in Slot A and the differential packet in Slot C. The new firmware is temporarily stored in Slot B.

[0098] S6.2: After the new firmware is generated, the terminal node triggers the upgrade system and the screen enters the upgrade program;

[0099] S6.3: After the screen upgrade is successful, the terminal node erases the old firmware in Slot A. After the erasure is complete, the terminal node writes the new firmware in Slot B to Slot A, overwriting the original old firmware. After the new firmware is written to Slot A, the terminal node erases Slot B and Slot C to free up storage space.

[0100] The present invention adopts a dynamic differential upgrade strategy, in which the frame insertion strategy embeds the upgrade package data into the normal business data transmission gap, ensuring that business data is transmitted first even during the firmware upgrade process, thereby not affecting the normal scheduled use of the experimental equipment.

[0101] All terminal nodes of the experimental equipment management system use CLASS C type LoRaWAN devices to ensure the real-time data transmission and system stability.

[0102] Through the above technical solution, the present invention provides an innovative system that effectively solves the problems of experimental equipment management and remote upgrading, and has high application value and broad promotion prospects.

[0103] Those skilled in the art will understand that the foregoing descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art will be able to modify the technical solutions described in the foregoing examples or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the invention shall be included within the scope of protection of the invention.

Claims

1. An experimental equipment management system based on LoRaWAN, characterized in that: include: Device control unit, LoRaWAN communication unit, power monitoring unit, user interaction display unit, remote reservation management platform, gateway and server unit, firmware management and upgrade unit; The device control unit is used to control the power supply of the experimental equipment and includes a relay module controlled by a single-chip microcomputer to realize the power switch control of the equipment; the LoRaWAN communication unit uses a wireless communication Soc chip to communicate with the remote server through the LoRaWAN network, and is responsible for receiving and transmitting device status information and firmware upgrade data packets; the power monitoring unit includes an energy metering chip for real-time monitoring of the current, voltage and power parameters of the experimental equipment; the user interaction display unit includes a serial port screen connected via 485 communication, which is used to display the reservation information, operation process, equipment introduction pictures and precautions of the experimental equipment; the remote reservation management platform runs on the server side, and is used to manage the use reservation of the experimental equipment and monitor the operating status of the equipment; The gateway and server are used to handle system communication and data transmission. The server runs the remote reservation management platform and firmware upgrade management system, while the gateway is responsible for device communication and firmware update management through the LoRaWAN network. The firmware management and upgrade unit adopts a dynamic differential upgrade strategy to remotely update the firmware of the display unit, specifically: first, obtain the old firmware of the target terminal node, and compare it with the new firmware on the server side to generate a differential packet; then, divide the differential packet into several small blocks, and dynamically adjust the size and transmission frequency of the blocks based on the current network quality and the normal business data transmission of the device; when there is no normal business data transmission, block transmission is performed according to the maximum transmission capacity; when there is normal business data transmission, the differential packet data is embedded in the transmission gap of the normal business data through the interpolation strategy; at the terminal device, each block data is received and verified, and confirmation or retransmission is requested based on the verification result; after all blocks are received and reassembled, new firmware is generated based on the differential packet and the old firmware , and after verification, it is overwritten and written to the main storage area of ​​the terminal device; the microcontroller starts the firmware upgrade program and uses the new firmware to update the content of the display unit to ensure the normal operation of the display unit function; the differential packet is divided into several small blocks, and based on the current network quality and the normal business data transmission of the device, the size and transmission frequency of the blocks are dynamically adjusted, including: the gateway calculates the link margin Margin based on its measured signal-to-noise ratio (SNR); the gateway divides the differential packet file into several file blocks and dynamically adjusts the size of the file blocks based on the link margin Margin and the current spreading factor SF; the file block size is adjusted according to the change of Margin and the current maximum load capacity; the maximum load capacity is calculated based on the current spreading factor SF and bandwidth.

2. The LoRaWAN-based experimental equipment management system according to claim 1, characterized in that: In the experimental equipment management system, the experimenter reserves the equipment usage time through the remote reservation management platform. The equipment control unit performs the power-on operation when the reservation time arrives, connects the equipment power for the experimenter to use, and after the reservation time ends, the experimenter turns off the equipment power by himself.

3. The LoRaWAN-based experimental equipment management system according to claim 1, characterized in that: The equipment control unit works in conjunction with the power monitoring unit to control and monitor the operating status of the experimental equipment in real time. After the scheduled use of the experimental equipment ends, the power monitoring unit determines whether the equipment is still in use by monitoring the equipment current. If the equipment is still in use, a notification is sent to the appointment personnel through the remote appointment management platform, prompting that the appointment time has expired and requiring the experimenter to manually turn off the power of the equipment. In order to protect the safety of the equipment, the equipment control unit can only perform the power-off operation after the power of the equipment is manually turned off.

4. The LoRaWAN-based experimental equipment management system according to claim 1, characterized in that: The display content of the serial port screen is remotely and dynamically differentially upgraded through the firmware management and upgrade unit to update the device introduction picture and operation process.

5. The LoRaWAN-based experimental equipment management system according to claim 1, characterized in that: The firmware management and upgrade unit storage area includes a storage chip for storing the current firmware and the received differential packets.

6. The LoRaWAN-based experimental equipment management system according to claim 1, characterized in that: The dynamic differential upgrade strategy is specifically implemented through the following sub-steps: S1: differential packet generation; S1.1: The server receives the update request, obtains the device ID and the new update package, and then sends a request message for version information to the target terminal node through the gateway. S1.2: Based on the received version number, the server retrieves and obtains the corresponding old version update package stored on the server. The server compares the old and new version files using the BSDIFF algorithm to generate a differential package. After compressing the differential package using the LZ77 lossless compression algorithm, the package is sent to the gateway storage. S2: Network quality assessment; S2.1: The gateway sends an upgrade request to the target terminal node that needs to be upgraded. The upgrade request contains basic information of the differential packet, including the file size and CRC-16 checksum. After receiving the request, the target terminal node records the differential packet information and starts the upgrade program; S2.2: After starting the upgrade program, the target terminal node sends an empty data packet to the gateway. After receiving the data packet, the gateway measures the received signal strength indicator (RSSI) and signal-to-noise ratio (SNR) and calculates the link margin. The calculation formula for the link margin is: Margin=SNR measured -SNR required (1) Among them, SNR measured is the signal-to-noise ratio of the empty data packet received by the gateway, SNR required The minimum signal-to-noise ratio required for the gateway to successfully demodulate the signal; S3: differential packet transmission; S3.1: The gateway divides the differential packet file into several file blocks and dynamically adjusts the size of the file blocks according to the link margin Margin calculated in step S2.2 and the current spreading factor SF. Suppose the file block size is B n ; S3.2: First calculate the maximum load capacity P under the current spreading factor SF SF : According to the current spreading factor SF) and bandwidth, the maximum payload capacity P SF It can be calculated by the following formula: Among them, DR is the data rate, which is determined by SF and bandwidth, TOA is the air time, which means the time required for the data packet to propagate in the air, Header Size is the size of the physical layer header, and Payload Overhead is the overhead of LoRaWAN transmission. The calculated result P SF Represents the maximum load capacity that can be carried under the current SF; S3.3: File block size B n According to the change of Margin and the current maximum load capacity P SF Adjust according to the following formula: Among them, B n-1 The size of the file block transferred last time, Margin n-1 Margin is the link margin measured last time. baseline is the preset benchmark Margin value. Through this adjustment method, when the link margin is high, the file block size is increased to improve the transmission efficiency; when the link margin is low, the file block size is reduced to improve the transmission success rate. S3.4: When service data and differential packet data need to be transmitted at the same time, the gateway can insert differential packet data into a single service transmission frame. If the service data does not occupy the maximum load capacity P SF , the remaining capacity is used to transmit differential packet data; specifically, if the business data size B data Less than the maximum load capacity P SF , the remaining capacity is used to insert differential packet data. The adjustment formula for interpolation transmission is as follows: B upgrade =min(P SF -B data ,B n ) (4) Among them, B upgrade is the size of the differential packet file block actually inserted into the transmission frame, B n The size of the differential packet file block is dynamically adjusted according to the margin. Through this frame insertion method, business data and differential packet data share the transmission frame, ensuring that business data is transmitted first and making full use of bandwidth resources for efficient differential packet transmission. S3.5: After each successful file block transmission and verification by the terminal node, the terminal node sends a short acknowledgment (ACK) to the gateway to confirm receipt and verification of the file block. After receiving this acknowledgment, the gateway measures the network quality based on this information and calculates the link margin. Throughout the upgrade process, the gateway dynamically adjusts the file block size and transmission frequency based on the measured network quality and the current spreading factor (SF) value to ensure optimal transmission efficiency and success rate under different network conditions. S4: differential packet storage and processing; S4.1: Each data block is appended with an index number and an end flag when it is sent. A 1 indicates that this is the last data block, while a 0 indicates that there are subsequent data blocks. The data block ends with a CRC-16 checksum to verify the accuracy of the data packet. S4.2: The terminal node first allocates a buffer for the received data blocks to temporarily store the contents of each data block. After the data block is stored in the buffer, the terminal node immediately calculates the CRC-16 checksum of the data block and compares it with the checksum carried in the data block. If the check succeeds, the data block is marked as writable and an ACK signal is sent to the gateway. If the check fails, the data block in the buffer is discarded and a NACK signal is immediately sent to the gateway to request retransmission. S4.3: On the gateway side, after each data block is sent, it waits for the ACK signal from the terminal node. If the ACK is not received within the set timeout period, the gateway will retransmit the data block. The number of retransmissions is set to 3. If the data block is still unsuccessful after 3 retransmissions, the gateway will trigger the error handling mechanism, suspend the upgrade, and report to the server. S4.4: In the terminal node, the storage space is divided into three independent storage partitions: Slot A, Slot B, and Slot C, which are used to store the old firmware, the new firmware, and the differential package, respectively. Slot A is used to store the currently running old firmware version. The firmware in this partition will not be erased until the new firmware is fully verified to ensure that the system always has a stable running version. Slot B is used to store the generated new firmware version. When the new firmware is generated, the system will temporarily store it in this partition and overwrite it with Slot B after verification. Slot C is used to store received differential packages. This partition is used to temporarily store and process differential data until the new firmware is generated and verified. S4.5: If the received data block passes verification, the terminal node writes its contents to Slot C of the storage chip based on the data block index number. During each write, the size of a single data block is ensured to be no larger than 256 bytes. If the data block is smaller than 256 bytes, the remaining portion is padded with a specific padding byte, 0xFF, to ensure page write consistency. After writing each data block, the terminal node immediately reads the written data from the storage chip and performs a CRC check again to ensure that no errors occurred during the data writing process. S5: differential packet reassembly and verification; S5.1: After all data blocks have been received and successfully written to Slot C, the terminal node begins differential packet reassembly. The terminal node arranges the received data blocks in index order, first creating an array of sufficient size to store pointers to all data blocks, then inserting the data blocks one by one according to their index numbers, ensuring that they are arranged in the correct order. After the sorting is complete, the ordered data blocks are merged into a continuous differential packet. After the reassembly is complete, the terminal node performs a full CRC check on the entire differential packet to ensure data integrity. S6: New firmware generation and old firmware replacement; S6.1: The terminal node uses the BSDIFF algorithm to generate new firmware based on the old firmware in Slot A and the differential packet in Slot C. The new firmware is temporarily stored in Slot B. S6.2: After the new firmware is generated, the terminal node triggers the upgrade system and the screen enters the upgrade program; S6.3: After the screen upgrade is successful, the terminal node erases the old firmware in Slot A. After the erasure is complete, the terminal node writes the new firmware in Slot B to Slot A, overwriting the original old firmware. After the new firmware is written to Slot A, the terminal node erases Slot B and Slot C to free up storage space.

Citation Information

Patent Citations

  • Over-the-air firmware upgrading method and system for Internet of Things equipment

    CN111212121A

  • Remote firmware upgrading device based on LORA communication and upgrading method thereof

    CN118473928A