Wireless communication and data synchronization method and system for split medicine cabinet

By employing concurrent data links and data legacy mechanisms with 4G, BLE, and LoRa modules in the split-type medicine box, the problem of unstable data connection in complex environments is solved, achieving the integrity of medication safety traceability and the reliability of data synchronization.

CN122248521APending Publication Date: 2026-06-19ZKS IOT TECH CROP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZKS IOT TECH CROP
Filing Date
2026-02-07
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In complex environments, the wireless communication link of the split medicine box is easily interfered with, which leads to unstable concurrent data connection between the mother box, the grandchild box, and the third-level box. When communication is interrupted, the child box goes offline, resulting in the loss of data for out-of-threshold events, and the integrity of medication safety traceability cannot be guaranteed.

Method used

The system employs a 4G module built into the mother box, and dual-mode BLE and LoRa modules built into the daughter and granddaughter boxes to establish concurrent data links. It monitors the mother box's power level in real time to trigger a data transmission mechanism. When the daughter box is offline, it records over-threshold events and transmits them in batches when it reconnects. It uses vehicle charging to wake up the 4G module to prioritize data transmission and combines hash verification to ensure data integrity.

Benefits of technology

Stable data connections between parent and grandparent boxes are achieved in complex environments, ensuring the integrity of medication safety traceability, improving the reliability and robustness of data synchronization, and enhancing the system's adaptability and the continuity of data synchronization under emergencies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122248521A_ABST
    Figure CN122248521A_ABST
Patent Text Reader

Abstract

This invention relates to the field of wireless communication technology and discloses a wireless communication and data synchronization method and system for a split-type medicine box. The method includes the following steps: collecting operating data parameters of the mother box, daughter box, and grandchild box of the split-type medicine box, including temperature curves, number of times the lid is opened, remaining cooling capacity, and power status; configuring wireless communication modules, with the mother box having a built-in 4G module and the daughter and grandchild boxes having built-in BLE and LoRa dual-mode modules; establishing a concurrent data link between the mother-daughter-grandchild three-level medicine box, a mobile APP, and a backend server; and simultaneously writing over-threshold events to the local FRAM memory at minute-level timestamps during the daughter box's offline period, and batch transmitting offline data back upon reconnection. This can solve the problem of daughter box offline data loss due to communication interruption, ensure the integrity of medication safety traceability, and improve the reliability of data synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wireless communication technology, specifically to a wireless communication and data synchronization method and system for a split-type medicine box. Background Technology

[0002] Wireless communication is a communication method that uses the properties of electromagnetic wave signals to propagate in free space to exchange information.

[0003] Currently, because the split-type medicine box adopts a multi-level distributed architecture, the wireless communication link it relies on is easily interfered with in complex environments when performing real-time synchronization of medicine box data. It cannot maintain concurrent data connection between the mother box, the child box, and the child box in real time. When a communication interruption causes the child box to go offline, it will cause the loss of data on events exceeding the threshold during the offline period, and cannot guarantee the integrity of medication safety traceability.

[0004] Therefore, a wireless communication and data synchronization method and system for split-type medicine boxes are proposed to solve the above problems. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a wireless communication and data synchronization method and system for split-type medicine boxes, solving the problem mentioned in the background that it is impossible to maintain concurrent data connections between the mother box, the grandchild box, and the third-level box in real time.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a wireless communication and data synchronization method and system for a split-type medicine box, the method comprising the following steps: S1. Collect the operating data parameters of the mother box, daughter box and grandchild box of the split medicine box, including temperature curve, number of times the lid is opened, remaining cold energy and power status; S2. Configure wireless communication modules. The mother box has a built-in 4G module, and the daughter and granddaughter boxes have built-in BLE and LoRa dual-mode modules to establish a concurrent data link between the mother-daughter-granddaughter three-level medicine box, the mobile APP, and the back-end server. S3. Monitor the mother box power in real time. When the power is lower than the preset threshold, trigger the data will mechanism, pause the cooling function and suddenly upload compressed data frames containing temperature curves, number of times the lid is opened and remaining cooling capacity. S4. At the moment the child box is removed from the mother box, the mother box, the child box and the backend complete the session key switching and snapshot sequence number alignment operations within the BLE broadcast cycle to ensure communication security. S5. During the offline period of the sub-box, the over-threshold event is written to the local FRAM memory with a minute-level timestamp, and the event type and data parameters are recorded. S6. When the sub-box reconnects to the mother box and the backend, it batch transmits the over-threshold event data stored in FRAM during the offline period. S7. When the medicine box is in the vehicle charging state, the 4G module is woken up by the DC handshake pulse, and the compressed frames that have not been uploaded in the data will mechanism are prioritized for transmission. S8 integrates the synchronous data of the mother box, daughter box and grandchild box, and uploads it to the mobile APP and backend through concurrent data links to complete data verification and archiving, ensuring that the last frame of data is not lost before power failure.

[0007] Preferably, the step S1 of collecting operational data parameters includes the following steps: S11. Collect real-time temperature data, number of times the lid is opened, remaining cold energy data and power data of the mother box, daughter box and grandchild box through temperature sensor, Hall sensor and power meter; S12. The collected data is classified and stored according to the medicine box level. The data of the mother box is cached in the local SD card first, and the data of the daughter box and granddaughter box are temporarily stored in the built-in FRAM.

[0008] Preferably, configuring the wireless communication module in step S2 includes the following steps: S21. Initialize the wireless communication module. The 4G module of the mother box establishes a long connection with the backend server using the TCP / IP protocol. The BLE modules of the daughter box and granddaughter box are used for short-range broadcasting, and the LoRa module is used for long-range relay communication. S22. Based on the concurrent data link protocol, allocate communication time slots for the mother-child-grandchild three-level medicine boxes to ensure that the data upload priority is mother box > child box > grandchild box.

[0009] Preferably, the real-time monitoring of the mother box power in S3 includes the following steps: S31. Set the mother box power threshold to 20%. When the power is lower than the threshold, trigger a hardware interrupt signal to pause the operation of the cooling module. S32. Using the LZ77 compression algorithm, the temperature curve, number of times the lid is opened, and remaining cold energy are encapsulated into a compressed frame and uploaded to the backend via a 4G module. The header of the compressed frame contains a timestamp and a medicine box ID.

[0010] Preferably, the session key switching and snapshot sequence number alignment in S4 includes the following steps: S41, The sub-box removal event is detected by the accelerometer and triggers the three-way handshake protocol within the BLE broadcast cycle; S42. A temporary session key is generated using the AES-256 algorithm. The key is updated synchronously between the mother box and the child box. The background server verifies the consistency of the snapshot sequence number to prevent data replay attacks.

[0011] Preferably, the step S5 of recording the event type and data parameters includes the following steps: S51. Define over-threshold events as temperatures exceeding 5°C and exceeding the limit for the number of times the lid is opened. Event data is sorted by minute-level timestamps. S52. Use the non-volatile characteristics of FRAM to write event data. Each record includes the event type, value, and CRC checksum.

[0012] Preferably, the batch transmission of out-of-threshold event data during offline periods in step S6 includes the following steps: S61. When the sub-box reconnects, it first sends a connection request frame through the LoRa module. After the mother box responds, it switches to BLE high-speed transmission mode. S62. Before batch data transmission, verify the integrity of the data in FRAM, automatically remove duplicate data, and confirm the transmission success rate through the ACK mechanism.

[0013] Preferably, the compressed frames not uploaded in the priority data retransmission mechanism in S7 include the following steps: S71: The vehicle charging interface detects the DC handshake pulse, and wakes up the 4G module when the pulse width exceeds 10ms. S72, the retransmission logic prioritizes the compressed frames of the data will mechanism. When the network is congested, it is downgraded to LoRa transmission to ensure that the data is delivered.

[0014] Preferably, the integration of synchronization data of the mother box, daughter box, and granddaughter box in step S8 includes the following steps: S81. After data synchronization, the backend server generates a data hash value. The mobile APP compares the local hash with the cloud hash to ensure that the last frame of data is consistent. S82. When verification fails, a retransmission mechanism is triggered to read backup data from the mother box SD card and resynchronize.

[0015] Preferably, the system includes: The data acquisition module uses a sensor array unit to collect the operating parameters of the medicine box, formats the temperature curve, number of times the lid is opened and power data through the data preprocessing unit, and outputs the raw data of the medicine box through the buffer management unit. The wireless communication management module receives the raw data from the medicine box, initializes the 4G, BLE and LoRa modules through the module configuration unit, establishes a parent-child-grandchild three-level communication channel through the concurrent link scheduling unit, and outputs encrypted data streams through the security encryption unit. The will mechanism processing module receives the encrypted data stream, triggers a threshold judgment through the power monitoring unit, encapsulates the data using the compressed frame generation unit, and outputs the will data frame through the burst upload unit. The offline event processing module receives sub-box status data, updates the session key within the BLE cycle through the key switching unit, records over-threshold events using the FRAM storage unit, and transmits offline data in batches through the back-connection synchronization unit. The charging wake-up module receives the vehicle charging signal, wakes up the communication module through the pulse detection unit, processes the will data using the retransmission priority unit, and outputs the retransmission result through the data verification unit. The data synchronization engine module integrates the will data frame, offline data, and retransmission results. It verifies data integrity through a hash comparison unit, uploads the data to the mobile APP and backend through an archiving unit, and adjusts synchronization parameters through an error retransmission unit.

[0016] Compared with the prior art, the present invention provides a wireless communication and data synchronization method and system for a split-type medicine box, which has the following beneficial effects: 1. In this invention, when performing wireless communication and data synchronization for the split-type medicine box, a concurrent data link is established between the mother-child-grandchild three-level medicine box, the mobile APP, and the backend server. A dual-mode BLE and LoRa module is used to achieve complementary short-range and long-range communication. Simultaneously, during the offline period of the child box, out-of-threshold events are written to the local FRAM memory with minute-level timestamps, and offline data is transmitted back in batches upon reconnection. This solves the problem of offline data loss due to communication interruption, ensures the integrity of medication safety traceability, and improves the reliability of data synchronization.

[0017] 2. In this invention, when performing wireless communication and data synchronization of the split-type medicine box, the power of the mother box is monitored in real time and a data will mechanism is triggered when it is below a threshold. This mechanism pauses the cooling function and suddenly uploads a compressed frame containing temperature curves, number of times the lid is opened, and remaining cooling capacity. At the same time, a hash verification mechanism is used to compare the consistency between local and cloud data after data synchronization. If the verification fails, a retransmission is triggered. This can solve the problem of missing key data due to power failure of the mother box, ensure that the last frame of data before power failure is not lost, and improve the robustness of the system under emergency conditions.

[0018] 3. In this invention, when performing wireless communication and data synchronization of the split-type medicine box, the 4G module is woken up by the DC handshake pulse during vehicle charging, and the compressed frames that have not been uploaded in the data transmission mechanism are prioritized for retransmission. At the same time, the transmission priority is dynamically adjusted based on the concurrent data link, which can solve the problem of unreliable data synchronization in mobile scenarios, realize intelligent wake-up and seamless data retransmission at the moment of charging, and enhance the system's adaptability in complex environments and the continuity of data synchronization. Attached Figure Description

[0019] Figure 1 This is a flowchart of the wireless communication and data synchronization method based on a split-type medicine box according to the present invention; Figure 2 This is a schematic diagram of the wireless communication and data synchronization system based on a split-type medicine box according to the present invention. Detailed Implementation

[0020] 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.

[0021] Please see Figure 1 - Figure 2 The method and system for wireless communication and data synchronization of the split-type medicine box include the following steps: S1. Collect the operating data parameters of the mother box, daughter box and grandchild box of the split medicine box, including temperature curve, number of times the lid is opened, remaining cold energy and power status; S2. Configure wireless communication modules. The mother box has a built-in 4G module, and the daughter and granddaughter boxes have built-in BLE and LoRa dual-mode modules to establish a concurrent data link between the mother-daughter-granddaughter three-level medicine box, the mobile APP, and the back-end server. S3. Monitor the mother box power in real time. When the power is lower than the preset threshold, trigger the data will mechanism, pause the cooling function and suddenly upload compressed data frames containing temperature curves, number of times the lid is opened and remaining cooling capacity. S4. At the moment the child box is removed from the mother box, the mother box, the child box and the backend complete the session key switching and snapshot sequence number alignment operations within the BLE broadcast cycle to ensure communication security. S5. During the offline period of the sub-box, the over-threshold event is written to the local FRAM memory with a minute-level timestamp, and the event type and data parameters are recorded. S6. When the sub-box reconnects to the mother box and the backend, it batch transmits the over-threshold event data stored in FRAM during the offline period. S7. When the medicine box is in the vehicle charging state, the 4G module is woken up by the DC handshake pulse, and the compressed frames that have not been uploaded in the data will mechanism are prioritized for transmission. S8 integrates the synchronous data of the mother box, daughter box and grandchild box, and uploads it to the mobile APP and backend through concurrent data links to complete data verification and archiving, ensuring that the last frame of data is not lost before power failure.

[0022] The steps involved in collecting runtime data parameters in S1 are as follows: S11. Real-time temperature data, number of times the lid is opened, remaining cooling capacity data, and power data of the mother box, daughter box, and granddaughter box are collected through temperature sensors, Hall effect sensors, and power meters. The amount of data collected is calculated using a formula: ; in, Indicates the total amount of data. Indicates the number of sampling points. Indicates the size of each sample; The sensor samples once per minute, with each sample size... Fixed at 16 bytes, the microcontroller performs real-time calculations during implementation. The calculation results are used to dynamically allocate storage resources: the data of the mother box is cached to the SD card, and the data of the daughter / granddaughter boxes is temporarily stored in FRAM; S12. The collected data is classified and stored according to the medicine box level. The data of the mother box is cached in the local SD card first, and the data of the daughter box and granddaughter box are temporarily stored in the built-in FRAM.

[0023] Configuring the wireless communication module in S2 includes the following steps: S21. Initialize the wireless communication module. The 4G module of the mother box establishes a long connection with the backend server using the TCP / IP protocol. The BLE modules of the daughter box and granddaughter box are used for short-range broadcasting, and the LoRa module is used for long-range relay communication. The data transmission rate is evaluated using the formula: ; in, Indicates the transmission rate. Indicates the amount of data. Indicates time; During implementation, the communication processor monitors the amount of data. and transmission time The formula is used to dynamically adjust the communication protocol: when When the data is below the threshold, the system switches to the LoRa module to improve reliability. The calculation is performed through the AT command set built into the module. In the concurrent data link, the formula result is given priority to the transmission time slot of the mother box to ensure that high-priority data is transmitted first. S22. Based on the concurrent data link protocol, allocate communication time slots for the mother-child-grandchild three-level medicine boxes to ensure that the data upload priority is mother box > child box > grandchild box.

[0024] Real-time monitoring of the mother box power in S3 includes the following steps: S31. Set the mother box power threshold to 20%. When the power level falls below the threshold, a hardware interrupt signal is triggered to pause the operation of the cooling module. The power level decrease rate is calculated using a formula: ; in, Indicates the rate of battery depletion. Indicates the initial battery level. Indicates the current battery level. Indicates time; The fuel meter samples the fuel level every second. Microcontroller computing ,when If the threshold is exceeded, the will mechanism will be triggered immediately; S32. Using the LZ77 compression algorithm, the temperature curve, number of times the lid was opened, and remaining cold energy are encapsulated into a compressed frame, which is then burst-up uploaded to the backend via a 4G module. The header of the compressed frame includes a timestamp and a medicine box ID. The compression ratio is calculated using a formula: ; in, Indicates compression ratio. Indicates the size of the original data. Indicates the size of the compressed data. Represents the original data. This represents the compressed data; The LZ77 compression algorithm is implemented in software; the system... The value determines whether to retransmit.

[0025] The session key switching and snapshot sequence number alignment in S4 include the following steps: S41. The daughter box removal event is detected by the accelerometer, triggering the three-way handshake protocol within the BLE broadcast cycle. The broadcast cycle is set by the formula: ; in Indicates the broadcast cycle. Indicates the broadcast frequency. Indicates broadcast; S42. A temporary session key is generated using the AES-256 algorithm. The key is updated synchronously between the mother box and the child box. The backend server verifies the consistency of the snapshot sequence number to prevent data replay attacks. The key update interval is calculated using a formula: ; in, Indicates the key update interval. Indicates the number of broadcast cycles. Indicates the broadcast cycle. Indicates broadcasting. This represents the key.

[0026] Recording event types and data parameters in S5 includes the following steps: S51. Define over-threshold events as temperatures exceeding 5°C and exceeding the limit for the number of times the lid is opened. Event data is sorted by minute-level timestamps, and timestamp accuracy is calibrated using a formula: ; in, Indicates time deviation, Indicates the time when the event occurred. Indicates reference time; The RTC module provides a reference time. Time of the incident Recorded by sensors, the system is calibrated during implementation. To ensure minute-level accuracy, resynchronization is triggered if the deviation exceeds 1 minute; S52. Use the non-volatile characteristics of FRAM to write event data. Each record includes the event type, value, and CRC checksum. Storage capacity is evaluated using a formula: ; in, Indicates the FRAM storage capacity. Indicates the maximum number of event records. This indicates the size of each record.

[0027] System dynamic monitoring When the data is close to the limit, data will be uploaded first. Batch back of out-of-threshold event data during offline periods in S6 includes the following steps: S61. When the sub-box reconnects, it first sends a connection request frame through the LoRa module. After the mother box responds, it switches to BLE high-speed transmission mode. The transmission success rate is calculated using the formula: ; in, Indicates the transmission success rate. Indicates the number of successful transmissions. This represents the total number of attempts; S62. Before batch data transmission, verify the integrity of the data in FRAM, automatically remove duplicate data, confirm the transmission success rate through the ACK mechanism, and evaluate the deduplication efficiency using a formula: ; in, Indicates deduplication efficiency. Indicates a unique data quantity. Indicates the total amount of data; The deduplication algorithm is implemented in software, comparing the number of unique data items. and total data volume During implementation, the system uses CRC check to identify duplicate data, thereby improving the efficiency of data transmission.

[0028] In S7's priority data retransmission mechanism, the unuploaded compressed frames include the following steps: S71: The on-board charging interface detects the DC handshake pulse. The 4G module is woken up when the pulse width exceeds 10ms. The pulse width is measured using a formula: ; in, Indicates the pulse width. Indicates the pulse start time. Indicates the pulse end time; S72. The retransmission logic prioritizes compressed frames from the data legacy mechanism. When network congestion occurs, it downgrades to LoRa transmission to ensure data delivery. The retransmission delay is calculated using the following formula: ; in, This indicates a delay in the retransmission. Actual upload time, Indicates the trigger time.

[0029] In S8, integrating the synchronization data of the mother box, daughter box, and granddaughter box includes the following steps: S81. After data synchronization, the backend server generates a data hash value. The mobile app compares the local hash with the cloud hash to ensure that the last frame of data is consistent. The hash value is calculated using a formula: ; in, Represents the hash value. Indicates the amount of data; Hash represents the hash function. S82. When verification fails, a retransmission mechanism is triggered to read backup data from the mother box SD card and resynchronize. During implementation, the system sets an upper limit to prevent unlimited retransmissions. The number of retransmissions is limited by a formula: ; in, Indicates the maximum number of retransmissions. Indicates the amount of erroneous data. This indicates the amount of data retransmitted in each batch.

[0030] The system includes: The data acquisition module uses a sensor array unit to collect the operating parameters of the medicine box, formats the temperature curve, number of times the lid is opened and power data through the data preprocessing unit, and outputs the raw data of the medicine box through the buffer management unit. The wireless communication management module receives raw data from the medicine box, initializes 4G, BLE and LoRa modules through the module configuration unit, establishes a parent-child-grandchild three-level communication channel through the concurrent link scheduling unit, and outputs encrypted data stream through the security encryption unit. The will mechanism processing module receives encrypted data streams, triggers threshold judgment through the power monitoring unit, encapsulates data using the compressed frame generation unit, and outputs will data frames through the burst upload unit. The offline event processing module receives sub-box status data, updates the session key within the BLE cycle through the key switching unit, records over-threshold events using the FRAM storage unit, and transmits offline data in batches through the back-connection synchronization unit. The charging wake-up module receives the vehicle charging signal, wakes up the communication module through the pulse detection unit, processes the will data using the retransmission priority unit, and outputs the retransmission result through the data verification unit. The data synchronization engine module integrates will data frames, offline data, and retransmission results. It verifies data integrity through a hash comparison unit, uploads the data to the mobile app and backend through an archiving unit, and adjusts synchronization parameters through an error retransmission unit.

[0031] The wireless communication and data synchronization method and system operation steps of the split-type medicine box are as follows: Step S1: Collect runtime data parameters: The principle is to collect key operating parameters of the mother box, daughter box, and grandchild box in real time through a sensor array, including temperature curves, number of times the lid is opened, remaining cooling capacity, and power status. This step provides the raw data foundation for subsequent data synchronization, ensuring that all medicine box-level information is completely captured. The collected data is classified and stored according to priority. The mother box data is cached on the local SD card, and the daughter box and grandchild box data are temporarily stored in the built-in FRAM to optimize storage efficiency and prepare for offline processing.

[0032] Step S2: Configure the wireless communication module: The principle is to establish concurrent data links through heterogeneous communication modules. The mother box has a built-in 4G module for remote connection, while the daughter box and granddaughter box have built-in BLE and LoRa dual-mode modules to handle short-range broadcast and long-range relay communication respectively. This step realizes a stable link between the mother-daughter-granddaughter three-level medicine box and the mobile APP and backend server. By dynamically allocating communication time slots, the priority of data upload is guaranteed, and the robustness and real-time performance of the link are improved.

[0033] Step S3: Monitor battery level and trigger the data will mechanism: The principle is to monitor the mother box's power in real time. When the power is lower than the preset threshold, a hardware interrupt is triggered to pause the cooling function and suddenly upload a compressed data frame containing the temperature curve, the number of times the lid is opened, and the remaining cooling capacity. This step prioritizes the processing of critical data through a data will mechanism to prevent data loss due to sudden power outages. The compression algorithm reduces the transmission load and ensures that the last frame of data is delivered.

[0034] Step S4: Handle safety synchronization during sub-box removal: The principle is that at the moment the child box is unplugged, the three-way handshake between the mother box, the child box and the backend is completed using the BLE broadcast cycle, realizing the session key switching and snapshot sequence number alignment. This step generates a temporary key through an encryption algorithm and verifies the sequence number consistency to prevent data replay attacks and ensure communication security and continuous session synchronization.

[0035] Step S5: Record out-of-threshold events during offline periods: The principle is that during the offline period of the sub-box, the over-threshold events are written to the local FRAM memory with minute-level timestamps, and the event type and parameters are recorded. This step uses the non-volatile characteristics of FRAM to persistently store data, and the timestamp calibration ensures the accuracy of the event sequence, providing a complete record for subsequent backhaul.

[0036] Step S6: Batch transmission of offline data upon reconnection: The principle is that when the sub-box reconnects to the mother box and the backend, it first sends a connection request through the LoRa module, then switches to BLE high-speed mode to batch transmit offline data stored in FRAM. This step ensures that no offline events are missed and improves transmission efficiency by verifying data integrity and automatically deduplicating, combined with the ACK confirmation mechanism.

[0037] Step S7: Data transfer during onboard charging: The principle is that when the medicine box is in the vehicle charging state, it detects the DC handshake pulse to wake up the 4G module, and prioritizes the retransmission of compressed frames that have not been uploaded in the data will mechanism. This step uses the charging window to intelligently wake up the communication module, and degrades to LoRa transmission when the network is congested, so as to achieve seamless data retransmission in mobile scenarios.

[0038] Step S8: Integrate data and complete verification and archiving: The principle is to integrate the synchronized data of the mother box, daughter box and grandchild box, and upload it to the mobile APP and the backend through concurrent data links. Hash value comparison and verification are performed to ensure data integrity. When the verification fails, the retransmission mechanism is triggered to read the backup data from the mother box SD card and resynchronize it. Finally, the archiving is completed to ensure that the last frame of data is not lost before the power failure.

[0039] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0040] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for wireless communication and data synchronization of a split-type medicine box, characterized in that, The method includes the following steps: S1. Collect the operating data parameters of the mother box, daughter box and grandchild box of the split medicine box, including temperature curve, number of times the lid is opened, remaining cold energy and power status; S2. Configure wireless communication modules. The mother box has a built-in 4G module, and the daughter and granddaughter boxes have built-in BLE and LoRa dual-mode modules to establish a concurrent data link between the mother-daughter-granddaughter three-level medicine box, the mobile APP, and the back-end server. S3. Monitor the mother box power in real time. When the power is lower than the preset threshold, trigger the data will mechanism, pause the cooling function and suddenly upload compressed data frames containing temperature curves, number of times the lid is opened and remaining cooling capacity. S4. At the moment the child box is pulled out of the mother box, the mother box, the child box and the backend complete the session key switching and snapshot sequence number alignment operations within the BLE broadcast cycle. S5. During the offline period of the sub-box, the over-threshold event is written to the local FRAM memory with a minute-level timestamp, and the event type and data parameters are recorded. S6. When the sub-box reconnects to the mother box and the backend, it batch transmits the over-threshold event data stored in FRAM during the offline period. S7. When the medicine box is in the vehicle charging state, the 4G module is woken up by the DC handshake pulse, and the compressed frames that have not been uploaded in the data will mechanism are prioritized for transmission. S8 integrates the synchronized data of the mother box, daughter box, and grandchild box, and uploads it to the mobile APP and backend through concurrent data links to complete data verification and archiving.

2. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, The steps involved in collecting operational data parameters in S1 are as follows: S11. Real-time temperature data, number of times the lid is opened, remaining cold energy data and power data of the mother box, daughter box and grandchild box are collected through temperature sensor, Hall sensor and power meter; S12. The collected data is classified and stored according to the medicine box level. The data of the mother box is cached in the local SD card first, and the data of the daughter box and granddaughter box are temporarily stored in the built-in FRAM.

3. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, Configuring the wireless communication module in S2 includes the following steps: S21. Initialize the wireless communication module. The 4G module of the mother box establishes a long connection with the backend server using the TCP / IP protocol. The BLE modules of the daughter box and granddaughter box are used for short-range broadcasting, and the LoRa module is used for long-range relay communication. S22. Based on the concurrent data link protocol, allocate communication time slots for the mother-child-grandchild three-level medicine boxes.

4. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, The real-time monitoring of the mother box power in S3 includes the following steps: S31. Set the mother box power threshold to 20%. When the power is lower than the threshold, trigger a hardware interrupt signal to pause the operation of the cooling module. S32. Using the LZ77 compression algorithm, the temperature curve, number of times the lid is opened, and remaining cold energy are encapsulated into a compressed frame and uploaded to the backend via a 4G module. The header of the compressed frame contains a timestamp and a medicine box ID.

5. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, The session key switching and snapshot sequence number alignment in S4 include the following steps: S41. The sub-box removal event is detected by the accelerometer and triggers the three-way handshake protocol within the BLE broadcast cycle. S42. A temporary session key is generated using the AES-256 algorithm. The key is updated synchronously between the mother box and the child box. The backend server verifies the consistency of the snapshot sequence number.

6. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, The S5 process for recording event types and data parameters includes the following steps: S51. Define over-threshold events as temperatures exceeding 5°C and exceeding the limit for the number of times the lid is opened. Event data is sorted by minute-level timestamps. S52. Use the non-volatile characteristics of FRAM to write event data. Each record includes the event type, value, and CRC checksum.

7. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, The batch transmission of out-of-threshold event data during offline periods in S6 includes the following steps: S61. When the sub-box reconnects, it first sends a connection request frame through the LoRa module. After the mother box responds, it switches to BLE high-speed transmission mode. S62. Before batch data transmission, verify the integrity of the data in FRAM, automatically remove duplicate data, and confirm the transmission success rate through the ACK mechanism.

8. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, The compressed frames that were not uploaded in the priority data retransmission mechanism in S7 include the following steps: S71: The vehicle charging interface detects the DC handshake pulse, and wakes up the 4G module when the pulse width exceeds 10ms. S72, the retransmission logic prioritizes the compressed frames of the data will mechanism, and when the network is congested, it is downgraded to LoRa transmission.

9. The wireless communication and data synchronization method for the split-type medicine box according to claim 1, characterized in that, The integration of synchronization data from the mother box, daughter box, and granddaughter box in S8 includes the following steps: S81. After data synchronization, the backend server generates a data hash value, and the mobile APP compares the local hash with the cloud hash. S82. When verification fails, a retransmission mechanism is triggered to read backup data from the mother box SD card and resynchronize.

10. A wireless communication and data synchronization system for a split-type medicine box, used to implement the wireless communication and data synchronization method for the split-type medicine box according to any one of claims 1-9, characterized in that, The system includes: The data acquisition module uses a sensor array unit to collect the operating parameters of the medicine box, formats the temperature curve, number of times the lid is opened and power data through the data preprocessing unit, and outputs the raw data of the medicine box through the buffer management unit. The wireless communication management module receives the raw data from the medicine box, initializes the 4G, BLE and LoRa modules through the module configuration unit, establishes a parent-child-grandchild three-level communication channel through the concurrent link scheduling unit, and outputs encrypted data streams through the security encryption unit. The will mechanism processing module receives the encrypted data stream, triggers a threshold judgment through the power monitoring unit, encapsulates the data using the compressed frame generation unit, and outputs the will data frame through the burst upload unit. The offline event processing module receives sub-box status data, updates the session key within the BLE cycle through the key switching unit, records over-threshold events using the FRAM storage unit, and transmits offline data in batches through the back-connection synchronization unit. The charging wake-up module receives the vehicle charging signal, wakes up the communication module through the pulse detection unit, processes the will data using the retransmission priority unit, and outputs the retransmission result through the data verification unit. The data synchronization engine module integrates the will data frame, offline data, and retransmission results. It verifies data integrity through a hash comparison unit, uploads the data to the mobile APP and backend through an archiving unit, and adjusts synchronization parameters through an error retransmission unit.