Medicine use monitoring and reminding method based on intelligent portable medicine box and intelligent portable medicine box
By installing gesture sensors and strain pressure sensors inside the smart pillbox, and combining the work of multiple sensors, the problem of smart pillboxes being unable to accurately monitor and remind users to take their medication has been solved, achieving higher accuracy in medication monitoring and more timely reminders.
Patent Information
- Application Number
- CN202511981296.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-03
AI Technical Summary
Existing smart pillboxes struggle to accurately monitor and remind users to take different medications at different times, and they cannot identify issues such as users taking the wrong medication or taking too little medication, resulting in insufficient accuracy and real-time performance in medication monitoring and reminders.
A gesture sensor and a strain pressure sensor are installed inside the smart portable pillbox. The microcontroller monitors the user's medication retrieval process, and combined with preset judgment time periods and effective medication retrieval thresholds, it judges the user's medication retrieval behavior and provides timely reminders through the display screen and smart terminal.
It improves the accuracy and reliability of medication monitoring, reduces the possibility of users missing medication doses, enhances the timeliness and relevance of medication reminders, and reduces the probability of misjudgment.
Smart Images

Figure CN121774808A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data monitoring and processing, and in particular relates to a method for monitoring and reminding medication based on a smart portable pillbox and the smart portable pillbox itself. Background Technology
[0002] With the increasing trend of population aging and the growing demand for chronic disease management, long-term, regular, and accurate drug treatment has become crucial for safeguarding patients' health. In daily life, for elderly people with memory loss or patients who need to take multiple medications, missed doses, incorrect doses, or doses not taken as prescribed are extremely common. Traditional drug storage devices usually only exist as simple physical containers, lacking intelligent assistance mechanisms, and rely entirely on the patient's own memory and compliance to follow medical orders, which often leads to a significant reduction in the effectiveness of drug treatment.
[0003] A related technology has developed a smart pillbox with timed reminders and lid-opening detection functions. This technology typically sets up a magnetic sensor or mechanical contact switch at the connection between the lid and the body of the pillbox, and works in conjunction with a built-in timer chip. When the preset medication time is reached, the pillbox will emit an audible and visual alarm to remind the user. Once the user opens the lid, the sensor detects the opening action, the control system determines that the user has performed the medication action, stops the alarm, and generates a record of medication completion, reducing the probability that the user will completely forget to take the medication.
[0004] However, when patients need to take medications from different compartments at different times, the technology assumes the task is complete once the user responds to the reminder and opens the medicine box. But if the user mistakenly reaches into a compartment that is not for the current time slot, or if the user reaches into the compartment but does not actually grab enough pills, or even puts the pills back after taking them out to observe them, the technology has difficulty detecting these specific errors in medication location or dosage. This results in the system recording successful medication administration, while the patient actually takes the wrong, missed, or under-administered medication, reducing the accuracy and real-time performance of medication monitoring and reminders. Summary of the Invention
[0005] This application provides a method for medication monitoring and reminder based on a smart portable pillbox, as well as the smart portable pillbox itself, to improve the accuracy and real-time performance of medication monitoring and reminders.
[0006] In the first aspect, this application provides a method for monitoring and reminding medication based on a smart portable pillbox. In response to the user's operation of opening the smart portable pillbox, the microcontroller monitors the operating data of all gesture sensors. All gesture sensors are installed in several pill compartments inside the smart portable pillbox. A strain pressure sensor is installed under the inner liner of the pillbox composed of several pill compartments. The microcontroller determines the target compartment for the user to retrieve the medication based on the operational data. The microcontroller determines the target drug that the user will take based on the target drug compartment; In response to the user's action of closing the smart portable pillbox, the microcontroller determines the gravity difference data collected by the strain pressure sensor; Based on the target drug and gravity difference data, combined with the user's current medication task, if it is determined that the user has not completed the current medication task, the microcontroller determines the supplementary medication and the corresponding supplementary dosage. The microcontroller sends the supplementary medication and the corresponding dosage to the corresponding smart terminal, and displays the supplementary medication and the corresponding dosage on the display screen.
[0007] By employing the above technical solution, and by installing gesture sensors in several medicine compartments within the smart portable pillbox, and a strain pressure sensor under the pillbox liner, the microcontroller can monitor the user's hand gestures and changes in medication weight during the medication dispensing process. When the user opens the pillbox, the microcontroller identifies the target medicine compartment through the gesture sensor and determines the actual medication dispensing status based on the gravity difference data collected by the strain pressure sensor. If the user has not completed the current medication task, the microcontroller can determine the supplementary medication and dosage, and promptly remind the user through the display screen and smart terminal. Through the coordinated operation of multiple sensors, the accuracy and reliability of medication monitoring are improved, the possibility of missed medication doses is reduced, and the timeliness and relevance of medication reminders are enhanced.
[0008] In conjunction with some implementations of the first aspect, in some implementations, the microcontroller determines the target compartment for the user to retrieve the medication based on operational data, specifically including: When any gesture sensor outputs a drug retrieval gesture sensing signal, the microcontroller marks the drug compartment with the gesture sensor as a candidate drug compartment and records the start time of the drug retrieval gesture sensing signal. The microcontroller acquires the first weight data of the strain pressure sensor at the start time, and the second weight data at the end of the preset judgment period after the start time; The microcontroller calculates the difference between the first weight data and the second weight data to obtain the weight change value; If the weight change value is greater than the preset effective drug retrieval threshold, the microcontroller determines the candidate drug cell as the target drug cell; If the weight change is less than or equal to the effective drug retrieval threshold, the microcontroller removes the marker from the candidate drug cell and determines that no drug retrieval has occurred.
[0009] By adopting the above technical solution, a multi-dimensional judgment is made by setting a preset judgment period and a valid medication retrieval threshold, combined with changes in medication retrieval gesture sensing signals and weight data. After detecting a gesture sensing signal, the microcontroller marks the corresponding medication compartment as a candidate compartment and verifies whether an actual medication retrieval has occurred by comparing the weight change value with the valid medication retrieval threshold within the preset judgment period. This multi-verification mechanism improves the accuracy of medication retrieval behavior recognition, reduces the probability of misjudgment caused by environmental interference and unconscious user actions, and reduces the system's false alarm rate.
[0010] In conjunction with some implementations of the first aspect, in some implementations, after the microcontroller determines the target drug to be taken by the user based on the target drug compartment, the method further includes: The microcontroller searches for the standard unit weight of the drug corresponding to the target drug in a preset drug mapping table based on the unique identifier of the target drug. The microcontroller calculates the ratio of the weight change to the standard unit weight of the drug to obtain the calculated value; The microcontroller matches the calculated value with a sequence of integers and determines the number of medicines dispensed in a single transaction as the integer that differs the least from the calculated value. Based on the target drug and the corresponding quantity of medication to be dispensed at one time, and combined with the user's current medication task, if it is determined that the user has not completed the medication task, the microcontroller determines the supplementary medication and the corresponding dosage to be supplemented. The microcontroller sends the supplementary medication and the corresponding dosage to the corresponding smart terminal, and displays the supplementary medication and the corresponding dosage on the display screen.
[0011] By employing the above technical solution, the system stores standard unit weight information of drugs in a pre-set drug mapping table and calculates the actual drug quantity based on weight change values. The system matches the calculated ratio with an integer sequence, selecting the integer with the smallest difference as the single drug quantity. This calculation method takes into account potential measurement errors in practical applications. By comparing the actual drug quantity with the medication task, the system can more accurately determine the user's medication completion status, improving the accuracy of medication monitoring. This intelligent calculation method based on actual weight changes enhances the accuracy of the system in determining the drug quantity.
[0012] In conjunction with some implementation methods of the first aspect, in some implementation methods, when it is determined that the user has not completed the current medication task based on the target drug and gravity difference data, combined with the user's current medication task, the microcontroller determines the supplementary medication and the corresponding supplementary dosage, specifically including: The microcontroller analyzes the current medication task and determines the quantity of each target drug to be administered. For each target drug, the microcontroller determines the standard unit weight of the target drug based on its unique identifier. The microcontroller determines the independent weight change value corresponding to the target drug compartment where the target drug is located from the gravity difference data; The microcontroller calculates the ratio of the independent weight change value to the standard unit weight of the drug, and rounds the ratio to obtain the actual quantity of the target drug taken. If the actual amount of medication taken is less than the amount that should be taken, the microcontroller determines that the user has not completed the current medication task; The microcontroller calculates the difference between the required dosage and the actual dosage taken as the supplementary dose and marks the target drug as the supplementary medication.
[0013] By employing the aforementioned technical solution, the system obtains the required medication quantity by analyzing the current medication task and calculates the actual amount dispensed based on the standard drug weight, thus achieving precise monitoring of the user's medication usage. The system determines the dosage to be replenished by comparing the actual amount dispensed with the required amount; this data-driven comparison method improves the accuracy of medication monitoring. By further subdividing the gravity difference data into each target drug compartment, the system can independently monitor the dispensing of multiple drugs, enhancing its ability to monitor complex medication regimens.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after responding to the user's action of opening the smart portable pillbox, the method further includes: The microcontroller determines the medication compartment and dosage to be dispensed based on the current medication task. The microcontroller generates a location diagram containing all drug compartments; The microcontroller adds the drug compartment and the dose to be dispensed to the location diagram and displays it on the screen.
[0015] By adopting the above technical solution, a schematic diagram of all medication compartment locations is generated based on the current medication task. The compartments to be retrieved and their corresponding dosages are added to the location diagram for display, allowing users to intuitively understand the specific location of each compartment and which compartments contain the required dosage. Presenting clear visual information on the screen reduces the time users spend searching for the target compartment among multiple compartments, minimizing medication retrieval errors caused by unclear compartment locations. Simultaneously, since the required dosage is directly displayed in the location diagram, users can accurately determine the required dosage, reducing the risk of inaccurate dosage. This intelligent medication guidance method improves the accuracy and efficiency of the medication retrieval process, enabling users to complete their medication tasks more easily.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, the method further includes, prior to the user's action of opening the smart portable pillbox: If the user fails to complete the current medication task within the preset time, the microcontroller controls the audible and visual alarm to operate according to the preset first alarm mode. After the preset first alarm mode ends and no user operation to open the smart portable medicine box is detected, the microcontroller controls the sound and light alarm to operate according to the preset second alarm mode. After the preset second alarm mode ends and no user operation to open the smart portable medicine box is detected, the microcontroller controls the sound and light alarm to operate according to the preset third alarm mode and sends a preset notification message to the smart terminal.
[0017] By adopting the above technical solution, a three-level progressive audible and visual alarm mode is used to remind users to take their medication on time. Switching between different alarm modes increases the intensity of the reminder. When the system detects that a user has not completed the medication task within the specified time, it first activates the first alarm mode to remind the user. If the user still does not respond, it escalates to the second alarm mode. Finally, if the user continues to not respond, the third alarm mode is activated, and a notification message is sent to the smart terminal. This progressive reminder mechanism increases the user's attention to the medication reminder and enhances the perceptibility of the reminder effect. By sending notification messages to the smart terminal, the coverage of the reminder information is expanded, increasing the likelihood that the user will complete the medication task on time, thereby reducing the probability of the user missing a dose.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after responding to the user's action of closing the smart portable pillbox, the method further includes: The microcontroller controls the audible and visual alarm to emit a preset warning audio, and controls the lights to flash at different frequencies and remain on for a preset duration before turning off.
[0019] By adopting the above technical solution, after the user closes the smart portable pillbox, a preset warning audio signal is emitted by the sound and light alarm, and the light flashes at different frequencies to convey feedback signals that the medication operation has been completed. This sound and light combined feedback method enhances the user's perceptual experience of completing the medication task, and helps the user establish a complete medication operation loop through timely sound and light prompts. The continuous on and off process of the light gives the user sufficient visual feedback time, improves the user's confirmation of the completion status of the medication behavior, helps to strengthen the user's memory of the medication behavior, and reduces the possibility that the user will have doubts about whether the medication has been completed.
[0020] In a second aspect, embodiments of this application provide a smart portable pillbox, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the smart portable pillbox to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a smart portable pillbox, cause the smart portable pillbox to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer program product that, when run on a smart portable pillbox, causes the smart portable pillbox to perform the method described in any possible implementation of the first aspect.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This application provides a medication monitoring and reminder method based on a smart portable pillbox. By installing gesture sensors in several pill compartments within the smart portable pillbox and a strain pressure sensor under the pillbox's inner liner, a microcontroller can monitor the user's hand gestures and changes in medication weight during the medication retrieval process. When the user opens the pillbox, the microcontroller identifies the target pill compartment using the gesture sensor and determines the user's actual medication retrieval status based on the gravity difference data collected by the strain pressure sensor. If the user has not completed their current medication task, the microcontroller can determine the supplementary medication and dosage, and promptly remind the user through a display screen and a smart terminal. Through the coordinated operation of multiple sensors, the accuracy and reliability of medication monitoring are improved, the possibility of missed medication doses is reduced, and the timeliness and relevance of medication reminders are enhanced.
[0024] 2. This application provides a medication monitoring and reminder method based on a smart portable pillbox. It uses a multi-dimensional judgment process, combining gesture sensing signals and weight data changes, by setting a preset judgment period and a valid medication retrieval threshold. After detecting a gesture sensing signal, the microcontroller marks the corresponding pillbox as a candidate pillbox and verifies whether an actual medication retrieval has occurred by comparing the weight change value with the valid medication retrieval threshold within the preset judgment period. This multi-verification mechanism improves the accuracy of medication retrieval behavior recognition, reduces the probability of misjudgments caused by environmental interference and unconscious user actions, and also reduces the system's false alarm rate.
[0025] 3. This application provides a medication monitoring and reminder method based on a smart portable pillbox. It stores standard unit weight information of medications in a preset drug mapping table and calculates the actual amount of medication dispensed by combining this information with weight change values. The system matches the calculated ratio with an integer sequence, selecting the integer with the smallest difference as the amount of medication dispensed per dose. This calculation method takes into account potential measurement errors in practical applications. By comparing the actual amount of medication dispensed with the medication task, the system can more accurately determine the user's medication completion status, improving the accuracy of medication monitoring. This intelligent calculation method based on actual weight changes enhances the accuracy of the system in determining the amount of medication dispensed. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating a medication monitoring and reminder method based on a smart portable pillbox, as described in an embodiment of this application.
[0027] Figure 2 This is another flowchart illustrating a medication monitoring and reminder method based on a smart portable pillbox, as described in this application.
[0028] Figure 3 This is an anatomical diagram of the device structure of a smart portable medicine box provided in an embodiment of this application.
[0029] Figure 4 This is a schematic diagram of the physical structure of a smart portable medicine box provided in an embodiment of this application. Detailed Implementation
[0030] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0031] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0032] The following example is used in conjunction with Figure 1 The present application describes a method for medication monitoring and reminder based on a smart portable pillbox: Please see Figure 1 This is a flowchart illustrating a medication monitoring and reminder method based on a smart portable pillbox, as described in an embodiment of this application.
[0033] S101. In response to the user's operation of opening the smart portable pillbox, the microcontroller monitors the operating data of all gesture sensors; In response to a user opening the smart portable pillbox, the microcontroller monitors the operational data of all gesture sensors. These sensors are installed in several pill compartments within the pillbox, and a strain pressure sensor is installed beneath the pillbox's inner liner, which comprises these compartments. The smart portable pillbox refers to a medication storage container integrating electronic monitoring components, typically possessing wireless communication capabilities. The microcontroller, as the core processing unit, is responsible for data acquisition, processing, and command issuance; it can be a microcontroller, a SoC chip, or other embedded processor. Gesture sensors are sensors capable of detecting human hand movements or proximity, such as infrared proximity sensors, capacitive sensors, or time-of-flight (ToF) sensors. They are installed in the pillbox's compartments to independently monitor the space above each compartment. The pillbox liner is the structural component that directly holds the medication; a strain pressure sensor is installed beneath it to measure the total weight of the liner and the medication. Operational data refers to the real-time electrical or digital signals output by the gesture sensors, reflecting the presence of obstructions or approaching objects within the sensing area. When the user opens the medicine box lid, an opening signal is triggered. The microcontroller then activates the gesture sensors corresponding to all medicine compartments and puts them into working mode. The sensors scan the space above each medicine compartment in real time to capture the user's hand movements.
[0034] To respond to user actions of opening the medicine box and monitor data, several specific technical approaches can be employed. One approach uses a mechanical trigger mechanism, placing a microswitch or Hall sensor at the opening / closing connection of the medicine box. When the medicine box lid is opened, a change in the magnetic field or the opening / closing of contacts generates an interrupt signal, waking up the microcontroller in low-power sleep mode. After waking up, the microcontroller polls the register values of each infrared proximity sensor via the I2C or SPI bus to determine if an object is approaching. Another approach utilizes light-sensing triggering, placing a photoresistor or light sensor inside the medicine box. When the medicine box is opened, ambient light enters, causing a sudden change in light intensity, triggering the microcontroller to start its monitoring program. At this time, the microcontroller can receive signals from the capacitive gesture sensor using an interrupt-driven approach; that is, when the sensor detects a change in capacitance exceeding the noise floor, it actively sends a pulse to the microcontroller, which then records the operational data accordingly.
[0035] S102. The microcontroller determines the target compartment for the user to retrieve the medication based on the operating data. The microcontroller determines the target medication compartment for the user based on operational data. Specifically, when any gesture sensor outputs a medication retrieval gesture signal, the microcontroller marks the medication compartment with the gesture sensor as a candidate compartment and records the start time of the gesture signal. The microcontroller acquires the first weight data from the strain pressure sensor at the start time and the second weight data at the end of a preset judgment period after the start time. The microcontroller calculates the difference between the first and second weight data to obtain the weight change value. If the weight change value is greater than a preset effective medication retrieval threshold, the microcontroller determines the candidate compartment as the target compartment. If the weight change value is less than or equal to the effective medication retrieval threshold, the microcontroller removes the marker from the candidate compartment and determines that no medication retrieval has occurred.
[0036] When any gesture sensor outputs a medication retrieval gesture signal, meaning the signal strength exceeds a preset trigger level, the microcontroller marks the medication compartment equipped with that gesture sensor as a candidate compartment. A candidate compartment is one where the user is initially judged to be likely to perform an action. Simultaneously, the microcontroller records the start time of the gesture signal generation, i.e., the time the hand enters the sensing area. Subsequently, the microcontroller acquires the first weight data from the strain pressure sensor at the start time, and the second weight data at the end of a preset judgment period. The preset judgment period is a short time window, sufficient to cover the duration of a typical medication retrieval action. The first weight data represents the total system weight before medication retrieval, and the second weight data represents the total system weight after the retrieval action. The microcontroller calculates the difference between the two to obtain the weight change value. The effective medication retrieval threshold is a pre-set weight difference standard used to distinguish between weight reduction caused by vibration interference and actual medication retrieval. If the weight change value is greater than this threshold, it indicates that medication has been removed, and the candidate compartment is designated as the target compartment; conversely, if the weight change is minimal, the marking is removed, and it is determined that no retrieval action has occurred.
[0037] One method for determining the target pill compartment in this step is a time-window-based synchronous verification algorithm. When the microcontroller detects an infrared blocking signal (gesture sensing) from a pill compartment, it starts a high-precision timer. During the timer's operation, the microcontroller continuously reads the values from the strain pressure sensor at a high sampling rate (e.g., 100Hz) and smooths the data using a moving average filtering algorithm to extract the weight decrease curve for that time period. By analyzing the slope and magnitude of the decrease in the curve, the weight change is calculated. Another approach is to use event-driven state machine logic. The system defines states such as idle, gesture trigger, weight verification, and target confirmation. When the gesture sensor interrupts and the state transitions to gesture trigger, the system locks the current weight reading as the first weight data and starts a delay task. After the delay, the second weight data is read. If the difference between the two values matches the logic (i.e., the weight decrease is approximately equal to the weight of one or more pills), the state transitions to target confirmation; otherwise, it returns to the idle state.
[0038] S103, The microcontroller determines the target drug that the user will take based on the target drug compartment; The target drug refers to the specific medication that the user intends to take and that is stored in the target drug compartment. Each drug compartment is assigned a unique drug compartment ID during system initialization or when the user loads the medication. This ID is bound to specific drug information in the microcontroller's memory. Drug information includes the drug name, unique drug identifier, standard unit weight, dosage form, etc. The microcontroller queries its internal database or mapping table, indexes the corresponding drug record based on the target drug compartment ID determined in step S102, and thus identifies the specific drug the user just processed. This process ensures that subsequent dosage calculations and reminders are specific to the drug, rather than general drug information.
[0039] To identify medications based on their compartments, one approach is a static lookup table. During the medication compartment setup, the user scans the medication barcode using a mobile app and selects the compartment location. This information is synchronized via Bluetooth to the microcontroller's EEPROM or Flash memory, creating a static mapping table of "compartment ID - medication information." Once the microcontroller identifies the target compartment, it directly reads this table to obtain the target medication information. Another approach is dynamic identification technology. If the compartment has RFID reading capabilities and the medication packaging has an RFID tag, the microcontroller can activate the RFID antenna of the target compartment each time medication is retrieved, reading the tag information in real time. Alternatively, a color sensor can be installed at the bottom of the compartment. Based on pre-recorded pill color characteristics, it can help confirm the type of medication currently in the compartment. While this is typically used as an auxiliary verification method, it has advantages in scenarios where medications in compartments change frequently.
[0040] S104. In response to the user's operation of closing the smart portable medicine box, the microcontroller determines the gravity difference data collected by the strain pressure sensor; Closing the pillbox marks the end of a complete medication administration process, and the system enters the billing phase. After detecting a lid closure signal (such as a Hall sensor state flip or the light disappearing), the microcontroller waits for the pillbox to be placed stably to avoid vibration interference from the closing action. The gravity difference data refers to the difference between the total weight before the user opens the pillbox and the total weight after closing it; it reflects the total mass of all objects removed from the pillbox during the opening process. This data forms the physical basis for subsequent calculations of the actual medication dosage. The microcontroller needs to eliminate the influence of environmental vibrations, temperature drift, and other factors on the sensors to ensure that it obtains the true amount of medication weight reduction.
[0041] To determine the gravity difference data, differential sampling and steady-state determination techniques can be employed. Upon detecting a lid-closing signal, the microcontroller initiates a steady-state detection algorithm, continuously monitoring the output variance of the strain gauge sensor. When the variance is less than a preset stability threshold, the medicine box is considered stationary, and the value read at this point is taken as the weight after the lid is closed. The microcontroller retrieves the baseline weight cached before the lid is opened, and the difference between the two yields the original gravity difference. To improve accuracy, a temperature compensation algorithm can be used, reading values from the built-in temperature sensor to correct the temperature drift characteristic curve of the strain gauge sensor, resulting in calibrated gravity difference data. Another approach is to use an integral averaging method, collecting data for a period of time (e.g., 1 second) before and after the lid is opened, performing integral averaging to eliminate the influence of random noise, and then calculating the difference between the two average values.
[0042] S105. Based on the target drug and gravity difference data, combined with the user's current medication task, if it is determined that the user has not completed the current medication task, the microcontroller determines the supplementary medication and the corresponding supplementary dosage. Based on the target drug and gravity difference data, combined with the user's current medication task, if it is determined that the user has not completed the current medication task, the microcontroller determines the supplementary medication and the corresponding supplementary dosage. Specifically, this includes: the microcontroller parses the current medication task and determines the quantity of medication to be taken for each target drug; for each target drug, the microcontroller determines the standard unit weight of the target drug based on its unique identifier; the microcontroller determines the independent weight change value corresponding to the target drug compartment where the target drug is located from the gravity difference data; the microcontroller calculates the ratio of the independent weight change value to the standard unit weight of the drug and rounds the ratio to obtain the actual quantity of the target drug taken; if the actual quantity taken is less than the quantity to be taken, the microcontroller determines that the user has not completed the current medication task; the microcontroller calculates the difference between the quantity to be taken and the actual quantity taken as the supplementary dosage and marks the target drug as a supplementary medication.
[0043] The current medication task refers to the type and quantity of medication that the user should take within the current time period, as set by the doctor's order. The microcontroller first parses the task to determine the required quantity of each target drug. Next, it obtains the standard unit weight (i.e., the average weight of a single pill) of the target drug based on its unique identifier. The microcontroller separates the independent weight change value corresponding to a specific target pill cell from the global gravity difference data. This typically requires combining the weight change ratio of each pill cell recorded in step S102 or directly accumulating the single change values measured in S102. The ratio of the independent weight change value to the standard unit weight of the drug is calculated and rounded to obtain the actual quantity of medication taken. If the actual quantity is less than the required quantity, the task is considered incomplete, the difference is the supplementary dose, and the drug is marked as a supplementary medication.
[0044] The specific method for implementing this step involves rounding and remainder analysis to calculate the actual number of pills dispensed. When calculating the weight ratio, the result is often a decimal. The microcontroller not only rounds the result to an integer number of pills but also analyzes the remainder. If the remainder is too large (close to 0.5 pill weight), it may indicate pill breakage or sensor error, and the system can mark the data confidence level. For simultaneous dispensing from multiple pill compartments, a component decomposition algorithm can be used. If the gravity difference data represents the total weight change, the microcontroller uses the target pill compartment sequence identified in S102 to construct a system of linear equations, solves for the most probable integer combination of solutions, and thus determines the actual number of pills dispensed for each drug.
[0045] When the standard weight of the medication is relatively light (e.g., small pills) and the sensor accuracy is limited, the calculated actual number of pills taken may fluctuate between two integers (e.g., a calculated result of 1.5 pills), leading to false positives. To address this issue, a historical behavior-weighted judgment logic can be introduced. The microcontroller relies not only on the current weight calculation result but also on the user's historical medication habits. If the calculation result is in a fuzzy range (e.g., between 1.4 and 1.6), the system checks the user's medication records for that time period over the past week. If the history shows that the user always takes 2 pills, it tends to judge it as 2 pills, but simultaneously marks this record as "questionable." A more rigorous approach is that when the calculation result is in a fuzzy range, the microcontroller does not immediately classify it as incomplete, but triggers a secondary confirmation logic, displaying on the screen, "Insufficient medication quantity detected. Please confirm whether you have taken 2 pills?", allowing the user to manually confirm or remedy the situation by opening and closing the pillbox again, thus avoiding the confusion caused by direct false positives.
[0046] S106. The microcontroller sends the supplementary medication and the corresponding dosage to the corresponding smart terminal, and displays the supplementary medication and the corresponding dosage on the display screen.
[0047] The smart terminal typically refers to the user's smartphone, tablet, or the guardian's device, which are connected via wireless communication protocols such as Bluetooth, Wi-Fi, or NB-IoT. The display screen is an OLED or LCD screen integrated into the medicine box itself. The microcontroller packages the generated reminder data into a specific communication message, containing fields such as the medication name, missing quantity, and administration time, and sends it to the smart terminal app for a pop-up reminder. At the same time, the microcontroller drives the local screen to display the missing information using text, icons, or highlighted colors, intuitively informing the user what medication still needs to be taken.
[0048] To achieve the sending and display functions, in terms of communication, a Bluetooth Low Energy (BLE) broadcast and notification mechanism can be used. The microcontroller, acting as a peripheral, updates the data to be replenished to a specific GATT characteristic and actively pushes it to the smart terminal, acting as the central device, via the Notify attribute. For local display, a graphical user interface (GUI) rendering technology can be used. The microcontroller uses its internal graphics library to draw a planar layout of the pill dispenser and displays the area to be replenished in flashing red, labeled with "-1" or "Replenish 1 pill". Another approach is to use text-to-speech (TTS) to assist the display. In addition to the screen display, the microcontroller drives a voice chip via an I2S interface to announce, "You have one aspirin left untaken, please replenish," providing both visual and auditory reminders.
[0049] In the above embodiments, by installing gesture sensors in several medicine compartments within the smart portable pillbox and a strain pressure sensor under the pillbox liner, the microcontroller can monitor the user's hand gestures and changes in drug weight during medication retrieval. When the user opens the pillbox, the microcontroller identifies the target medicine compartment using the gesture sensor and determines the actual medication retrieval based on the gravity difference data collected by the strain pressure sensor. If the user has not completed the current medication task, the microcontroller can determine the supplementary medication and dosage, and promptly remind the user through the display screen and smart terminal. Through the coordinated operation of multiple sensors, the accuracy and reliability of medication monitoring are improved, the possibility of missed medication doses is reduced, and the timeliness and relevance of medication reminders are enhanced.
[0050] In the above embodiments, the basic process of the medication monitoring and reminder method based on a smart portable pillbox has been described in detail. This method monitors the user's medication-taking behavior through the cooperation of a gesture sensor and a strain pressure sensor. To further improve the accuracy of the system in judging the actual amount of medication taken by the user and to make the monitoring of drug dosage more precise, this application also provides another medication monitoring and reminder method based on a smart portable pillbox. The following is a combination of... Figure 2Another method for medication monitoring and reminders based on a smart portable pillbox, as described in the embodiments of this application, is as follows: Please see Figure 2 This is another flowchart illustrating a medication monitoring and reminder method based on a smart portable pillbox, as described in this application.
[0051] S201. The microcontroller searches for the standard unit weight of the drug corresponding to the target drug in a preset drug mapping table based on the unique identifier of the target drug. The target drug refers to the specific medication that the user intends to retrieve, determined through gesture sensing and initial weight changes in the preceding steps. A unique identifier is a digital code, string, or electronic tag information that can absolutely distinguish different types of drugs, such as a Universal Product Code (UPC), a specific ID generated internally by the system, or RFID tag data. The preset drug mapping table is a data structure stored in the microcontroller's non-volatile memory. It exists in the form of key-value pairs or a relational database, establishing a logical correspondence between the drug's unique identifier and its attributes. The standard unit weight of the drug refers to the average physical weight of a single tablet of that specific drug under standard manufacturing specifications; this value is typically accurate to the milligram level. The lookup process refers to the operation by which the microcontroller uses a retrieval algorithm to locate specific data in the data structure. This step is fundamental to subsequent precise calculations and aims to obtain the baseline constants required for the calculations. The microcontroller reads the target drug's ID, traverses or indexes the mapping table, and extracts the corresponding unit weight data. If the ID does not exist in the mapping table, the system may trigger exception handling or default settings.
[0052] S202. The microcontroller calculates the ratio of the weight change value to the standard unit weight of the drug to obtain the calculated value; The weight change value refers to the total weight difference collected by the strain pressure sensor before and after a user's medication retrieval operation, after noise reduction processing. It represents the total mass of all objects removed from the pillbox. The standard unit weight of the medication is the reference constant obtained in step S201. The ratio is the quotient of the former divided by the latter. The calculated value is a floating-point number, which theoretically represents the number of pills removed. However, due to sensor noise, vibration interference, or uneven weight distribution of the pills themselves, this value is usually not a perfect integer, but a real number with a decimal part (e.g., 1.05 or 1.92). The arithmetic logic unit (ALU) or floating-point unit (FPU) within the microcontroller is responsible for performing this division operation. This step does not involve rounding or rounding, but preserves the original calculation precision for subsequent steps to perform more complex statistical analysis or matching.
[0053] S203. The microcontroller matches the calculated value with the integer sequence and determines the integer with the smallest difference from the calculated value as the quantity of medicine to be taken in a single transaction. The integer sequence refers to the set of natural numbers (such as 1, 2, 3, 4...), representing the possible number of pills to be taken. The matching process is not a simple rounding, but rather finds the optimal solution by calculating distances. The microcontroller calculates the absolute difference (i.e., distance) between the calculated value obtained in step S202 and each integer in the sequence; the integer with the closest distance is considered the most likely true number of pills taken. The number of pills taken in a single transaction is the final number of pills the user took. This method is more adaptable than simple threshold judgment because it can handle linear errors. For example, if the calculated value is 2.9, its distance from 2 is 0.9, and its distance from 3 is 0.1, therefore it is determined to be 3 pills.
[0054] The matching step can be implemented using either a simplified logic based on least squares or a distance traversal algorithm. The microcontroller sets a maximum possible limit for a single dose (e.g., 10 pills) and generates an array of integers from 1 to 10. The program uses a loop to calculate the absolute value of the difference between the calculated value and each element in the array, maintaining a "minimum distance" variable and a "best matching integer" variable. During the traversal, these two variables are continuously updated until the loop ends, and the final "best matching integer" is the result. Another approach is to use a lookup table based on intervals. The system predefines the floating-point range corresponding to each integer. For example, 0.5 to 1.49 corresponds to integer 1, and 1.5 to 2.49 corresponds to integer 2. The microcontroller takes the calculated value as input and uses a series of comparison instructions (if-else if structures) to determine which interval it falls into, thus directly mapping the corresponding integer.
[0055] S204. Based on the target drug and the corresponding quantity of drug to be dispensed at one time, and combined with the user's current medication task, if it is determined that the user has not completed the medication task, the microcontroller determines the supplementary medication and the corresponding supplementary dosage. The microcontroller compares the amount of medication taken in a single instance obtained in step S203 with the required amount for the current task. If they are equal, the task is marked as completed; if the actual amount taken is less than the required amount, it is determined to be incomplete. The supplementary medication is the drug ID corresponding to the incomplete task. The supplementary dosage is the difference between the required amount and the actual amount taken. This step not only focuses on a single action but may also involve the cumulative processing of multiple medication take-ups within the same time window to ensure that the final judgment is based on the user's total intake during that period.
[0056] One way to implement this step is through event-driven task state machine technology. The system maintains a state variable (e.g., "Pending," "In Progress," "Completed," "Insufficient Dosage") for each medication task. When it receives data on the quantity of medication taken in a single transaction, the microcontroller queries the task corresponding to the current time and updates the "Quantity Taken" counter for that task (Quantity Taken = Quantity Taken + Quantity Taken in Single Transaction). Then, it compares the updated "Quantity Taken" with the "Target Quantity." If the former is less than the latter, the state is set to "Insufficient Dosage," and the difference is calculated as the dosage to be supplemented; if they are equal or greater, it is set to "Completed." Another approach is to use a timed settlement mechanism. The microcontroller does not immediately determine task failure upon each opening of the lid. Instead, at the end of the medication time window (e.g., 30 minutes after the set medication time), it reads all medication records for that medication within that time period, sums them to obtain the total dosage, and then compares it all at once with the task requirement. If the sum is insufficient, a supplementary dosage determination is triggered. This method allows users to take medication multiple times, which is suitable for the actual scenario where elderly people with swallowing difficulties need to take medication in multiple doses.
[0057] S205, the microcontroller sends the supplementary medication and the corresponding dosage to the corresponding smart terminal, and displays the supplementary medication and the corresponding dosage on the display screen.
[0058] Transmission refers to the transmission of structured data packets to external devices via a wireless communication interface. Smart terminals include smartphones, tablets, or cloud server gateways. Display refers to the visual output device that drives the pillbox itself. The information to be supplemented typically includes the drug name (or pillbox number), the specific number of missing pills, and warning labels. The purpose of this step is to create a closed loop, translating the monitoring results from the background into actionable instructions visible to the user, ensuring that the user is aware and can take remedial action. The microcontroller needs to handle the encapsulation of the communication protocol stack and the timing control of the display driver.
[0059] Specifically, the sending and display functions can be implemented in two ways. For sending, data can be reported via a Wi-Fi module using MQTT or HTTP protocols. The microcontroller encapsulates the supplemental medication ID, dosage, and timestamp into a JSON message and publishes it to a specific topic on a cloud server. The app on the smart terminal subscribes to this topic and receives push notifications in real time. For display, GUI rendering technology for OLED screens can be used. The microcontroller runs a lightweight graphics library (such as LVGL) that dynamically generates an image buffer (Frame Buffer) containing text prompts (such as "Please take supplemental medication") and numerical icons based on the dosage data, and refreshes it to the OLED screen via the SPI interface. Another approach is to use a segmented LCD driver combined with Bluetooth pass-through. The microcontroller directly controls the segmented LCD to light up the corresponding "supplemental medication" icon and numerical segment code, while simultaneously sending simple hexadecimal instructions to the mobile phone via Bluetooth Serial Protocol (SPP) or BLE feature value writing. The mobile app parses the instructions and displays a notification in the notification bar.
[0060] In the above embodiments, a preset drug mapping table stores standard unit weight information of drugs, and the actual drug quantity is calculated by combining the weight change value. The system matches the calculated ratio with an integer sequence, selecting the integer with the smallest difference as the single drug quantity. This calculation method takes into account measurement errors that may exist in practical applications. By comparing the actual drug quantity with the medication task, the system can more accurately determine the user's medication completion status, improving the accuracy of medication monitoring. This intelligent calculation method based on actual weight changes improves the accuracy of the system in determining the drug quantity.
[0061] Furthermore, in response to the user's operation of opening the smart portable pillbox, the microcontroller determines the pill compartment to be taken and the dose to be taken based on the current medication task; the microcontroller generates a location diagram containing all the pill compartments; the microcontroller adds the pill compartment to be taken and the dose to be taken to the location diagram and displays it on the display screen.
[0062] The user's action of opening the smart portable pillbox refers to the act of changing the physical state of the pillbox to obtain medication. This is typically detected by a Hall sensor, reed switch, or mechanical microswitch located at the connection between the lid and the body of the pillbox. When a change in the level signal is detected (e.g., from high to low), it is determined as an opening operation. This signal serves as an external trigger source for the microcontroller to wake up from low-power sleep mode or trigger an interrupt service routine. The current medication task refers to a preset medication plan stored in the system database, matching the current real-time clock (RTC) timestamp. This plan includes key information such as the type of medication, the time window for administration, and the dosage. The pill compartment to be retrieved refers to the specific physical compartment in the pillbox's physical array that stores the medication required for the current task. It is usually identified by two-dimensional coordinates (e.g., row X, column Y) or linear indices (e.g., compartment 1, compartment 2). The dosage to be retrieved refers to the number of pills required for the current task. A location map is a graphical user interface (GUI) element built on a pixel matrix of a display screen. It's a virtual mapping of the physical layout of the medicine box, simulating the actual distribution of medicine compartments through the arrangement of geometric shapes (such as rectangles and circles). Adding the medicine compartment to be retrieved and the dosage to the location map involves image compositing or layer overlay processing, where the visual highlighting effect of the target medicine compartment and its numerical characters are superimposed on the corresponding coordinates of the base map. This process transforms physical spatial information into digital visual information. Through the microcontroller's graphics processing logic, abstract database records are transformed into intuitive spatial navigation guidance, ensuring that users can immediately obtain the key information of "what to take" and "how much to take" the moment they open the box.
[0063] To specifically implement the generation of the schematic diagram and the overlay information display in this step, a layer compositing technique based on pre-stored bitmap resources can be used. Multiple image resources are pre-stored in the microcontroller's non-volatile memory (such as SPI Flash), including a "background image" representing the overall outline of the pillbox and all inactive pill compartments, and a "highlighted state image" and "digital bitmaps" (0 to 9) designed separately for each pill compartment position. When the microcontroller determines that the pill compartment to be retrieved is index N and the dosage is M, the display driver first loads the background image into the frame buffer, then looks up the corresponding screen coordinate offset based on index N, writes the "highlighted state image" into the corresponding area of the frame buffer using a logical OR operation, and finally overlays the "digital bitmap" representing the dosage M at the center of the highlighted area. This method has lower requirements for the microcontroller's computational performance and is suitable for resource-constrained embedded systems. Another approach is to use real-time rendering technology based on vector graphics libraries. The microcontroller runs a lightweight embedded graphics library (such as LVGL or uGUI). The system defines an array of structures describing the attributes of each cell, containing geometric parameters such as the center coordinates, width, and height of each cell. During program execution, this array is traversed, and the outlines of all cells are drawn in real-time using the `Draw_Rect` or `Draw_Circle` functions. For cells marked as "pending," the system automatically fills them with a striking color (such as green) during drawing and calls the `Draw_Text` function to render the dosage number within the geometry. This approach offers high flexibility, dynamically adjusting the scale and style of the diagram based on the pillbox configuration, and supporting scaling, animation effects, and adaptive adaptation to different screen resolutions.
[0064] In the above embodiments, a schematic diagram showing the locations of all medication compartments is generated based on the current medication task. The compartments to be retrieved and the dosage to be taken are added to the location diagram for display, allowing the user to intuitively understand the specific location of each compartment and how much medication to retrieve from each compartment. By presenting clear visual information on the display screen, the time spent by the user searching for the target compartment among multiple compartments is reduced, minimizing medication retrieval errors caused by unclear compartment locations. Simultaneously, since the dosage to be taken is directly displayed in the location diagram, the user can accurately grasp the required dosage, reducing the risk of inaccurate dosage. This intelligent medication guidance method improves the accuracy and efficiency of the user's medication retrieval process, enabling users to complete their medication tasks more easily.
[0065] Furthermore, before responding to the user's operation of opening the smart portable medicine box, if it is determined that the user has not completed the current medication task within the preset time, the microcontroller controls the sound and light alarm to operate according to the preset first alarm mode; After the preset first alarm mode ends and no user operation to open the smart portable medicine box is detected, the microcontroller controls the sound and light alarm to operate according to the preset second alarm mode. After the preset second alarm mode ends and no user operation to open the smart portable medicine box is detected, the microcontroller controls the sound and light alarm to operate according to the preset third alarm mode and sends a preset notification message to the smart terminal.
[0066] The microcontroller compares the time data from the real-time clock (RTC) with the preset medication schedule. If it determines that the current time has exceeded the preset medication time and the allowed buffer time window (i.e., the "preset time limit," such as 30 minutes after the scheduled medication time), and the system status flag still indicates that the medication task has not been completed, the microcontroller determines that the user has missed a dose and immediately initiates the alarm process. In this step, the preset first alarm mode is typically defined as the "gentle reminder mode." The microcontroller uses a pulse width modulation (PWM) module to output a low duty cycle control signal to drive a buzzer to emit a low-frequency, intermittent alert sound (such as "beep...beep..."), while simultaneously controlling an LED indicator to flash slowly in a breathing pattern at a low brightness (e.g., flashing once every 2 seconds, in yellow). This mode aims to remind the user to take their medication without disturbing the user or the surrounding environment, and is suitable for scenarios where the user is nearby but has forgotten the time.
[0067] If, after the preset duration (e.g., 5 minutes) of the first alarm mode has elapsed, the microcontroller detects the status of the Hall sensor or mechanical switch and confirms that the medicine box lid remains closed, it determines that the user has not responded to the initial alert. At this point, the microcontroller escalates the alarm level, controlling the audible and visual alarm to operate in the preset second alarm mode. This mode is defined as the "emergency alert mode." The microcontroller adjusts the frequency and duty cycle of the PWM signal to make the buzzer emit a medium-to-high volume, fast-paced alarm sound (e.g., "beep...beep..."), while simultaneously controlling the LED indicator to change color (e.g., switch to orange) and increase the flashing frequency (e.g., flash once every 0.5 seconds). This mode aims to penetrate background noise or alert inattentive users by enhancing the intensity of visual and auditory stimulation.
[0068] If the system still does not detect an open lid signal after the preset duration (e.g., 10 minutes) of the second alarm mode, the microcontroller will enter the highest level of alert state, controlling the audible and visual alarm to operate in the preset third alarm mode and simultaneously triggering a wireless communication task. The third alarm mode is defined as a "powerful alarm mode," where the buzzer emits a continuous or rapid, piercing alarm at maximum volume, and the LED flashes a bright red light. Simultaneously, the microcontroller wakes up the built-in wireless communication module (such as a Bluetooth Low Energy (BLE), Wi-Fi, or NB-IoT module), assembles a data packet containing the device ID, current time, details of the missed medication, and the alarm level, and sends it to the user's smart terminal (such as a mobile app) via a wireless protocol. Upon receiving the data, the smart terminal alerts the user via push notifications, SMS, or vibration. It can even be configured to notify the user's guardian or relatives, enabling remote intervention.
[0069] In the above embodiment, a three-level progressive audible and visual alarm mode is used to remind users to take their medication on time. Switching between different alarm modes increases the intensity of the reminder. When the system detects that the user has not completed the medication task within the specified time, it first activates the first alarm mode to remind the user. If the user still does not respond, it escalates to the second alarm mode. Finally, if the user continues to not respond, the third alarm mode is activated and a notification message is sent to the smart terminal. This progressive reminder mechanism increases the user's attention to the medication reminder and enhances the perceptibility of the reminder effect. By sending a notification message to the smart terminal, the coverage of the reminder information is expanded, increasing the likelihood that the user will complete the medication task on time, thereby reducing the probability of the user missing a dose.
[0070] Furthermore, after the user closes the smart portable pillbox, a preset warning audio signal is emitted via an audio and light alarm, and the light remains on for a preset duration before turning off, providing feedback to the user that the medication administration has been completed. This combined audio and visual feedback enhances the user's perception of completing the medication task, helping them establish a complete medication administration loop through timely audio and visual cues. The continuous on and off of the light provides the user with ample visual feedback time, increasing their confirmation of the medication administration's completion status, reinforcing their memory of the medication administration behavior, and reducing the likelihood of doubts about whether the medication has been taken.
[0071] To further understand the internal structure of the provided smart portable pillbox, the following will be combined with... Figure 3 This application describes a smart portable pillbox. Figure 3This is an anatomical diagram of a smart portable pillbox provided in an embodiment of this application. It includes a portable pillbox lid, a pillbox inner liner, a pillbox tray, a pillbox base, a smart pillbox compartment, and a strain pressure sensor. A microcontroller is integrated into the smart pillbox compartment. The display screen, audible and visual alarm, microcontroller, and gesture sensor are not shown in the diagram. The strain pressure sensor, gesture sensor, display screen, and audible and visual alarm are each connected to the microcontroller, which is connected to a smart terminal via a wireless communication module.
[0072] The intelligent portable pillbox in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 4 This is a schematic diagram of the physical device structure of a smart portable pillbox for medication monitoring and reminder, provided in an embodiment of this application.
[0073] It should be noted that, Figure 4 The structure of the smart portable pillbox shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0074] like Figure 4 As shown, the smart portable pillbox includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 402 or programs loaded from storage section 408 into Random Access Memory (RAM) 403, such as the methods described in the above embodiments. The RAM 403 also stores various programs and data required for the operation of the smart portable pillbox. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An Input / Output (I / O) interface 405 is also connected to the bus 404.
[0075] The following components are connected to I / O interface 405: input section 406 including a camera, infrared sensor, etc.; output section 407 including a liquid crystal display (LCD) and speakers, etc.; storage section 408 including a hard disk, etc.; and communication section 409 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. Communication section 409 performs communication processing via a network such as the Internet. Drive 410 is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 410 as needed so that computer programs read from it can be installed into storage section 408 as needed.
[0076] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs the various functions defined in the present invention.
[0077] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor smart portable pillbox, device, or apparatus, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. The transmitted data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of smart portable pillboxes, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based smart portable pillbox that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0079] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the smart portable pillbox described in the above embodiments; or it may exist independently and not assembled into the smart portable pillbox. The storage medium carries one or more computer programs that, when executed by a processor of a smart portable pillbox, cause the smart portable pillbox to implement the methods provided in the above embodiments.
[0080] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0081] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0082] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0083] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for medication monitoring and reminders based on a smart portable pillbox, characterized in that, include: In response to the user's operation of opening the smart portable pillbox, the microcontroller monitors the operating data of all gesture sensors. All gesture sensors are installed in several pill compartments inside the smart portable pillbox. A strain pressure sensor is installed under the inner liner of the pillbox composed of several pill compartments. The microcontroller determines the target compartment for the user to retrieve the medication based on the operational data. The microcontroller determines the target drug that the user takes based on the target drug compartment; In response to the user's action of closing the smart portable medicine box, the microcontroller determines the gravity difference data collected by the strain pressure sensor; If, based on the target drug and the gravity difference data, and in conjunction with the user's current medication task, it is determined that the user has not completed the current medication task, the microcontroller determines the supplementary medication and the corresponding supplementary dosage. The microcontroller sends the supplementary medication and the corresponding dosage to the corresponding smart terminal, and displays the supplementary medication and the corresponding dosage on the display screen.
2. The method according to claim 1, characterized in that, The microcontroller determines the target medicine compartment for the user to retrieve the medication based on the operational data, specifically including: When any of the gesture sensors outputs a drug-taking gesture sensing signal, the microcontroller marks the drug compartment with the gesture sensor installed as a candidate drug compartment and records the start time of the drug-taking gesture sensing signal. The microcontroller acquires the first weight data of the strain pressure sensor at the start time, and the second weight data at the end of a preset determination period after the start time. The microcontroller calculates the difference between the first weight data and the second weight data to obtain the weight change value; If the weight change value is greater than a preset effective drug dispensing threshold, the microcontroller determines that the candidate drug cell is the target drug cell; If the weight change value is less than or equal to the effective drug retrieval threshold, the microcontroller removes the label from the candidate drug compartment and determines that no drug retrieval has occurred.
3. The method according to claim 1 or 2, characterized in that, After the microcontroller determines the target drug taken by the user based on the target drug compartment, the method further includes: The microcontroller searches for the standard unit weight of the drug corresponding to the target drug in a preset drug mapping table based on the unique identifier of the target drug. The microcontroller calculates the ratio of the weight change value to the standard unit weight of the drug to obtain the calculated value; The microcontroller matches the calculated value with an integer sequence and determines the integer with the smallest difference from the calculated value as the quantity of medicine to be dispensed in a single transaction. If, based on the target drug and the corresponding single dispensing quantity, and in conjunction with the user's current medication task, it is determined that the user has not completed the medication task, the microcontroller determines the supplementary medication and the corresponding supplementary dosage. The microcontroller sends the supplementary medication and the corresponding dosage to the corresponding smart terminal, and displays the supplementary medication and the corresponding dosage on the display screen.
4. The method according to claim 1, characterized in that, When, based on the target drug and the gravity difference data, and in conjunction with the user's current medication task, it is determined that the user has not completed the current medication task, the microcontroller determines the supplementary medication and the corresponding dosage to be supplemented, specifically including: The microcontroller parses the current medication task and determines the amount of medication to be taken for each of the target drugs. For each target drug, the microcontroller determines the standard unit weight of the target drug based on the unique identifier of the target drug; The microcontroller determines the independent weight change value corresponding to the target drug compartment where the target drug is located from the gravity difference data; The microcontroller calculates the ratio of the independent weight change value to the standard unit weight of the drug, and rounds the ratio to obtain the actual quantity of the target drug taken. If the actual amount of medication taken is less than the amount of medication to be taken, the microcontroller determines that the user has not completed the current medication task; The microcontroller calculates the difference between the required dosage and the actual dosage taken as the supplementary dose, and marks the target drug as a supplementary medication.
5. The method according to claim 1, characterized in that, After responding to the user's action of opening the smart portable pillbox, the method further includes: The microcontroller determines the medication compartment and the dosage to be dispensed based on the current medication task. The microcontroller generates a location diagram containing all the drug compartments; The microcontroller adds the drug compartment to be dispensed and the dosage to be dispensed to the location diagram and displays it on the display screen.
6. The method according to claim 1, characterized in that, Prior to the user opening the smart portable pillbox, the method further includes: If it is determined that the user has not completed the current medication task within a preset time, the microcontroller controls the audible and visual alarm to operate according to the preset first alarm mode; If no user is detected opening the smart portable medicine box after the preset first alarm mode has ended, the microcontroller controls the sound and light alarm to operate according to the preset second alarm mode. If no user is detected opening the smart portable medicine box after the preset second alarm mode has ended, the microcontroller controls the audible and visual alarm to operate in the preset third alarm mode and sends a preset notification message to the smart terminal.
7. The method according to claim 1 or 6, characterized in that, After responding to the user's action of closing the smart portable pillbox, the method further includes: The microcontroller controls the audible and visual alarm to emit a preset warning audio, and controls the light to flash at different frequencies and remain on for a preset duration before turning off.
8. A smart portable pillbox, characterized in that, The smart portable pillbox includes: One or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the smart portable pillbox to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the smart portable pillbox, the smart portable pillbox performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on the smart portable pillbox, the smart portable pillbox performs the method as described in any one of claims 1-7.