Intelligent medicine taking reminding method for old people and intelligent medicine box

By obtaining the initial characteristics of the elderly during the medication process, constructing a state vector and adopting a two-level behavior indexing mechanism, the optimal reminder path is dynamically generated, which solves the adaptability problem of the existing intelligent medication reminder system, realizes efficient and personalized medication reminders, and reduces the risk of missed and wrong medications.

CN120732701AActive Publication Date: 2025-10-03ANHUI LEADER TECHNOLOGY INNOVATION DEVELOPMENT CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202511234026.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-01
Publication Date
2025-10-03
Estimated Expiration
2045-09-01

Smart Images

  • Figure CN120732701A_ABST
    Figure CN120732701A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of intelligent medical treatment, and particularly relates to an intelligent medicine taking reminding method for old people and an intelligent medicine box, and the method comprises the steps: obtaining an initial motion feature, an initial interaction feature and initial environment information, and constructing an initial state vector based on the initial motion feature, the initial interaction feature and the initial environment information; performing hash value calculation on the initial state vector, determining a state code, and performing first-level behavior indexing on the state code to obtain a behavior chain identification set; performing secondary behavior indexing on the behavior chain identification set to obtain a behavior chain candidate set; and dynamically generating an optimal reminding path based on the behavior chain candidate set, and reminding the old to take medicine in real time based on the optimal reminding path. According to the method, intelligent, personalized and dynamically optimized medication reminding based on the real-time state of the old can be realized, and medication compliance and safety are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of intelligent medical technology, and in particular relates to an intelligent medication reminder method and an intelligent medicine box for the elderly. Background Art

[0002] With the accelerated aging of my country's population, the prevalence of multiple illnesses and long-term medication use among the elderly is increasing, significantly increasing the complexity of medication management. However, due to memory loss, decreased cognitive function, or a lack of health awareness, the elderly often miss doses, take duplicate medications, or even take medication incorrectly, increasing medication risks and medical burdens. Traditional methods that rely on manual reminders or paper records are unable to meet actual needs. Therefore, intelligent medication reminder systems based on the Internet of Things, mobile Internet, and artificial intelligence technologies have emerged. These systems use wearable devices, smart pill boxes, mobile applications, or voice assistants, combined with big data analysis and personalized management, to implement medication plan development, medication reminders, abnormal warnings, and data sharing, thereby helping the elderly improve medication compliance, reduce medication risks, and enhance their quality of life.

[0003] Existing smart medication reminders mostly use fixed audio or simple visual prompts, lacking the ability to personalize reminders based on different user characteristics. Elderly individuals exhibit significant differences in physical function, such as unsteady hand movements, slow movements, or decreased visual and auditory function. Existing systems typically provide reminders at a uniform interval and intensity, failing to dynamically adapt to the individual's actual operating ability and reaction speed. This results in suboptimal reminders and can even lead to missed or duplicated doses.

[0004] To sum up, in the process of intelligently reminding the elderly to take medicine, there is a problem of poor reminder effect due to the single reminder method and lack of adaptability. Summary of the Invention

[0005] The embodiments of the present application provide an intelligent medication reminder method and an intelligent medicine box for the elderly, which can solve the problem in the related art that in the process of intelligently reminding the elderly to take medicine, the reminder effect is poor due to the single reminder method and lack of adaptability.

[0006] In a first aspect, the embodiments of the present application provide a smart medication reminder method for the elderly, comprising: Acquiring initial motion features, initial interaction features, and initial environmental information, and constructing an initial state vector based on the initial motion features, the initial interaction features, and the initial environmental information; wherein the initial motion features are used to characterize the tremor index of the elderly person's hand, the initial interaction features are used to characterize the distance between the elderly person's hand and the medicine box, and the initial environmental information includes initial ambient light intensity and initial ambient noise decibels; Performing a hash value calculation on the initial state vector to determine a state code, and performing a first-level behavior index on the state code to obtain a behavior chain identifier set; wherein the first-level behavior index is obtained by searching a first-level behavior index table for a behavior chain identifier corresponding to the state code; Performing secondary behavior indexing on the behavior chain identifier set to obtain a behavior chain candidate set; wherein the secondary behavior indexing is performed by searching a secondary behavior index table for a behavior chain corresponding to the behavior chain identifier, wherein the behavior chain is a series of reminders for guiding the elderly to take medication, and the behavior chain includes a series of behavior nodes for medication reminders, a preset duration for completing the action corresponding to each behavior node, and prompt parameters; Based on the behavior chain candidate set, an optimal reminder path is dynamically generated, and based on the optimal reminder path, medication reminders are given to the elderly in real time.

[0007] The above technical solutions in the embodiments of the present application have at least the following technical effects: The intelligent medication reminder method for the elderly provided in this application first obtains the initial motion features (used to characterize the tremor index of the elderly's hands), the initial interaction features (used to characterize the distance between the elderly's hands and the medicine box) and the initial environmental information (initial ambient light intensity and initial ambient noise decibels), and constructs an initial state vector based on the initial motion features, initial interaction features and initial environmental information. Then, the initial state vector is hashed to determine the state code, and the state code is indexed by the first level behavior (the behavior chain identifier corresponding to the state code is searched through the first level behavior index table) to obtain a behavior chain identifier set. The behavior chain identifier set is then indexed by the second level behavior (the behavior chain corresponding to the behavior chain identifier is searched through the second level behavior index table) to obtain a behavior chain candidate set (the behavior chain is a series of reminders to guide the elderly to take medicine. The behavior chain includes a series of behavior nodes for medication reminders, the preset time for completing the action corresponding to each behavior node, and the prompt parameters). Finally, based on the behavior chain candidate set, the optimal reminder path is dynamically generated, and based on the optimal reminder path, the elderly are reminded to take medicine in real time. This method adopts a two-level behavior indexing mechanism, which can greatly reduce the computational overhead of state matching and behavior chain retrieval, and improve the system response speed. This method can accurately find the corresponding complete medication reminder link through a two-level behavior indexing mechanism, improve retrieval speed and accuracy, dynamically generate the optimal path based on the candidate behavior chain, and adjust the reminder method in time according to real-time status changes, thereby reducing invalid or disruptive prompts. During the medication process, this method can update the reminder path in real time according to the environment and the elderly's status to achieve continuous adaptation, rather than a fixed and rigid reminder mode. It can improve the elderly's medication compliance in different environments and different physical conditions, and reduce the risk of missed or wrong medication. This method can realize intelligent, personalized, and dynamically optimized medication reminders based on the real-time status of the elderly, improve medication compliance and safety, facilitate the reminder strategy to be efficiently adapted in a variety of environments and physical conditions, reduce cognitive burden and interference, and has the advantages of low latency and high scalability of system operation.

[0008] In a second aspect, an embodiment of the present application provides a smart medication reminder device for the elderly, comprising: an acquisition unit, which acquires initial motion features, initial interaction features, and initial environmental information, and constructs an initial state vector based on the initial motion features, the initial interaction features, and the initial environmental information; wherein the initial motion features are used to characterize the tremor index of the elderly person's hand, the initial interaction features are used to characterize the distance between the elderly person's hand and the medicine box, and the initial environmental information includes initial ambient light intensity and initial ambient noise decibels; A primary behavior indexing unit is configured to perform a hash value calculation on the initial state vector to determine a state code, and perform a primary behavior index on the state code to obtain a behavior chain identifier set; wherein the primary behavior index is performed by searching a primary behavior index table for a behavior chain identifier corresponding to the state code; a secondary behavior indexing unit, configured to perform secondary behavior indexing on the behavior chain identifier set to obtain a behavior chain candidate set; wherein the secondary behavior indexing is performed by searching a behavior chain corresponding to the behavior chain identifier through a secondary behavior index table, wherein the behavior chain is a series of reminders for guiding the elderly to take medication, and the behavior chain includes a series of behavior nodes for medication reminders, a preset duration for completing the action corresponding to each behavior node, and prompt parameters; The medication reminder unit is used to dynamically generate an optimal reminder path based on the behavior chain candidate set, and to provide medication reminders to the elderly in real time based on the optimal reminder path.

[0009] In a third aspect, an embodiment of the present application provides a smart medicine box, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the embodiments of the first aspect is implemented.

[0010] It can be understood that the beneficial effects of the second to third aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Figure 1 This is a flowchart of an intelligent medication reminder method for the elderly provided in one embodiment of the present application; Figure 2 This is an example diagram of a secondary behavior index table in the smart medication reminder method for the elderly provided in an embodiment of the present application; Figure 3 This is an example diagram of the first-level behavior index table of the smart medication reminder method for the elderly provided in an embodiment of the present application; Figure 4 It is a structural diagram of the smart medicine box provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0014] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0015] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0016] In related technologies, most smart medication reminders use fixed audio or simple visual prompts, lacking the ability to personalize reminders based on different user characteristics. Elderly individuals exhibit significant differences in physical function, such as unsteady hand movements, slow movements, or decreased visual and auditory function. Existing systems typically provide reminders at a uniform interval and intensity, failing to dynamically adapt to the individual's actual operating ability and reaction speed. This results in suboptimal reminders and can even lead to missed or duplicated doses.

[0017] After issuing a reminder signal, existing reminder mechanisms do not further track whether the user has taken or retrieved their medication. If an elderly person fails to take their medication after the initial reminder, the system will repeat the same reminder pattern, lacking multi-stage management and optimization based on user behavior feedback. This not only reduces the effectiveness of reminders but also may increase the psychological burden on the elderly, reducing their reliance on and motivation to use smart reminder devices.

[0018] During medication reminders, the collection of behavioral information about the elderly is limited, making it impossible to obtain key status information that directly impacts the reminder outcome. For example, it's impossible to identify the physical movements of the elderly when taking medication, nor accurately determine their operational relationship to the medication storage location. Furthermore, there's a lack of awareness of external factors like ambient light and noise. This lack of information leads to a lack of accurate assessment of the elderly's true state during reminders, making it difficult to implement more effective reminder strategies.

[0019] To address the aforementioned issues, embodiments of the present application provide a smart medication reminder method and smart medicine box for the elderly. This method first obtains initial motion features (used to characterize the tremor index of the elderly's hand), initial interaction features (used to characterize the distance between the elderly's hand and the medicine box), and initial environmental information (initial ambient light intensity and initial ambient noise decibels). Based on the initial motion features, initial interaction features, and initial environmental information, an initial state vector is constructed. A hash value is then calculated on the initial state vector to determine a state code. The state code is then indexed by a primary behavior (using a primary behavior index table to search for a behavior chain identifier corresponding to the state code) to obtain a set of behavior chain identifiers. The behavior chain identifier set is then indexed by a secondary behavior (using a secondary behavior index table to search for a behavior chain corresponding to the behavior chain identifier) ​​to obtain a set of candidate behavior chains (a behavior chain is a series of reminders guiding the elderly to take medication, comprising a series of medication reminder behavior nodes, a preset duration for completing the action corresponding to each behavior node, and reminder parameters). Finally, based on the candidate behavior chain set, an optimal reminder path is dynamically generated. Based on this optimal reminder path, medication reminders are provided to the elderly in real time. This method utilizes a two-level behavior indexing mechanism, significantly reducing the computational overhead of state matching and behavior chain retrieval, improving system responsiveness. The index table is extensible, facilitating the subsequent addition of new state features or reminder strategies, enabling long-term system iteration. This two-level behavior indexing mechanism accurately locates the corresponding complete medication reminder chain, improving retrieval speed and accuracy. Dynamically generating the optimal path based on candidate behavior chains, the method allows for timely adjustment of reminder patterns based on real-time state changes, thereby reducing ineffective or disruptive reminders. During medication use, the method updates the reminder path in real time based on the environment and the patient's state, achieving continuous adaptation rather than a fixed, rigid reminder model. This approach improves medication adherence in diverse environments and physical states, reducing the risk of missed or incorrect doses. This method enables intelligent, personalized, and dynamically optimized medication reminders based on the patient's real-time state, improving medication adherence and safety. It also ensures that reminder strategies adapt efficiently across diverse environments and physical states, reducing cognitive burden and distractions. It also offers the advantages of low-latency and highly scalable system operation.

[0020] The smart medication reminder method for the elderly provided in the embodiment of the present application can be applied to a smart medicine box. In this case, the smart medicine box is the executor of the smart medication reminder method for the elderly provided in the embodiment of the present application. The embodiment of the present application does not impose any restrictions on the specific type of the smart medicine box.

[0021] For example, see Figure 4The smart medicine box may include a data acquisition device, a reminder device, and a control device that is communicatively connected to the data acquisition device and the reminder device. The data acquisition device may include a tremor index acquisition device, a distance acquisition device, an ambient light acquisition device, and a noise acquisition device. The tremor index acquisition device is a device that can wirelessly connect to a wristband to obtain hand motion data and calculate the hand tremor index based on the hand motion data. The built-in inertial sensor (IMU) in the wristband can collect the hand motion data of the elderly and transmit the hand motion data to the tremor index acquisition device via wireless communication methods (such as Bluetooth, Zigbee, WiFi).

[0022] The distance acquisition device is a device that can detect the distance between the hand and the smart medicine box. It can use ultra-wideband (UWB) technology. A UWB radio frequency transceiver module (such as a UWB chip that supports IEEE 802.15.4z), antenna, and microcontroller (MCU) are installed inside the wearable bracelet as a Tag (mobile end). The same model or compatible UWB transceiver module, antenna, and microcontroller are installed in the distance acquisition device as an Anchor (base station end). The wearable bracelet sends UWB pulses to the distance acquisition device. After receiving the pulses, the distance acquisition device sends the UWB pulses to the wearable bracelet. After receiving the pulses, the wearable bracelet sends the UWB pulses to the distance acquisition device again. The distance acquisition device calculates the distance between the hand and the smart medicine box based on the round-trip time of the pulses.

[0023] The ambient light collection device is a device that can collect the intensity of visible light in the environment and can be an ambient light sensor (such as a light-dependent resistor (LDR), a photodiode (photodiode), or an IC-type ambient light sensor). The noise collection device is a device that can collect the level of noise in the environment and can be a noise sensor (such as a capacitive noise sensor, a piezoelectric noise sensor, or a resistive noise sensor).

[0024] The reminder device is a device that can provide real-time reminders to the elderly during the medication process. It can include a voice reminder module (such as a speaker / loudspeaker and a voice chip), a light reminder module (such as an LED light (single or multi-color)), a vibration reminder module (such as a micro vibration motor, which can be installed at the bottom of the medicine box or worn on a bracelet), and a display reminder module (such as an OLED / LCD display screen, which can display reminder information).

[0025] The control device is a device that can control the data acquisition device and the reminder device and perform data processing. It may include a main control module (such as ESP32 (series), Raspberry Pi Zero, STM32F4 / F7 series, Arduino Nano 33 BLESense), a data acquisition device control module (such as an I2C / SPI controller for controlling the ambient light sensor and noise sensor, and a GPIO / ADC interface for controlling the distance acquisition device), a reminder device control module (such as a DAC and amplifier for controlling the voice reminder module, a GPIO interface for controlling the light reminder module, a motor drive unit (such as L298N, MOS tube, etc.) for controlling the vibration reminder module, and an I2C / SPI controller for controlling the display reminder module).

[0026] Optionally, the smart medicine box may further include a power module, which may be a rechargeable battery (e.g., a lithium-ion battery, a lithium-polymer battery) or a USB direct power supply (powered via a USB port (Micro-USB / Type-C)). The power module is connected to the control device, and the output of the power module directly supplies power to the control device via a power management chip (PMIC).

[0027] In order to better understand the smart medication reminder method for the elderly provided in the embodiment of the present application, the specific implementation process of the smart medication reminder method for the elderly provided in the embodiment of the present application is exemplarily introduced below.

[0028] Figure 1 The following is a schematic flow chart of a smart medication reminder method for the elderly provided in an embodiment of the present application. The smart medication reminder method for the elderly includes: S100: Acquire initial motion features, initial interaction features, and initial environmental information, and construct an initial state vector based on the initial motion features, initial interaction features, and initial environmental information. The initial motion features are used to characterize the tremor index of the elderly person's hand, the initial interaction features are used to characterize the distance between the elderly person's hand and the medicine box, and the initial environmental information includes initial ambient light intensity and initial ambient noise decibels.

[0029] It can be understood that the initial movement characteristics are used to reflect the stability of the elderly's hand movements. The core indicator is the tremor index, which is a quantitative indicator of the degree of hand shaking. The higher the tremor index, the greater the degree of hand instability, which may affect the smooth progress of medication operations.

[0030] The initial interaction feature is used to describe the spatial relationship between the elderly person's hand and the smart medicine box, that is, the distance between the hand and the smart medicine box. This distance can reflect whether the user has approached the medicine box, thereby determining whether to enter the preparation stage for medication.

[0031] The initial ambient light intensity is the light intensity in the surrounding environment, which can be used to determine whether the current environment is too dark or too bright, thereby providing a basis for selecting a reminder method (such as visual prompt brightness adjustment).

[0032] The initial ambient noise decibel level indicates the background noise level in the surrounding environment and can be used to determine the effectiveness of using voice reminders in the current environment. Excessive noise may prevent voice prompts from being clearly heard.

[0033] For example, a wristband with a built-in inertial measurement unit (IMU) can be used to measure the acceleration of an elderly person's hand over a short period of time. This detected acceleration data is then transmitted via wireless communication (e.g., Bluetooth, WiFi, etc.) to a tremor index acquisition device in a smart medicine box for calculation of the tremor index (initial motion characteristics). The amplitude of the acceleration data can be calculated based on its three-axis components (x, y, and z). A fast Fourier transform (FFT) of the amplitude within a time window (e.g., 2s to 5s) is performed to obtain a spectrum. This spectrum can then be integrated over a total frequency range (e.g., 0.5Hz to 20Hz) to obtain the total energy. Medical research indicates that hand tremors are primarily concentrated in the 4-12Hz range (physiological / pathological tremors). Therefore, this frequency range can be used as the tremor frequency range. The spectrum can be integrated over this range to obtain the tremor energy. The ratio of the tremor energy to the total energy is then calculated as the tremor index.

[0034] The distance acquisition device can be used to detect whether a hand is close to the medicine box and calculate the actual distance between the hand and the medicine box (initial interaction feature) in real time.

[0035] The ambient light sensor can be used to collect the brightness value of the surrounding environment to obtain the initial ambient light intensity; the noise sensor can be used to collect the background noise intensity of the surrounding environment to obtain the initial ambient noise decibel.

[0036] The initial motion features, initial interaction features, initial ambient light intensity and initial ambient noise decibels can be normalized and concatenated into the initial state vector, i.e. ,in, Represents the initial motion characteristics, represents the initial interaction features, Indicates the initial ambient light intensity, Indicates the initial ambient noise level in decibels.

[0037] This step can provide accurate and comprehensive basic data for subsequent status analysis and reminder strategy optimization, thereby achieving targeted adaptive adjustments during the reminder process.

[0038] S200: Calculate the hash value of the initial state vector to determine the state code, and perform a first-level behavior index on the state code to obtain a behavior chain identifier set. The first-level behavior index is to search the first-level behavior index table for the behavior chain identifier corresponding to the state code.

[0039] For example, based on business needs and feature sensitivity, a bucket width or threshold interval (bucketing rule) can be predefined for each component (initial motion feature, initial interaction feature, initial ambient light intensity, and initial ambient noise decibel). For example, initial motion features can be bucketed by medical grade: 0.0-0.2 is bucket 1 (no noticeable tremor), 0.2-0.6 is bucket 2 (mild tremor), and 0.6 and above is bucket 3 (severe tremor). Initial interaction features can be bucketed by the effective range of the elderly person's medication-taking action: 0-20 cm is bucket 1 (touched the medicine box), 20-50 cm is bucket 2 (within reach), and 50-100 cm is bucket 3 (requires one step of movement). Initial ambient light intensity can be bucketed based on visual recognition and reading requirements: <300 Lux is bucket 1 (very dim light), 300-700 Lux is bucket 2 (moderate light), and >700 Lux is bucket 3 (bright light). Initial ambient noise decibels can be bucketed based on speech intelligibility: <50 dB is bucket 1 (relatively quiet), 50-80 dB is bucket 2 (normal environment), and >80 dB is bucket 3 (very noisy).

[0040] According to the bucketing rule, each component in the initial state vector can be mapped to the corresponding bucket number to form the state label vector after bucketing For example, if the initial state vector is F=[0.25, 45cm, 250lux, 55dB], then the bucketing result of the initial state vector is K=[2, 2, 2, 2].

[0041] Bucketing can be used to improve noise resistance, where small fluctuations in values ​​will not cause changes in bucket numbers, thus avoiding frequent switching of reminder strategies. It can also simplify the index table size, compressing the state of continuous infinite values ​​into a finite number of bucket combinations, reducing the size of the first-level behavior index table. It also provides controllable accuracy, which can be achieved by adjusting the bucket width to strike a balance between accuracy and system response stability.

[0042] You can choose a stable, fast, and low-collision non-encrypted hash function (such as XXH3, MurmurHash3), or a cryptographic hash function (such as SHA-256) when security is required. Based on the hash function, you can calculate the hash value of each component in the bucket result K, and combine the hash values ​​to form a hash key, which is the state encoding. ,in, Indicates the status code, The hash value representing the initial motion feature, A hash value representing the initial interaction feature, A hash value representing the initial ambient light intensity, A hash value representing the initial ambient noise level in decibels.

[0043] The structure of the first-level behavior index table is state code The correspondence between the state code SC and the behavior chain identifier ChainID. The state code SC can be used to search in the primary behavior index table. If a hit is found, the corresponding behavior chain identifier set is returned. If a hit is not found, it can be downgraded to subkey matching (such as ignoring noise components or merging adjacent buckets), or searching for the nearest neighbor code by similarity (such as Hamming distance or edit distance) to ensure that the candidate set can be returned even in edge states. If a hit is still not found, the default behavior chain identifier can be returned (such as the backup path of general voice and high-contrast visual cues).

[0044] This step efficiently maps multi-dimensional continuous state features into compact and unique state codes by bucketing the initial state vector and calculating the hash value. It then uses the first-level behavior index table to quickly match states to behavior chain identifiers, thereby achieving low-latency, low storage overhead, noise-resistant and scalable state retrieval in massive state space, providing high-quality candidate input for subsequent second-level behavior index screening and optimal reminder path generation.

[0045] S300: Perform secondary behavior indexing on the behavior chain identifier set to obtain a candidate behavior chain set. The secondary behavior indexing involves searching a secondary behavior index table for a behavior chain corresponding to the behavior chain identifier. The behavior chain is a series of reminders guiding the elderly to take medication. The behavior chain includes a series of medication reminder behavior nodes, a preset duration for completing the action corresponding to each behavior node, and reminder parameters.

[0046] It can be understood that the structure of the secondary behavior index table is the correspondence between the behavior chain identifier ChainID and the behavior chain. The behavior chain can include a sequence of behavior nodes, each of which corresponds to a medication reminder operation (reminder method and reminder action). The behavior nodes are arranged in execution order to form a complete reminder process (e.g., voice prompt to approach the medicine box → voice prompt to open the medicine box → voice prompt to take the medicine → voice prompt to take the medicine and confirm swallowing). The preset duration for completing the action corresponding to each behavior node is the time the system waits for the elderly person to complete the corresponding action at that behavior node, such as the preset time for taking the medicine is 5 seconds and the preset time for taking the medicine is 10 seconds. The preset duration can be adjusted based on the results of the elderly person's operation speed assessment. The reminder parameters are the intensity of the reminder method, such as voice volume, light color and frequency, screen text size, etc.

[0047] The secondary behavior index table can be traversed to search for the behavior chain corresponding to each ChainID in the behavior chain identification set in the secondary behavior index table, and all matched behavior chains can be combined to form a behavior chain candidate set.

[0048] This step allows the abstract chain identifier to be mapped into a directly executable, multi-modal, multi-node complete medication reminder solution within milliseconds, ensuring retrieval efficiency while making the policy content flexible and scalable, providing a foundation for subsequent dynamic optimization and personalized adaptation.

[0049] Understandably, in resource-constrained embedded medication reminder devices (smart pill boxes), reminder policy generation must meet low latency, high reliability, and pass safety certification for medical scenarios. While dynamic reminder policy generation directly on the device through deep learning and other methods offers some flexibility under ideal conditions, it faces three practical challenges: First, the computational and response delays cannot meet real-time requirements. When generating a complete medication behavior chain, the deep learning model needs to perform multi-layer feature extraction and sequence planning on the input state vector. Even after lightweighting and trimming, the inference process still takes hundreds of milliseconds on low-power MCUs such as the Cortex-M series, and consumes a lot of computing power and electricity. This not only delays the issuance of reminders, but also affects battery life, making it difficult to meet the power consumption requirements of maintenance-free operation for more than one year. In contrast, the two-level behavior indexing mechanism advances the generation and verification of the behavior chain to the offline stage. The device side only needs to look up the table based on the state code to obtain the corresponding behavior chain. The entire process takes only 0.5-2ms, significantly reducing computing overhead and power consumption.

[0050] Secondly, medical certification and explainability requirements dictate that we cannot rely solely on black-box generation. In healthcare and elderly care scenarios, reminder strategies must undergo clinical expert review, simulation testing, and failure mode analysis (FMEA) to ensure that no errors or potential risk alerts are triggered under any circumstances. The behavior chain output by the dynamically generated model at runtime is determined by internal weights and nonlinear calculations. This lacks explainability and predictability, making it impossible to complete medical safety verification at the moment of generation and, therefore, difficult to obtain certification. Under the two-level behavior indexing mechanism, each stored behavior chain is a white-box rule chain that has been verified offline. The chain content and execution logic are fully traceable, which can directly meet the requirements of medical safety supervision.

[0051] Furthermore, the cost and coverage of behavioral data acquisition limit the feasibility of dynamic generation. Deep learning generation solutions rely on tens of thousands of labeled elderly medication behavior data for training, covering different tremor levels, interaction habits, and environmental conditions. However, the acquisition of real-world behavioral data for the elderly is subject to ethical and privacy protection constraints, and the collection cycle is long and costly, making it difficult to generate sufficient training samples. A two-level indexing solution, on the other hand, only needs to collect a limited number of typical medication trajectories. Through state bucketing and index mapping, it can cover most scenarios. When encountering a very small number of unmatched states, it can also downgrade through a secure default link and update the index library after subsequent offline verification.

[0052] For these reasons, a two-level behavior indexing mechanism achieves the balance of low latency (millisecond-level table lookup), high interpretability (auditable links), and low data requirements (a small number of typical trajectories) on embedded devices, while also meeting hardware cost and power constraints. This two-level behavior indexing mechanism effectively circumvents the real-time, authentication, and data scarcity bottlenecks faced by dynamic generation solutions in medical scenarios, ensuring the system remains stable, efficient, and secure over the long term.

[0053] In one possible implementation, a secondary behavior index table is constructed, including: S101: Obtain a historical medication dataset, wherein the historical medication dataset includes a large amount of action path data, historical action duration, and historical state vectors of the elderly's medication process.

[0054] It can be understood that action path data describes the sequence of actions an elderly person takes to complete a medication, such as approaching a medicine box → opening it → taking the medicine → taking the medicine → swallowing it. Each action can include the action type (e.g., taking or taking the medicine), the timestamp of the action, the movement trajectory of the action, and a flag indicating whether the action is completed or not. The historical action duration is the time it takes the elderly person to complete each action, and the historical state vector is the state of each action node during execution. This can include motion characteristics, interaction characteristics, ambient light intensity, and ambient noise decibels.

[0055] For example, devices such as accelerometers, gyroscopes, or wristbands can be used to capture the intensity, trajectory, duration, and frequency of hand tremors. Cameras or infrared sensors can be used to monitor changes in the distance between the hand and the medicine box, as well as whether the elderly person takes medication as directed, such as whether the box is opened or the medication is removed correctly, and the timing and sequence of these actions. Smart medicine boxes equipped with RFID or Bluetooth technology can detect whether the elderly person successfully opens the box or removes medication, thereby capturing the movement path.

[0056] The motion characteristics are obtained by wearing a bracelet and a tremor index collection device, the interaction characteristics are collected by a distance collection device, the ambient light intensity of the elderly during medication is collected by an ambient light collection device, and the ambient noise decibels during medication are collected by a noise collection device.

[0057] After data collection, it can be transmitted in real time to the cloud or local servers for further processing and storage. Wireless communication technologies such as WiFi, Bluetooth, or Internet of Things (IoT) can be used to ensure the real-time and reliability of data.

[0058] Based on a unified clock reference, data from different devices can be time-aligned, deleting records with anomalies or severe omissions and filling in data with minor frame drops. Based on sensor trigger logic and timing rules, action events are automatically annotated, and action sequences are segmented using rules or models to form complete medication application paths. The motion features, interaction features, ambient light intensity, and ambient noise decibels at each action node's corresponding time point are concatenated into a state vector. This state vector is normalized (e.g., min-max normalization) to unify the numerical dimensions for ease of subsequent calculations. Each complete medication application process can be recorded as a triple structure consisting of an action sequence, a duration sequence, and a state sequence for subsequent analysis. For example, medication application time: 2025-07-01, action sequence: [approach, take medication, ...], duration sequence: [0s, 4.5s, ...], state sequence: [[Ti, D, L, N], ...]. Data can be stored in structured databases (such as PostgreSQL) or serialized storage formats (such as Parquet).

[0059] This step builds the foundational data resources for subsequent behavior chain modeling and reminder strategy optimization through multi-source sensing, unified data collection, structured modeling, and quality assurance. This historical medication dataset not only comprehensively reflects the elderly's medication behavior in real-world scenarios but also provides solid support for the system's personalized, dynamic, and highly reliable reminder mechanism.

[0060] S201: Perform action thinning on the historical medication dataset to obtain a collection of action chains.

[0061] An action chain is a series of actions that an elderly person goes through to complete a medication task. For example, it might include taking medication from a box, putting it into their mouth, and drinking water. The purpose of action thinning is to reduce redundant operation information and consolidate or simplify common repetitive actions, making subsequent action chain construction more efficient.

[0062] For example, feature extraction methods, such as acceleration, angular velocity, and position changes, can be used to identify specific actions performed by the elderly. For example, opening a medicine box may involve a certain rotation angle and force variation, while taking medicine involves an upward or forward movement of the hand. The extracted action features are classified and mapped to specific actions based on predefined labels (such as taking medicine or drinking water). Each action is manually or automatically annotated. This annotation process converts raw data into structured action information, facilitating subsequent analysis.

[0063] Based on the labeled data, we can extract each individual action during the elderly person's medication process. Each action has its own specific time, duration, and sequence. Based on the extracted individual actions, a complete action chain can be formed. During the extraction process, some repeated actions or operations may appear, such as redundant operations such as re-opening the lid or re-taking the medicine. By setting a threshold, we can remove repeated and irrelevant actions. For example, if the time interval between two medication-taking actions is less than a certain threshold, they can be merged into a single action.

[0064] To reduce data redundancy, similar action chains can be deduplicated. Clustering algorithms (such as K-means) or time series-based similarity calculations (such as Dynamic Time Warping (DTW)) can be used to identify similar action chains and group them together.

[0065] The action chains after completing the above operations are summarized into an action chain collection. The action chain collection includes different types of action chains, which describe the typical behavioral paths of various elderly people in the process of taking medicine. The content contained in the action chain collection is that each action chain includes the order of a series of medication actions, the time period of each action, the duration of the action, and other information.

[0066] The action chain collection provides basic data support for the subsequent intelligent medication reminder system, which can help the system better understand the medication behavior of the elderly and customize personalized medication reminder paths for each elderly person.

[0067] Optionally, in S201, action thinning is performed on the historical medication dataset to obtain a set of action chains, including: In S2011, the action path data in the historical medication dataset is segmented and labeled to obtain the initial collection of action chains.

[0068] For example, the motion path data can be segmented according to set segmentation rules. For example, the motion can be segmented based on time periods, changes in motion, or changes in the external environment (such as tremor index, lighting changes, etc.). For example, the motion segmentation rule can be that the start mark is when the distance acquisition device detects that the distance between the hand and the medicine box is less than 20 cm, indicating that the medicine box begins to contact; the end mark is when the camera detects that the swallowing action is complete, or the elderly press the interactive button or module to indicate that the medication is complete; timeout segmentation is when the patient is still for more than 45 seconds, etc., as a sign of motion segmentation.

[0069] Based on the time and duration of actions in the historical medication dataset, a continuous event flow graph can be constructed. This event flow graph connects each action in chronological order, forming a trajectory of the medication process. Each action can be assigned a corresponding label based on its specific characteristics. Action labels can be encoded, such as labeling lid opening as A03 and medication removal as A04. Action characteristics can be considered when labeling, such as duration, direction, and environmental conditions.

[0070] All labeled actions are arranged in chronological order to form a complete action chain. The initial action chain collection includes different action chains in the historical medication dataset. Each action chain represents the entire process of an elderly person completing a medication task. This collection provides basic data for subsequent action chain generation.

[0071] Through these labeled and segmented data, every step of the elderly's medication process can be clearly recorded, thereby providing data support for subsequent behavior chain generation and personalized medication reminders.

[0072] S2012: performing action thinning on each action chain in the initial action chain collection to obtain a second action chain collection.

[0073] As you can understand, the initial collection of action chains includes a complete record of all actions taken by each elderly person during medication use. The action chains in the initial collection may contain redundant, repetitive, or irrelevant actions. Therefore, thinning (in both the temporal and spatial dimensions) can be used to simplify the action chains and improve the efficiency of subsequent processing and behavior chain generation.

[0074] For example, time-dimension thinning analyzes the time intervals between each action node in an action chain, eliminating short and unnecessary actions and simplifying the action chain structure. Time-dimension thinning removes unnecessary and repetitive actions while retaining the essential action nodes for the elderly during medication use.

[0075] A time interval threshold (e.g., 2 seconds) can be set. When the time interval between two adjacent actions is less than the time interval threshold, the two adjacent actions can be identified as belonging to the same action process. In each action chain, the time difference between adjacent actions can be checked in sequence. If the time interval between two adjacent actions is less than the set time interval threshold and there is no obvious spatial variation between the two adjacent actions, the two adjacent actions can be considered redundant and the two actions can be merged into one action, or one of the actions can be deleted. If the time interval between consecutive actions is very short (e.g., 1 second) and the action content is highly similar (e.g., opening a medicine box multiple times), these actions can be merged into a more concise action.

[0076] Spatial dimensional thinning analyzes the spatial displacement of each action in the action chain and eliminates redundant actions with minimal spatial variation. Spatial dimensional thinning removes repetitive actions with minimal spatial variation, retaining key steps in the medication process while reducing unnecessary steps, making the action chain more concise and efficient.

[0077] A spatial displacement threshold (e.g., 5cm) can be set. If the spatial displacement between two consecutive actions is less than the spatial displacement threshold, the two actions can be considered redundant. For each action in an action chain, the spatial displacement between each action can be calculated using the motion trajectory of the action in the action path data. If the spatial displacement between two adjacent actions is less than the set spatial displacement threshold, the two adjacent actions can be merged. If the spatial displacement between adjacent actions is small and the action types are repeated (e.g., between adjusting a medicine box and opening it), the adjacent actions can be merged or deleted.

[0078] The action chains that have been thinned out in the time and space dimensions are collected to form a new data set, namely the second collection of action chains. This collection includes streamlined action chains and represents the most important and concise action path in the elderly's medication process.

[0079] This step not only reduces redundant actions and irrelevant operation steps through rarefaction in the time and space dimensions, but also retains the most critical parts of each action chain, providing an optimized data foundation for subsequent behavior chain generation and personalized medication reminders.

[0080] For example, in S2012, actions are thinned out for each action chain in the initial action chain collection to obtain a second action chain collection, including: S20121, based on the historical state vectors in the historical medication dataset, screen the key nodes of each action chain in the initial collection of action chains, and calculate the weight of the key nodes of each action chain in the initial collection of action chains based on the historical action duration in the historical medication dataset.

[0081] For example, key medical nodes can be predefined, forming the immutable skeleton of the medication action chain. These key medical nodes can be retained to facilitate the basic execution of the entire medication process. For example, key medical nodes may include the action of touching the medicine box (the distance between the hand and the medicine box can be confirmed by a distance acquisition device), the action of taking the medicine (the removal of the tablet from the medicine box can be confirmed by visual recognition technology or pressure sensors), and the action of swallowing (the swallowing action can be confirmed by visual recognition technology or swallowing sound feature recognition).

[0082] In addition to medically critical nodes, dynamically changing nodes (key nodes) can be screened from each action chain in the initial collection of action chains. These nodes can help the system adjust reminder strategies based on actual conditions, enhancing the intelligence of the medication process. The differential rate of change of hand acceleration can be calculated based on the action path data in the historical medication dataset. When the rate of change exceeds a set threshold (e.g., 2 m / s²), it can be marked as a critical turning point (i.e., a key node). For example, severe hand tremors may trigger specific reminders for specific actions. Based on the historical state vectors in the historical medication dataset, step changes in motion characteristics (tremor index (TI)) between adjacent actions (e.g., ΔTI > 0.15) can be calculated, as well as significant changes in ambient light and noise. For example, significant changes in ambient light may necessitate adjustments to the reminder method or frequency.

[0083] The historical action durations in the historical medication dataset include the action durations of the key nodes selected using the above method. For each action chain in the initial action chain collection, the weight of each key node can be calculated based on its action duration, medical weight, and whether the action at the key node is completed. The medical weight of key nodes that are medical key nodes can be set to 1.0, while the medical weight of key nodes that are not medical key nodes can be set to 0.3. This allows the retention of medical key nodes in subsequent weighted filtering and thinning.

[0084] In step S20122, based on the weights of the key nodes of each action chain in the initial action chain collection and the historical state vectors in the historical medication dataset, the key nodes of each action chain in the initial action chain collection are subjected to layered thinning to obtain a second action chain collection. Layered thinning includes weighted filtering and thinning, topology optimization, and state merging.

[0085] For example, weighted filtering and thinning involves filtering nodes based on the weight of each key node, removing redundant nodes with low weights. By comparing the weights of the key nodes in each action chain in the initial collection of action chains and removing those with weights below a threshold (e.g., 0.65), we can eliminate action nodes that contribute little to the medication process, such as transitional actions (e.g., adjusting the pill box), while retaining action nodes that are crucial for medication use. After weighted filtering, each action chain retains only the important key nodes, simplifying the original action chain and removing redundancy.

[0086] Topology optimization aims to adjust the structure of action chains, making them more concise and consistent with the logic of the medication process. By using weighted filtering and thinning to identify the key nodes retained in each action chain, a graph representing the relationships between these key nodes can be constructed. Each key node serves as a node in the graph, and the edges between them represent their temporal and sequential relationships within the medication process. Shortest path algorithms (such as Dijkstra's algorithm) can be used to optimize the node relationship graph, removing unnecessary redundant nodes and paths, ensuring that the action chain encompasses all key nodes along the shortest possible path. Nodes with close sequential relationships and nearly simultaneous occurrences during the actual medication process can be merged into a single, simpler action node. For example, if the time between opening a medicine box and taking medication is extremely short, these two nodes can be merged into a single medication-taking node. Topology optimization reduces irrelevant nodes and redundant paths, improving the simplicity and efficiency of the action chain.

[0087] Using the historical state vectors in the historical medication dataset, we can calculate the Euclidean distance between the state vectors of consecutive nodes in the node relationship graph. When the distance between two nodes is less than a set threshold (e.g., less than 0.1), the two nodes are considered to represent the same or similar medication behavior and can be merged into a single node. State merging reduces duplicate state change nodes, making the action chain more concise and retaining key nodes with significant state changes, avoiding the omission of important medication information.

[0088] Through the three steps of weighted filtering and thinning, topology structure optimization, and state merging, the second collection of action chains generated finally includes simpler and more efficient action chains.

[0089] The above steps can not only simplify the action chain and reduce redundant nodes, but also optimize the structure of the action chain while ensuring the integrity of the medication process.

[0090] S2013: Calculate the similarity between each action chain in the second action chain collection, and based on the similarity between each action chain in the second action chain collection, perform an aggregation operation on the action chains in the second action chain collection to obtain an action chain collection.

[0091] For example, the similarity between each action chain may be calculated based on time, and whether the action chains are similar may be determined by calculating the time interval difference between corresponding action nodes in the action chain.

[0092] We can calculate the similarity between each action chain based on the action type and analyze the overlap of action types within the action chain. For example, if two action chains both contain the action sequence of opening a medicine box, taking medicine, and taking medicine, they may have a high similarity.

[0093] The similarity between each action chain can be calculated based on the edit distance. By calculating the edit distance between two action chains (such as the Levenshtein distance), their similarity can be measured. For example, if two action chains can be transformed into each other with only a small amount of insertion, deletion, or substitution, their similarity is high.

[0094] The total similarity can be calculated by taking the weighted average of the similarities of the above time, action type and edit distance.

[0095] A similarity threshold (such as 0.8) can be set. If the similarity of two action chains is higher than the threshold, they belong to similar action patterns and can be aggregated; action chains with similarity lower than the threshold are regarded as different action patterns and are not aggregated.

[0096] Clustering algorithms such as hierarchical clustering, K-means clustering, or DBSCAN can be used to cluster action chains based on similarity. These algorithms can then group action chains with high similarity into one category, thereby generating multiple action patterns. For example, the distance between each pair of action chains can be calculated based on similarity, and similar action chains can be gradually merged through hierarchical clustering until all action chains are grouped into one category. This ultimately determines which action chains can be aggregated.

[0097] For each action chain, we can use a weighted average approach to merge action chains based on the time nodes, action types, and weights. For example, we can average the time nodes of similar action chains to obtain a unified action chain that represents the action pattern.

[0098] Alternatively, the most representative action chain can be selected from multiple action chains of a cluster as the merged result. For example, the action chain with the most execution times or the action chain that best represents the cluster can be selected as the final result.

[0099] After the aggregation operation is complete, a collection of action chains is obtained. These aggregated action chains can be verified to check whether they accurately describe the possible action paths that different elderly individuals may take during medication use. If the aggregation results are unsatisfactory, the similarity threshold or clustering method can be adjusted to further optimize the aggregation effect.

[0100] This step reduces unnecessary complexity by removing redundancy and merging similar action chains, providing streamlined and effective data support for subsequent behavior chain generation and personalized medication reminders.

[0101] S301, generating a behavior chain collection based on the action chain collection and the historical medication dataset.

[0102] Understandably, a behavior chain is a series of reminders that guide the elderly through the entire medication process. These include not only the actions they need to complete but also external cues for how to perform them, such as voice reminders, light indicators, or vibrations. The goal of the behavior chain is to enable the elderly to complete each action accurately and promptly through a variety of reminder methods.

[0103] For example, for each action chain, a corresponding reminder strategy can be added to each action node. Based on historical medication datasets, it is possible to analyze which actions require external prompts, such as light prompts for opening a medicine box or voice reminders for elderly patients experiencing tremors. Appropriate reminder actions can be added after each action node. Reminder actions are not limited to voice or light signals; vibration or reminder buttons can also be added to provide additional guidance and assistance to the elderly.

[0104] When generating behavior chains, consider the dynamics of medication administration. For example, hand tremors or changes in ambient lighting may affect the speed or accuracy of an action. Therefore, conditional judgment nodes can be introduced into the behavior chain. For example, if the tremor index (movement characteristic) exceeds a certain threshold, additional reminders or assistance actions can be triggered, such as reminding the patient to slow down or providing additional assistance. If medication administration is delayed, the behavior chain can adjust based on the delay, repeating the reminder or providing a stronger prompt.

[0105] Combine all action nodes, reminder nodes, and conditional judgment nodes in the order of the action chain to form a complete behavior chain. For example, the behavior chain is: Action node: Open medicine box, Reminder node: Voice prompt: Open medicine box → Action node: Take medicine, Conditional judgment node: Check hand tremor index. If the tremor is strong, trigger the prompt: Steady hand → Action node: Take medicine, Reminder node: Voice prompt: Take medicine → Action node: Drink water, Conditional judgment node: Adjust visual prompt intensity based on ambient light intensity.

[0106] The behavior chains corresponding to all action chains are summarized into a behavior chain collection, which will be integrated into the intelligent medication reminder system. The system can select the most suitable behavior chain for reminders and guidance in real time based on the current status of the elderly.

[0107] This step enables the behavior chain to respond to different medication scenarios and the different needs of the elderly, thereby providing personalized and accurate medication reminder services.

[0108] Optionally, in S301, based on the action chain collection and the historical medication dataset, a behavior chain collection is generated, including: S3011, based on the historical action duration of the historical medication dataset, calculate the difficulty coefficient of each action in each action chain.

[0109] For example, the average action duration of each action type can be calculated based on the action duration of each action in each action chain in the action chain collection. The ratio between the action duration of each action in each action chain and the average action duration of the corresponding action type can be calculated, which is the difficulty coefficient of each action in each action chain. If the difficulty coefficient is less than 1, it means that the execution time of the action is less than the average action duration, indicating that the action is relatively simple; if the difficulty coefficient is 1, it means that the execution time of the action is equal to the average action duration, indicating that the action is in line with the average level; if the difficulty coefficient is greater than 1, it means that the execution time of the action is greater than the average action duration, indicating that the action is relatively complex.

[0110] S3012, based on the strategy mapping rule, determine the reminder strategy corresponding to the difficulty coefficient of each action in each action chain, and combine each action in each action chain with the reminder strategy corresponding to each action to generate a behavior chain corresponding to each action chain.

[0111] For example, different difficulty ranges can be pre-set to correspond to different modal reminder strategies. For example, the strategy mapping rule can be that when the difficulty range is [0, 0.8), a single-modal reminder strategy is used, such as voice reminder, light reminder, or vibration reminder; when the difficulty range is [0.8, 1.5), a dual-modal reminder strategy is used, such as voice and light or voice and vibration; and when the difficulty range is ≥1.5, a tri-modal reminder strategy is used, such as voice, vibration, and light.

[0112] The preset strategy mapping rules can be used to match the reminder strategy corresponding to the difficulty coefficient of each action in each action chain, and the actions in each action chain can be merged with their corresponding reminder strategies to obtain the behavior chain corresponding to each action chain.

[0113] This step converts the physical action nodes in the action chain into a multimodal reminder behavior chain, providing data support for subsequent medication reminders and personalized suggestions, helping the elderly to receive timely and appropriate medication reminders.

[0114] S3013, based on the difficulty coefficient of each action in each action chain and the reminder strategy corresponding to each action, calculate the similarity between the behavior chains corresponding to each action chain, and based on the similarity between the behavior chains corresponding to each action chain, merge the behavior chains whose similarity exceeds the similarity threshold to obtain a behavior chain collection.

[0115] For example, for each behavior chain, the number of common actions between the two behavior chains is calculated. The common action number refers to the number of identical actions in the two behavior chains. For each common action, the difficulty coefficient difference between the two behavior chains can be calculated. The difficulty coefficient difference is the difference in difficulty coefficients of the identical actions in the two behavior chains. The average difficulty difference of all common actions can also be calculated.

[0116] For each common action, calculate the difference in reminder strategies for each identical action. If the same action in two chains uses the same reminder strategy, the reminder strategy difference can be 0; if the same action in two chains uses different reminder strategies, the reminder strategy difference can be 1. Alternatively, it can be set as a decay coefficient to indicate the impact of strategy differences on similarity. Calculate the average reminder strategy difference for all common actions.

[0117] Each behavior chain includes several actions. The number of actions in the behavior chain can be counted to obtain the total number of actions in each behavior chain.

[0118] The similarity between each two behavior chains can be calculated based on the number of common actions, difficulty coefficient difference, reminder strategy difference and the total number of actions in the behavior chain, that is, , where the total number of actions is the total number of actions corresponding to the behavior chain with more total actions in the two behavior chains.

[0119] You can set a similarity threshold, such as 0.85, and use a clustering algorithm (such as hierarchical clustering or K-means clustering) to cluster behavior chains, assigning behavior chains with similarity greater than the threshold to the same cluster. For each behavior chain in a cluster, select a representative behavior chain as the representative of that cluster. If the differences between multiple behavior chains are small, you can merge them into a new behavior chain, retaining their main action nodes and reminder strategies.

[0120] After the above similarity calculation and aggregation, the final behavior chain collection is obtained. Each behavior chain in the behavior chain collection includes a series of reminder actions, the reminder strategy and preset duration and state range corresponding to each reminder action.

[0121] Through the above steps, the difficulty of executing each action can be quantified, and the most appropriate reminder method can be matched for actions of different difficulty levels in combination with the strategy mapping rules, thereby generating accurate and targeted behavior chains. The similarity between behavior chains is calculated through the dual characteristics of difficulty coefficient and reminder strategy, and the behavior chains with high similarity are merged. This not only reduces the number of redundant behavior chains and reduces storage and retrieval costs, but also retains the core medication reminder mode. This enables the system to more efficiently match the adapted reminder scheme in subsequent operations, realize the personalization, simplification and high execution efficiency of the reminder strategy, and improve the medication compliance and reminder accuracy of the elderly.

[0122] S3014: Determine the state range and preset duration of each behavior chain in the behavior chain set based on the historical state vectors and historical action durations in the historical medication dataset.

[0123] For example, the historical action duration and historical state vector of each action node of each action chain in the initial collection of action chains can be directly read from the historical medication data set. When each action chain performs action thinning, the retained action nodes inherit their historical action duration and historical state vector intactly.

[0124] The state range of the action chain without aggregation operation can be composed of the union of the state vectors of each retained action node, and robust intervals are given for the three dimensions (tremor index, ambient light intensity and ambient noise decibel): interval = [p5, p95] (5% and 95% percentiles calculated on this dimension for all retained nodes in the chain), and the action duration of each action remains unchanged.

[0125] Align the nodes of the aggregated multiple action chains (align by action type and sequence, and classify or skip branches that cannot be aligned). Robustly summarize the duration of all similar nodes participating in the aggregation, such as a weighted truncated mean. The weight can be taken as the frequency of occurrence of the node in each chain or the overall quality score (success rate) of the chain, and the truncation ratio can be 5%, for example, to obtain the action duration of the aggregated action. The state range of the action chain can be generated using a weighted quantile envelope, which not only covers the differences between different individuals but also avoids infinite expansion. That is, the weighted quantile interval is calculated in three dimensions: [P5, P95], with the same weights as above. The aggregated action chain has a unified state range and action duration for each action.

[0126] The state range of each action chain can be directly mapped to the state range of the corresponding behavior chain, and the action duration of each action can be mapped to the preset duration of the corresponding behavior node in the behavior chain. When multiple behavior chains are merged into one, the same robust fusion principle as for action chain aggregation can be applied. The weighted quantile envelope is calculated for each of the three dimensions to obtain the state range of the behavior chain (core range and buffer range can also be output). The weighted truncated mean / weighted median of the preset duration set of the same behavior node (which has been aligned) is then taken to obtain the preset duration of the merged behavior node.

[0127] This step, while ensuring data traceability and statistical robustness, processes state vectors and action durations in historical medication data through thinning, aggregation, and one-to-one mapping, accurately generating the state range of the behavior chain and the preset duration of each behavior node. This not only ensures the adaptability of the final behavior chain to the needs of the elderly under varying tremor indices, ambient noise, and lighting conditions, but also provides a reliable basis for the precise choreography of reminder rhythms, thereby achieving personalized, environmentally adaptive, and highly successful medication reminder path generation.

[0128] S401: assign a unique identifier to each behavior chain in the behavior chain collection to obtain a behavior chain identifier collection.

[0129] For example, each action chain can be assigned a unique identifier. These identifiers uniquely represent each action chain, making it easier to quickly find and call the corresponding action chain in the system. Identifiers not only simplify subsequent operations but also provide an efficient mechanism for managing, querying, and updating action chains.

[0130] S501: Construct a secondary behavior index table according to the behavior chain identifier collection and the behavior chain collection.

[0131] Exemplarily, a secondary behavior index table can be constructed using a collection of behavior chain identifiers and a collection of behavior chains. This table matches the unique identifier of the behavior chain with the specific behavior chain to form an efficient search structure. The main function of the secondary behavior index table is to quickly find the corresponding behavior chain based on the given behavior chain identifier. For example, when the initial state vector of the elderly is received, the behavior chain identifier set can be obtained through the primary behavior index, and then the corresponding behavior chain can be found through the secondary behavior index. This dual index structure can improve query efficiency and is conducive to quickly responding to the elderly's medication needs in real-time applications. For an example of a secondary behavior index table, please refer to Figure 2 .

[0132] Through these steps, the secondary behavior index table can effectively organize various action chains and behavior chains in the historical medication data, and associate them with the behavior chains through unique identifiers, providing accurate and personalized reminder services for the subsequent medication reminder system.

[0133] In one possible implementation, a first-level behavior index table is constructed, including: S10, calculating the hash value of each component in each historical state vector according to the historical state vectors in the historical medication data set, and combining the hash value of each component into a state code to obtain the state code of each historical state vector.

[0134] Exemplarily, the implementation method of this step is consistent with step S200. Through the bucketing rule, each component in each historical state vector is mapped to the corresponding bucket number to form a historical state label vector. The hash value of each component in the historical state label vector is calculated according to the hash function, and the hash value of each component is combined to form a state code to obtain the state code of each historical state vector.

[0135] S20, based on the historical state vectors and the secondary behavior index table in the historical medication data set, determining the behavior chain identifier corresponding to each historical state vector.

[0136] Exemplarily, each behavior chain in the secondary behavior index table has a corresponding state range. For each historical state vector, it can be determined whether the various components of the historical state vector fall within the state range of a certain behavior chain. If the various components of the historical state vector fall within the state range of the behavior chain, the historical state vector is bound to the behavior chain identifier of the behavior chain; if the various components of the historical state vector fall within the state ranges of multiple behavior chains respectively, the optimal behavior chain can be selected according to priority, nearest neighbor principle, etc., and its identifier can be bound.

[0137] S30: Construct a first-level behavior index table according to the state code of each historical state vector and the behavior chain identifier corresponding to each historical state vector.

[0138] For example, a mapping relationship can be formed between the state code of each historical state vector and its corresponding behavior chain identifier to construct a first-level behavior index table. Figure 3 .

[0139] This step can significantly improve the system's efficiency in processing the relationship between state vectors and behavior chains, support fast and accurate matching and retrieval of corresponding behavior chain identifiers, and provide an accurate data basis for subsequent personalized reminders and behavior predictions.

[0140] S400 dynamically generates the optimal reminder path based on the behavior chain candidate set, and based on the optimal reminder path, provides medication reminders to the elderly in real time.

[0141] For example, a comprehensive evaluation can be performed on each behavior chain in the behavior chain candidate set, and the evaluation indicators may include: fitness score, which can calculate the fitness based on the degree of match between the initial state vector and the execution conditions and prompt parameters of each behavior node in the behavior chain; execution cost, which can include the total time required to execute the behavior chain, the energy consumption and occupancy of the hardware resources involved (such as voice broadcast, LED light flashing, screen display, etc.); perceptibility and achievability, which can extract the elderly's past reactions to the behavior chain under similar conditions from the system log (such as whether it was completed in one go, whether repeated prompts were needed, etc.), and combine the current environmental noise and lighting conditions to predict the probability of the elderly perceiving the prompt and the success rate of completing the prompt action.

[0142] During the evaluation process, multi-objective optimization methods (such as weighted scoring models or heuristic search) can be used to comprehensively calculate the above evaluation indicators according to preset weights to obtain a comprehensive priority score for each candidate behavior chain. The behavior chain with the highest priority score can be determined as the current optimal reminder path. In the event of conflicting indicators, policy rules can be used to prioritize medication safety and compliance. For example, when environmental noise is too high, light or vibration-based reminder links can be preferred, even if the execution cost is slightly higher.

[0143] The first action node in the optimal reminder path can be designated as the current node. Its prompt method, action, parameters, and preset duration are read, and a reminder is issued through the corresponding output channel, such as a voice announcement prompting "Please approach the medicine box," a flashing LED, or a pop-up text on the screen. During the prompting process, sensors can monitor the patient's progress in real time to determine whether the action corresponding to the current action node has been completed. If the action is not detected within the preset duration, a secondary prompt (such as increasing the volume or flashing frequency) or a fallback strategy (such as switching to a more perceptible prompt method) can be triggered based on the link configuration. After the current action node completes, the execution pointer automatically moves to the next action node, repeating the prompting, detection, and confirmation process until the entire behavior chain is complete. During chain execution, if a significant change in the state vector is detected in real time (such as a sudden increase in ambient noise or a rise in the tremor index), the current link can be immediately interrupted, the candidate set evaluation phase can be re-entered, a new optimal reminder path can be generated, and execution can continue, ensuring that the strategy continues to match the patient's condition. Information such as the completion time, number of prompts, and success / failure of each action node can be recorded in an execution log, providing data support for subsequent behavior chain optimization and adaptive weight adjustment.

[0144] This step can respond to changes in the elderly person's condition at the millisecond level, achieving closed-loop control from candidate link evaluation, optimal path generation, real-time reminders, and dynamic adjustments. This not only helps the reminder strategy always fit the elderly person's current physical condition and environmental conditions, but also significantly improves the success rate and compliance of medication reminders.

[0145] In one possible implementation, S400 dynamically generates an optimal reminder path based on the behavior chain candidate set, including: S410, selecting the optimal behavior chain from the behavior chain candidate set.

[0146] For example, the total cost of each behavior chain in the behavior chain candidate set can be evaluated using a cost function, all behavior chains are sorted from smallest to largest in terms of total cost, and the one with the lowest total cost is selected as the optimal behavior chain.

[0147] The cost function is used to measure the comprehensive execution cost of each behavior chain. The smaller the value, the better the behavior chain. It can include execution time, resource consumption, and environmental adaptability. ,in, represents the cost function, Indicates the execution time. Indicates resource consumption, Indicates environmental adaptability, 、 、 They represent the weights corresponding to execution time, resource consumption, and environmental adaptability (which can be dynamically adjusted based on the initial environmental information and initial motion characteristics).

[0148] Execution duration represents the total time required to complete the actions corresponding to all behavior nodes in the behavior chain. It can be used to calculate the preset duration for completing all behavior nodes in the behavior chain. Resource consumption is used to measure the number and type of reminder resources (such as light, voice, vibration, etc.) required to execute the behavior chain. Consumption scores can be set for different resources, such as 1 point for voice reminders, 1.5 points for light reminders, and 2 points for vibration reminders (high power consumption and high device requirements).

[0149] Environmental adaptability measures the suitability of a behavior chain under the initial environmental information and initial motion characteristics. This can be done by comparing the initial environmental information and initial motion characteristics with the behavior chain's state range to determine whether the initial ambient light intensity, initial ambient noise decibels, and initial motion characteristics are within the behavior chain's state range. If they are within the state range, the deviation is 0; if they are below the lower limit of the state range, the deviation is calculated as (lower limit of the state range - initial value) / lower limit of the state range; if they are above the upper limit of the state range, the deviation is calculated as (initial value - upper limit of the state range) / upper limit of the state range. Using the aforementioned deviation calculation method, the illumination deviation, noise deviation, and tremor index deviation are calculated, and environmental adaptability is calculated using a weighted approach based on the illumination deviation, noise deviation, and tremor index deviation.

[0150] This step can comprehensively consider factors such as execution time, resource consumption, and environmental adaptability, and screen the most suitable behavior chain in different environments and elderly conditions, thereby improving the effectiveness, personalization, and operability of the reminder strategy and reducing execution time and resource waste.

[0151] S420: Obtain current environment information and current action duration, wherein the current environment information includes the current environment light intensity and the current environment noise decibel. The current action duration is used to represent the time taken by the elderly to perform the action corresponding to a behavior node in the optimal behavior chain.

[0152] For example, once the optimal behavior chain is determined, reminders are issued step by step according to the behavior nodes in the optimal behavior chain, and the elderly person is expected to perform the corresponding actions. During the execution of each behavior node, the current environment information and the current action duration can be collected in parallel to provide data support for subsequent dynamic adjustment of the strategy.

[0153] The current environment information includes the current environment light intensity and the current environment noise decibel, which can be collected by the environment light collection device and the noise collection device respectively.

[0154] The execution time of each action can be counted from the moment the behavior node corresponding to the action starts to execute. For example, the behavior node is a voice prompt to take medicine. When the system issues a voice prompt to take medicine, the timer starts immediately. This is beneficial for the timing range to cover the entire reaction time and execution time of the elderly after receiving the reminder. Different types of actions can stop the timing by detecting whether the action is completed or not through different sensors or devices, thereby obtaining the current action duration. For example, the completion of the medicine-taking action can be detected by a pressure sensor (to detect the reduction of the amount of medicine in the medicine box slot) or an RFID tag (to detect the removal of the tablet); the completion of the swallowing action can be detected by a microphone (to detect the characteristics of the swallowing sound) or visual recognition technology (to detect the swallowing action).

[0155] If the action still does not detect a completion signal within the preset time (such as 15 seconds), the timer can automatically stop at the timeout point, record the action as unfinished, and mark its duration as timeout. Subsequent reminder strategies can trigger remedial reminders (such as another voice prompt, or switching to a more intense reminder mode).

[0156] S430 , dynamically adjusting the optimal behavior chain based on the current environment information and the current action duration to generate an optimal reminder path.

[0157] For example, the current ambient light intensity can be compared with the ideal light range in the state range of the optimal behavior chain, and the brightness of the prompt light can be appropriately reduced or increased; the current ambient noise decibels can be compared with the ideal noise range in the state range of the optimal behavior chain, and the prompt sound volume can be appropriately reduced or increased.

[0158] When the current action duration exceeds the preset duration, the waiting time between the current behavior node and the next behavior node can be extended to prevent the elderly from receiving the next step reminder before completing the current action, and add repeated reminders or stronger reminders to the current behavior node.

[0159] According to the above dynamic adjustment method, the reminder strategy and execution rhythm of each behavior node can be adjusted according to the real-time situation to form the optimal reminder path.

[0160] Through the above steps, adaptive optimization of reminder mode, intensity and rhythm is achieved, which improves the effectiveness and operability of reminders, reduces the risk of missed doses or wrong doses due to environmental interference or slow movements, and significantly improves the medication compliance and safety of the elderly.

[0161] Optionally, S430 , based on current environmental information and current action duration, dynamically adjust the optimal behavior chain to generate an optimal reminder path, including: S431: Optimize the prompt parameters in the optimal behavior chain based on the current environment information, wherein the prompt parameters include the brightness of the prompt light and the prompt volume.

[0162] It can be understood that during the execution of the optimal behavior chain, the prompt parameters of the currently executed behavior node can be dynamically optimized according to the current environmental information, which can facilitate adaptive adjustments according to environmental changes, enhance the effectiveness and comfort of prompts, and thus improve the elderly's medication compliance.

[0163] For example, if the current ambient light intensity is within the ideal light range in the state range of the optimal behavior chain, the brightness of the prompt light is kept unchanged; if the current ambient light intensity exceeds the upper limit of the ideal light range in the state range of the optimal behavior chain, the brightness of the prompt light can be reduced to avoid excessive interference; if the current ambient light intensity is lower than the lower limit of the ideal light range in the state range of the optimal behavior chain, the brightness of the prompt light can be increased, which helps the elderly to still see the light prompt in a darker environment.

[0164] The adjustment method can be ,in, Indicates the brightness of the indicator light after adjustment. Indicates the base indicator light brightness (such as 100 units of light intensity). The coefficient representing the influence of control deviation can be set to a constant (such as 0.5). Indicates the median value of the ideal lighting range. For example, if the ideal lighting range is 100~300lux, the median value of the ideal lighting range is 200lux. Indicates the current ambient light intensity. Indicates the width of the ideal lighting range. For example, if the ideal lighting range is 100~300lux, the width of the ideal lighting range is 200lux.

[0165] Similarly, if the current ambient noise decibel is within the ideal noise range in the state range of the optimal behavior chain, the prompt volume remains unchanged; if the current ambient noise decibel exceeds the upper limit of the ideal noise range in the state range of the optimal behavior chain, the volume can be increased to help the elderly hear the prompt clearly; if the current ambient noise decibel is lower than the lower limit of the ideal noise range in the state range of the optimal behavior chain, the volume can be lowered to avoid discomfort caused by excessive sound.

[0166] The adjustment method can be ,in, Indicates the adjusted prompt volume. Indicates the base volume (e.g. 50 units). Indicates the effect of controlling noise deviation, which can be set to a constant (such as 0.5). It represents the median value of the ideal noise range. For example, if the ideal noise range is 40-60 dB, the median value of the ideal noise range is 50 dB. Indicates the current ambient noise decibel. Indicates the width of the ideal noise range. For example, if the ideal noise range is 40-60 dB, the width of the ideal noise range is 20 dB.

[0167] By real-time monitoring of ambient light intensity and noise levels and adjusting the brightness of the reminder light and the reminder volume accordingly, the medication reminder parameters can be automatically optimized, so that the elderly can receive clear and easy-to-perceive reminders under various environmental conditions, thereby improving medication compliance and accuracy.

[0168] S432: If the duration of the current action exceeds the preset duration of the current behavior node, an auxiliary subchain corresponding to the current behavior node is inserted after the current behavior node in the optimal behavior chain. The current behavior node represents a behavior node in the optimal behavior chain for medication reminders, and the auxiliary subchain is used to help the elderly person complete the action corresponding to the current behavior node.

[0169] For example, if the current action duration exceeds the preset duration and exceeds a set threshold (e.g., 20% of the preset duration), it indicates that the elderly person may be experiencing difficulties, and the logic for inserting an auxiliary sub-chain can be triggered. For example, if the preset duration is 5 seconds and the threshold is 20%, if the actual execution time exceeds 6 seconds (i.e., 120% of 5 seconds), the auxiliary sub-chain will be inserted.

[0170] When inserting an auxiliary sub-chain, you can select the auxiliary sub-chain corresponding to the current behavior node. The auxiliary sub-chain can include additional help actions or guidance to help the elderly complete the action corresponding to the current behavior node. The content of the auxiliary sub-chain can be selected based on the specific situation, so that the elderly can get appropriate help when performing the current action.

[0171] An auxiliary subchain can be inserted after the current behavior node, so that the elderly can continue to take the next medication operation after completing the action corresponding to the current behavior node. The insertion of the auxiliary subchain will not interrupt the execution of the optimal behavior chain, but will serve as a supplement to the current behavior node.

[0172] After inserting the auxiliary sub-chain, the execution progress of the current behavior node can be continuously monitored. If the elderly person completes the action successfully, it will automatically enter the next behavior node; if it exceeds the preset time of the auxiliary sub-chain, the prompt of the auxiliary sub-chain can be adjusted again according to the actual progress; if the prompt in the auxiliary sub-chain (such as voice, visual or tactile prompt) does not cause the elderly person to respond, the prompt frequency can be automatically increased until the elderly person completes the operation.

[0173] This step optimizes the execution of each medication behavior node by inserting auxiliary sub-chains in real time, allowing the system to maintain efficient and reliable operation even in complex or changing environmental conditions. By dynamically optimizing and adjusting strategies, it can continuously generate the optimal medication reminder path that best suits the current environment and the patient's condition, improving the system's intelligence and responsiveness.

[0174] In one possible implementation, the smart medication reminder method for the elderly also includes: S4001: Count the current elapsed time and calculate the current execution degree based on the current elapsed time and the total preset time. The current elapsed time represents the time it takes for the elderly person to execute the action corresponding to the optimal behavior chain from the beginning to the current execution. The total preset time is the sum of the preset times of all behavior nodes in the optimal behavior chain.

[0175] For example, during the execution of the optimal behavior chain, the execution status of each behavior node can be tracked in real time to calculate the current elapsed time. The total preset time of all behavior nodes in the optimal behavior chain can be calculated to obtain the total preset time.

[0176] The ratio of the current elapsed time to the total preset time is calculated as the current execution degree. The current elapsed time can be continuously updated during the execution of each behavior node, and the current execution degree can be calculated in real time. This allows the system to dynamically understand the progress of the elderly at each stage and make corresponding adjustments.

[0177] S4002: When it is determined that the current execution degree is lower than the execution degree threshold, a behavior chain switch is triggered.

[0178] For example, an execution degree threshold (such as 70%) can be pre-defined. If the current execution degree is lower than the execution degree threshold, it can be considered that the optimal behavior chain is not effective in reminding the elderly during medication, and the behavior chain switch can be triggered.

[0179] Optionally, a behavior chain switch, including: S4002A, obtain the current motion features, current interaction features, and construct the current state vector based on the current motion features, current interaction features and current environmental information; S4002B, based on the current state vector, re-screen the new behavior chain through the first-level behavior index and the second-level behavior index; S4002C, based on the new behavior chain and the optimal behavior chain, determine the switching node of the new behavior chain, and according to the switching node, switch the optimal behavior chain to the new behavior chain, and execute the medication reminder from the switching node.

[0180] For example, the implementation method of step S4002A is consistent with step S100 and is not further described here. A set of behavior chain identifiers matching the current state vector can be searched through the primary behavior index table, a set of behavior chains matching the set of behavior chain identifiers can be searched through the secondary behavior index table, and a new optimal behavior chain (new behavior chain) can be screened from the set of behavior chains using a cost function.

[0181] It can detect whether the optimal behavior chain and the new behavior chain have a common node (the behavior node corresponds to the same action). If there is a common node and it is the current behavior node, it can be determined as the switching node of the new behavior chain, and the new behavior chain can be directly switched to at the switching node. During the switch, the state of the current behavior node can be retained to ensure a smooth transition between the optimal behavior chain and the new behavior chain.

[0182] If there is a common node and the common node is located before the current behavior node, you can start execution from the common node (switch node) of the new behavior chain, ignore the execution of the current behavior node, and continue to execute the subsequent nodes of the new behavior chain; if there is a common node and the common node is located after the current behavior node, you can execute the current behavior node first, until the current behavior node is completed, jump to the common node of the new behavior chain, and continue to execute the subsequent nodes of the new behavior chain.

[0183] If there are no common nodes, it is not possible to switch directly through the common nodes. A transition node can be introduced to make the switching of the behavior chain more reasonable. The transition node can help the system establish a connection between the two behavior chains to make the switching smooth. A transition node is a node that can meet the requirements of both the optimal behavior chain and the new behavior chain, or a standard node automatically generated by the system. For example, between two completely different behavior chains, a unified transition node can be generated, such as a confirmation of medication status or a preparation completion prompt, to mark the start and end of the behavior chain switch.

[0184] You can also determine the transition node by defining the preconditions and postconditions for each behavior node. For example, if the starting node of the new behavior chain is medicine extraction, and the current node of the optimal behavior chain is lid opening, then the completion state of lid opening can be used as the precondition of the medicine extraction node, and a smooth transition can be achieved.

[0185] By determining whether to switch behavior chains based on the current execution degree, the optimal behavior chain can be adjusted in real time to ensure that the elderly person always executes medication reminders on the behavior chain that suits their current state. This helps the system adapt to the individual differences and execution abilities of different elderly people, avoiding reminder failures or delays caused by sticking to a specific behavior chain. These steps not only help the elderly person complete the nodes in the current behavior chain, but also adjust the behavior chain based on dynamic evaluation and achieve smooth switching. In complex or changing environments, the system can adaptively adjust, not rely on fixed behavior chains, but flexibly switch based on real-time feedback, thereby improving the robustness and stability of the system.

[0186] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0187] Corresponding to the smart medication reminder method for the elderly described in the above embodiment, the embodiment of the present application also provides a smart medication reminder device for the elderly, and each unit of the device can implement each step of the smart medication reminder method for the elderly.

[0188] The device includes: The acquisition unit is configured to acquire initial motion features, initial interaction features, and initial environmental information, and construct an initial state vector based on the initial motion features, initial interaction features, and initial environmental information. The initial motion features are used to characterize the tremor index of the elderly person's hand, the initial interaction features are used to characterize the distance between the elderly person's hand and the medicine box, and the initial environmental information includes the initial ambient light intensity and the initial ambient noise decibels.

[0189] The first-level behavior indexing unit is used to calculate the hash value of the initial state vector, determine the state code, and perform first-level behavior indexing on the state code to obtain a behavior chain identifier set. The first-level behavior indexing is performed by searching the first-level behavior index table for the behavior chain identifier corresponding to the state code.

[0190] The secondary behavior indexing unit is used to perform secondary behavior indexing on the behavior chain identifier set to obtain a candidate behavior chain set. The secondary behavior indexing involves searching the secondary behavior index table for the behavior chain corresponding to the behavior chain identifier. A behavior chain is a series of reminders guiding the elderly to take medication. The behavior chain includes a series of medication reminder behavior nodes, the preset duration for completing the action corresponding to each behavior node, and prompt parameters.

[0191] The medication reminder unit is used to dynamically generate the optimal reminder path based on the behavior chain candidate set, and based on the optimal reminder path, provide medication reminders to the elderly in real time.

[0192] It should be noted that the information interaction, execution process, etc. between the above-mentioned units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0193] The present application also provides a smart medicine box. Figure 4 This is a schematic diagram of the structure of the smart medicine box provided by one embodiment of the present application. The smart medicine box may include a data acquisition device, a reminder device, and a control device that is in communication with the data acquisition device and the reminder device. Figure 4 As shown, the control device 6 of the smart medicine box of this embodiment includes: at least one processor 60 ( Figure 4 Only one is shown), at least one memory 61 ( Figure 4 Only one is shown in the figure) and a computer program 62 stored in the at least one memory 61 and executable on the at least one processor 60. When the processor 60 executes the computer program 62, the smart medicine box implements the steps of any of the above-mentioned smart medication reminder method embodiments for the elderly, or implements the functions of each unit in the above-mentioned device embodiments.

[0194] For example, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to implement the present application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the control device 6 of the smart medicine box.

[0195] The smart medicine box may include, but is not limited to, a processor 60 and a memory 61. It will be understood by those skilled in the art that Figure 4 This is merely an example of a smart medicine box and does not constitute a limitation on the smart medicine box. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, buses, etc.

[0196] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0197] In some embodiments, the memory 61 may be an internal storage unit of the control device 6 of the smart medicine box, such as a hard disk or memory of the smart medicine box. In other embodiments, the memory 61 may also be an external storage device of the smart medicine box, such as a plug-in hard disk equipped on the smart medicine box, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Furthermore, the memory 61 may also include both an internal storage unit of the smart medicine box and an external storage device. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.

[0198] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0199] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A smart medication reminder method for the elderly, characterized in that: include: Acquiring initial motion features, initial interaction features, and initial environmental information, and constructing an initial state vector based on the initial motion features, the initial interaction features, and the initial environmental information; wherein the initial motion features are used to characterize the tremor index of the elderly person's hand, the initial interaction features are used to characterize the distance between the elderly person's hand and the medicine box, and the initial environmental information includes initial ambient light intensity and initial ambient noise decibels; Performing a hash value calculation on the initial state vector to determine a state code, and performing a first-level behavior index on the state code to obtain a behavior chain identifier set; wherein the first-level behavior index is obtained by searching a first-level behavior index table for a behavior chain identifier corresponding to the state code; Performing secondary behavior indexing on the behavior chain identifier set to obtain a behavior chain candidate set; wherein the secondary behavior indexing is performed by searching a secondary behavior index table for a behavior chain corresponding to the behavior chain identifier, wherein the behavior chain is a series of reminders for guiding the elderly to take medication, and the behavior chain includes a series of behavior nodes for medication reminders, a preset duration for completing the action corresponding to each behavior node, and prompt parameters; Based on the behavior chain candidate set, an optimal reminder path is dynamically generated, and based on the optimal reminder path, medication reminders are given to the elderly in real time.

2. The smart medication reminder method for the elderly according to claim 1, characterized in that: Constructing the secondary behavior index table includes: Acquire a historical medication dataset; wherein the historical medication dataset includes a large amount of action path data, historical action duration, and historical state vectors of the elderly's medication process; Perform action thinning on the historical medication dataset to obtain a collection of action chains; generating a behavior chain collection based on the action chain collection and the historical medication dataset; Assigning a unique identifier to each behavior chain in the behavior chain collection to obtain a behavior chain identifier collection; The secondary behavior index table is constructed according to the behavior chain identifier collection and the behavior chain collection.

3. The smart medication reminder method for the elderly as claimed in claim 2, characterized in that: The action thinning of the historical medication dataset to obtain an action chain collection includes: Performing action segmentation and labeling on the action path data in the historical medication dataset to obtain an initial set of action chains; performing action thinning on each action chain in the initial action chain collection to obtain a second action chain collection; The similarity between each action chain in the second collection of action chains is calculated, and based on the similarity between each action chain in the second collection of action chains, an aggregation operation is performed on the action chains in the second collection of action chains to obtain the action chain collection.

4. The smart medication reminder method for the elderly as claimed in claim 3, characterized in that: The step of thinning out each action chain in the initial action chain collection to obtain a second action chain collection includes: screening key nodes of each action chain in the initial set of action chains based on the historical state vectors in the historical medication dataset, and calculating the weight of the key nodes of each action chain in the initial set of action chains based on the historical action duration in the historical medication dataset; Based on the weight of the key nodes of each action chain in the initial collection of action chains and the historical state vectors in the historical medication data set, the key nodes of each action chain in the initial collection of action chains are layered and thinned out to obtain the second collection of action chains; wherein, the layered thinning out includes weighted filtering and thinning, topology structure optimization, and state merging.

5. The smart medication reminder method for the elderly as claimed in claim 2, characterized in that: Generating a behavior chain collection based on the action chain collection and the historical medication dataset includes: Calculating the difficulty coefficient of each action in each action chain based on the historical action duration of the historical medication dataset; Based on the strategy mapping rules, determine the reminder strategy corresponding to the difficulty coefficient of each action in each action chain, and combine each action in each action chain with the reminder strategy corresponding to each action to generate the behavior chain corresponding to each action chain; Based on the difficulty coefficient of each action in each action chain and the reminder strategy corresponding to each action, the similarity between the behavior chains corresponding to each action chain is calculated, and based on the similarity between the behavior chains corresponding to each action chain, the behavior chains whose similarity exceeds a similarity threshold are merged to obtain the behavior chain collection; According to the historical state vectors and historical action durations in the historical medication dataset, the state range and preset duration of each behavior chain in the behavior chain collection are determined.

6. The smart medication reminder method for the elderly as claimed in claim 5, characterized in that: Constructing the first-level behavior index table includes: Calculating a hash value of each component in each historical state vector according to the historical state vectors in the historical medication dataset, and combining the hash values ​​of each component into a state code to obtain a state code for each historical state vector; Determining a behavior chain identifier corresponding to each historical state vector based on the historical state vectors in the historical medication dataset and the secondary behavior index table; The first-level behavior index table is constructed according to the state code of each historical state vector and the behavior chain identifier corresponding to each historical state vector.

7. The smart medication reminder method for the elderly according to claim 1, characterized in that: The dynamically generating the optimal reminder path based on the behavior chain candidate set includes: Selecting the optimal behavior chain from the behavior chain candidate set; Obtaining current environment information and current action duration; wherein the current environment information includes the current environment light intensity and the current environment noise decibel, and the current action duration is used to represent the time used by the current elderly person to perform the action corresponding to a behavior node in the optimal behavior chain; Based on the current environmental information and the current action duration, the optimal behavior chain is dynamically adjusted to generate the optimal reminder path.

8. The smart medication reminder method for the elderly according to claim 7, characterized in that: The dynamically adjusting the optimal behavior chain based on the current environment information and the current action duration to generate the optimal reminder path includes: Based on the current environment information, optimizing the prompt parameters in the optimal behavior chain; wherein the prompt parameters include the brightness of the prompt light and the prompt volume; Determine that the duration of the current action exceeds the preset duration of the current behavior node, and insert an auxiliary sub-chain corresponding to the current behavior node after the current behavior node in the optimal behavior chain; wherein, the current behavior node is used to represent a behavior node in the optimal behavior chain for the current medication reminder, and the auxiliary sub-chain is used to help the elderly complete the action corresponding to the current behavior node.

9. The smart medication reminder method for the elderly according to claim 8, characterized in that: The method further comprises: Counting the current elapsed time and calculating the current execution degree based on the current elapsed time and the total preset time; wherein the current elapsed time is used to represent the time consumed by the elderly from the beginning to the current execution of the action corresponding to the optimal behavior chain, and the total preset time is the sum of the preset time of all behavior nodes in the optimal behavior chain; When it is determined that the current execution degree is lower than the execution degree threshold, triggering the behavior chain switching; The behavior chain switching includes: Acquire current motion features and current interaction features, and construct a current state vector based on the current motion features, the current interaction features, and the current environment information; Based on the current state vector, a new behavior chain is re-screened through the primary behavior index and the secondary behavior index; Based on the new behavior chain and the optimal behavior chain, a switching node of the new behavior chain is determined, and according to the switching node, the optimal behavior chain is switched to the new behavior chain, and the medication reminder is executed from the switching node.

10. A smart medicine box comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Method for improving medicine taking health of old people living alone by employing Petri network technology

    CN106021883A

  • Action guidance method and device based on action capture

    CN110045823A

  • Intelligent training method and system for simulating transvaginal posterior fornix paracentesis

    CN111696417A

  • Intelligent medicine box

    CN111840062A

  • Medicine taking reminding system and method for remote monitoring of medicine taking of patient

    CN113035313A