A guideline knowledge base reasoning driven home health management system

By collecting sleep and wake-up times to generate a baseline schedule, which is then converted into a relative time task schedule, the problem of aligning reminder anchors with schedule boundaries in shift-working families is solved, achieving continuous and consistent reminders for health management.

CN122117373APending Publication Date: 2026-05-29SHANDONG LANGTU INTELLIGENCE NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG LANGTU INTELLIGENCE NETWORK TECHNOLOGY CO LTD
Filing Date
2026-02-07
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In shift work family settings, the reminder anchors of existing health management systems are difficult to reliably align with the actual work and rest boundaries of family members, resulting in misaligned reminder times and a mismatch between the recipients of notifications and the frequency of reminders, which affects the continuity and comprehensibility of health management.

Method used

By collecting the user's sleep and wake-up times through the user terminal, a baseline time for sleep is generated. The intelligent agent module extracts time-conditional guide clauses from the health knowledge base and converts them into a relative time task list. Combining the sleep segment intersection ratio and phase bias minute, a rearrangement coefficient is generated to trigger a minimum clarification interaction or update the baseline time for sleep to maintain reminder time alignment.

Benefits of technology

It enables family members to receive reminders and management arrangements that align with their own sleep rhythms during shift changes, night shifts, and midnight shifts, reducing reminders that are not timed correctly and improving the sustainability and understandability of health management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122117373A_ABST
    Figure CN122117373A_ABST
Patent Text Reader

Abstract

The application discloses a family health management system based on guideline knowledge base reasoning driving, and particularly relates to the field of health service and management information processing for family scenes, and is used for solving the problem that the reminder and management action are dislocated due to the difficulty in stable alignment of the guideline time condition under the shift and night shift work-rest conditions; the sleeping time and the getting-up time are collected through a user terminal, and the sleep midpoint is obtained, the work-rest reference time is generated in a data collection and storage module, the guideline clauses with time conditions are extracted from a health knowledge base by an intelligent agent module, and are converted into clause time windows relative to the work-rest reference time to generate a relative time task table, an event sequence is recorded by a task and reminder module, the sleep segment intersection and the phase deviation minute are calculated by the intelligent agent module, and a rearrangement coefficient is generated through a comprehensive analyzer, a treatment decision is formed according to the rearrangement coefficient to trigger the minimum clarification interaction or update the work-rest reference time and synchronously update the relative time task table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of health service and management information processing for home settings, and more specifically, to a family health management system based on guide knowledge base reasoning. Background Technology

[0002] With the widespread adoption of wearable monitoring, home terminals, and remote services, family health management is gradually shifting from manual memory and verbal reminders to a management approach based on terminal data collection and message push notifications. Among existing publicly available technologies, Chinese patent application number 201510344832 proposes a family health management solution that integrates monitoring terminals, family management terminals, and mobile terminals. It achieves data sharing and anomaly alerts through cloud-based and medical institution-side business platforms, continuously acquiring health information and triggering reminders within the home environment. Chinese patent application number 201910558371.4 proposes a method and platform for intelligent medication reminders, generating reminder times based on medication information and sending medication purchase and administration reminders to different roles within the family, emphasizing notifications driven by preset medication times. While these technologies can achieve health data aggregation and reminders at preset times, the reminder anchor points and schedule organization can easily become unstable when there are shift work, night shifts, or cross-day / night rest periods within the same family.

[0003] In shift work families, the challenges of health management are primarily manifested in the difficulty of consistently aligning the time conditions of guidelines with actual work-rest schedules. This leads to time misalignments in reminders and triggers a chain reaction of errors. Many guidelines rely on relative event windows such as after waking up, before falling asleep, and after falling asleep. Existing solutions typically use fixed clock times or initial reminder settings as anchor points. When there are cross-day / night sleep periods, daytime naps, or staggered mealtimes, reminders fall into inappropriate time slots and are misinterpreted as missed doses, tests, or abnormalities, requiring family members to frequently manually correct them. Furthermore, family care involves changes in the notification recipients and escalation levels. Shift changes alter who is currently providing care or receiving alerts. Without mechanisms for recognizing work-rest phases and rescheduling tasks, the notification recipients and reminder frequency can easily mismatch with actual responsibilities, resulting in redundant confirmations and communication costs, making sustained health management difficult.

[0004] To address the aforementioned problems, a technical solution is provided. Summary of the Invention

[0005] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a family health management system driven by reasoning based on a guide knowledge base. This system collects sleep and wake-up times via a user terminal and calculates the sleep midpoint. A data acquisition and storage module generates a baseline sleep schedule. An intelligent agent module extracts time-sensitive guide clauses from the health knowledge base and converts them into clause time windows relative to the baseline sleep schedule, generating a relative time task table. A task and reminder module records the sequence of execution events. The intelligent agent module calculates the sleep segment intersection-union ratio and phase bias minutes, and a comprehensive analyzer generates rearrangement coefficients. Based on these rearrangement coefficients, a decision is made to trigger a minimum clarification interaction or update the baseline sleep schedule and simultaneously update the relative time task table, thus solving the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: The user terminal collects the time of falling asleep and the time of waking up. The time of falling asleep and the time of waking up are preferentially taken from the sleep recognition results of wearable devices or mobile phones. If they are missing, the time of falling asleep is determined by the period when the mobile phone is continuously still and the screen is off for a long time, and the time of waking up is determined by the first stable interaction period. The data is written into the data collection and storage module and the sleep midpoint is calculated. The data acquisition and storage module reads the midpoint of sleep to generate the baseline time of sleep, which serves as the sole time reference input for the intelligent agent module to align the time semantics of the execution guidelines. The intelligent agent module extracts guide clauses with time conditions from the health knowledge base. The time conditions are converted into clause time windows relative to the baseline time of work and rest. After generating a relative time task table with the clause time windows and management actions, the task and reminder modules are sent out. The task and reminder module outputs reminders and records the sequence of execution events based on the relative time task table. The agent module calculates the sleep segment intersection-union ratio and phase bias minutes. The comprehensive analyzer outputs the rearrangement coefficient and generates a disposal decision, triggering the minimum clarification interaction to update the sleep time and wake-up time or update the sleep-wake baseline time and synchronize the relative time task table.

[0007] Furthermore, the user terminal reads the sleep recognition record set, filters the target sleep recognition record according to the effective range of sleep duration, prioritizes the longest sleep duration, prioritizes the earliest sleep start time, takes the sleep start time as the time of falling asleep, and takes the sleep end time as the time of waking up.

[0008] Furthermore, when the sleep recognition record set is empty, the static screen-off interval is extracted based on the acceleration change and the screen-off state. The time of falling asleep is the start time of the static screen-off interval. The time of waking up is determined based on the interaction event timestamp set counting within the interaction window duration to meet the lower limit of stable interaction count. The sleep midpoint is calculated based on the time of falling asleep and the time of waking up. The sleep midpoint of the time of falling asleep and the time of waking up is written into the data acquisition and storage module.

[0009] Furthermore, the data acquisition and storage module reads the sleep midpoint and determines the start time of the inference day and the duration of the day. The sleep midpoint is normalized within the day relative to the start time of the inference day to obtain the intraday phase. The intraday phase is mapped to a ring phase angle according to the whole day ratio. The ring phase angle and the intraday phase are written into the data acquisition and storage module.

[0010] Furthermore, the data acquisition and storage module reads the historical sequence of sleep midpoints to generate a candidate phase angle set. For any ring phase angle in the candidate phase angle set, the candidate total distance is calculated according to the ring distance rule. The robust representative phase angle is the ring phase angle with the smallest candidate total distance and the later time sequence. The start time of the inference day is combined with the robust representative phase angle to generate the sleep baseline time and output it to the agent module.

[0011] Furthermore, the intelligent agent module reads the baseline time of work and rest, the time of falling asleep, the time of waking up, the start time of the reasoning day, and the duration of the day and completes the consistency check. It then filters complete guide clauses from the health knowledge base, including clause identifiers, time condition expressions, management actions, time window advance offset, time window delay offset, and fixed time offset. The time condition expressions are limited to before going to sleep, after waking up, after falling asleep, and fixed time, and the value range is checked.

[0012] Furthermore, the agent module generates the anchoring type and determines the anchoring time based on the time condition expression through a deterministic mapping table. When the anchoring type is the inference day start time anchoring type, the anchoring time is the fixed time value determined by the offset between the inference day start time and the fixed time. The agent module generates the clause time window based on the anchoring time, the work and rest base time, the time window advance offset, and the time window delay offset, and performs inference day normalization. When the start and end of the clause time window cross the inference day boundary, a cross-day mark is generated and a two-segment clause time window is formed. The agent module generates a relative time task table based on the clause identifier, clause time window, management action, anchoring type, and cross-day mark, and issues the task and reminder modules.

[0013] The further task and reminder module outputs reminders and records the execution event sequence based on the relative time task table. The execution event sequence includes the event time, clause identifier, execution type and is written to the data acquisition and storage module. The agent module reads the execution event sequence and filters the execution event subsequence of the inference day according to the start time of the inference day and the duration of the day and sorts them according to the event time.

[0014] Furthermore, the intelligent agent module reads the sleep recognition interval and the still screen-off interval and calculates the sleep segment intersection-union ratio. The sleep segment intersection-union ratio is determined based on the overlap duration and union duration of the sleep recognition interval and the still screen-off interval and is written into the data acquisition and storage module. When the sleep recognition interval or the still screen-off interval is missing, the sleep segment intersection-union ratio is taken as the neutral sleep segment intersection-union ratio.

[0015] Furthermore, the intelligent agent module reads the baseline time of sleep and calculates the phase bias minute. The phase bias minute is determined by the median of the normalized offset set of the event times of the execution event subsequence on the inference day relative to the baseline time of sleep and is written into the data acquisition and storage module. The comprehensive analyzer generates rearrangement coefficients based on the sleep segment intersection-union ratio and the phase bias minute, and generates a handling judgment based on the threshold to trigger the minimum clarification interaction to update the sleep time and wake-up time, or update the baseline time of sleep and synchronously update the relative time task table.

[0016] The technical effects and advantages of the present invention, a family health management system based on guide knowledge base reasoning, are as follows: This invention transforms the time conditions in the guidelines from fixed clock times into relative time expressions based on daily routines. This allows family members to receive reminders and management arrangements consistent with their own sleep rhythms, even with changes in their actual schedules such as shift work, night shifts, catching up on sleep, and crossing midnight. The overall technical logic determines the sleep midpoint based on the time of falling asleep and waking up, then generates a baseline time for daily routines based on this midpoint. Subsequently, this baseline time is used to uniformly align the guidelines with the time windows and relative time task schedules, reducing mistimed or out-of-day reminders caused by shifts in daily routines from the source, and making management actions more closely aligned with the time periods that family members can perform that day.

[0017] When a sudden change occurs in the schedule or the data source is incomplete, this invention does not simply attribute the anomaly to non-execution. Instead, it distinguishes between the credibility of the schedule boundary and the overall phase shift by combining the sequence of execution events, generating a decision on how to handle the situation, and making a clear choice between minimal clarification interaction and updating the schedule baseline time. This reduces frequent interruptions while maintaining the stability of time alignment. The resulting reminders and management arrangements are more coherent and consistent, making it easier for family members to complete management actions at their own pace, reducing the burden of repeated adjustments and explanations, and improving the sustainability and understandability of family health management. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the structure of a family health management system based on guide knowledge base reasoning driven by the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0020] Example 1: Figure 1 This invention presents a family health management system based on guide knowledge base reasoning, comprising: The user terminal collects the time of falling asleep and waking up. The time of falling asleep and waking up is preferentially taken from the sleep recognition results of wearable devices or mobile phones. If the data is missing, the time of falling asleep is determined by the period when the mobile phone is continuously still and the screen is off for a long time, and the time of waking up is determined by the first stable interaction period. The data is written into the data collection and storage module and the midpoint of sleep is calculated.

[0021] The data acquisition and storage module reads the sleep midpoint to generate the sleep baseline time, which serves as the sole time reference input for the intelligent agent module to align the time semantics of the execution guidelines.

[0022] The intelligent agent module extracts guide clauses with time conditions from the health knowledge base. The time conditions are converted into clause time windows relative to the baseline time of work and rest. After generating a relative time task table with the clause time windows and management actions, the task and reminder modules are sent out.

[0023] The task and reminder module outputs reminders and records the sequence of execution events based on the relative time task table. The agent module calculates the sleep segment intersection-union ratio and phase bias minutes. The comprehensive analyzer outputs the rearrangement coefficient and generates a disposal decision, triggering the minimum clarification interaction to update the sleep time and wake-up time or update the sleep-wake baseline time and synchronize the relative time task table.

[0024] Shift and night shift family health management relies on relative time reminders and guideline reasoning. The source of time semantics must come from the actual work and rest boundaries. If the time of falling asleep and waking up is missing or the identification is inaccurate, the deviation will be transmitted to the sleep midpoint. Subsequently, the work and rest baseline time and the time window of the terms will shift synchronously. However, mobile terminals often have incomplete sleep recognition records when clearing background, interrupting wear, or segmenting sleep. Therefore, it is necessary to lock the time of falling asleep and waking up and generate the sleep midpoint on the user terminal side with a deterministic collection and rollback path.

[0025] S101: Deterministic screening of sleep recognition records and direct assignment of sleep time and wake-up time.

[0026] In shift and night shift situations, prioritizing sleep recognition records for bedtime and wake-up time can reduce additional reliance on mobile phone behavior and avoid mistaking low interaction during nighttime work hours for sleep.

[0027] The user terminal reads sleep recognition records from wearable devices or mobile phones to form a set of sleep recognition records. Each sleep recognition record includes the sleep start time and the sleep end time, and the sleep start time must be earlier than the sleep end time. The data acquisition and storage module maintains the effective sleep duration range, which consists of a minimum duration boundary and a maximum duration boundary, both of which are positive time lengths, with the minimum duration boundary being smaller than the maximum duration boundary. For each sleep recognition record, the sleep duration is first calculated by subtracting the sleep start time from the sleep end time. Then, it is determined whether the sleep duration falls within the effective sleep duration range. If it does, the sleep recognition record is recorded as a candidate sleep recognition record. If there is more than one candidate sleep recognition record, the candidate sleep recognition record with the longest sleep duration is selected first. If there is still a tie, the candidate sleep recognition record with the earlier sleep start time is selected, and the sleep start time is assigned to the selected record, and the wake-up time is assigned to the selected record's sleep end time. When there are no candidate sleep recognition records, the process proceeds to the next step. After the assignment is completed, the time of falling asleep and the time of waking up satisfy the condition that the time of falling asleep is earlier than the time of waking up, and the difference between the two falls within the effective range of sleep duration, which makes it easier to directly calculate the midpoint of sleep in the future.

[0028] S102: Extract and determine the sleep time during the static screen-off interval.

[0029] When sleep recognition records are missing, the time of falling asleep needs to be inferred from the observable terminal state. The static screen-off joint constraint can exclude scenarios where the screen is off but the user moves frequently, as well as scenarios where the user is stationary but the screen is on while reading or working.

[0030] The user terminal side collects long-term acceleration modulus time series and screen status time series, where the acceleration modulus is a non-negative number, and the screen status takes two values: screen off (marked as off state) and screen on (marked as on state). The data acquisition and storage module maintains the upper limit of acceleration change, the lower limit of continuous static screen-off duration, and the sampling interval. The sampling interval is a positive time length, the upper limit of acceleration change is a non-negative number, and the lower limit of continuous static screen-off duration is a positive time length. The long-term acceleration modulus time series is sampled according to the sampling interval. For two adjacent sampling times, the acceleration modulus of the later time time is subtracted from the acceleration modulus of the previous time time to obtain the difference. The absolute value of the difference is then taken to obtain the acceleration change. When the acceleration change does not exceed the upper limit of acceleration change and the screen status is off, the corresponding sampling time time is marked as the static screen-off point.

[0031] Run-length segmentation is performed on consecutive static screen-off points to obtain several static screen-off intervals. Each static screen-off interval has a start time and an end time, and the start time must be earlier than the end time. For each static screen-off interval, the interval duration is calculated by subtracting the start time from the end time. Then, it is determined whether the duration is not less than the lower limit of the continuous static screen-off duration. If it is, the static screen-off interval is recorded as a candidate static screen-off interval. If there is more than one candidate static screen-off interval, the candidate static screen-off interval with the longest duration is selected first. If there is still a tie, the candidate static screen-off interval with the earlier start time is selected, and the sleep time is assigned as the start time of the selected interval.

[0032] Example: After the mobile phone is placed on the bedside table and the screen is turned off, the terminal acceleration modulus only changes slightly over a long period of time. After the run is segmented, a static screen-off interval with a long duration is formed. The start time of this static screen-off interval can be taken at the time of falling asleep, which is consistent with the actual behavior of the mobile phone before and after falling asleep.

[0033] S103: Identify and determine wake-up time during stable interaction periods.

[0034] Using stable interactions instead of individual interaction events for the wake-up time can reduce misjudgments of waking up caused by occasional unlocking or accidental touches, and can also adapt to cross-day scenarios where people catch up on sleep during the day after a night shift.

[0035] The user terminal reads the set of timestamps of interaction events. The interaction events are limited to three types of auditable events: unlock events, active lighting events, and foreground application switching events. The timestamps of the interaction events are absolute timestamps. The data acquisition and storage module maintains the duration of the interaction window and the lower limit of the stable interaction count. The duration of the interaction window is a positive time length, and the lower limit of the stable interaction count is a positive integer.

[0036] A sliding time window is constructed using a continuous time progression method. The starting point of the sliding time window begins to move after the time of falling asleep, and the movement range is no greater than the duration of the interaction window each time. Within each sliding time window, the number of interaction events falling between the starting point and the ending point of the sliding time window is counted to obtain the window interaction count. When the window interaction count is not less than the lower limit of the stable interaction count, the starting point of the current sliding time window is recorded as a stable interaction candidate time. The earliest of all stable interaction candidate times is determined as the wake-up time. If no stable interaction candidate time exists, the screen state time when the screen first appears lit is used as the wake-up time candidate, and the wake-up time candidate must be later than the time of falling asleep, and the wake-up time candidate minus the time of falling asleep must fall within the valid sleep duration range. If the wake-up time candidate does not meet the valid sleep duration range, the next candidate static screen-off interval is reselected from the candidate static screen-off interval set according to the interval duration from largest to smallest. Step S102 is repeated to determine the time of falling asleep, and this step is repeated until a wake-up time that meets the valid sleep duration range is obtained.

[0037] Example: When night shift workers catch up on sleep during the day, their phones continuously unlock and switch between foreground applications after the sleep ends. The window interaction count meets the lower limit of stable interaction count. The wake-up time is taken as the earliest sliding time window that meets the conditions, which can avoid determining wake-up based on just one accidental touch.

[0038] S104: Consistency check between the Chinese operation expression of the sleep midpoint and the database entry.

[0039] When the sleep midpoint is used to generate the baseline time for subsequent routines, it is required to be recalculated and to be consistent with the time of falling asleep and waking up on the same time axis to avoid time loops caused by crossing days.

[0040] The calculation of the sleep midpoint is performed in the following order: First, subtract the sleep onset time from the wake-up time to obtain the sleep duration; then, divide the sleep duration by two to obtain the half-sleep duration; finally, add the half-sleep duration to the sleep onset time to obtain the sleep midpoint. Next, it is verified that the sleep midpoint lies between the sleep onset time and the wake-up time, and that the sleep onset time, wake-up time, and sleep midpoint satisfy a sequential relationship within the same absolute timestamp field. After successful verification, the sleep onset time, wake-up time, and sleep midpoint are written to the same record in the data acquisition and storage module. This allows the data acquisition and storage module to read only the sleep midpoint to generate the baseline sleep schedule, and allows the task and reminder module to retrospectively read the sleep onset time and wake-up time to participate in the boundary information required for subsequent sleep segment intersection and union calculations.

[0041] The time of falling asleep and the time of waking up are determined first through sleep recognition records. When sleep recognition records are missing, the time of falling asleep is determined through the static screen-off interval and the time of waking up is determined through the stable interaction period. The time of falling asleep and the time of waking up are written into the data acquisition and storage module and the sleep midpoint is calculated. The sleep midpoint is the only input for generating the work and rest baseline time, which is recalculated and traceable.

[0042] The sleep midpoint is used to express the central location of the daily routine and is suitable for carrying relative time semantics such as before going to sleep and after waking up. However, shift work across midnight and daytime naps will cause the sleep midpoint to loop around the natural day boundary. Directly using the sleep midpoint for time alignment can easily map the same routine to different dates, resulting in misaligned time windows and reminders. Therefore, it is necessary to normalize the sleep midpoint to the inference day and generate a stable routine reference time in the data acquisition and storage module.

[0043] The processing logic for step S2 is as follows: S201: Determination of the starting time of the inference day and intraday phase mapping.

[0044] The starting time of the reasoning day is used to push the midpoint of sleep across midnight into the same reasoning day range; otherwise, the time window of the terms will have a misaligned time point in night shift and nap scenarios.

[0045] The data acquisition and storage module reads the user terminal's time zone information and determines the starting point of the date of the inference day based on this information. The data acquisition and storage module also provides a constant for the length of a day and determines the end time of the inference day based on this constant. The intraday phase is obtained by subtracting the start time of the inference day from the midpoint of sleep. When the initial phase difference is earlier than zero, the initial phase difference is added to the length of a day and the addition is repeated until the phase difference falls within the range from zero to the length of a day. When the initial phase difference is not earlier than the length of a day, the initial phase difference is subtracted from the length of a day and the subtraction is repeated until the phase difference falls within the range from zero to the length of a day. After completion, the phase difference is recorded as the intraday phase and written to the data acquisition and storage module.

[0046] S202: Acquisition of sleep midpoint history sequence and generation of ring phase angle.

[0047] A robust approach requires that the phase angle be referenced simultaneously with the current sleep midpoint and the historical sequence of recent sleep midpoints in order to maintain representativeness when there is short-term napping during night shifts or when identification errors exist.

[0048] The data acquisition and storage module reads the sleep midpoint history sequence of the same user and extracts the number of records corresponding to the preset number of days to be reviewed, from the most recent to the oldest time. The sleep midpoint history sequence filters out null records and records that are inconsistent with the user's terminal time zone. For each sleep midpoint in the sleep midpoint history sequence, step S201 is executed first to obtain the corresponding intraday phase. Then, the intraday phase is divided by the length of a day to obtain the intraday ratio. Subsequently, the intraday ratio is mapped to the angular domain from zero to the full circle angle to obtain the annular phase angle and written to the data acquisition and storage module. The same mapping is executed synchronously for the current sleep midpoint to obtain the current annular phase angle and written to the data acquisition and storage module.

[0049] S203: Calculation of ring distance and selection of robust representative phase angle.

[0050] The core difficulty in night shift and shift work scenarios comes from the ring boundary. Directly using linear interpolation will treat the phases on both sides of the zero point as moving away, thus compromising the selection of representative values.

[0051] The ring distance is defined as the smaller of the absolute value of the linear difference between two ring phase angles and the full circle angle minus the absolute value of the linear difference. The ring distance ranges from zero to a semi-circular angle. The data acquisition and storage module forms a candidate phase angle set by combining the current ring phase angle with the ring phase angles corresponding to the historical sequence of sleep midpoints. For each candidate phase angle in the candidate phase angle set, the ring distance between it and all ring phase angles in the candidate phase angle set is calculated and accumulated to obtain the total candidate distance. The robust representative phase angle is selected from the candidate phase angles with the smallest total candidate distance. When the total candidate distances are tied for the smallest, the candidate phase angle corresponding to the later sleep midpoint is selected as the robust representative phase angle.

[0052] Example: Night shift workers catch up on sleep during the day, causing their sleep midpoint to fall in the afternoon. After finishing the previous night shift, they experience a short period of sleep with their sleep midpoint close to the early morning. The circular distance can still provide a close distance on both sides of the full circle boundary. This robustness means that the phase angle is more likely to fall on the main sleep phase after catching up on sleep rather than being pulled by the short period of sleep.

[0053] S204: Generation of work and rest baseline time and output of unique time baseline.

[0054] The baseline time of work and rest needs to be directly located to an absolute timestamp within the reasoning day in order for the agent module to use it for time semantic alignment of guide clauses and to generate clause time windows.

[0055] The data acquisition and storage module divides the robust representative phase angle by the whole circle angle to obtain the angle ratio, and then multiplies the angle ratio by the length of a day to obtain the intraday offset duration. The work-rest reference time is obtained by adding the intraday offset duration to the start time of the inference day. The work-rest reference time falls within the range from the start time of the inference day to the end time of the inference day. The data acquisition and storage module writes the work-rest reference time and outputs the work-rest reference time to the agent module as the sole time reference input for the time semantic alignment of the guide clause. In step S3, the agent module can convert the time condition into the clause time window by simply referencing the work-rest reference time without having to process the cross-day wrap-around again.

[0056] The data acquisition and storage module reads the sleep midpoint and determines the start time of the inference day and the duration of the day. The sleep midpoint is normalized within the day to obtain the intraday phase. The historical sequence of the sleep midpoint is mapped to a set of candidate phase angles and a robust representative phase angle is selected by the ring distance. The start time of the inference day and the robust representative phase angle generate the rest and sleep reference time and output it to the agent module as the only time reference input.

[0057] Guidelines often use time conditions such as fixed times before bed, after waking up, and after falling asleep. Only by converting these time conditions into calculable time windows can the task and reminder modules be triggered on time and form an execution event sequence. However, fixed clock times cannot cover shift work and nap scenarios. The time conditions must be rewritten around the baseline time of the work and rest schedule. Otherwise, the relative time task table will experience a large number of false triggers on the day of work and rest schedule change. Therefore, it is necessary to complete the structured parsing and time window generation of the time conditions with the baseline time of the work and rest schedule as the core.

[0058] S301: Read the baseline time of work and rest and complete the time domain consistency check.

[0059] In shift and night shift scenarios, the time window for the terms must be expressed within the same reasoning day; otherwise, the relative time task schedule will be triggered on the shift change day due to a mismatch.

[0060] The data acquisition and storage module reads the time of falling asleep, the time of waking up, the time of the baseline schedule, the start time of the reasoning day, and the length of a day. It performs a consistency check, which includes the following: the time of falling asleep is earlier than the time of waking up; the start time of the reasoning day is earlier than the end time of the reasoning day; the end time of the reasoning day is determined by the start time of the reasoning day and the length of a day; and the time of the baseline schedule falls between the start time and the end time of the reasoning day.

[0061] If the consistency check fails, an empty relative time task table is output and a failure reason flag is written. If the consistency check passes, proceed to step S302.

[0062] Once the consistency check is completed, the normalized range of the clause time window is uniquely determined, avoiding the projection of the work and rest benchmark time that crosses midnight onto the wrong date.

[0063] S302: Extract the guidelines with time conditions and complete the field integrity and value range validation.

[0064] Health knowledge bases typically contain both structured terms and text descriptions. The generation of term time windows relies on structured fields; otherwise, term time windows can only rely on textual understanding and are difficult to recalculate.

[0065] The health knowledge base outputs a set of guidelines, each of which includes a clause identifier, a time condition expression, a management action, an advance time window offset, a delay time window offset, and a fixed time offset. The time condition expression is limited to one of four categories: before bedtime, after waking up, after falling asleep, or at a fixed time. The advance and delay time window offsets are limited to non-negative time lengths, and the advance time window offset is no greater than the delay time window offset. The fixed time offset is limited to a time length that is no earlier than zero and earlier than the length of one day. When the time condition expression is not at a fixed time, the fixed time offset is zero.

[0066] The intelligent agent module filters guide clauses from the guide clause set to form a candidate guide clause set, which includes guide clauses with time condition expressions, management actions, and clause identifiers. Each guide clause in the candidate guide clause set is checked item by item for the time condition expression value, the time window advance offset value, the time window delay offset value, and the fixed time offset value. Guide clauses that fail the check are removed from the candidate guide clause set and a removal reason flag is written.

[0067] After the field validation is completed, proceed to step S303.

[0068] S303: Parse the time condition expression and determine the anchoring type and anchoring time.

[0069] The key to shift and night shift scenarios is to place the time before and after sleep into the boundaries of your actual work and rest schedule, rather than into a fixed night or a fixed morning.

[0070] The intelligent agent module parses the time condition expression for each guideline clause in the candidate guideline clause set, and the parsing result generates the anchoring type anchoring time.

[0071] Anchoring types are expressed based on time conditions and obtained through a deterministic mapping table. The mapping table includes anchoring types for the time of falling asleep before sleep, the time of falling asleep after sleep, the time of waking up after waking up, and the anchoring type for the start time of the reasoning day at a fixed time.

[0072] The anchoring time is assigned based on the anchoring type. For the "Sleep Time" anchoring type, the anchoring time is taken as the sleep time. For the "Wake Time" anchoring type, the anchoring time is taken as the wake time. For the "Inference Day Start Time" anchoring type, the anchoring time is taken as the fixed time obtained by adding the inference day start time to the fixed time offset.

[0073] Example: Night shift workers catch up on sleep during the day, with their sleep time falling in the afternoon. The time condition is expressed as a guideline clause before sleep, which is mapped to a sleep time anchoring type. The anchoring time moves with the sleep time, and the clause time window moves synchronously with the sleep time.

[0074] S304: Generate the terms time window and encapsulate the relative time task table to issue tasks and reminders module.

[0075] The clause time window needs to be expressed with the work and rest base time as the sole time base input; otherwise, when calculating the phase bias in minutes, it will be impossible to compare the execution event sequence with the clause time window in the same semantic coordinate.

[0076] The intelligent agent module calculates the start and end times of the clause time window for each candidate guideline clause. The calculation order is as follows: first, subtract the work-rest baseline time from the anchor time to obtain the anchor difference duration; then, subtract the time window advance offset from the anchor difference duration to obtain the start offset duration; then, add the time window delay offset to the anchor difference duration to obtain the end offset duration; then, add the start offset duration to the work-rest baseline time to determine the start time of the clause time window; and finally, add the end offset duration to the work-rest baseline time to determine the end time of the clause time window.

[0077] The agent module performs inference day normalization on the start and end times of the clause time window. The normalization rule adopts a repeated shifting method. When the start time of the clause time window is earlier than the start time of the inference day, the start time of the clause time window is shifted backward by one day and the shifting is repeated until it falls between the start and end times of the inference day. When the start time of the clause time window is not earlier than the end time of the inference day, the start time of the clause time window is shifted forward by one day and the shifting is repeated until it falls between the start and end times of the inference day. The same shifting rule is applied to the end time of the clause time window.

[0078] After normalization, if the start time of the clause time window is earlier than the end time of the clause time window, the cross-day mark is set to negative; if the start time of the clause time window is later than the end time of the clause time window, the cross-day mark is set to positive. The clause time window is represented as the first segment from the start time of the clause time window to the end time of the inference date, and the second segment from the start time of the inference date to the end time of the clause time window.

[0079] The relative time task list consists of a clause identifier, a clause time window, a management action, an anchoring type, and a cross-day marker. The relative time task list is formed by summarizing all the entries. The agent module distributes the relative time task list to the task and reminder modules.

[0080] Example: The guidelines require reminders to begin some time before falling asleep and continue for a short time after falling asleep. When the night shift worker falls asleep at midnight, the normalized time window of the guidelines will show a cross-day marker. After receiving the two-segment time window of the guidelines, the task and reminder module will trigger the first reminder at the end of the reasoning day and the second reminder at the beginning of the reasoning day. The reminders will no longer be lost due to the change of natural days.

[0081] The intelligent agent module reads the baseline time of work and rest and filters complete guide clauses with time condition expressions and management action fields from the health knowledge base. The time condition expression is deterministically mapped to obtain the anchoring type and determine the anchoring time. The anchoring time is combined with the time window advance offset and the time window delay offset to generate the clause time window and perform inference day normalization. Cross-day markers are used to express the two-segment clause time window that crosses the inference day boundary. The relative time task table is encapsulated by the clause time window and management action and then sent to the task and reminder module.

[0082] After the relative time task schedule is issued, there are fluctuations in reminder triggering and user execution due to shift delays, earlier naps, and temporary outings. The deviation between the execution event sequence and the term time window may come from unstable identification of the daily routine anchor point or from the overall daily routine phase shift. However, the handling paths for the two types of deviations are different. The former requires minimal clarification interaction to update the sleep time and wake-up time, while the latter requires updating the daily routine baseline time and rearranging the term time window. Therefore, the deviation judgment needs to be embedded in interpretable parameter calculation and comprehensive analysis.

[0083] S401: Execution event sequence collection and reasoning daily screening.

[0084] After a reminder is triggered by a relative time task schedule, an execution event sequence is formed. The execution event sequence needs to be limited to the same reasoning day range in order to be consistent with the clause time window for comparison, so as to avoid the event falling into the wrong natural day due to shifts crossing midnight.

[0085] The task and reminder module generates an execution event record for each reminder and writes it to the data acquisition and storage module. The execution event record includes the event time and clause identifier, as well as an execution type field. The execution type is limited to one of three categories: confirmation, measurement, and dialogue. The agent module reads the execution event sequence and the inference day start time and day duration. The agent module filters execution event records whose event time falls within the range of the inference day start time to the inference day start time plus the day duration to form an inference day execution event subsequence. The inference day execution event subsequence is sorted from morning to evening according to the event time. When the inference day execution event subsequence is empty, the handling decision takes the updated work-rest baseline time and synchronously updates the non-clarified branch of the relative time task table. The non-clarified branch is limited to not changing the sleep time and wake-up time.

[0086] S402: Calculation of the intersection and union ratio of sleep segments.

[0087] Sleep segment intersection and union is used to determine the degree of consistency between the boundary between the time of falling asleep and the time of waking up when they come from two sources. In shift and night shift scenarios, boundary deviation is more likely to occur when the sleep recognition interval is inconsistent with the static screen-off interval. Sleep segment intersection and union is used to solidify the degree of consistency into recalcible evidence.

[0088] The intelligent agent module reads the sleep recognition interval and the static screen-off interval from the data acquisition and storage module. The sleep recognition interval consists of the sleep start time and the sleep end time, with the sleep start time being earlier than the sleep end time. The static screen-off interval consists of the interval start time and the interval end time, with the interval start time being earlier than the interval end time. The start time of the overlapping interval is the later of the sleep start time and the interval start time, and the end time of the overlapping interval is the earlier of the sleep end time and the interval end time. The overlap duration is the overlap interval end time minus the overlap interval. The duration obtained at the start time is zero if the start time of the overlapping interval is not earlier than the end time of the overlapping interval. The union duration is the sum of the duration of the sleep recognition interval and the duration of the static screen-off interval, minus the overlapping duration. The sleep segment intersection-union ratio is the ratio of the overlapping duration to the union duration and is written to the data acquisition and storage module. The sleep segment intersection-union ratio falls between zero and one and includes the endpoints. When the sleep recognition interval or the static screen-off interval is missing, the sleep segment intersection-union ratio is the neutral sleep segment intersection-union ratio maintained by the data acquisition and storage module. The neutral sleep segment intersection-union ratio falls between zero and one and does not include the endpoints.

[0089] S403: Phase offset minute calculation.

[0090] Phase bias minutes are used to characterize the overall forward or backward shift of the execution event subsequence relative to the work-rest baseline time. During shift changes, the execution event subsequence often moves as a whole, and a single event is insufficient to characterize a stable shift. Therefore, phase bias minutes employs ring normalization and median aggregation.

[0091] The agent module reads the baseline time of the work and rest schedule and the start time and duration of the inference day. For each execution event record of the execution event subsequence on the inference day, it calculates the offset time of the event time relative to the baseline time of the work and rest schedule. The offset time is the duration obtained by subtracting the baseline time of the work and rest schedule from the event time. If the offset time is earlier than the negative half-day duration, the offset time is added to the duration of the day and the addition is repeated until the offset time falls into the range of negative half-day duration to half-day duration. If the offset time is not earlier than half-day duration, the offset time is subtracted from the duration of the day and the subtraction is repeated until the offset time falls into the range of negative half-day duration to half-day duration. All normalized offset times are combined to form a normalized offset set. The phase bias minutes are taken as the median offset time of the normalized offset set, converted into minutes, and written to the data acquisition and storage module. The value range of the phase bias minutes falls into the range of negative half-day minutes to half-day minutes.

[0092] Example: After night shift workers finish catching up on sleep during the day, they continuously complete measurements and confirm reminders within a short period of time. The inference day execution event subsequences are concentrated after the work and rest baseline time. The median offset duration of the normalized offset set shows a stable positive offset, and the phase offset minute shows a positive value.

[0093] S404: The synthesis analyzer generates rearrangement coefficients.

[0094] The sleep segment intersection ratio reflects the degree of boundary consistency, while the phase bias minute reflects the overall phase shift. These two types of evidence complement each other to generate rearrangement coefficients, avoiding mis-rearrangement caused by the boundary deviation between the time of falling asleep and the time of waking up, and also avoiding the overall shift being misidentified as a boundary deviation.

[0095] The integrated analyzer reads the sleep segment intersection-union ratio and phase bias minute and reads the phase intensity scale. The phase intensity scale is the positive time length and is maintained by the data acquisition and storage module. The integrated analyzer first calculates the absolute value of the phase bias minute and records it as A, and records the phase intensity scale as S. The phase intensity is I, which is equal to A divided by the sum of A and S and is limited to between zero and one, without taking the upper limit. The rearrangement coefficient is the product of the sleep segment intersection-union ratio and the phase intensity and is written to the data acquisition and storage module. The rearrangement coefficient value ranges between zero and one and includes the lower limit.

[0096] It should be noted that the phase intensity scale is determined by the data acquisition and storage module based on the clause time windows of the relative time task table within the inference day. It is used to characterize the transition speed and saturation threshold of the phase bias minute from weak evidence to strong evidence. Specifically, the time window span is calculated for each clause time window within the inference day, and when there is a two-segment clause time window, the larger of the two spans is taken as the clause time window span. All clause time window spans are summarized and the median value is taken as the phase intensity scale. After the synthesis analyzer reads the phase intensity scale, it performs saturation mapping on the absolute value of the phase bias minute to obtain the phase intensity. This ensures that the normal fluctuation of the phase bias minute within the clause time window span does not trigger excessive rearrangement and stabilizes and strengthens the continuous significant shift. Thus, it, together with the intersection and comparison of the sleep segment, constrains the rearrangement coefficient and supports the disposal decision.

[0097] S405: Handling decision generation and synchronous update.

[0098] The decision-making process requires a unique choice between minimal clarification interaction and updating the work schedule baseline. Incorrect choices in shift and night shift scenarios will propagate the deviation to the clause time window and the relative time task table, causing continuous misalignment.

[0099] The agent module reads the rearrangement coefficient, sleep segment intersection-union ratio, and phase bias minute, and reads the rearrangement coefficient threshold, sleep segment intersection-union ratio threshold, and phase bias minute threshold. When the three conditions are met simultaneously, the branch for updating the rest time baseline is selected. The three conditions are, in order, that the rearrangement coefficient is not less than the rearrangement coefficient threshold, the sleep segment intersection-union ratio is not less than the sleep segment intersection-union ratio threshold, and the absolute value of the phase bias minute is not less than the phase bias minute threshold. When the three conditions are not met simultaneously, the branch for triggering the minimum clarification interaction is selected.

[0100] When the decision to trigger the minimum clarification interaction branch is made, the task and reminder module sends a minimum clarification interaction instruction to the user terminal. The minimum clarification interaction instruction is limited to the input action of confirming the sleep time and wake-up time. The user terminal sends back the updated sleep time and wake-up time to the data acquisition and storage module. The data acquisition and storage module updates the sleep midpoint and the baseline time according to steps S1 and S2. The agent module regenerates the relative time task table according to step S3 and sends it to the task and reminder module. When the decision to update the baseline time is made, the data acquisition and storage module performs an inference intraday phase shift update on the baseline time based on the phase bias minute and writes it to the data acquisition and storage module. The agent module regenerates the relative time task table according to step S3 and sends it to the task and reminder module. The sleep time and wake-up time remain unchanged.

[0101] Example: When family members catch up on sleep during the day after working the night shift, reminders are concentrated during the nap period. There is a significant inconsistency between the sleep recognition interval and the static screen-off interval. The sleep segment intersection ratio deviates from the sleep segment intersection ratio threshold. The handling judgment is to take the minimum clarification interaction branch that triggers the action. After the user terminal confirms the wake-up time, the routine baseline time is updated with the midpoint of sleep, and the relative time task table is adjusted synchronously with the clause time window.

[0102] The task and reminder module outputs reminders and records the sequence of execution events based on the relative time task table. The agent module calculates the intersection-union ratio of sleep segments based on the sequence of execution events and the time of falling asleep and waking up, and calculates the phase bias minute based on the sequence of execution events and the time of rest. The comprehensive analyzer inputs the intersection-union ratio of sleep segments and the phase bias minute and outputs the rearrangement coefficient. The rearrangement coefficient is used to generate the disposal decision. The disposal decision selects to trigger the minimum clarification interaction to update the time of falling asleep and waking up or to update the time of rest and simultaneously update the relative time task table.

[0103] Specifically, the above are merely preferred embodiments of this application and are not intended to limit this application.

[0104] The rearrangement coefficient threshold, sleep segment intersection ratio threshold, phase bias minute threshold, and other preset parameters can be pre-calibrated through offline simulation testing or set to fixed values ​​according to on-site operating procedures.

[0105] In the description of this specification, references to terms such as "an embodiment," "example," and "specific example" indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0106] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to specific implementations. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A family health management system based on guide knowledge base reasoning, characterized in that, include: The user terminal collects the time of falling asleep and the time of waking up. The time of falling asleep and the time of waking up are preferentially taken from the sleep recognition results of wearable devices or mobile phones. If they are missing, the time of falling asleep is determined by the period when the mobile phone is continuously still and the screen is off for a long time, and the time of waking up is determined by the first stable interaction period. The data is written into the data collection and storage module and the sleep midpoint is calculated. The data acquisition and storage module reads the midpoint of sleep to generate the baseline time of sleep, which serves as the sole time reference input for the intelligent agent module to align the time semantics of the execution guidelines. The intelligent agent module extracts guide clauses with time conditions from the health knowledge base. The time conditions are converted into clause time windows relative to the baseline time of work and rest. After generating a relative time task table with the clause time windows and management actions, the task and reminder modules are sent out. The task and reminder module outputs reminders and records the sequence of execution events based on the relative time task table. The agent module calculates the sleep segment intersection-union ratio and phase bias minutes. The comprehensive analyzer outputs the rearrangement coefficient and generates a disposal decision, triggering the minimum clarification interaction to update the sleep time and wake-up time or update the sleep-wake baseline time and synchronize the relative time task table.

2. The family health management system based on guide knowledge base reasoning driven according to claim 1, characterized in that: The user terminal reads the set of sleep recognition records, filters the target sleep recognition records according to the effective range of sleep duration, prioritizes the longest sleep duration, prioritizes the earliest sleep start time, takes the sleep start time as the time of falling asleep, and takes the sleep end time as the time of waking up.

3. A family health management system based on guide knowledge base reasoning driven according to claim 2, characterized in that: When the sleep recognition record set is empty, the static screen-off interval is extracted based on the acceleration change and the screen-off state. The time of falling asleep is the start time of the static screen-off interval. The time of waking up is determined by counting the interaction event timestamps within the interaction window duration to meet the lower limit of stable interaction count. The sleep midpoint is calculated based on the time of falling asleep and the time of waking up. The sleep midpoint is written into the data acquisition and storage module.

4. A family health management system based on guide knowledge base reasoning driven according to claim 3, characterized in that: The data acquisition and storage module reads the sleep midpoint and determines the start time of the inference day and the duration of the day. The sleep midpoint is normalized within the day relative to the start time of the inference day to obtain the intraday phase. The intraday phase is mapped to a ring phase angle according to the whole day ratio. The ring phase angle and the intraday phase are written into the data acquisition and storage module.

5. A family health management system based on guide knowledge base reasoning driven according to claim 4, characterized in that: The data acquisition and storage module reads the historical sequence of sleep midpoints to generate a candidate phase angle set. For any ring phase angle in the candidate phase angle set, the candidate total distance is calculated according to the ring distance rule. The robust representative phase angle is the ring phase angle with the smallest candidate total distance and the later time sequence. The start time of the inference day is combined with the robust representative phase angle to generate the rest and sleep baseline time and output to the agent module.

6. A family health management system based on guide knowledge base reasoning driven according to claim 5, characterized in that: The intelligent agent module reads the baseline time of work and rest, the time of falling asleep, the time of waking up, the start time of the reasoning day, and the length of a day and completes the consistency check. It filters the complete guide clauses from the health knowledge base, including clause identifiers, time condition expressions, management actions, time window advance offset, time window delay offset, and fixed time offset. The time condition expressions are limited to before going to sleep, after waking up, after falling asleep, and fixed time, and the value range is checked.

7. A family health management system based on guide knowledge base reasoning driven according to claim 6, characterized in that: The agent module generates the anchoring type and determines the anchoring time based on the time condition expression through a deterministic mapping table. When the anchoring type is the inference day start time anchoring type, the anchoring time is the fixed time value determined by the offset between the inference day start time and the fixed time. The agent module generates the clause time window based on the anchoring time, the work and rest base time, the time window advance offset, and the time window delay offset, and performs inference day normalization. When the start and end of the clause time window cross the inference day boundary, a cross-day mark is generated and a two-segment clause time window is formed. The agent module generates a relative time task table based on the clause identifier, clause time window, management action, anchoring type, and cross-day mark, and issues the task and reminder modules.

8. A family health management system based on guide knowledge base reasoning driven according to claim 7, characterized in that: The task and reminder module outputs reminders and records the execution event sequence based on the relative time task table. The execution event sequence includes the event time, clause identifier, execution type and is written to the data acquisition and storage module. The agent module reads the execution event sequence and filters the execution event subsequence of the inference day according to the start time of the inference day and the duration of the day and sorts them according to the event time.

9. A family health management system based on guide knowledge base reasoning driven according to claim 8, characterized in that: The intelligent agent module reads the sleep recognition interval and the still screen-off interval and calculates the sleep segment intersection-union ratio. The sleep segment intersection-union ratio is determined based on the overlap duration and union duration of the sleep recognition interval and the still screen-off interval and is written into the data acquisition and storage module. When the sleep recognition interval or the still screen-off interval is missing, the sleep segment intersection-union ratio is taken as the neutral sleep segment intersection-union ratio.

10. A family health management system based on guide knowledge base reasoning driven according to claim 9, characterized in that: The intelligent agent module reads the baseline time of sleep and calculates the phase bias minute. The phase bias minute is determined by the median of the normalized offset set of the event times of the execution event subsequence on the inference day relative to the baseline time of sleep and is written into the data acquisition and storage module. The comprehensive analyzer generates rearrangement coefficients based on the sleep segment intersection-union ratio and the phase bias minute. According to the threshold, it generates a processing judgment to trigger the minimum clarification interaction to update the sleep time and wake-up time, or update the baseline time of sleep and synchronously update the relative time task table.

Citation Information

Patent Citations

  • Family health management system and practical utilization method thereof

    CN105894419A

  • Method and platform for intelligent medication reminding

    CN110368308A